33{
34 HANDLE hSlot, hSlot2, hWriter, hWriter2;
38
39
40 dwMax = dwNext = dwMsgCount =
dwTimeout = 0;
42 &dwMsgCount, &
dwTimeout ),
"getmailslotinfo succeeded\n");
43
44
48
49
52 "Created mailslot with invalid name\n");
54 "error should be ERROR_INVALID_NAME\n");
55
56
60
61
64 dwMax = dwNext = dwMsgCount =
dwTimeout = 0;
66 "getmailslotinfo failed\n");
67 ok( dwMax == ~0
U,
"dwMax incorrect\n");
69 ok( dwMsgCount == 0,
"dwMsgCount incorrect\n");
72 "getmailslotinfo failed\n");
74
75
78
79
83 ok(!
ret,
"ReadFile should fail\n");
86
90 ok(!
ret,
"ReadFile should fail\n");
94
98 ok( !
ret,
"slot read\n");
102 "slot write\n");
104
105
109 "error should be ERROR_SHARING_VIOLATION got %p / %u\n", hWriter,
GetLastError());
111
112
116
117
118
119
120
122 ok( !
ret,
"slot read\n");
126 "slot write\n");
128
129
130
131
132
134 "can read client\n");
138 "can't write client\n");
140 "can read client\n");
143
144
145
146
147
149 "slot read\n");
151
152
154 ok( !
ret,
"slot read\n");
157
158
161
163
164
167
169
170
173
175
176
179
180
182
183
184
185
186
190
191
192
193
194
197
199
200
204
205
206 dwMax = dwNext = dwMsgCount =
dwTimeout = 0;
208 "getmailslotinfo failed\n");
210 ok( dwMax == 0,
"dwMax incorrect\n");
211 ok( dwMsgCount == 0,
"dwMsgCount incorrect\n");
213
214
216 ok( !
ret,
"slot read\n");
219
220
223
224
225 dwNext = dwMsgCount = 0;
227 "getmailslotinfo failed\n");
228 ok( dwNext == 1,
"dwNext incorrect\n");
229 ok( dwMsgCount == 1,
"dwMsgCount incorrect\n");
230
234
235
236 dwNext = dwMsgCount = 0;
238 "getmailslotinfo failed\n");
239 ok( dwNext == 1,
"dwNext incorrect\n");
241 ok( dwMsgCount == 2,
"dwMsgCount incorrect\n");
242 }
243
244
246
247
248 dwNext = dwMsgCount = 0;
250 "getmailslotinfo failed\n");
251 ok( dwNext == 1,
"dwNext incorrect\n");
253 ok( dwMsgCount == 3,
"dwMsgCount incorrect %u\n", dwMsgCount);
254
256
257
258
259
260
262 "1st slot read failed\n");
263 ok(
count == 1,
"failed to get 1st message\n");
264 ok(
buffer[0] ==
'a',
"1st message wrong\n");
265
266
267 dwNext = dwMsgCount = 0;
269 "getmailslotinfo failed\n");
270 ok( dwNext == 2,
"dwNext incorrect\n");
272 ok( dwMsgCount == 2,
"dwMsgCount incorrect %u\n", dwMsgCount);
273 }
274
275
277 "2nd slot read failed\n");
278 ok(
count == 2,
"failed to get 2nd message\n");
279 ok( (
buffer[0] ==
'b' ) && (
buffer[1] ==
'c' ),
"2nd message wrong\n");
280
281
282 dwNext = dwMsgCount = 0;
284 "getmailslotinfo failed\n");
285 ok( dwNext == 0,
"dwNext incorrect %u\n", dwNext);
287 ok( dwMsgCount == 1,
"dwMsgCount incorrect %u\n", dwMsgCount);
288 }
289
290
293 "3rd slot read failed\n");
294 }
295 ok(
count == 0,
"failed to get 3rd message\n");
296
297
298
299
300
301 dwNext = dwMsgCount = 0;
303 "getmailslotinfo failed\n");
305 ok( dwMsgCount == 0,
"dwMsgCount incorrect\n");
306
307
309 ok( !
ret,
"3rd slot read succeeded\n");
312
313
317
318
330
331 return 0;
332}
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_INVALID_HANDLE
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
BOOL WINAPI GetMailslotInfo(IN HANDLE hMailslot, IN LPDWORD lpMaxMessageSize, IN LPDWORD lpNextSize, IN LPDWORD lpMessageCount, IN LPDWORD lpReadTimeout)
HANDLE WINAPI CreateMailslotA(IN LPCSTR lpName, IN DWORD nMaxMessageSize, IN DWORD lReadTimeout, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetTickCount(VOID)
GLuint GLuint GLsizei count
static const char szmspath[]
#define MAILSLOT_NO_MESSAGE
DWORD WINAPI GetLastError(void)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
#define ERROR_SEM_TIMEOUT
#define ERROR_SHARING_VIOLATION
#define ERROR_PATH_NOT_FOUND