The following code works without any problems, sometimes, and at other times it throws an "Access Denied" error. The behavior is incompatible.
_hMutex = CreateMutex(NULL, FALSE, MutexName);
if (_hMutex == NULL)
{
throw MY_ERROR(GetLastError(), L"Error creating mutex handle");
}
I run my standalone executable that has this code, performs an operation, and shuts down. This is not a multithreaded application. I log in with the same user credentials every time I run this.
Could you help me solve this problem?
Thanks Hem
source
share