Hello

I have a "functions" DLL that is included in my traditional
applications and within my Windows Services, but I need to be able to
check whether an application is running a method in the DLL or whether
it is being called from a Windows service, how can I go about doing
this?

Thanks in advance

PD

RE: Can you check if a DLL is running within a Windows Service or trad by Dave

Dave
Fri Nov 05 16:02:02 CST 2004

Hi

Well I have not actually tried this, but I think one way would be to
determine what process is the parent of the executing process. If it is
"services.exe" then you could deduce that it is a service. You can get the
process parent using a Win32 API call to NtQueryInformationProcess, but I
have not done this personally, so don't have any examples for you.

Does anyone have a better way?

"Pdarroch" wrote:

> Hello
>
> I have a "functions" DLL that is included in my traditional
> applications and within my Windows Services, but I need to be able to
> check whether an application is running a method in the DLL or whether
> it is being called from a Windows service, how can I go about doing
> this?
>
> Thanks in advance
>
> PD
>