ReactOS 0.4.16-dev-2208-g6350669
mailslot.c
Go to the documentation of this file.
1/*
2 * Mailslot regression test
3 *
4 * Copyright 2003 Mike McCormack
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <stdarg.h>
22#include <stdlib.h>
23#include <stdio.h>
24
25#include <ntstatus.h>
26#define WIN32_NO_STATUS
27#include <windef.h>
28#include <winbase.h>
29#include <winternl.h>
30#include "wine/test.h"
31#ifdef __REACTOS__
32#include "winehacks.h"
33#endif
34
35static const char szmspath[] = "\\\\.\\mailslot\\wine_mailslot_test";
36
37static int mailslot_test(void)
38{
39 UNICODE_STRING nt_path = RTL_CONSTANT_STRING( L"\\??\\MAILSLOT\\wine_mailslot_test" );
40 HANDLE hSlot, hSlot2, hWriter, hWriter2;
41 unsigned char buffer[16];
42 DWORD count, dwMax, dwNext, dwMsgCount, dwTimeout;
46 BOOL ret;
47
48 /* sanity check on GetMailslotInfo */
49 dwMax = dwNext = dwMsgCount = dwTimeout = 0;
50 ok( !GetMailslotInfo( INVALID_HANDLE_VALUE, &dwMax, &dwNext,
51 &dwMsgCount, &dwTimeout ), "getmailslotinfo succeeded\n");
52
53 /* open a mailslot that doesn't exist */
56 ok( hWriter == INVALID_HANDLE_VALUE, "nonexistent mailslot\n");
57
58 /* open a mailslot without the right name */
59 hSlot = CreateMailslotA( "blah", 0, 0, NULL );
60 ok( hSlot == INVALID_HANDLE_VALUE,
61 "Created mailslot with invalid name\n");
63 "error should be ERROR_INVALID_NAME\n");
64
65 /* open a mailslot with a null name */
66 hSlot = CreateMailslotA( NULL, 0, 0, NULL );
67 ok( hSlot == INVALID_HANDLE_VALUE, "Created mailslot with invalid name\n");
68 ok( GetLastError() == ERROR_PATH_NOT_FOUND, "error should be ERROR_PATH_NOT_FOUND\n");
69
70 /* valid open, but with wacky parameters ... then check them */
71 hSlot = CreateMailslotA( szmspath, -1, -1, NULL );
72 ok( hSlot != INVALID_HANDLE_VALUE , "mailslot with valid name failed\n");
73 dwMax = dwNext = dwMsgCount = dwTimeout = 0;
74 ok( GetMailslotInfo( hSlot, &dwMax, &dwNext, &dwMsgCount, &dwTimeout ),
75 "getmailslotinfo failed\n");
76 ok( dwMax == ~0U, "dwMax incorrect\n");
77 ok( dwNext == MAILSLOT_NO_MESSAGE, "dwNext incorrect\n");
78 ok( dwMsgCount == 0, "dwMsgCount incorrect\n");
79 ok( dwTimeout == ~0U, "dwTimeout incorrect\n");
80 ok( GetMailslotInfo( hSlot, NULL, NULL, NULL, NULL ),
81 "getmailslotinfo failed\n");
82 ok( CloseHandle(hSlot), "failed to close mailslot\n");
83
84 /* now open it for real */
85 hSlot = CreateMailslotA( szmspath, 0, 0, NULL );
86 ok( hSlot != INVALID_HANDLE_VALUE , "valid mailslot failed\n");
87
88 /* try and read/write to it */
89 count = 0xdeadbeef;
90 SetLastError(0xdeadbeef);
92 ok(!ret, "ReadFile should fail\n");
93 ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError());
94 ok(count == 0, "expected 0, got %lu\n", count);
95
96 count = 0xdeadbeef;
97 SetLastError(0xdeadbeef);
98 ret = ReadFile(hSlot, buffer, 0, &count, NULL);
99 ok(!ret, "ReadFile should fail\n");
100 ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError());
101 ok(count == 0, "expected 0, got %lu\n", count);
102
103 count = 0;
104 memset(buffer, 0, sizeof buffer);
105 ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
106 ok( !ret, "slot read\n");
107 if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
108 else ok( count == 0, "wrong count %lu\n", count );
109 ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL),
110 "slot write\n");
111 ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
112
113 io.Status = 0xdeadbeef;
114 io.Information = 0xdeadbeef;
115 ret = NtReadFile( hSlot, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL );
116 ok( ret == STATUS_IO_TIMEOUT, "got %#x\n", ret );
117 ok( io.Status == 0xdeadbeef, "got status %#lx\n", io.Status );
118 ok( io.Information == 0xdeadbeef, "got size %Iu\n", io.Information );
119
120 io.Status = 0xdeadbeef;
121 io.Information = 0xdeadbeef;
122 ret = NtWriteFile( hSlot, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL );
123 ok( ret == STATUS_ACCESS_DENIED, "got %#x\n", ret );
124 ok( io.Status == 0xdeadbeef, "got status %#lx\n", io.Status );
125 ok( io.Information == 0xdeadbeef, "got size %Iu\n", io.Information );
126
127 /* now try and open the client, but with the wrong sharing mode */
129 0, NULL, OPEN_EXISTING, 0, NULL);
130 ok( hWriter != INVALID_HANDLE_VALUE /* vista */ || GetLastError() == ERROR_SHARING_VIOLATION,
131 "error should be ERROR_SHARING_VIOLATION got %p / %lu\n", hWriter, GetLastError());
132 if (hWriter != INVALID_HANDLE_VALUE) CloseHandle( hWriter );
133
134 /* now open the client with the correct sharing mode */
137 ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %lu\n", GetLastError());
138
139 /*
140 * opening a client should make no difference to
141 * whether we can read or write the mailslot
142 */
143 ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL);
144 ok( !ret, "slot read\n");
145 if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
146 else ok( count == 0, "wrong count %lu\n", count );
147 ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL),
148 "slot write\n");
149 ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
150
151 /*
152 * we can't read from this client,
153 * but we should be able to write to it
154 */
155 ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
156 "can read client\n");
158 "wrong error %lu\n", GetLastError() );
159 ok( WriteFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
160 "can't write client\n");
161 ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
162 "can read client\n");
164 "wrong error %lu\n", GetLastError() );
165
166 io.Status = 0xdeadbeef;
167 io.Information = 0xdeadbeef;
168 ret = NtReadFile( hWriter, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL );
169 todo_wine ok( ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret );
170 ok( io.Status == 0xdeadbeef, "got status %#lx\n", io.Status );
171 ok( io.Information == 0xdeadbeef, "got size %Iu\n", io.Information );
172
173 /*
174 * seeing as there's something in the slot,
175 * we should be able to read it once
176 */
177 ok( ReadFile( hSlot, buffer, sizeof buffer, &count, NULL),
178 "slot read\n");
179 ok( count == (sizeof buffer/2), "short read\n" );
180
181 /* but not again */
182 ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
183 ok( !ret, "slot read\n");
184 if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
185 else ok( count == 0, "wrong count %lu\n", count );
186
187 /* now try open another writer... should fail */
190 /* succeeds on vista, don't test */
191 if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
192
193 /* now try open another as a reader ... also fails */
196 /* succeeds on vista, don't test */
197 if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
198
199 /* now try open another as a writer ... still fails */
202 /* succeeds on vista, don't test */
203 if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
204
205 /* now open another one */
206 hSlot2 = CreateMailslotA( szmspath, 0, 0, NULL );
207 ok( hSlot2 == INVALID_HANDLE_VALUE , "opened two mailslots\n");
208
209 /* close the client again */
210 ok( CloseHandle( hWriter ), "closing the client\n");
211
212 /*
213 * now try reopen it with slightly different permissions ...
214 * shared writing
215 */
218 ok( hWriter != INVALID_HANDLE_VALUE, "sharing writer\n");
219
220 /*
221 * now try open another as a writer ...
222 * but don't share with the first ... fail
223 */
226 /* succeeds on vista, don't test */
227 if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
228
229 /* now try open another as a writer ... and share with the first */
232 ok( hWriter2 != INVALID_HANDLE_VALUE, "2nd sharing writer\n");
233
234 /* check the mailslot info */
235 dwMax = dwNext = dwMsgCount = dwTimeout = 0;
236 ok( GetMailslotInfo( hSlot, &dwMax, &dwNext, &dwMsgCount, &dwTimeout ),
237 "getmailslotinfo failed\n");
238 ok( dwNext == MAILSLOT_NO_MESSAGE, "dwNext incorrect\n");
239 ok( dwMax == 0, "dwMax incorrect\n");
240 ok( dwMsgCount == 0, "dwMsgCount incorrect\n");
241 ok( dwTimeout == 0, "dwTimeout incorrect\n");
242
243 /* check there's still no data */
244 ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
245 ok( !ret, "slot read\n");
246 if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
247 else ok( count == 0, "wrong count %lu\n", count );
248
249 /* write two messages */
250 buffer[0] = 'a';
251 ok( WriteFile( hWriter, buffer, 1, &count, NULL), "1st write failed\n");
252
253 /* check the mailslot info */
254 dwNext = dwMsgCount = 0;
255 ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
256 "getmailslotinfo failed\n");
257 ok( dwNext == 1, "dwNext incorrect\n");
258 ok( dwMsgCount == 1, "dwMsgCount incorrect\n");
259
260 buffer[0] = 'b';
261 buffer[1] = 'c';
262 ok( WriteFile( hWriter2, buffer, 2, &count, NULL), "2nd write failed\n");
263
264 /* check the mailslot info */
265 dwNext = dwMsgCount = 0;
266 ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
267 "getmailslotinfo failed\n");
268 ok( dwNext == 1, "dwNext incorrect\n");
269 ok( dwMsgCount == 2, "dwMsgCount incorrect\n");
270
271 /* write a 3rd message with zero size */
272 ok( WriteFile( hWriter2, buffer, 0, &count, NULL), "3rd write failed\n");
273
274 /* check the mailslot info */
275 dwNext = dwMsgCount = 0;
276 ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
277 "getmailslotinfo failed\n");
278 ok( dwNext == 1, "dwNext incorrect\n");
279 ok( dwMsgCount == 3, "dwMsgCount incorrect %lu\n", dwMsgCount);
280
281 buffer[0]=buffer[1]=0;
282
283 /*
284 * then check that they come out with the correct order and size,
285 * then the slot is empty
286 */
287 ok( ReadFile( hSlot, buffer, sizeof buffer, &count, NULL),
288 "1st slot read failed\n");
289 ok( count == 1, "failed to get 1st message\n");
290 ok( buffer[0] == 'a', "1st message wrong\n");
291
292 /* check the mailslot info */
293 dwNext = dwMsgCount = 0;
294 ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
295 "getmailslotinfo failed\n");
296 ok( dwNext == 2, "dwNext incorrect\n");
297 ok( dwMsgCount == 2, "dwMsgCount incorrect %lu\n", dwMsgCount);
298
299 /* read the second message */
300 ok( ReadFile( hSlot, buffer, sizeof buffer, &count, NULL),
301 "2nd slot read failed\n");
302 ok( count == 2, "failed to get 2nd message\n");
303 ok( ( buffer[0] == 'b' ) && ( buffer[1] == 'c' ), "2nd message wrong\n");
304
305 /* check the mailslot info */
306 dwNext = dwMsgCount = 0;
307 ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
308 "getmailslotinfo failed\n");
309 ok( dwNext == 0, "dwNext incorrect %lu\n", dwNext);
310 ok( dwMsgCount == 1, "dwMsgCount incorrect %lu\n", dwMsgCount);
311
312 /* read the 3rd (zero length) message */
313 ok( ReadFile( hSlot, buffer, sizeof buffer, &count, NULL),
314 "3rd slot read failed\n");
315 ok( count == 0, "failed to get 3rd message\n");
316
317 /*
318 * now there should be no more messages
319 * check the mailslot info
320 */
321 dwNext = dwMsgCount = 0;
322 ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
323 "getmailslotinfo failed\n");
324 ok( dwNext == MAILSLOT_NO_MESSAGE, "dwNext incorrect\n");
325 ok( dwMsgCount == 0, "dwMsgCount incorrect\n");
326
327 /* check that reads fail */
328 ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
329 ok( !ret, "3rd slot read succeeded\n");
330 if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
331 else ok( count == 0, "wrong count %lu\n", count );
332
333 /* Try to perform a partial read. */
334 count = 0;
335 ret = WriteFile( hWriter, buffer, 2, &count, NULL );
336 ok( ret, "got %d\n", ret );
337 ok( count == 2, "got count %lu\n", count );
338
339 io.Status = 0xdeadbeef;
340 io.Information = 0xdeadbeef;
341 ret = NtReadFile( hSlot, NULL, NULL, NULL, &io, buffer, 1, NULL, NULL );
342 ok( ret == STATUS_BUFFER_TOO_SMALL, "got %#x\n", ret );
343 ok( io.Status == 0xdeadbeef, "got status %#lx\n", io.Status );
344 ok( io.Information == 0xdeadbeef, "got size %Iu\n", io.Information );
345
346 io.Status = 0xdeadbeef;
347 io.Information = 0xdeadbeef;
348 memset( &info, 0xcc, sizeof(info) );
350 ok( ret == STATUS_SUCCESS, "got %#x\n", ret );
351 ok( io.Status == STATUS_SUCCESS, "got status %#lx\n", io.Status );
352 ok( io.Information == sizeof(info), "got size %Iu\n", io.Information );
353 ok( !info.MaximumMessageSize, "got maximum size %lu\n", info.MaximumMessageSize );
354 ok( !info.MailslotQuota, "got quota %lu\n", info.MailslotQuota );
355 ok( info.NextMessageSize == 2, "got next size %lu\n", info.NextMessageSize );
356 ok( info.MessagesAvailable == 1, "got message count %lu\n", info.MessagesAvailable );
357 ok( !info.ReadTimeout.QuadPart, "got timeout %I64u\n", info.ReadTimeout.QuadPart );
358
359 io.Status = 0xdeadbeef;
360 io.Information = 0xdeadbeef;
361 memset( &info, 0xcc, sizeof(info) );
363 todo_wine ok( ret == STATUS_SUCCESS || ret == STATUS_INVALID_PARAMETER /* Win < 8 */, "got %#x\n", ret );
364 if (ret == STATUS_SUCCESS)
365 {
366 ok( io.Status == STATUS_SUCCESS, "got status %#lx\n", io.Status );
367 ok( io.Information == sizeof(info), "got size %Iu\n", io.Information );
368 ok( !info.MaximumMessageSize, "got maximum size %lu\n", info.MaximumMessageSize );
369 ok( !info.MailslotQuota, "got quota %lu\n", info.MailslotQuota );
370 ok( info.NextMessageSize == 2, "got next size %lu\n", info.NextMessageSize );
371 ok( info.MessagesAvailable == 1, "got message count %lu\n", info.MessagesAvailable );
372 ok( !info.ReadTimeout.QuadPart, "got timeout %I64u\n", info.ReadTimeout.QuadPart );
373 }
374
375 /* finally close the mailslot and its client */
376 ok( CloseHandle( hWriter2 ), "closing 2nd client\n");
377 ok( CloseHandle( hWriter ), "closing the client\n");
378 ok( CloseHandle( hSlot ), "closing the mailslot\n");
379
380 /* test timeouts */
381 hSlot = CreateMailslotA( szmspath, 0, 1000, NULL );
382 ok( hSlot != INVALID_HANDLE_VALUE , "valid mailslot failed\n");
383 count = 0;
384 memset(buffer, 0, sizeof buffer);
385 dwTimeout = GetTickCount();
386 ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n");
387 ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
388 dwTimeout = GetTickCount() - dwTimeout;
389 ok( dwTimeout >= 900, "timeout too short %lu\n", dwTimeout );
390 ok( CloseHandle( hSlot ), "closing the mailslot\n");
391
392 InitializeObjectAttributes( &attr, &nt_path, 0, NULL, NULL );
394 ok( !ret, "got %#x\n", ret );
395
396 io.Status = 0xdeadbeef;
397 io.Information = 0xdeadbeef;
398 ret = NtWriteFile( hSlot, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL );
399 todo_wine ok( ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret );
400 ok( io.Status == 0xdeadbeef, "got status %#lx\n", io.Status );
401 ok( io.Information == 0xdeadbeef, "got size %Iu\n", io.Information );
402
403#ifdef __REACTOS__
404 if (is_reactos()) {
405 ok(FALSE, "FIXME: This often bugchecks on ReactOS. This does not bugcheck on checked Windows builds.\n");
406 } else {
407#endif
408 io.Status = 0xdeadbeef;
409 io.Information = 0xdeadbeef;
410 ret = NtReadFile( hSlot, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL );
411 ok( ret == STATUS_PENDING, "got %#x\n", ret );
412 ok( io.Status == 0xdeadbeef, "got status %#lx\n", io.Status );
413 ok( io.Information == 0xdeadbeef, "got size %Iu\n", io.Information );
414#ifdef __REACTOS__
415 }
416#endif
417
418 ret = WaitForSingleObject( hSlot, 0 );
419 ok( ret == WAIT_TIMEOUT, "got %d\n", ret );
420
422#ifdef __REACTOS__
423 ok( hWriter != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_SHARING_VIOLATION) /* WS03 */, "got err %lu\n", GetLastError() );
424#else
425 ok( hWriter != INVALID_HANDLE_VALUE, "got err %lu\n", GetLastError() );
426#endif
427
428 ret = WriteFile( hWriter, "data", 4, &count, NULL );
429#ifdef __REACTOS__
430 ok( ret == TRUE || broken(GetLastError() == ERROR_INVALID_HANDLE) /* WS03 */, "got error %lu\n", GetLastError() );
431#else
432 ok( ret == TRUE, "got error %lu\n", GetLastError() );
433#endif
434
435 ret = WaitForSingleObject( hSlot, 1000 );
436#ifdef __REACTOS__
437 ok( !ret || broken(ret == WAIT_TIMEOUT) /* WS03 */, "got %d\n", ret );
438 ok( !io.Status || broken(io.Status == 0xdeadbeef) /* WS03 */, "got status %#lx\n", io.Status );
440#else
441 ok( !ret, "got %d\n", ret );
442 ok( !io.Status, "got status %#lx\n", io.Status );
443#endif
444 ok( io.Information == 4, "got size %Iu\n", io.Information );
445
446 CloseHandle( hWriter );
447 CloseHandle( hSlot );
448
449 return 0;
450}
451
452START_TEST(mailslot)
453{
455}
#define GetNTVersion()
Definition: apitest.h:17
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define U(x)
Definition: wordpad.c:45
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define FILE_SHARE_READ
Definition: compat.h:136
#define ERROR_INVALID_NAME
Definition: compat.h:103
BOOL WINAPI GetMailslotInfo(IN HANDLE hMailslot, IN LPDWORD lpMaxMessageSize, IN LPDWORD lpNextSize, IN LPDWORD lpMessageCount, IN LPDWORD lpReadTimeout)
Definition: mailslot.c:116
HANDLE WINAPI CreateMailslotA(IN LPCSTR lpName, IN DWORD nMaxMessageSize, IN DWORD lReadTimeout, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: mailslot.c:23
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
@ FileMailslotQueryInformation
Definition: from_kernel.h:87
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
#define todo_wine
Definition: minitest.h:80
static const char szmspath[]
Definition: mailslot.c:35
static int mailslot_test(void)
Definition: mailslot.c:37
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
Definition: file.c:100
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define MAILSLOT_NO_MESSAGE
Definition: finfo.c:18
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
#define GENERIC_WRITE
Definition: nt_native.h:90
NTSTATUS NTAPI NtCreateMailslotFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG CreateOptions, IN ULONG MailslotQuota, IN ULONG MaxMessageSize, IN PLARGE_INTEGER TimeOut)
Definition: file.c:3790
#define is_reactos()
Definition: test.h:1041
#define memset(x, y, z)
Definition: compat.h:39
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)
Definition: cookie.c:202
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define STATUS_PENDING
Definition: telnetd.h:14
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_IO_TIMEOUT
Definition: udferr_usr.h:163
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_SEM_TIMEOUT
Definition: winerror.h:315
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:257
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228