BOOL IsUserAdmin(VOID)
/*++
Routine Description: This routine returns TRUE if the caller's
process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to
open its own process and process token.
Arguments: None.
Return Value:
TRUE - Caller has Administrators local group.
FALSE - Caller does not have Administrators local group. --
*/
{
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
Any Idea what to do ?1.) Google for the error.
Any Idea what to do ?1.) Google for the error.
2.) Respect the forum rules. This is a C::B forum and not a general programming forum.
I'll give you a hint anyways:
As seen on:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa376389%28v=vs.85%29.aspx
...does CheckTokenMembership require to link against Advapi32 in the right order.
Sorry. But for me this question has to do specifically with the usage of codeblocks. I didn't asked anything about programming. I asked about that specific problem I have in codeblocks. This was the reason, why I mentioned VisualStudio.
ok, so I was totally wrong about my expectations about the forum. My first Idea was, as I mentioned above, that this forum will
discuss all topics around the usage of that IDE. I thought, this includes how to set up compilers and linkers, too.
During my investigations I found things like : "in this and that IDE it is handled so and so. I dont know, how it works in codeblocks.."
My next step was then to search for an codeblocks-forum *shrugs*
And bare in mind that although this sounds harsh we have to be strict when it comes to compiler errors. This is an error coming from the compiler just being reported by the IDE therefore it would really not belong here for the reasons Jens stated. C::B supports way to many compilers and if you additionally take their versions into account, probably nobody can provide meaningful answers. :-)
Any way... I doubt that the compiler that ships with C::B does not support that. Please post the full build log... Just to be sure.