Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
31917bfa
Commit
31917bfa
authored
Oct 21, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Fix synchronization tests compilation with __WINESRC__ defined.
parent
a18087e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
sync.c
dlls/kernel32/tests/sync.c
+23
-23
No files found.
dlls/kernel32/tests/sync.c
View file @
31917bfa
...
...
@@ -54,7 +54,7 @@ static void test_signalandwait(void)
DWORD
r
;
HANDLE
event
[
2
],
semaphore
[
2
],
file
;
kernel32
=
GetModuleHandle
(
"kernel32
"
);
kernel32
=
GetModuleHandle
A
(
"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
]
=
CreateEvent
W
(
NULL
,
0
,
0
,
NULL
);
event
[
1
]
=
CreateEvent
W
(
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
]
=
CreateSemaphore
W
(
NULL
,
0
,
1
,
NULL
);
semaphore
[
1
]
=
CreateSemaphore
W
(
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
=
CreateFile
A
(
"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
=
OpenMutex
A
(
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
=
CreateMutex
A
(
NULL
,
FALSE
,
"WineTestMutex"
);
ok
(
hCreated
!=
NULL
,
"CreateMutex failed with error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hOpened
=
OpenMutex
(
0
,
FALSE
,
"WineTestMutex"
);
hOpened
=
OpenMutex
A
(
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
=
OpenMutex
A
(
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
=
OpenMutex
A
(
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
=
OpenMutex
A
(
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
=
OpenMutex
A
(
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
=
OpenMutex
A
(
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
=
CreateMutex
A
(
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
=
CreateMutex
A
(
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
=
GetModuleHandle
A
(
"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
=
CreateSemaphore
W
(
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
=
CreateEvent
W
(
NULL
,
TRUE
,
FALSE
,
NULL
);
et1
=
CreateEvent
W
(
NULL
,
TRUE
,
FALSE
,
NULL
);
et2
=
CreateEvent
W
(
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
]
=
CreateEvent
W
(
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
=
GetModuleHandle
A
(
"kernel32.dll
"
);
pChangeTimerQueueTimer
=
(
void
*
)
GetProcAddress
(
hdll
,
"ChangeTimerQueueTimer"
);
pCreateTimerQueue
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateTimerQueue"
);
pCreateTimerQueueTimer
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateTimerQueueTimer"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment