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
5628183b
Commit
5628183b
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 pipe tests compilation with __WINESRC__ defined.
parent
b2e9561a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
40 deletions
+37
-40
pipe.c
dlls/kernel32/tests/pipe.c
+37
-40
No files found.
dlls/kernel32/tests/pipe.c
View file @
5628183b
...
@@ -23,12 +23,9 @@
...
@@ -23,12 +23,9 @@
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include <windef.h>
#include "windef.h"
#include <winbase.h>
#include "winbase.h"
#include <winsock.h>
#include "winternl.h"
#include <wtypes.h>
#include <winerror.h>
#include "wine/test.h"
#include "wine/test.h"
#define PIPENAME "\\\\.\\PiPe\\tests_pipe.c"
#define PIPENAME "\\\\.\\PiPe\\tests_pipe.c"
...
@@ -64,7 +61,7 @@ static void test_CreateNamedPipe(int pipemode)
...
@@ -64,7 +61,7 @@ static void test_CreateNamedPipe(int pipemode)
else
else
trace
(
"test_CreateNamedPipe starting in message mode
\n
"
);
trace
(
"test_CreateNamedPipe starting in message mode
\n
"
);
/* Bad parameter checks */
/* Bad parameter checks */
hnp
=
CreateNamedPipe
(
"not a named pipe"
,
PIPE_ACCESS_DUPLEX
,
pipemode
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
"not a named pipe"
,
PIPE_ACCESS_DUPLEX
,
pipemode
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -76,7 +73,7 @@ static void test_CreateNamedPipe(int pipemode)
...
@@ -76,7 +73,7 @@ static void test_CreateNamedPipe(int pipemode)
if
(
pipemode
==
PIPE_TYPE_BYTE
)
if
(
pipemode
==
PIPE_TYPE_BYTE
)
{
{
/* Bad parameter checks */
/* Bad parameter checks */
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_READMODE_MESSAGE
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_READMODE_MESSAGE
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -86,7 +83,7 @@ static void test_CreateNamedPipe(int pipemode)
...
@@ -86,7 +83,7 @@ static void test_CreateNamedPipe(int pipemode)
"CreateNamedPipe should fail with PIPE_TYPE_BYTE | PIPE_READMODE_MESSAGE
\n
"
);
"CreateNamedPipe should fail with PIPE_TYPE_BYTE | PIPE_READMODE_MESSAGE
\n
"
);
}
}
hnp
=
CreateNamedPipe
(
NULL
,
hnp
=
CreateNamedPipe
A
(
NULL
,
PIPE_ACCESS_DUPLEX
,
pipemode
|
PIPE_WAIT
,
PIPE_ACCESS_DUPLEX
,
pipemode
|
PIPE_WAIT
,
1
,
1024
,
1024
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
1
,
1024
,
1024
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
ok
(
hnp
==
INVALID_HANDLE_VALUE
&&
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
ok
(
hnp
==
INVALID_HANDLE_VALUE
&&
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
...
@@ -99,7 +96,7 @@ static void test_CreateNamedPipe(int pipemode)
...
@@ -99,7 +96,7 @@ static void test_CreateNamedPipe(int pipemode)
/* Functional checks */
/* Functional checks */
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
pipemode
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
pipemode
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -340,7 +337,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -340,7 +337,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
HANDLE
hnp
,
hnp2
;
HANDLE
hnp
,
hnp2
;
/* Check no mismatch */
/* Check no mismatch */
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
2
,
/* nMaxInstances */
2
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -348,7 +345,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -348,7 +345,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
hnp2
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp2
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
2
,
/* nMaxInstances */
2
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -360,7 +357,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -360,7 +357,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
ok
(
CloseHandle
(
hnp2
),
"CloseHandle
\n
"
);
ok
(
CloseHandle
(
hnp2
),
"CloseHandle
\n
"
);
/* Check nMaxInstances */
/* Check nMaxInstances */
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -368,7 +365,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -368,7 +365,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
hnp2
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp2
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -380,7 +377,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -380,7 +377,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
ok
(
CloseHandle
(
hnp
),
"CloseHandle
\n
"
);
ok
(
CloseHandle
(
hnp
),
"CloseHandle
\n
"
);
/* Check PIPE_ACCESS_* */
/* Check PIPE_ACCESS_* */
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
2
,
/* nMaxInstances */
2
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -388,7 +385,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -388,7 +385,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
hnp2
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_INBOUND
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp2
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_INBOUND
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
2
,
/* nMaxInstances */
2
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -400,7 +397,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -400,7 +397,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
ok
(
CloseHandle
(
hnp
),
"CloseHandle
\n
"
);
ok
(
CloseHandle
(
hnp
),
"CloseHandle
\n
"
);
/* check everything else */
/* check everything else */
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
4
,
/* nMaxInstances */
4
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -408,7 +405,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
...
@@ -408,7 +405,7 @@ static void test_CreateNamedPipe_instances_must_match(void)
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
hnp2
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_MESSAGE
,
hnp2
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_MESSAGE
,
/* nMaxInstances */
3
,
/* nMaxInstances */
3
,
/* nOutBufSize */
102
,
/* nOutBufSize */
102
,
/* nInBufSize */
24
,
/* nInBufSize */
24
,
...
@@ -442,7 +439,7 @@ static DWORD CALLBACK serverThreadMain1(LPVOID arg)
...
@@ -442,7 +439,7 @@ static DWORD CALLBACK serverThreadMain1(LPVOID arg)
trace
(
"serverThreadMain1 start
\n
"
);
trace
(
"serverThreadMain1 start
\n
"
);
/* Set up a simple echo server */
/* Set up a simple echo server */
hnp
=
CreateNamedPipe
(
PIPENAME
"serverThreadMain1"
,
PIPE_ACCESS_DUPLEX
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
"serverThreadMain1"
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -494,7 +491,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg)
...
@@ -494,7 +491,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg)
trace
(
"serverThreadMain2
\n
"
);
trace
(
"serverThreadMain2
\n
"
);
/* Set up a simple echo server */
/* Set up a simple echo server */
hnp
=
CreateNamedPipe
(
PIPENAME
"serverThreadMain2"
,
PIPE_ACCESS_DUPLEX
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
"serverThreadMain2"
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
2
,
/* nMaxInstances */
2
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -546,7 +543,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg)
...
@@ -546,7 +543,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg)
/* Set up next echo server */
/* Set up next echo server */
hnpNext
=
hnpNext
=
CreateNamedPipe
(
PIPENAME
"serverThreadMain2"
,
PIPE_ACCESS_DUPLEX
,
CreateNamedPipe
A
(
PIPENAME
"serverThreadMain2"
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
2
,
/* nMaxInstances */
2
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -570,7 +567,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg)
...
@@ -570,7 +567,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg)
trace
(
"serverThreadMain3
\n
"
);
trace
(
"serverThreadMain3
\n
"
);
/* Set up a simple echo server */
/* Set up a simple echo server */
hnp
=
CreateNamedPipe
(
PIPENAME
"serverThreadMain3"
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
"serverThreadMain3"
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -579,7 +576,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg)
...
@@ -579,7 +576,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg)
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
hEvent
=
CreateEvent
(
NULL
,
/* security attribute */
hEvent
=
CreateEvent
W
(
NULL
,
/* security attribute */
TRUE
,
/* manual reset event */
TRUE
,
/* manual reset event */
FALSE
,
/* initial state */
FALSE
,
/* initial state */
NULL
);
/* name */
NULL
);
/* name */
...
@@ -699,7 +696,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg)
...
@@ -699,7 +696,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg)
trace
(
"serverThreadMain4
\n
"
);
trace
(
"serverThreadMain4
\n
"
);
/* Set up a simple echo server */
/* Set up a simple echo server */
hnp
=
CreateNamedPipe
(
PIPENAME
"serverThreadMain4"
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
"serverThreadMain4"
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -822,7 +819,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg)
...
@@ -822,7 +819,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg)
trace
(
"serverThreadMain5
\n
"
);
trace
(
"serverThreadMain5
\n
"
);
/* Set up a simple echo server */
/* Set up a simple echo server */
hnp
=
CreateNamedPipe
(
PIPENAME
"serverThreadMain5"
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
"serverThreadMain5"
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -831,7 +828,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg)
...
@@ -831,7 +828,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg)
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
hEvent
=
CreateEvent
(
NULL
,
/* security attribute */
hEvent
=
CreateEvent
W
(
NULL
,
/* security attribute */
TRUE
,
/* manual reset event */
TRUE
,
/* manual reset event */
FALSE
,
/* initial state */
FALSE
,
/* initial state */
NULL
);
/* name */
NULL
);
/* name */
...
@@ -966,7 +963,7 @@ static void test_NamedPipe_2(void)
...
@@ -966,7 +963,7 @@ static void test_NamedPipe_2(void)
trace
(
"test_NamedPipe_2 starting
\n
"
);
trace
(
"test_NamedPipe_2 starting
\n
"
);
/* Set up a twenty second timeout */
/* Set up a twenty second timeout */
alarm_event
=
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
NULL
);
alarm_event
=
CreateEvent
W
(
NULL
,
TRUE
,
FALSE
,
NULL
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
alarmThread
=
CreateThread
(
NULL
,
0
,
alarmThreadMain
,
(
void
*
)
20000
,
0
,
&
alarmThreadId
);
alarmThread
=
CreateThread
(
NULL
,
0
,
alarmThreadMain
,
(
void
*
)
20000
,
0
,
&
alarmThreadId
);
ok
(
alarmThread
!=
NULL
,
"CreateThread failed: %d
\n
"
,
GetLastError
());
ok
(
alarmThread
!=
NULL
,
"CreateThread failed: %d
\n
"
,
GetLastError
());
...
@@ -1022,7 +1019,7 @@ static int test_DisconnectNamedPipe(void)
...
@@ -1022,7 +1019,7 @@ static int test_DisconnectNamedPipe(void)
DWORD
ret
;
DWORD
ret
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hnp
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
hnp
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
/* nInBufSize */
1024
,
/* nInBufSize */
1024
,
...
@@ -1179,7 +1176,7 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p)
...
@@ -1179,7 +1176,7 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p)
CloseHandle
(
process_token
);
CloseHandle
(
process_token
);
}
}
pipe
=
CreateFile
(
PIPE_NAME
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
params
->
security_flags
,
NULL
);
pipe
=
CreateFile
A
(
PIPE_NAME
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
params
->
security_flags
,
NULL
);
ok
(
pipe
!=
INVALID_HANDLE_VALUE
,
"CreateFile for pipe failed with error %d
\n
"
,
GetLastError
());
ok
(
pipe
!=
INVALID_HANDLE_VALUE
,
"CreateFile for pipe failed with error %d
\n
"
,
GetLastError
());
ret
=
WriteFile
(
pipe
,
message
,
sizeof
(
message
),
&
bytes_written
,
NULL
);
ret
=
WriteFile
(
pipe
,
message
,
sizeof
(
message
),
&
bytes_written
,
NULL
);
...
@@ -1260,7 +1257,7 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_
...
@@ -1260,7 +1257,7 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_
SECURITY_IMPERSONATION_LEVEL
ImpersonationLevel
;
SECURITY_IMPERSONATION_LEVEL
ImpersonationLevel
;
DWORD
size
;
DWORD
size
;
hPipeServer
=
CreateNamedPipe
(
PIPE_NAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_READMODE_BYTE
|
PIPE_WAIT
,
1
,
100
,
100
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
hPipeServer
=
CreateNamedPipe
A
(
PIPE_NAME
,
PIPE_ACCESS_DUPLEX
,
PIPE_TYPE_BYTE
|
PIPE_READMODE_BYTE
|
PIPE_WAIT
,
1
,
100
,
100
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
ok
(
hPipeServer
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed with error %d
\n
"
,
GetLastError
());
ok
(
hPipeServer
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed with error %d
\n
"
,
GetLastError
());
params
.
security_flags
=
security_flags
;
params
.
security_flags
=
security_flags
;
...
@@ -1648,7 +1645,7 @@ static void test_NamedPipeHandleState(void)
...
@@ -1648,7 +1645,7 @@ static void test_NamedPipeHandleState(void)
DWORD
state
,
instances
,
maxCollectionCount
,
collectDataTimeout
;
DWORD
state
,
instances
,
maxCollectionCount
,
collectDataTimeout
;
char
userName
[
MAX_PATH
];
char
userName
[
MAX_PATH
];
server
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
server
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
/* dwOpenMode */
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* dwOpenMode */
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -1656,10 +1653,10 @@ static void test_NamedPipeHandleState(void)
...
@@ -1656,10 +1653,10 @@ static void test_NamedPipeHandleState(void)
/* nDefaultWait */
NMPWAIT_USE_DEFAULT_WAIT
,
/* nDefaultWait */
NMPWAIT_USE_DEFAULT_WAIT
,
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
server
!=
INVALID_HANDLE_VALUE
,
"cf failed
\n
"
);
ok
(
server
!=
INVALID_HANDLE_VALUE
,
"cf failed
\n
"
);
ret
=
GetNamedPipeHandleState
(
server
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ret
=
GetNamedPipeHandleState
A
(
server
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
todo_wine
todo_wine
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
ret
=
GetNamedPipeHandleState
(
server
,
&
state
,
&
instances
,
NULL
,
NULL
,
NULL
,
ret
=
GetNamedPipeHandleState
A
(
server
,
&
state
,
&
instances
,
NULL
,
NULL
,
NULL
,
0
);
0
);
todo_wine
todo_wine
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
...
@@ -1672,7 +1669,7 @@ static void test_NamedPipeHandleState(void)
...
@@ -1672,7 +1669,7 @@ static void test_NamedPipeHandleState(void)
* on a local pipe.
* on a local pipe.
*/
*/
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetNamedPipeHandleState
(
server
,
&
state
,
&
instances
,
ret
=
GetNamedPipeHandleState
A
(
server
,
&
state
,
&
instances
,
&
maxCollectionCount
,
&
collectDataTimeout
,
userName
,
&
maxCollectionCount
,
&
collectDataTimeout
,
userName
,
sizeof
(
userName
)
/
sizeof
(
userName
[
0
]));
sizeof
(
userName
)
/
sizeof
(
userName
[
0
]));
todo_wine
todo_wine
...
@@ -1705,7 +1702,7 @@ static void test_NamedPipeHandleState(void)
...
@@ -1705,7 +1702,7 @@ static void test_NamedPipeHandleState(void)
CloseHandle
(
client
);
CloseHandle
(
client
);
CloseHandle
(
server
);
CloseHandle
(
server
);
server
=
CreateNamedPipe
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
server
=
CreateNamedPipe
A
(
PIPENAME
,
PIPE_ACCESS_DUPLEX
,
/* dwOpenMode */
PIPE_TYPE_MESSAGE
|
PIPE_WAIT
,
/* dwOpenMode */
PIPE_TYPE_MESSAGE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -1713,10 +1710,10 @@ static void test_NamedPipeHandleState(void)
...
@@ -1713,10 +1710,10 @@ static void test_NamedPipeHandleState(void)
/* nDefaultWait */
NMPWAIT_USE_DEFAULT_WAIT
,
/* nDefaultWait */
NMPWAIT_USE_DEFAULT_WAIT
,
/* lpSecurityAttrib */
NULL
);
/* lpSecurityAttrib */
NULL
);
ok
(
server
!=
INVALID_HANDLE_VALUE
,
"cf failed
\n
"
);
ok
(
server
!=
INVALID_HANDLE_VALUE
,
"cf failed
\n
"
);
ret
=
GetNamedPipeHandleState
(
server
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ret
=
GetNamedPipeHandleState
A
(
server
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
todo_wine
todo_wine
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
ret
=
GetNamedPipeHandleState
(
server
,
&
state
,
&
instances
,
NULL
,
NULL
,
NULL
,
ret
=
GetNamedPipeHandleState
A
(
server
,
&
state
,
&
instances
,
NULL
,
NULL
,
NULL
,
0
);
0
);
todo_wine
todo_wine
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
...
@@ -1763,7 +1760,7 @@ static void test_readfileex_pending(void)
...
@@ -1763,7 +1760,7 @@ static void test_readfileex_pending(void)
const
char
test_string
[]
=
"test"
;
const
char
test_string
[]
=
"test"
;
int
i
;
int
i
;
server
=
CreateNamedPipe
(
PIPENAME
,
FILE_FLAG_OVERLAPPED
|
PIPE_ACCESS_DUPLEX
,
server
=
CreateNamedPipe
A
(
PIPENAME
,
FILE_FLAG_OVERLAPPED
|
PIPE_ACCESS_DUPLEX
,
/* dwOpenMode */
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* dwOpenMode */
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
/* nMaxInstances */
1
,
/* nMaxInstances */
1
,
/* nOutBufSize */
1024
,
/* nOutBufSize */
1024
,
...
@@ -1911,9 +1908,9 @@ START_TEST(pipe)
...
@@ -1911,9 +1908,9 @@ START_TEST(pipe)
{
{
HMODULE
hmod
;
HMODULE
hmod
;
hmod
=
GetModuleHandle
(
"advapi32.dll"
);
hmod
=
GetModuleHandle
A
(
"advapi32.dll"
);
pDuplicateTokenEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"DuplicateTokenEx"
);
pDuplicateTokenEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"DuplicateTokenEx"
);
hmod
=
GetModuleHandle
(
"kernel32.dll"
);
hmod
=
GetModuleHandle
A
(
"kernel32.dll"
);
pQueueUserAPC
=
(
void
*
)
GetProcAddress
(
hmod
,
"QueueUserAPC"
);
pQueueUserAPC
=
(
void
*
)
GetProcAddress
(
hmod
,
"QueueUserAPC"
);
if
(
test_DisconnectNamedPipe
())
if
(
test_DisconnectNamedPipe
())
...
...
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