CreateMutex fails after impersonation
问题 Here's the code where I'me trying to impersonate a user and then create a mutex. The mutex is not getting created. I get ERROR_ACCESS_DENIED error. void Impersonate() { DWORD logonType = LOGON32_LOGON_INTERACTIVE; DWORD logonProvider = LOGON32_PROVIDER_DEFAULT; HANDLE userToken; HANDLE hMutex; DWORD err; LPSTR user = "zoom"; // the user I created myself on my machine. // It has Administrator privileges, and my account, // from which I start the app, is Admin too LPSTR password = "zoom"; LPSTR