Module: wine Branch: master Commit: c96752c044c151497e0de115516cfb809603268e URL: http://source.winehq.org/git/wine.git/?a=commit;h=c96752c044c151497e0de11551...
Author: Alexandre Julliard julliard@winehq.org Date: Wed May 21 20:42:54 2008 +0200
kernel32: Event names are case sensitive.
---
dlls/kernel32/sync.c | 5 ++--- dlls/kernel32/tests/sync.c | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index bd2dd06..eb2fcc5 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -469,8 +469,7 @@ HANDLE WINAPI CreateEventW( SECURITY_ATTRIBUTES *sa, BOOL manual_reset, attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF | - ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); + attr.Attributes = OBJ_OPENIF | ((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0); attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; if (name) @@ -531,7 +530,7 @@ HANDLE WINAPI OpenEventW( DWORD access, BOOL inherit, LPCWSTR name ) attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = NULL; - attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0); + attr.Attributes = inherit ? OBJ_INHERIT : 0; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; if (name) diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index d130803..e3de911 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -268,9 +268,9 @@ static void test_slist(void) ok(((struct item*)entry->Next)->value == 1, "item 1 not at the back of list\n"); }
-static void test_event_security(void) +static void test_event(void) { - HANDLE handle; + HANDLE handle, handle2; SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; ACL acl; @@ -303,6 +303,37 @@ static void test_event_security(void) handle = CreateEventA(&sa, FALSE, FALSE, __FILE__ ": Test Event"); ok(handle != NULL, "CreateEventW with blank sd failed with error %d\n", GetLastError()); CloseHandle(handle); + + /* test case sensitivity */ + + SetLastError(0xdeadbeef); + handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); + ok( handle != NULL, "CreateEvent failed with error %u\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + handle2 = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); + ok( handle2 != NULL, "CreateEvent failed with error %d\n", GetLastError()); + ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); + CloseHandle( handle2 ); + + SetLastError(0xdeadbeef); + handle2 = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": TEST EVENT"); + ok( handle2 != NULL, "CreateEvent failed with error %d\n", GetLastError()); + ok( GetLastError() == 0, "wrong error %u\n", GetLastError()); + CloseHandle( handle2 ); + + SetLastError(0xdeadbeef); + handle2 = OpenEventA( EVENT_ALL_ACCESS, FALSE, __FILE__ ": Test Event"); + ok( handle2 != NULL, "OpenEvent failed with error %d\n", GetLastError()); + CloseHandle( handle2 ); + + SetLastError(0xdeadbeef); + handle2 = OpenEventA( EVENT_ALL_ACCESS, FALSE, __FILE__ ": TEST EVENT"); + ok( !handle2, "OpenEvent succeeded\n"); + ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + + CloseHandle( handle ); }
static HANDLE sem = 0; @@ -419,6 +450,6 @@ START_TEST(sync) test_signalandwait(); test_mutex(); test_slist(); - test_event_security(); + test_event(); test_iocp_callback(); }