The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Not to self: ERROR_ALREADY_EXIST (183) can also mean your named Mutex already exists

Posted by jpluimers on 2020/09/16

A while ago, I had an error like this when debugging plugins:

Project bds.exe raised exception class EOSError with message ‘System Error.  Code: 183.
Cannot create a file when that file already exists’.

It got was raised when [WayBackGetLastError returned ERROR_ALREADY_EXIST which according to [WayBackSystem Error Codes (0-499) (Windows) has this description:

ERROR_ALREADY_EXISTS

183 (0xB7)
Cannot create a file when that file already exists.

 

The last line is the same description that [WayBackFormatMessage returns. And it put me on the wrong foot as it wasn’t a file, but a mutex that was created: indeed [WayBackCreateMutex documents it:

If the mutex is a named mutex and the object existed before this function call, the return value is a handle to the existing object, GetLastError returns ERROR_ALREADY_EXISTS, bInitialOwner is ignored, and the calling thread is not granted ownership. However, if the caller has limited access rights, the function will fail with ERROR_ACCESS_DENIED and the caller should use the OpenMutex function.

In the mean time, the plugin doesn’t raise that as an exception any more.

–jeroen

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.