Hi,
I have a problem when calling GetTokenInformation,
for some reason it fails on windows server 2003 32bit but succeeds on server 2008 64bit.
PTOKEN_USER pSIDTokenUser = NULL;
DWORD dwReturnLength;
if (!GetTokenInformation(hToken, TokenUser, NULL, 0, &dwReturnLength) && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
}
pSIDTokenUser = (PTOKEN_USER)new BYTE[dwReturnLength];
memset(pSIDTokenUser, 0, dwReturnLength);
if (!pSIDTokenUser)
if (!GetTokenInformation(hToken, TokenUser, pSIDTokenUser, dwReturnLength, NULL))
the second call to GetTokenInformation on windows 2003 always return 0 with the error 998 ("Invalid access to memory location").
I assume it has something to do with the pSIDTokenUser size/alignment (I use the default) etc, but could not find the reason.
Thanks.