Trying to understand process privilege attributes
问题 I'm writing a logging service that may collect privileges of a process and I'm trying to understand attributes for each process privilege. Let me explain with this code: HANDLE hToken; if(OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &hToken)) { DWORD dwSize = 0; if(!GetTokenInformation(hToken, TokenPrivileges, NULL, dwSize, &dwSize) && ::GetLastError() == ERROR_INSUFFICIENT_BUFFER) { BYTE* pb = new (std::nothrow) BYTE[dwSize]; if(pb) { TOKEN_PRIVILEGES* pTPs = (TOKEN_PRIVILEGES*)pb;