kernel32: Mutex names are case sensitive.
This commit is contained in:
parent
36a7f31752
commit
e9793cc183
@ -669,8 +669,7 @@ HANDLE WINAPI CreateMutexW( SECURITY_ATTRIBUTES *sa, BOOL owner, LPCWSTR name )
|
|||||||
attr.Length = sizeof(attr);
|
attr.Length = sizeof(attr);
|
||||||
attr.RootDirectory = 0;
|
attr.RootDirectory = 0;
|
||||||
attr.ObjectName = NULL;
|
attr.ObjectName = NULL;
|
||||||
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF |
|
attr.Attributes = OBJ_OPENIF | ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0);
|
||||||
((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0);
|
|
||||||
attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
|
attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
|
||||||
attr.SecurityQualityOfService = NULL;
|
attr.SecurityQualityOfService = NULL;
|
||||||
if (name)
|
if (name)
|
||||||
@ -722,7 +721,7 @@ HANDLE WINAPI OpenMutexW( DWORD access, BOOL inherit, LPCWSTR name )
|
|||||||
attr.Length = sizeof(attr);
|
attr.Length = sizeof(attr);
|
||||||
attr.RootDirectory = 0;
|
attr.RootDirectory = 0;
|
||||||
attr.ObjectName = NULL;
|
attr.ObjectName = NULL;
|
||||||
attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0);
|
attr.Attributes = inherit ? OBJ_INHERIT : 0;
|
||||||
attr.SecurityDescriptor = NULL;
|
attr.SecurityDescriptor = NULL;
|
||||||
attr.SecurityQualityOfService = NULL;
|
attr.SecurityQualityOfService = NULL;
|
||||||
if (name)
|
if (name)
|
||||||
|
@ -148,7 +148,30 @@ static void test_mutex(void)
|
|||||||
todo_wine ok(!ret && (GetLastError() == ERROR_NOT_OWNER),
|
todo_wine ok(!ret && (GetLastError() == ERROR_NOT_OWNER),
|
||||||
"ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %d\n", GetLastError());
|
"ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %d\n", GetLastError());
|
||||||
|
|
||||||
|
/* test case sensitivity */
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hOpened = OpenMutex(READ_CONTROL, FALSE, "WINETESTMUTEX");
|
||||||
|
ok(!hOpened, "OpenMutex succeeded\n");
|
||||||
|
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hOpened = OpenMutex(READ_CONTROL, FALSE, "winetestmutex");
|
||||||
|
ok(!hOpened, "OpenMutex succeeded\n");
|
||||||
|
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hOpened = CreateMutex(NULL, FALSE, "WineTestMutex");
|
||||||
|
ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError());
|
||||||
|
ok(GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError());
|
||||||
CloseHandle(hOpened);
|
CloseHandle(hOpened);
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hOpened = CreateMutex(NULL, FALSE, "WINETESTMUTEX");
|
||||||
|
ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError());
|
||||||
|
ok(GetLastError() == 0, "wrong error %u\n", GetLastError());
|
||||||
|
CloseHandle(hOpened);
|
||||||
|
|
||||||
CloseHandle(hCreated);
|
CloseHandle(hCreated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user