Thomas Weidenmueller wrote:
Joseph Galbraith wrote:
Ahh... I see the confusion; I'll counter with another quote from the platform SDK:
Return Values
If the function succeeds, the return value is a handle to the mutex object. If the named mutex object existed before the function call, the function returns a handle to the existing object and GetLastError returns ERROR_ALREADY_EXISTS. Otherwise, the caller created the mutex.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
If you read your quote carefully, you'll notice that it is refering to existing events, semaphores, waitable timers, jobs, or file-mapping objets... mutex is notably absent from the list. The key is the last sentance: "This occurs because these objects [the ones listed] share the same name space [as mutex objects.]
I do see now where the confusion comes from though; at first I was just going to respond that the two pieces of platform SDK documentation were in conflict, and the one I quoted is the behavior observed experimentally... then I read carefully.
Thanks for clearing this up, I didn't read the entire documentation, blame me. Maybe we should inform the MSDN team.
Sure, I'll report a PSDK documentation bug.
Thanks,
Joseph