Alexandre Julliard : kernel32: Waitable timer names are case sensitive.
Alexandre Julliard
julliard at winehq.org
Wed May 21 16:32:07 CDT 2008
Module: wine
Branch: master
Commit: b62f3dee2d629999f8f4cd2970af3592e091a8d1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b62f3dee2d629999f8f4cd2970af3592e091a8d1
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed May 21 20:44:36 2008 +0200
kernel32: Waitable timer names are case sensitive.
---
dlls/kernel32/sync.c | 5 ++---
dlls/kernel32/tests/sync.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c
index e317bf7..0032d17 100644
--- a/dlls/kernel32/sync.c
+++ b/dlls/kernel32/sync.c
@@ -913,8 +913,7 @@ HANDLE WINAPI CreateWaitableTimerW( SECURITY_ATTRIBUTES *sa, BOOL manual, LPCWST
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)
@@ -967,7 +966,7 @@ HANDLE WINAPI OpenWaitableTimerW( 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 6402457..7c9967d 100644
--- a/dlls/kernel32/tests/sync.c
+++ b/dlls/kernel32/tests/sync.c
@@ -372,6 +372,42 @@ static void test_semaphore(void)
CloseHandle( handle );
}
+static void test_waitable_timer(void)
+{
+ HANDLE handle, handle2;
+
+ /* test case sensitivity */
+
+ SetLastError(0xdeadbeef);
+ handle = CreateWaitableTimerA(NULL, FALSE, __FILE__ ": Test WaitableTimer");
+ ok(handle != NULL, "CreateWaitableTimer failed with error %u\n", GetLastError());
+ ok(GetLastError() == 0, "wrong error %u\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ handle2 = CreateWaitableTimerA(NULL, FALSE, __FILE__ ": Test WaitableTimer");
+ ok( handle2 != NULL, "CreateWaitableTimer failed with error %d\n", GetLastError());
+ ok( GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError());
+ CloseHandle( handle2 );
+
+ SetLastError(0xdeadbeef);
+ handle2 = CreateWaitableTimerA(NULL, FALSE, __FILE__ ": TEST WAITABLETIMER");
+ ok( handle2 != NULL, "CreateWaitableTimer failed with error %d\n", GetLastError());
+ ok( GetLastError() == 0, "wrong error %u\n", GetLastError());
+ CloseHandle( handle2 );
+
+ SetLastError(0xdeadbeef);
+ handle2 = OpenWaitableTimerA( TIMER_ALL_ACCESS, FALSE, __FILE__ ": Test WaitableTimer");
+ ok( handle2 != NULL, "OpenWaitableTimer failed with error %d\n", GetLastError());
+ CloseHandle( handle2 );
+
+ SetLastError(0xdeadbeef);
+ handle2 = OpenWaitableTimerA( TIMER_ALL_ACCESS, FALSE, __FILE__ ": TEST WAITABLETIMER");
+ ok( !handle2, "OpenWaitableTimer succeeded\n");
+ ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
+
+ CloseHandle( handle );
+}
+
static HANDLE sem = 0;
static void CALLBACK iocp_callback(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped)
@@ -488,5 +524,6 @@ START_TEST(sync)
test_slist();
test_event();
test_semaphore();
+ test_waitable_timer();
test_iocp_callback();
}
More information about the wine-cvs
mailing list