GetGPOList API returns error 0x534 (1332, ERROR_NONE_MAPPED)
I tried this code :
HANDLE hToken = NULL; bool success = true; if (OpenProcessToken (GetCurrentProcess(), TOKEN_IMPERSONATE | TOKEN_READ | TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN, &hToken)) { PGROUP_POLICY_OBJECT gpo = NULL; if (GetGPOList (hToken, NULL, NULL, NULL, GPO_LIST_FLAG_MACHINE, &gpo)) { FreeGPOList (gpo); } else { ShowLastError (3); success = false; } CloseHandle (hToken); } else { ShowLastError (3); success = false; }
This looks fine, and I even tried TOKEN_ACCESS_ALL, same result.
Is it something wrong with that Token?
I didn't specify a Account name, and I just used this process' token, and
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ccf1f498-3237-45ac-9985-438eb576ee07 did not help me to solve this.
ShowLastError is a function that reports an error by GetLastError().
Anybody knows why this happens and how to fix it?
- I just knew that this problem is because of GetUserNameEx. It says that the user name is not available in the fully qualified distinguished name. What happend? My account does not have fully qualified DN?
Jin-oh on