Jeff:

In fact, it is sufficient to call the supplied function as described in
my last mail: IsService(EXENAME_SERVICES,EXENAME_WINLOGON,SYSTEM_SID)
The three arguments are just three #define's (refer to svccheck.h).
The function's prototype requires three params because I cloned the
stuff from another project I'm currently working on.
For your convenience, you can also add another #define:

#define _IsService
IsService(EXENAME_SERVICES,EXENAME_WINLOGON,SYSTEM_SID)

and use the macro "_IsService" instead. If you need another solution,
please
let me know.

Ingo.


-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Jeffrey Altman
Gesendet: Samstag, 9. August 2003 17:48
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re: AW: BUG: CreateToolhelp32Snapshot, check if running as NT
service


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.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to