diff -r 6054b4897eed -r d18a4fe6b86a Win32OperatingSystem.st --- a/Win32OperatingSystem.st Thu Aug 18 15:48:36 2016 +0200 +++ b/Win32OperatingSystem.st Thu Aug 18 16:37:37 2016 +0200 @@ -7960,7 +7960,7 @@ "Modified: / 03-08-2010 / 16:59:26 / cg" ! -primOpenMutex:lpSecurityDescriptor initialOwner:bInitialOwner name:lpName +primOpenMutex:dwDesiredAccess initialOwner:bInitialOwner name:lpName "If the function succeeds, the return value is a handle to the mutex object. If the function fails, the return value is NULL. To get extended error information, call GetLastError. If a named mutex does not exist, the function fails and GetLastError returns ERROR_FILE_NOT_FOUND." @@ -7971,23 +7971,22 @@ %{ if (__isString(lpName) && ((bInitialOwner == true) || (bInitialOwner == false))) { - void *c_descr = NULL; - char *c_name; - BOOL c_initialOwner = (bInitialOwner == true); - HANDLE c_handle; - - c_name = __stringVal(lpName); - - if (lpSecurityDescriptor != nil) { - if (__isExternalAddressLike(lpSecurityDescriptor) - || __isExternalBytesLike(lpSecurityDescriptor) ) { - c_descr = __externalAddressVal(lpSecurityDescriptor); - } else - goto badArg; - } - c_handle = OpenMutexA(c_descr, c_initialOwner, c_name); - __externalAddressVal(handle) = c_handle; - RETURN(handle); + DWORD c_dwDesiredAccess = 0; + char *c_name; + BOOL c_initialOwner = (bInitialOwner == true); + HANDLE c_handle; + + c_name = __stringVal(lpName); + + if (dwDesiredAccess != nil) { + if (! isSmallInteger(dwDesiredAccess)) { + goto badArg; + } + c_dwDesiredAccess = __intVal(dwDesiredAccess); + } + c_handle = OpenMutexA(c_dwDesiredAccess, c_initialOwner, c_name); + __externalAddressVal(handle) = c_handle; + RETURN(handle); } badArg: ; %}.