Require Administrator Privileges Exclusive [new]: Getuidx64

BOOL GetRealUserSID(PSID *ppSid) HANDLE hToken; if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) return FALSE; DWORD dwSize = 0; GetTokenInformation(hToken, TokenUser, NULL, 0, &dwSize); PTOKEN_USER pUser = (PTOKEN_USER)malloc(dwSize); BOOL bResult = GetTokenInformation(hToken, TokenUser, pUser, dwSize, &dwSize); if (bResult) *ppSid = pUser->User.Sid;

The word exclusive is critical. It means: getuidx64 require administrator privileges exclusive

anybody could walk up to this machine right now and sign in as the administrator. and they can do anything they want and they don' YouTube·Ask Leo! BOOL GetRealUserSID(PSID *ppSid) HANDLE hToken; if (

From a developer’s perspective, implementing getuidx64 is a defensive programming choice. The developer likely uses: BOOL GetRealUserSID(PSID *ppSid) HANDLE hToken

If you control the source code, replace the getuidx64 call with a Windows-appropriate authentication method:

Back to Blog