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
9d5ddd25
Commit
9d5ddd25
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 mailslot tests compilation with __WINESRC__ defined.
parent
a897e13f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
mailslot.c
dlls/kernel32/tests/mailslot.c
+15
-15
No files found.
dlls/kernel32/tests/mailslot.c
View file @
9d5ddd25
...
...
@@ -42,24 +42,24 @@ static int mailslot_test(void)
&
dwMsgCount
,
&
dwTimeout
),
"getmailslotinfo succeeded
\n
"
);
/* open a mailslot that doesn't exist */
hWriter
=
CreateFile
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
hWriter
=
CreateFile
A
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter
==
INVALID_HANDLE_VALUE
,
"nonexistent mailslot
\n
"
);
/* open a mailslot without the right name */
hSlot
=
CreateMailslot
(
"blah"
,
0
,
0
,
NULL
);
hSlot
=
CreateMailslot
A
(
"blah"
,
0
,
0
,
NULL
);
ok
(
hSlot
==
INVALID_HANDLE_VALUE
,
"Created mailslot with invalid name
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_NAME
,
"error should be ERROR_INVALID_NAME
\n
"
);
/* open a mailslot with a null name */
hSlot
=
CreateMailslot
(
NULL
,
0
,
0
,
NULL
);
hSlot
=
CreateMailslot
A
(
NULL
,
0
,
0
,
NULL
);
ok
(
hSlot
==
INVALID_HANDLE_VALUE
,
"Created mailslot with invalid name
\n
"
);
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
"error should be ERROR_PATH_NOT_FOUND
\n
"
);
/* valid open, but with wacky parameters ... then check them */
hSlot
=
CreateMailslot
(
szmspath
,
-
1
,
-
1
,
NULL
);
hSlot
=
CreateMailslot
A
(
szmspath
,
-
1
,
-
1
,
NULL
);
ok
(
hSlot
!=
INVALID_HANDLE_VALUE
,
"mailslot with valid name failed
\n
"
);
dwMax
=
dwNext
=
dwMsgCount
=
dwTimeout
=
0
;
ok
(
GetMailslotInfo
(
hSlot
,
&
dwMax
,
&
dwNext
,
&
dwMsgCount
,
&
dwTimeout
),
...
...
@@ -73,7 +73,7 @@ static int mailslot_test(void)
ok
(
CloseHandle
(
hSlot
),
"failed to close mailslot
\n
"
);
/* now open it for real */
hSlot
=
CreateMailslot
(
szmspath
,
0
,
0
,
NULL
);
hSlot
=
CreateMailslot
A
(
szmspath
,
0
,
0
,
NULL
);
ok
(
hSlot
!=
INVALID_HANDLE_VALUE
,
"valid mailslot failed
\n
"
);
/* try and read/write to it */
...
...
@@ -103,14 +103,14 @@ todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
/* now try and open the client, but with the wrong sharing mode */
hWriter
=
CreateFile
(
szmspath
,
GENERIC_WRITE
,
hWriter
=
CreateFile
A
(
szmspath
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter
!=
INVALID_HANDLE_VALUE
/* vista */
||
GetLastError
()
==
ERROR_SHARING_VIOLATION
,
"error should be ERROR_SHARING_VIOLATION got %p / %u
\n
"
,
hWriter
,
GetLastError
());
if
(
hWriter
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hWriter
);
/* now open the client with the correct sharing mode */
hWriter
=
CreateFile
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
hWriter
=
CreateFile
A
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter
!=
INVALID_HANDLE_VALUE
,
"existing mailslot err %u
\n
"
,
GetLastError
());
...
...
@@ -156,25 +156,25 @@ todo_wine
else
ok
(
count
==
0
,
"wrong count %u
\n
"
,
count
);
/* now try open another writer... should fail */
hWriter2
=
CreateFile
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
hWriter2
=
CreateFile
A
(
szmspath
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
/* succeeds on vista, don't test */
if
(
hWriter2
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hWriter2
);
/* now try open another as a reader ... also fails */
hWriter2
=
CreateFile
(
szmspath
,
GENERIC_READ
,
hWriter2
=
CreateFile
A
(
szmspath
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
/* succeeds on vista, don't test */
if
(
hWriter2
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hWriter2
);
/* now try open another as a writer ... still fails */
hWriter2
=
CreateFile
(
szmspath
,
GENERIC_WRITE
,
hWriter2
=
CreateFile
A
(
szmspath
,
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
/* succeeds on vista, don't test */
if
(
hWriter2
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hWriter2
);
/* now open another one */
hSlot2
=
CreateMailslot
(
szmspath
,
0
,
0
,
NULL
);
hSlot2
=
CreateMailslot
A
(
szmspath
,
0
,
0
,
NULL
);
ok
(
hSlot2
==
INVALID_HANDLE_VALUE
,
"opened two mailslots
\n
"
);
/* close the client again */
...
...
@@ -184,7 +184,7 @@ todo_wine
* now try reopen it with slightly different permissions ...
* shared writing
*/
hWriter
=
CreateFile
(
szmspath
,
GENERIC_WRITE
,
hWriter
=
CreateFile
A
(
szmspath
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter
!=
INVALID_HANDLE_VALUE
,
"sharing writer
\n
"
);
...
...
@@ -192,13 +192,13 @@ todo_wine
* now try open another as a writer ...
* but don't share with the first ... fail
*/
hWriter2
=
CreateFile
(
szmspath
,
GENERIC_WRITE
,
hWriter2
=
CreateFile
A
(
szmspath
,
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
/* succeeds on vista, don't test */
if
(
hWriter2
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hWriter2
);
/* now try open another as a writer ... and share with the first */
hWriter2
=
CreateFile
(
szmspath
,
GENERIC_WRITE
,
hWriter2
=
CreateFile
A
(
szmspath
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hWriter2
!=
INVALID_HANDLE_VALUE
,
"2nd sharing writer
\n
"
);
...
...
@@ -316,7 +316,7 @@ todo_wine
ok
(
CloseHandle
(
hSlot
),
"closing the mailslot
\n
"
);
/* test timeouts */
hSlot
=
CreateMailslot
(
szmspath
,
0
,
1000
,
NULL
);
hSlot
=
CreateMailslot
A
(
szmspath
,
0
,
1000
,
NULL
);
ok
(
hSlot
!=
INVALID_HANDLE_VALUE
,
"valid mailslot failed
\n
"
);
count
=
0
;
memset
(
buffer
,
0
,
sizeof
buffer
);
...
...
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