My OS is Vista with UAC turned on, I create a global Mutex object in Server side, then my AP with UI want to use CreateMutex with same name to get the Mutex object which has been created in server, but the function tell me I don't have right to access it. How can I do it?
Windows – About Mutex object in Vista
uacwinapiwindowswindows-vista
Related Topic
- Windows – Using SSPI (NTLM) Api’s With Windows AccessCheck() On Vista With UAC
- R – About ProgramData folder’s right with UAC turned on under Vista
- R – Create Vista User Account
- Windows – GetPrivateProfileString() Gives Access Denied Error on Vista
- How to request Administrator access inside a batch file
- Windows – How to auto-elevate the batch file, so that it requests from UAC administrator rights if required
Best Answer
I think in your case you'll need to explicitly allow all-access to your mutex via initializing corresponding security attributes.
Try creating mutex this way (consider it as semi-pseudo-code):
And by the way - it is Ok to use CreateMutex to open an existing mutex. But, OpenMutex allows you to specify required access level.
Also note, that if you need a really global mutex - you'll have to prefix it's name with "Global\" (refer to MSDN's "Kernel Object Namespaces" article)