[17/23] kernel32/tests: Fix synchronization tests compilation with __WINESRC__ defined.
Dmitry Timoshkov
dmitry at baikal.ru
Mon Oct 21 03:02:35 CDT 2013
---
dlls/kernel32/tests/sync.c | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c
index a040c59..b98d7c4 100644
--- a/dlls/kernel32/tests/sync.c
+++ b/dlls/kernel32/tests/sync.c
@@ -54,7 +54,7 @@ static void test_signalandwait(void)
DWORD r;
HANDLE event[2], semaphore[2], file;
- kernel32 = GetModuleHandle("kernel32");
+ kernel32 = GetModuleHandleA("kernel32.dll");
pSignalObjectAndWait = (void*) GetProcAddress(kernel32, "SignalObjectAndWait");
if (!pSignalObjectAndWait)
@@ -69,8 +69,8 @@ static void test_signalandwait(void)
}
ok( r == WAIT_FAILED, "should fail\n");
- event[0] = CreateEvent(NULL, 0, 0, NULL);
- event[1] = CreateEvent(NULL, 1, 1, NULL);
+ event[0] = CreateEventW(NULL, 0, 0, NULL);
+ event[1] = CreateEventW(NULL, 1, 1, NULL);
ok( event[0] && event[1], "failed to create event flags\n");
@@ -105,8 +105,8 @@ static void test_signalandwait(void)
CloseHandle(event[1]);
/* semaphores */
- semaphore[0] = CreateSemaphore( NULL, 0, 1, NULL );
- semaphore[1] = CreateSemaphore( NULL, 1, 1, NULL );
+ semaphore[0] = CreateSemaphoreW( NULL, 0, 1, NULL );
+ semaphore[1] = CreateSemaphoreW( NULL, 1, 1, NULL );
ok( semaphore[0] && semaphore[1], "failed to create semaphore\n");
r = pSignalObjectAndWait(semaphore[0], semaphore[1], 0, FALSE);
@@ -125,7 +125,7 @@ static void test_signalandwait(void)
CloseHandle(semaphore[1]);
/* try a registry key */
- file = CreateFile("x", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ file = CreateFileA("x", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL);
r = pSignalObjectAndWait(file, file, 0, FALSE);
ok( r == WAIT_FAILED, "should fail\n");
@@ -143,23 +143,23 @@ static void test_mutex(void)
DWORD failed = 0;
SetLastError(0xdeadbeef);
- hOpened = OpenMutex(0, FALSE, "WineTestMutex");
+ hOpened = OpenMutexA(0, FALSE, "WineTestMutex");
ok(hOpened == NULL, "OpenMutex succeeded\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
SetLastError(0xdeadbeef);
- hCreated = CreateMutex(NULL, FALSE, "WineTestMutex");
+ hCreated = CreateMutexA(NULL, FALSE, "WineTestMutex");
ok(hCreated != NULL, "CreateMutex failed with error %d\n", GetLastError());
SetLastError(0xdeadbeef);
- hOpened = OpenMutex(0, FALSE, "WineTestMutex");
+ hOpened = OpenMutexA(0, FALSE, "WineTestMutex");
todo_wine
ok(hOpened == NULL, "OpenMutex succeeded\n");
todo_wine
ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError());
SetLastError(0xdeadbeef);
- hOpened = OpenMutex(GENERIC_EXECUTE, FALSE, "WineTestMutex");
+ hOpened = OpenMutexA(GENERIC_EXECUTE, FALSE, "WineTestMutex");
ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError());
wait_ret = WaitForSingleObject(hOpened, INFINITE);
ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error %d\n", GetLastError());
@@ -172,7 +172,7 @@ todo_wine
}
SetLastError(0xdeadbeef);
- hOpened = OpenMutex(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex");
+ hOpened = OpenMutexA(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex");
ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError());
wait_ret = WaitForSingleObject(hOpened, INFINITE);
ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n");
@@ -181,7 +181,7 @@ todo_wine
for (i = 0; i < 32; i++)
{
SetLastError(0xdeadbeef);
- hOpened = OpenMutex(0x1 << i, FALSE, "WineTestMutex");
+ hOpened = OpenMutexA(0x1 << i, FALSE, "WineTestMutex");
if(hOpened != NULL)
{
SetLastError(0xdeadbeef);
@@ -211,23 +211,23 @@ todo_wine
/* test case sensitivity */
SetLastError(0xdeadbeef);
- hOpened = OpenMutex(READ_CONTROL, FALSE, "WINETESTMUTEX");
+ hOpened = OpenMutexA(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");
+ hOpened = OpenMutexA(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");
+ hOpened = CreateMutexA(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);
SetLastError(0xdeadbeef);
- hOpened = CreateMutex(NULL, FALSE, "WINETESTMUTEX");
+ hOpened = CreateMutexA(NULL, FALSE, "WINETESTMUTEX");
ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError());
ok(GetLastError() == 0, "wrong error %u\n", GetLastError());
CloseHandle(hOpened);
@@ -254,7 +254,7 @@ static void test_slist(void)
PSLIST_ENTRY (WINAPI *pInterlockedPushEntrySList)(PSLIST_HEADER,PSLIST_ENTRY);
HMODULE kernel32;
- kernel32 = GetModuleHandle("KERNEL32.DLL");
+ kernel32 = GetModuleHandleA("KERNEL32.DLL");
pInitializeSListHead = (void*) GetProcAddress(kernel32, "InitializeSListHead");
pQueryDepthSList = (void*) GetProcAddress(kernel32, "QueryDepthSList");
pInterlockedFlushSList = (void*) GetProcAddress(kernel32, "InterlockedFlushSList");
@@ -536,7 +536,7 @@ static void test_iocp_callback(void)
return;
}
- sem = CreateSemaphore(NULL, 0, 1, NULL);
+ sem = CreateSemaphoreW(NULL, 0, 1, NULL);
ok(sem != INVALID_HANDLE_VALUE, "Creating a semaphore failed\n");
ret = GetTempPathA(MAX_PATH, temp_path);
@@ -813,9 +813,9 @@ static void test_timer_queue(void)
ok(n5 == 1, "Timer callback 5 expected 1 got %d\n", n5);
/* Test synchronous deletion of the timer/queue with event trigger. */
- e = CreateEvent(NULL, TRUE, FALSE, NULL);
- et1 = CreateEvent(NULL, TRUE, FALSE, NULL);
- et2 = CreateEvent(NULL, TRUE, FALSE, NULL);
+ e = CreateEventW(NULL, TRUE, FALSE, NULL);
+ et1 = CreateEventW(NULL, TRUE, FALSE, NULL);
+ et2 = CreateEventW(NULL, TRUE, FALSE, NULL);
if (!e || !et1 || !et2)
{
skip("Failed to create timer queue descruction event\n");
@@ -1123,7 +1123,7 @@ static void test_WaitForMultipleObjects(void)
* we can wait on that many */
for (i=0; i<MAXIMUM_WAIT_OBJECTS; i++)
{
- maxevents[i] = CreateEvent(NULL, i==0, TRUE, NULL);
+ maxevents[i] = CreateEventW(NULL, i==0, TRUE, NULL);
ok( maxevents[i] != 0, "should create enough events\n");
}
@@ -1653,7 +1653,7 @@ static void test_condvars_base(void) {
START_TEST(sync)
{
- HMODULE hdll = GetModuleHandle("kernel32");
+ HMODULE hdll = GetModuleHandleA("kernel32.dll");
pChangeTimerQueueTimer = (void*)GetProcAddress(hdll, "ChangeTimerQueueTimer");
pCreateTimerQueue = (void*)GetProcAddress(hdll, "CreateTimerQueue");
pCreateTimerQueueTimer = (void*)GetProcAddress(hdll, "CreateTimerQueueTimer");
--
1.8.4.1
More information about the wine-patches
mailing list