At first, may be somebody knows some easy way to know, am I privileged user or not? Until now I tryed to write to certain registry key in HKEY_LOCAL_MACHINE, in case of success I decided I am an admin. Now, in Vista, it does not work - Vista allows for everybody to write to system area of registry - to virtual registry file. I have found API IsUserAnAdmin(), but it does work only in Vista. Then I have found an example with CheckTokenMembership(). The API is present in mingw libraries I got recently, in libadvapi32.lib, the actual name of the entry is
_CheckTokenMembership@12
There is no definition of it in mingw headers, so I define it locally as
extern BOOL WINAPI CheckTokenMembership(HANDLE, PSID, PBOOL);
or
WINUSERAPI BOOL WINAPI CheckTokenMembership(HANDLE, PSID, PBOOL);
Compiler generates such a reference to the different external name:
_Z20CheckTokenMembershipPvS_Pi@12
How to force compiler not to generate these additional pre/suffixes? Other API calls are compiled without any suffixes, for example,
WINUSERAPI UINT WINAPI SendInput(UINT,LPINPUT,int);
compiles to
_SendInput@12
Compiler mingw GNU GCC 3.4.4, got together with Code::Blocks v1.0 rc2 IDE, OS Windows Vista.
Any ideas?
Thank you.
_CheckTokenMembership@12
There is no definition of it in mingw headers, so I define it locally as
extern BOOL WINAPI CheckTokenMembership(HANDLE, PSID, PBOOL);
or
WINUSERAPI BOOL WINAPI CheckTokenMembership(HANDLE, PSID, PBOOL);
Compiler generates such a reference to the different external name:
_Z20CheckTokenMembershipPvS_Pi@12
How to force compiler not to generate these additional pre/suffixes? Other API calls are compiled without any suffixes, for example,
WINUSERAPI UINT WINAPI SendInput(UINT,LPINPUT,int);
compiles to
_SendInput@12
Compiler mingw GNU GCC 3.4.4, got together with Code::Blocks v1.0 rc2 IDE, OS Windows Vista.
Any ideas?
Thank you.