Re: AW: AW: AW: BUG: CreateToolhelp32Snapshot, check if running as NT service

2003-08-14 Thread Andy Polyakov
> There is more reliable way. For example. > > h = GetProcessWindowStation(); > if (h==NULL) fatal error; /* or return "runs as service" */ > if (GetUserObjectInformationW (h,UOI_NAME,NULL,0,NULL,&len) || > GetLastError() != ERROR_INSUFFICIENT_BUFFER) >fatal error; /* or return "runs a

AW: AW: BUG: CreateToolhelp32Snapshot, check if running as NT service

2003-08-14 Thread Ingo A. Kubbilun
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 ano

Re: AW: AW: AW: BUG: CreateToolhelp32Snapshot, check if running as NT service

2003-08-14 Thread Martin Kochanski
At 11:28 11/08/03 +0200, you wrote: >Hi, > >to make things clear, how to check if a Win32 exe is currently running >as a NT service: >1.) Check if the SID (security ID) of the current process is "S-1-5-18", >i.e. the so called LOCALSYSTEM account. This changes if you configure >your service (in the

Re: AW: AW: AW: BUG: CreateToolhelp32Snapshot, check if running as NT service

2003-08-11 Thread Andy Polyakov
> to make things clear, how to check if a Win32 exe is currently running > as a NT service: > 1.) Check if the SID (security ID) of the current process is "S-1-5-18", > i.e. the so called LOCALSYSTEM account. This changes if you configure > your service (in the services control panel) to run on a d

AW: AW: AW: BUG: CreateToolhelp32Snapshot, check if running as NT service

2003-08-11 Thread Ingo A. Kubbilun
chricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Richard Levitte - VMS Whacker Gesendet: Sonntag, 10. August 2003 11:39 An: [EMAIL PROTECTED]; [EMAIL PROTECTED] Betreff: Re: AW: AW: BUG: CreateToolhelp32Snapshot, check if running as NT service In message <[EMAIL PR