Ingo:

Thanks for the function. Can you provide a complete blackbox solution that is simply

BOOL IsService(void)

Please keep in mind that within the RAND_poll() function we have no input from the application as to the service name, logon session or account. All of that information would need to be extracted at runtime. I assume this could be done by extracting information from an OpenProcess() call. If you could provide the complete solution that would be very much appreciated.

- Jeff



Ingo A. Kubbilun wrote:

Hi,

someone asked for a function to determine if a Win32 exe is running
as a NT service?
Use svccheck.c and svccheck.h, just call:

if (IsService(EXENAME_SERVICES,EXENAME_WINLOGON,SYSTEM_SID))
{
...
}

If you are running your service on a different account than the well
known SYSTEM_SID, which is "S-1-5-18", then specify your specific
one as the 3rd param (zero-terminated string).

Rgs, Ingo.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to