24#define WIN32_NO_STATUS
35#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
36#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
37 (DWORD)((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
41#define FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
44#ifndef __WINE_WINTERNL_H
71#ifndef FILE_SYNCHRONOUS_IO_ALERT
72#define FILE_SYNCHRONOUS_IO_ALERT 0x10
75#ifndef FILE_SYNCHRONOUS_IO_NONALERT
76#define FILE_SYNCHRONOUS_IO_NONALERT 0x20
79#ifndef FSCTL_PIPE_LISTEN
80#define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
83#ifndef FSCTL_PIPE_WAIT
84#define FSCTL_PIPE_WAIT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
118#define loadfunc(name) if (!(p##name = (void *)GetProcAddress(module, #name))) { \
119 trace("GetProcAddress(%s) failed\n", #name); \
172#define test_file_access(a,b) _test_file_access(__LINE__,a,b)
182 ok_(__FILE__,
line)(
info.AccessFlags == expected_access,
"got access %08lx expected %08lx\n",
183 info.AccessFlags, expected_access);
186static const WCHAR testpipe[] = {
'\\',
'\\',
'.',
'\\',
'p',
'i',
'p',
'e',
'\\',
187 't',
'e',
's',
't',
'p',
'i',
'p',
'e', 0 };
189 't',
'e',
's',
't',
'p',
'i',
'p',
'e', 0 };
202 attr.RootDirectory = 0;
206 attr.SecurityQualityOfService =
NULL;
237 ULONG pipe_wait_size;
252 ok(0,
"NtCreateEvent failure: %#lx\n",
status);
260 pipe_wait, pipe_wait_size,
NULL, 0);
285 attr.RootDirectory = 0;
289 attr.SecurityQualityOfService =
NULL;
295 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
302 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
309 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
316 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
317 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
324 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
343 static const DWORD pipe_config[]= { 1, 0, 2 };
352 ok(0,
"NtCreateNamedPipeFile returned %lx, sharing: %lx\n",
res,
sharing[
j]);
360 ok(!
res,
"NtQueryInformationFile for server returned %lx, sharing: %lx\n",
res,
sharing[
j]);
361 ok(
info.NamedPipeConfiguration == pipe_config[
j],
"wrong duplex status for pipe: %ld, expected %ld\n",
362 info.NamedPipeConfiguration, pipe_config[
j]);
367 ok(!
res,
"NtQueryInformationFile for client returned %lx, access: %lx, sharing: %lx\n",
369 ok(
info.NamedPipeConfiguration == pipe_config[
j],
"wrong duplex status for pipe: %ld, expected %ld\n",
370 info.NamedPipeConfiguration, pipe_config[
j]);
383 ok(hclient !=
INVALID_HANDLE_VALUE,
"CreateFile failed for sharing %lx, access: %lx, GetLastError: %ld\n",
406 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
411 ok(
iosb.Status == 0x55555555,
"iosb.Status got changed to %lx\n",
iosb.Status);
416 ok(
iosb.Status == 0,
"Wrong iostatus %lx\n",
iosb.Status);
429 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
433 "can't open pipe, GetLastError: %lx\n",
GetLastError());
441 ok(
iosb.Status == 0x55555555,
"iosb.Status got changed to %lx\n",
iosb.Status);
467 ret = pQueueUserAPC(&
userapc, main_thread, 0);
501 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
544 ok(!
res,
"NtFsControlFile returned %lx\n",
res);
547 ok(!
iosb.Status,
"Wrong iostatus %lx\n",
iosb.Status);
571 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
581 ok(!
res,
"NtFsControlFile returned %lx\n",
res);
584 ok(!
iosb.Status,
"Wrong iostatus %lx\n",
iosb.Status);
613 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
620 res = pNtCancelIoFile(hPipe, &cancel_sb);
621 ok(!
res,
"NtCancelIoFile returned %lx\n",
res);
632 res = pNtCancelIoFile(hPipe, &cancel_sb);
633 ok(!
res,
"NtCancelIoFile returned %lx\n",
res);
638 if (pNtCancelIoFileEx)
641 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
647 res = pNtCancelIoFileEx(hPipe, &
iosb, &cancel_sb);
648 ok(!
res,
"NtCancelIoFileEx returned %lx\n",
res);
653 iosb.Status = 0xdeadbeef;
654 res = pNtCancelIoFileEx(hPipe,
NULL, &cancel_sb);
656 ok(
iosb.Status == 0xdeadbeef,
"Wrong iostatus %lx\n",
iosb.Status);
661 win_skip(
"NtCancelIoFileEx not available\n");
693 if (pNtCancelSynchronousIoFile ==
NULL)
695 win_skip(
"NtCancelSynchronousIoFile not available\n");
710 "NtCancelSynchronousIoFile returned %lx\n",
res);
714 ok(
iosb.Information == 0,
"iosb.Information got changed to %Iu\n",
iosb.Information);
719 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
722 ctx.iosb.Status = 0xdeadbabe;
723 ctx.iosb.Information = 0xdeadbeef;
732 ok(
iosb.Information == 0,
"iosb.Information got changed to %Iu\n",
iosb.Information);
742 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
744 ctx.iosb.Status = 0xdeadbabe;
745 ctx.iosb.Information = 0xdeadbeef;
757 "Failed to cancel I/O\n");
759 "iosb.Status got changed to %lx\n",
iosb.Status);
760 ok(
iosb.Information == 0,
"iosb.Information got changed to %Iu\n",
iosb.Information);
775 ctx.iosb.Status = 0xdeadbabe;
776 ctx.iosb.Information = 0xdeadbeef;
778 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
787 ok(
iosb.Information == 0,
"iosb.Information got changed to %Iu\n",
iosb.Information);
792 ok(
iosb.Information == 0,
"iosb.Information got changed to %Iu\n",
iosb.Information);
812 memset(&fpi, 0x55,
sizeof(fpi));
814 ok_(__FILE__,
line)(!
res,
"NtQueryInformationFile returned %lx\n",
res);
821#define check_pipe_handle_state(handle, r, c) _check_pipe_handle_state(__LINE__, handle, r, c)
837 attr.RootDirectory = 0;
841 attr.SecurityQualityOfService =
NULL;
857 0, 0, 0, 1, 0xFFFFFFFF, 500, 500, &
timeout);
858 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
864 "can't open pipe, GetLastError: %lx\n",
GetLastError());
901 ok(!
res,
"NtSetInformationFile returned %lx\n",
res);
934 0, 1, 1, 0, 0xFFFFFFFF, 500, 500, &
timeout);
935 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
941 "can't open pipe, GetLastError: %lx\n",
GetLastError());
951 ok(!
res,
"NtSetInformationFile returned %lx\n",
res);
960 ok(!
res,
"NtSetInformationFile returned %lx\n",
res);
985 ok(!
res,
"NtSetInformationFile returned %lx\n",
res);
991 res = pNtCreateNamedPipeFile(&hServer,
994 0, 1, 1, 0, 0xFFFFFFFF, 500, 500, &
timeout);
995 ok(!
res,
"NtCreateNamedPipeFile returned %lx\n",
res);
999 ok(!
res,
"NtCreateFile returned %lx\n",
res);
1003 res = pNtQueryInformationFile(hClient, &
iosb, &local_info,
sizeof(local_info),
1006 "NtQueryInformationFile(FilePipeLocalInformation) returned: %lx\n",
res);
1008 res = pNtQueryInformationFile(hClient, &
iosb, &local_info,
sizeof(local_info),
1011 "NtQueryInformationFile(FilePipeInformation) returned: %lx\n",
res);
1013 res = pNtQueryInformationFile(hClient, &
iosb, &local_info,
sizeof(local_info),
1038 ok(!
iosb.Status,
"iosb.Status = %lx\n",
iosb.Status);
1039 ok(
buf.ReadDataAvailable == 1,
"ReadDataAvailable = %lu\n",
buf.ReadDataAvailable);
1045 ok(
buf.ReadDataAvailable == 1,
"ReadDataAvailable = %lu\n",
buf.ReadDataAvailable);
1046 ok(!
iosb.Status,
"iosb.Status = %lx\n",
iosb.Status);
1052#define PIPENAME "\\\\.\\pipe\\ntdll_tests_pipe.c"
1101 iosb.Status = 0xdeadbabe;
1102 iosb.Information = 0xdeadbeef;
1108 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1109 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1114 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1115 ok(
iosb.Information == 1,
"wrong info %Iu\n",
iosb.Information );
1127 iosb.Status = 0xdeadbabe;
1128 iosb.Information = 0xdeadbeef;
1133 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1134 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1139 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1140 ok(
iosb.Information == 1,
"wrong info %Iu\n",
iosb.Information );
1151 iosb.Status = 0xdeadbabe;
1152 iosb.Information = 0xdeadbeef;
1161 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1162 ok(
iosb.Information == 1,
"wrong info %Iu\n",
iosb.Information );
1172 iosb.Status = 0xdeadbabe;
1173 iosb.Information = 0xdeadbeef;
1184 "FSCTL_PIPE_PEEK returned %lx\n",
status );
1190 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1193 "wrong info %Iu\n",
iosb.Information );
1204 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1206 ok(
iosb.Information == 1,
"wrong info %Iu\n",
iosb.Information );
1216 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1217 ok(
iosb.Information == 1,
"wrong info %Iu\n",
iosb.Information );
1227 iosb.Status = 0xdeadbabe;
1228 iosb.Information = 0xdeadbeef;
1233 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1234 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1241 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1242 ok(
iosb.Information == 1,
"wrong info %Iu\n",
iosb.Information );
1249 iosb.Status = 0xdeadbabe;
1250 iosb.Information = 0xdeadbeef;
1254 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1255 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1264 iosb.Status = 0xdeadbabe;
1265 iosb.Information = 0xdeadbeef;
1268 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1269 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1277 iosb.Status = 0xdeadbabe;
1278 iosb.Information = 0xdeadbeef;
1282 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1283 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1292 iosb.Status = 0xdeadbabe;
1293 iosb.Information = 0xdeadbeef;
1297 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1298 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1303 ok(
iosb.Information == 0,
"wrong info %Iu\n",
iosb.Information );
1315 iosb.Status = 0xdeadbabe;
1316 iosb.Information = 0xdeadbeef;
1320 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1321 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1328 ok(
iosb.Information == 0,
"wrong info %Iu\n",
iosb.Information );
1335 iosb.Status = 0xdeadbabe;
1336 iosb.Information = 0xdeadbeef;
1340 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1341 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1346 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1347 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1354 ok(
iosb.Information == 0,
"wrong info %Iu\n",
iosb.Information );
1362 if (pNtCancelIoFileEx)
1368 iosb.Status = 0xdeadbabe;
1369 iosb.Information = 0xdeadbeef;
1373 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1374 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1380 ok(
iosb.Information == 0,
"wrong info %Iu\n",
iosb.Information );
1388 iosb.Status = 0xdeadbabe;
1389 iosb.Information = 0xdeadbeef;
1393 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1394 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1399 ok(
iosb.Status == 0xdeadbabe,
"wrong status %lx\n",
iosb.Status );
1400 ok(
iosb.Information == 0xdeadbeef,
"wrong info %Iu\n",
iosb.Information );
1406 ok(
iosb.Information == 0,
"wrong info %Iu\n",
iosb.Information );
1416 win_skip(
"NtCancelIoFileEx not available\n");
1442 ok(
iosb.Status == 0,
"wrong status %lx\n",
iosb.Status );
1443 ok(
iosb.Information == 2,
"wrong info %Iu\n",
iosb.Information );
1450#define test_no_queued_completion(a) _test_no_queued_completion(__LINE__,a)
1458 pov = (
void *)0xdeadbeef;
1464#define test_queued_completion(a,b,c,d) _test_queued_completion(__LINE__,a,b,c,d)
1477 ok_(__FILE__,
line)(
io->Status == expected_status,
"Status = %lx\n",
io->Status);
1478 ok_(__FILE__,
line)(
io->Information == expected_information,
1479 "Information = %Iu\n",
io->Information);
1484 static const char buf[] =
"testdata";
1501 "status = %lx\n",
status);
1504 win_skip(
"FileIoCompletionNotificationInformation not supported\n");
1510 memset(&ov, 0,
sizeof(ov));
1519 ok(num_bytes ==
sizeof(
buf),
"expected sizeof(buf), got %lu\n", num_bytes);
1523 NULL, 0, &peek_buf,
sizeof(peek_buf));
1533 ok(num_bytes ==
sizeof(
buf),
"expected sizeof(buf), got %lu\n", num_bytes);
1538 ok(num_bytes ==
sizeof(
buf),
"expected sizeof(buf), got %lu\n", num_bytes);
1543 ok(
io.Information == 1,
"Information = %Iu\n",
io.Information);
1552 ok(
io.Information ==
sizeof(
buf)-1,
"Information = %Iu\n",
io.Information);
1556 NULL, 0, &peek_buf,
sizeof(peek_buf));
1576 NULL, 0, &peek_buf,
sizeof(peek_buf));
1578 "FSCTL_PIPE_PEEK returned %lx\n",
status);
1605 ok(
io.Information ==
sizeof(
buf),
"Information = %Iu\n",
io.Information);
1619 ok(
io.Information ==
sizeof(
buf),
"Information = %Iu\n",
io.Information);
1632 ok(
io.Information ==
sizeof(
buf),
"Information = %Iu\n",
io.Information);
1712 static const char buf[] =
"testdata";
1748 ok(0,
"unvalid command\n");
1779 attr.RootDirectory = 0;
1783 attr.SecurityQualityOfService =
NULL;
1801 ok(
io.Information == 1,
"Information = %Iu\n",
io.Information);
1817 ok(
io.Information == 1,
"Information = %Iu\n",
io.Information);
1844 ok(
io.Information == 0,
"Information = %Iu\n",
io.Information);
1871 ok(
io.Information == 0,
"Information = %Iu\n",
io.Information);
1910 "Characteristics = %lx\n",
device_info->Characteristics );
1921 "Characteristics = %lx\n",
device_info->Characteristics );
1927#define test_file_name_fail(a,b,c) _test_file_name_fail(__LINE__,a,b,c)
1936 "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n",
status );
1940 ok_(__FILE__,
line)(
status == expected_status,
"expected %#lx, got %#lx\n", expected_status,
status );
1943#define test_file_name(a) _test_file_name(__LINE__,a)
1952 {
'\\',
'n',
't',
'd',
'l',
'l',
'_',
't',
'e',
's',
't',
's',
'_',
'p',
'i',
'p',
'e',
'.',
'c'};
1960 "Information = %Iu\n",
iosb.Information );
1970 ok(
iosb.Information == 20,
"Information = %Iu\n",
iosb.Information );
2023 static char buf[] =
"test";
2026 memset(&peek_buf, 0xcc,
sizeof(peek_buf));
2046 ok(
status == expected_status,
"status = %lx, expected %lx in %s state %lu\n",
2047 status, expected_status, is_server ?
"server" :
"client",
state);
2061 "NtFsControlFile(FSCTL_PIPE_TRANSCEIVE) failed in %s state %lu: %lx\n",
2076 ok(
io.Status ==
status,
"io.Status = %lx\n",
io.Status);
2077 ok(!
io.Information,
"io.Information = %Ix\n",
io.Information);
2095 ok(
status == expected_status,
"NtReadFile failed in %s state %lu: %lx\n",
2114 char buf[256] =
"test";
2122 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2126 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2133 ok(local_info.
ReadDataAvailable != 0,
"ReadDataAvailable, expected non-zero, in %s state %lu\n",
2134 is_server ?
"server" :
"client",
state);
2136 ok(local_info.
ReadDataAvailable == 0,
"ReadDataAvailable, expected zero, in %s state %lu\n",
2137 is_server ?
"server" :
"client",
state);
2143 "NtQueryInformationFile(FileStandardInformation) failed in %s state %lu: %lx\n",
2147 "NtQueryInformationFile(FileStandardInformation) failed in %s state %lu: %lx\n",
2152 "got %I64u, expected %lu.\n",
2163 "NtQueryInformationFile(FilePipeInformation) failed in %s state %lu: %lx\n",
2167 "NtQueryInformationFile(FilePipeInformation) failed in %s state %lu: %lx\n",
2173 "NtQueryInformationFile(FileNameInformation) failed: %lx\n",
status);
2177 "NtQueryInformationFile(FileNameInformation) failed: %lx\n",
status);
2179 memset(&peek_buf, 0xcc,
sizeof(peek_buf));
2196 ok(
status == expected_status,
"status = %lx, expected %lx in %s state %lu\n",
2197 status, expected_status, is_server ?
"server" :
"client",
state);
2218 ok(
status == expected_status,
"NtWriteFile failed in %s state %lu: %lx\n",
2224 ok(
status == expected_status,
"NtReadFile failed in %s state %lu: %lx\n",
2303 attr.RootDirectory = 0;
2307 attr.SecurityQualityOfService =
NULL;
2309 timeout.QuadPart = -100000000;
2342 memset(&local_info, 0xcc,
sizeof(local_info));
2346 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2350 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2379 attr.RootDirectory = 0;
2383 attr.SecurityQualityOfService =
NULL;
2385 timeout.QuadPart = -100000000;
2397 status = pNtQueryInformationFile(
pipe, &
iosb, &local_info,
sizeof(local_info),
2400 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2415 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2419 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2434 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2438 "NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %lu: %lx\n",
2476 "Failed to query object security descriptor length: %08lx\n",
status);
2524 ok(
length != 0,
"Failed to get primary group token information length: %lu\n",
GetLastError());
2528 ok(
ret,
"Failed to get primary group token information: %lu\n",
GetLastError());
2546#define test_group(a,b,c) _test_group(__LINE__,a,b,c)
2555 if (!sec_desc)
return;
2559 "Failed to query group from security descriptor: %08lx\n",
status);
2561 ok_(__FILE__,
line)(
EqualSid(group_sid, expected_sid),
"SIDs are not equal\n");
2573 SID *world_sid, *local_sid;
2578 trace(
"security tests...\n");
2586 ok(
ret,
"InitializeSecurityDescriptor failed\n");
2589 ok(
ret,
"SetSecurityDescriptorOwner failed\n");
2592 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
2595 0x20000, 0x20000, 0,
NULL);
2606 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
2615 0x20000, 0x20000, 0,
NULL);
2621 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
2652 sec_attr.
nLength =
sizeof(sec_attr);
2656 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
2658 0x20000, 0x20000, 0, &sec_attr);
2668 0x20000, 0x20000, 0, &sec_attr);
2681 static const struct fsctl_test {
2687#define FSCTL_TEST(code, ...) { #code, code, __VA_ARGS__ }
2749 const struct fsctl_test *ft = &fsctl_tests[
i];
2758 "NtFsControlFile(%s) on \\Device\\NamedPipe: expected %#lx, got %#lx\n",
2759 ft->name, ft->status,
status);
2768 HANDLE hdirectory, hpipe, hpipe2, hwrite, hwrite2,
handle;
2783 hpipe = hwrite =
NULL;
2788 attr.SecurityQualityOfService =
NULL;
2790 pRtlInitUnicodeString(&
name,
L"\\Device\\NamedPipe");
2791 attr.RootDirectory = 0;
2798 pRtlInitUnicodeString(&
name,
L"nonexistent_pipe");
2806 name.MaximumLength = 0;
2807 attr.RootDirectory = hdirectory;
2812 0, 0, 0, 3, 4096, 4096, &
timeout);
2817 pRtlInitUnicodeString(&
name,
L"test3\\pipe");
2818 attr.RootDirectory = hdirectory;
2829 pRtlInitUnicodeString(&
name,
L"\\Device\\NamedPipe\\");
2830 attr.RootDirectory = 0;
2840 pRtlInitUnicodeString(&
name,
L"nonexistent_pipe");
2848 name.MaximumLength = 0;
2849 attr.RootDirectory = hdirectory;
2854 0, 0, 0, 3, 4096, 4096, &
timeout);
2866 0, 0, 0, 1, 4096, 4096, &
timeout);
2871 0, 0, 0, 3, 4096, 4096, &
timeout);
2874 attr.RootDirectory = hpipe;
2875 pRtlInitUnicodeString(&
name,
L"a");
2882 name.MaximumLength = 0;
2883 attr.RootDirectory = hpipe;
2896 attr.RootDirectory = hpipe;
2902 attr.RootDirectory = hpipe;
2907 attr.RootDirectory = hpipe2;
2926 ok(
data == 0xdeadbeef,
"Got unexpected data %#lx.\n",
data);
2932 ok(
data == 0xfeedcafe,
"Got unexpected data %#lx.\n",
data);
2939 pRtlInitUnicodeString(&
name,
L"test3\\pipe");
2940 attr.RootDirectory = hdirectory;
2945 ok(!
status,
"unexpected failure from NtCreateNamedPipeFile: %#lx\n",
status);
2975 win_skip(
"Skipping subtest_pipe_name for '%ws' on Windows 2003\n", pnt->
name);
2979 pRtlInitUnicodeString(&
name, pnt->
name);
2981 timeout.QuadPart = -100000000;
2983 status = pNtCreateNamedPipeFile(&pipe,
2987 0, 0, 0, 3, 4096, 4096, &
timeout);
2993 ok(pipe ==
NULL,
"expected NULL handle, got %p\n", pipe);
2997 ok(pipe !=
NULL,
"expected non-NULL handle\n");
3011 pRtlInitUnicodeString(&no_open_name, pnt->
no_open_name);
3017 "Expected STATUS_OBJECT_NAME_NOT_FOUND opening %s, got %#lx\n",
3031 {
L"\\Device\\NamedPipe\\wine-test\\" ,
STATUS_SUCCESS, 0,
L"\\Device\\NamedPipe\\wine-test" },
3032 {
L"\\Device\\NamedPipe\\wine/test" ,
STATUS_SUCCESS, 0,
L"\\Device\\NamedPipe\\wine\\test" },
3034 {
L"\\Device\\NamedPipe\\wine\\.\\test" ,
STATUS_SUCCESS, 0,
L"\\Device\\NamedPipe\\wine\\test" },
3035 {
L"\\Device\\NamedPipe\\wine\\..\\test" ,
STATUS_SUCCESS, 0,
L"\\Device\\NamedPipe\\test" },
3037 {
L"\\Device\\NamedPipe\\!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
STATUS_SUCCESS },
3076 unsigned int i, other_process;
3086 "status = %lx\n",
status);
3091 win_skip(
"FileIoCompletionNotificationInformation is not supported.\n");
3098 for (other_process = 0; other_process < 2; ++other_process)
3122 ok(
io.Status == 0xcccccccc,
"got %#lx.\n",
io.Status);
3131 ok(
io.Status == 0xcccccccc,
"got %#lx.\n",
io.Status);
3188 trace(
"starting invalid create tests\n");
3191 trace(
"starting create tests\n");
3194 trace(
"starting overlapped tests\n");
3197 trace(
"starting completion tests\n");
3200 trace(
"starting blocking tests\n");
3204 trace(
"starting FILE_PIPE_INFORMATION tests\n");
3207 if (!pOpenThread || !pQueueUserAPC)
3210 trace(
"starting alertable tests\n");
3213 trace(
"starting nonalertable tests\n");
3216 trace(
"starting cancelio tests\n");
3219 trace(
"starting cancelsynchronousio tests\n");
3222 trace(
"starting byte read in byte mode client -> server\n");
3224 trace(
"starting byte read in message mode client -> server\n");
3226 trace(
"starting message read in message mode client -> server\n");
3228 trace(
"starting byte read in byte mode server -> client\n");
3230 trace(
"starting byte read in message mode server -> client\n");
3232 trace(
"starting message read in message mode server -> client\n");
3241 win_skip(
"Skipping empty name pipe tests on Windows 2003.\n");
#define FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE
void CALLBACK completion(DWORD dwError, DWORD cbTransferred, LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags)
static const WCHAR nameW[]
#define FILE_NON_DIRECTORY_FILE
EXTERN_C NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG)
#define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
struct __type_info type_info
#define STATUS_INVALID_HANDLE
#define STATUS_NOT_SUPPORTED
#define STATUS_OBJECT_TYPE_MISMATCH
#define ERROR_INSUFFICIENT_BUFFER
#define NT_SUCCESS(StatCode)
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
BOOL WINAPI CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType, IN PSID DomainSid OPTIONAL, OUT PSID pSid, IN OUT DWORD *cbSid)
static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define ERROR_ACCESS_DENIED
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define STATUS_ACCESS_VIOLATION
@ FilePipeLocalInformation
@ FileIoCompletionNotificationInformation
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
@ FileFsDeviceInformation
enum _FSINFOCLASS FS_INFORMATION_CLASS
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLuint GLint GLboolean GLint GLenum access
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static HRESULT process_group(struct ciffile *file, struct inf_section *section, const char *section_name)
NTSTATUS NTAPI NtRemoveIoCompletion(IN HANDLE IoCompletionHandle, OUT PVOID *KeyContext, OUT PVOID *ApcContext, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER Timeout OPTIONAL)
HANDLE WINAPI CreateIoCompletionPort(IN HANDLE FileHandle, IN HANDLE ExistingCompletionPort, IN ULONG_PTR CompletionKey, IN DWORD NumberOfConcurrentThreads)
#define FILE_SKIP_SET_EVENT_ON_HANDLE
#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
BOOL WINAPI GetQueuedCompletionStatus(IN HANDLE CompletionHandle, IN LPDWORD lpNumberOfBytesTransferred, OUT PULONG_PTR lpCompletionKey, OUT LPOVERLAPPED *lpOverlapped, IN DWORD dwMilliseconds)
NTSTATUS NTAPI NtFlushBuffersFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock)
static ULONG *static ULONG *static ULONG *static ULONG *static OVERLAPPED DWORD BOOL
#define test_file_access(a, b)
static void _test_file_access(unsigned line, HANDLE handle, DWORD expected_access)
static void test_overlapped(void)
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
#define memcpy(s1, s2, n)
#define FILE_FLAG_OVERLAPPED
static struct test_info tests[]
static PROCESS_INFORMATION pi
#define create_process(cmd, pi)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
#define InitializeObjectAttributes(p, n, a, r, s)
#define FILE_PIPE_FULL_DUPLEX
BOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe)
HANDLE WINAPI CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout)
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)
#define FILE_READ_ATTRIBUTES
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
#define FILE_WRITE_ATTRIBUTES
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
VOID(* PIO_APC_ROUTINE)(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, IN ULONG Reserved)
#define FSCTL_PIPE_LISTEN
static void test_create_invalid(void)
static void _test_group(unsigned line, HANDLE handle, SID *expected_sid, BOOL todo)
static BOOL *static HANDLE PIO_APC_ROUTINE apc
static void test_peek(HANDLE pipe)
struct _FILE_PIPE_WAIT_FOR_BUFFER * PFILE_PIPE_WAIT_FOR_BUFFER
static TOKEN_PRIMARY_GROUP * get_current_group(void)
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG outbound_quota
static void test_security_info(void)
static BOOL *static HANDLE PIO_APC_ROUTINE PVOID apc_context
static BOOL init_func_ptrs(void)
#define test_queued_completion(a, b, c, d)
static OUT PIO_STATUS_BLOCK IoStatusBlock
static PIO_STATUS_BLOCK PVOID ptr
static TOKEN_OWNER * get_current_owner(void)
#define test_file_name(a)
static void test_pipe_names(void)
static NTSTATUS create_pipe(PHANDLE handle, ULONG access, ULONG sharing, ULONG options)
static BOOL *static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG in_size
static HANDLE create_pipe_server(void)
static BOOL open_succeeded
static HANDLE connect_and_write_pipe(HANDLE server)
static PIO_STATUS_BLOCK io_status
static HANDLE ULONG_PTR dwData
static BOOL userapc_called
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG completion_mode
static void CALLBACK userapc(ULONG_PTR dwParam)
static void CALLBACK ioapc(void *arg, PIO_STATUS_BLOCK io, ULONG reserved)
#define test_file_name_fail(a, b, c)
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
static SID * well_known_sid(WELL_KNOWN_SID_TYPE sid_type)
static BOOL *static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG code
static void _test_queued_completion(unsigned line, HANDLE port, IO_STATUS_BLOCK *io, NTSTATUS expected_status, ULONG expected_information)
static OBJECT_ATTRIBUTES *static ULONG access
static void test_create(void)
static void test_filepipeinfo(void)
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
static void test_empty_name(void)
static NTSTATUS listen_pipe(HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
static void test_async_cancel_on_handle_close(void)
static void test_alertable(void)
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG options
static const WCHAR testpipe[]
static void test_blocking(ULONG options)
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG pipe_type
#define check_pipe_handle_state(handle, r, c)
static BOOL bInheritHandle
static BOOL create_pipe_pair(HANDLE *read, HANDLE *write, ULONG flags, ULONG type, ULONG size)
static void read_pipe_test(ULONG pipe_flags, ULONG pipe_type)
#define test_no_queued_completion(a)
struct _FILE_PIPE_WAIT_FOR_BUFFER FILE_PIPE_WAIT_FOR_BUFFER
static void test_volume_info(void)
static BOOL DWORD dwThreadId
static void subtest_pipe_name(const struct pipe_name_test *pnt)
static void test_cancelsynchronousio(void)
static NTSTATUS wait_pipe(HANDLE handle, PUNICODE_STRING name, const LARGE_INTEGER *timeout)
static void test_file_info(void)
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG dispo
static void pipe_for_each_state(HANDLE(*create_server)(void), HANDLE(*connect_client)(HANDLE), void(*test)(HANDLE pipe, BOOL is_server, DWORD pipe_state))
static void _test_file_name_fail(unsigned line, HANDLE pipe, NTSTATUS expected_status, BOOL todo)
static void _test_no_queued_completion(unsigned line, HANDLE port)
static void test_pipe_with_data_state(HANDLE pipe, BOOL is_server, DWORD state)
static void _test_file_name(unsigned line, HANDLE pipe)
#define FILE_SYNCHRONOUS_IO_NONALERT
static DWORD WINAPI synchronousio_thread(void *arg)
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES attr
static PIO_STATUS_BLOCK PVOID ULONG len
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
static void test_completion(void)
static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
#define FSCTL_TEST(code,...)
static BOOL is_signaled(HANDLE obj)
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG Length
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG max_inst
static PSECURITY_DESCRIPTOR get_security_descriptor(HANDLE handle, BOOL todo)
static BOOL *static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG PLARGE_INTEGER timeout
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG inbound_quota
static void ULONG *static PIO_STATUS_BLOCK void ULONG FS_INFORMATION_CLASS info_class
static void test_pipe_local_info(HANDLE pipe, BOOL is_server, DWORD state)
static OBJECT_INFORMATION_CLASS
#define FILE_SYNCHRONOUS_IO_ALERT
static BOOL *static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID out_buffer
static void test_nonalertable(void)
static DWORD WINAPI blocking_thread(void *arg)
static HANDLE connect_pipe_reader(HANDLE server)
static void test_transceive(void)
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG IN FILE_INFORMATION_CLASS FileInformationClass
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG read_mode
static BOOL *static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID in_buffer
static void test_cancelio(void)
static void subtest_empty_name_pipe_operations(HANDLE handle)
#define test_group(a, b, c)
static const WCHAR testpipe_nt[]
static HANDLE connect_pipe(HANDLE server)
static void _check_pipe_handle_state(int line, HANDLE handle, ULONG read, ULONG completion)
static void ULONG *static PIO_STATUS_BLOCK void ULONG length
static HANDLE create_local_info_test_pipe(void)
NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor, OUT PSID *Group, OUT PBOOLEAN GroupDefaulted)
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
NTSTATUS NTAPI NtCancelIoFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock)
NTSTATUS NTAPI NtCreateNamedPipeFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN ULONG NamedPipeType, IN ULONG ReadMode, IN ULONG CompletionMode, IN ULONG MaximumInstances, IN ULONG InboundQuota, IN ULONG OutboundQuota, IN PLARGE_INTEGER DefaultTimeout)
#define STATUS_PIPE_DISCONNECTED
#define STATUS_PIPE_NOT_AVAILABLE
#define STATUS_PIPE_CONNECTED
#define STATUS_PIPE_LISTENING
#define STATUS_INVALID_PIPE_STATE
#define STATUS_PIPE_BROKEN
#define STATUS_OBJECT_PATH_INVALID
#define STATUS_INVALID_INFO_CLASS
#define STATUS_PIPE_CLOSING
#define STATUS_INSTANCE_NOT_AVAILABLE
#define STATUS_ILLEGAL_FUNCTION
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSTATUS NTAPI NtQuerySecurityObject(IN HANDLE Handle, IN SECURITY_INFORMATION SecurityInformation, OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN ULONG Length, OUT PULONG ResultLength)
#define FILE_DEVICE_NAMED_PIPE
#define FSCTL_PIPE_IMPERSONATE
#define OBJ_CASE_INSENSITIVE
#define offsetof(TYPE, MEMBER)
int winetest_get_mainargs(char ***pargv)
#define _WIN32_WINNT_VISTA
BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
#define FileAccessInformation
#define FileStandardInformation
NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, FS_INFORMATION_CLASS FsInformationClass)
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
NTSTATUS WINAPI NtSetSecurityObject(HANDLE Handle, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor)
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)
LPVOID lpSecurityDescriptor
enum blocking_thread_args::@1826 cmd
const WCHAR * no_open_name
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define FIELD_OFFSET(t, f)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INFO_LENGTH_MISMATCH
#define STATUS_OBJECT_NAME_INVALID
#define STATUS_OBJECT_NAME_NOT_FOUND
static rfbScreenInfoPtr server
#define PIPE_ACCESS_INBOUND
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
#define NMPWAIT_USE_DEFAULT_WAIT
#define PIPE_ACCESS_DUPLEX
DWORD WINAPI GetCurrentThreadId(void)
#define PIPE_READMODE_MESSAGE
#define PIPE_ACCESS_OUTBOUND
#define PIPE_TYPE_MESSAGE
#define FSCTL_PIPE_SET_CLIENT_PROCESS
#define FSCTL_PIPE_ASSIGN_EVENT
#define FSCTL_PIPE_TRANSCEIVE
#define FSCTL_PIPE_QUERY_EVENT
#define FSCTL_PIPE_DISCONNECT
#define FSCTL_PIPE_QUERY_CLIENT_PROCESS
#define FILE_PIPE_DISCONNECTED_STATE
NTSYSAPI NTSTATUS WINAPI NtCancelSynchronousIoFile(HANDLE, PIO_STATUS_BLOCK, PIO_STATUS_BLOCK)
#define FILE_PIPE_LISTENING_STATE
#define FILE_PIPE_CONNECTED_STATE
#define FILE_PIPE_CLOSING_STATE
#define DUPLICATE_SAME_ACCESS
#define DUPLICATE_CLOSE_SOURCE
#define OWNER_SECURITY_INFORMATION
#define SECURITY_DESCRIPTOR_REVISION
#define GROUP_SECURITY_INFORMATION
#define SECURITY_DESCRIPTOR_MIN_LENGTH
#define SECURITY_MAX_SID_SIZE