Getting error - Access is denied in OpenProcess() after enabling privileges
问题 I want to get executable path of csrss process. I enabled privileges, but GetLastError() function returns error 5 in OpenProcess. I'm running Visual Studio as administrator and compiling program in 64bit mode, also I'm using Windows 8. Thanks to all. HANDLE hcurrentProcess=GetCurrentProcess(); HANDLE hToken; size_t error; if (!OpenProcessToken(hcurrentProcess, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) return nullptr; if (CheckTokenPrivilege(hcurrentProcess, SE_DEBUG_NAME)) { LUID luid;