24#define WIN32_NO_STATUS
34#ifndef __WINE_WINTERNL_H
54#ifndef FILE_SYNCHRONOUS_IO_ALERT
55#define FILE_SYNCHRONOUS_IO_ALERT 0x10
58#ifndef FILE_SYNCHRONOUS_IO_NONALERT
59#define FILE_SYNCHRONOUS_IO_NONALERT 0x20
62#ifndef FSCTL_PIPE_LISTEN
63#define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
90#define loadfunc(name) if (!(p##name = (void *)GetProcAddress(module, #name))) { \
91 trace("GetProcAddress(%s) failed\n", #name); \
116static const WCHAR testpipe[] = {
'\\',
'\\',
'.',
'\\',
'p',
'i',
'p',
'e',
'\\',
117 't',
'e',
's',
't',
'p',
'i',
'p',
'e', 0 };
119 't',
'e',
's',
't',
'p',
'i',
'p',
'e', 0 };
132 attr.RootDirectory = 0;
134 attr.Attributes = 0x40;
136 attr.SecurityQualityOfService =
NULL;
173 attr.RootDirectory = 0;
175 attr.Attributes = 0x40;
177 attr.SecurityQualityOfService =
NULL;
183 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
190 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
197 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
204 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
205 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
212 0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &
timeout);
231 static const DWORD pipe_config[]= { 1, 0, 2 };
240 ok(0,
"NtCreateNamedPipeFile returned %x, sharing: %x\n",
res,
sharing[
j]);
248 ok(!
res,
"NtQueryInformationFile for server returned %x, sharing: %x\n",
res,
sharing[
j]);
249 ok(
info.NamedPipeConfiguration == pipe_config[
j],
"wrong duplex status for pipe: %d, expected %d\n",
250 info.NamedPipeConfiguration, pipe_config[
j]);
255 ok(!
res,
"NtQueryInformationFile for client returned %x, access: %x, sharing: %x\n",
257 ok(
info.NamedPipeConfiguration == pipe_config[
j],
"wrong duplex status for pipe: %d, expected %d\n",
258 info.NamedPipeConfiguration, pipe_config[
j]);
294 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
317 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
341 static const char buf[] =
"testdata";
353 memset(&ov, 0,
sizeof(ov));
373 ok(num_bytes ==
sizeof(
buf),
"expected sizeof(buf), got %u\n", num_bytes);
379 ok(
key == 0xdeadbeef,
"expected 0xdeadbeef, got %lx\n",
key);
380 ok(pov == &ov,
"expected %p, got %p\n", &ov, pov);
393 ok(num_bytes ==
sizeof(
buf),
"expected sizeof(buf), got %u\n", num_bytes);
395 pov = (
void *)0xdeadbeef;
397 ok(!
ret,
"GetQueuedCompletionStatus succeeded\n");
398 ok(pov ==
NULL,
"expected NULL, got %p\n", pov);
422 ret = pQueueUserAPC(&
userapc, main_thread, 0);
456 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
526 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
568 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
575 res = pNtCancelIoFile(hPipe, &cancel_sb);
576 ok(!
res,
"NtCancelIoFile returned %x\n",
res);
589 if (pNtCancelIoFileEx)
592 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
598 res = pNtCancelIoFileEx(hPipe, &
iosb, &cancel_sb);
599 ok(!
res,
"NtCancelIoFileEx returned %x\n",
res);
607 win_skip(
"NtCancelIoFileEx not available\n");
619 memset(&fpi, 0x55,
sizeof(fpi));
621 ok_(__FILE__,
line)(!
res,
"NtQueryInformationFile returned %x\n",
res);
628#define check_pipe_handle_state(handle, r, c) _check_pipe_handle_state(__LINE__, handle, r, c)
643 attr.RootDirectory = 0;
645 attr.Attributes = 0x40;
647 attr.SecurityQualityOfService =
NULL;
663 0, 0, 0, 1, 0xFFFFFFFF, 500, 500, &
timeout);
664 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
707 ok(!
res,
"NtSetInformationFile returned %x\n",
res);
740 0, 1, 1, 0, 0xFFFFFFFF, 500, 500, &
timeout);
741 ok(!
res,
"NtCreateNamedPipeFile returned %x\n",
res);
757 ok(!
res,
"NtSetInformationFile returned %x\n",
res);
766 ok(!
res,
"NtSetInformationFile returned %x\n",
res);
791 ok(!
res,
"NtSetInformationFile returned %x\n",
res);
815 ok(!
iosb.Status,
"iosb.Status = %x\n",
iosb.Status);
816 ok(
buf.ReadDataAvailable == 1,
"ReadDataAvailable = %u\n",
buf.ReadDataAvailable);
822 ok(
buf.ReadDataAvailable == 1,
"ReadDataAvailable = %u\n",
buf.ReadDataAvailable);
823 ok(!
iosb.Status,
"iosb.Status = %x\n",
iosb.Status);
829#define PIPENAME "\\\\.\\pipe\\ntdll_tests_pipe.c"
877 U(
iosb).Status = 0xdeadbabe;
878 iosb.Information = 0xdeadbeef;
885 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
886 ok( !apc_count,
"apc was called\n" );
891 ok(
iosb.Information == 1,
"wrong info %lu\n",
iosb.Information );
894 ok( !apc_count,
"apc was called\n" );
897 ok( !apc_count,
"apc was called\n" );
899 ok( apc_count == 1,
"apc not called\n" );
903 U(
iosb).Status = 0xdeadbabe;
904 iosb.Information = 0xdeadbeef;
910 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
911 ok( !apc_count,
"apc was called\n" );
916 ok(
iosb.Information == 1,
"wrong info %lu\n",
iosb.Information );
918 ok( !apc_count,
"apc was called\n" );
921 ok( !apc_count,
"apc was called\n" );
923 ok( apc_count == 1,
"apc not called\n" );
927 U(
iosb).Status = 0xdeadbabe;
928 iosb.Information = 0xdeadbeef;
938 ok(
iosb.Information == 1,
"wrong info %lu\n",
iosb.Information );
940 ok( !apc_count,
"apc was called\n" );
942 ok( !apc_count,
"apc was called\n" );
944 ok( apc_count == 1,
"apc not called\n" );
948 U(
iosb).Status = 0xdeadbabe;
949 iosb.Information = 0xdeadbeef;
964 ok(
iosb.Information == 1,
"wrong info %lu\n",
iosb.Information );
966 ok( !apc_count,
"apc was called\n" );
968 ok( !apc_count,
"apc was called\n" );
970 ok( apc_count == 1,
"apc not called\n" );
975 ok(
iosb.Information == 1,
"wrong info %lu\n",
iosb.Information );
977 ok( !apc_count,
"apc was called\n" );
979 ok( !apc_count,
"apc was called\n" );
981 ok( apc_count == 1,
"apc not called\n" );
985 U(
iosb).Status = 0xdeadbabe;
986 iosb.Information = 0xdeadbeef;
992 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
993 ok( !apc_count,
"apc was called\n" );
1000 ok(
iosb.Information == 1,
"wrong info %lu\n",
iosb.Information );
1001 ok( !apc_count,
"apc was called\n" );
1003 ok( apc_count == 1,
"apc was not called\n" );
1007 U(
iosb).Status = 0xdeadbabe;
1008 iosb.Information = 0xdeadbeef;
1013 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1015 ok( !apc_count,
"apc was called\n" );
1017 ok( !apc_count,
"apc was called\n" );
1022 U(
iosb).Status = 0xdeadbabe;
1023 iosb.Information = 0xdeadbeef;
1027 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1028 ok( !apc_count,
"apc was called\n" );
1030 ok( !apc_count,
"apc was called\n" );
1035 U(
iosb).Status = 0xdeadbabe;
1036 iosb.Information = 0xdeadbeef;
1041 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1043 ok( !apc_count,
"apc was called\n" );
1045 ok( !apc_count,
"apc was called\n" );
1050 U(
iosb).Status = 0xdeadbabe;
1051 iosb.Information = 0xdeadbeef;
1056 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1057 ok( !apc_count,
"apc was called\n" );
1061 ok(
iosb.Information == 0,
"wrong info %lu\n",
iosb.Information );
1063 ok( !apc_count,
"apc was called\n" );
1065 ok( apc_count == 1,
"apc was not called\n" );
1073 U(
iosb).Status = 0xdeadbabe;
1074 iosb.Information = 0xdeadbeef;
1079 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1080 ok( !apc_count,
"apc was called\n" );
1086 ok(
iosb.Information == 0,
"wrong info %lu\n",
iosb.Information );
1088 ok( !apc_count,
"apc was called\n" );
1090 ok( apc_count == 1,
"apc was not called\n" );
1093 U(
iosb).Status = 0xdeadbabe;
1094 iosb.Information = 0xdeadbeef;
1099 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1100 ok( !apc_count,
"apc was called\n" );
1105 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1112 ok(
iosb.Information == 0,
"wrong info %lu\n",
iosb.Information );
1114 ok( !apc_count,
"apc was called\n" );
1116 ok( apc_count == 1,
"apc was not called\n" );
1120 if (pNtCancelIoFileEx)
1126 U(
iosb).Status = 0xdeadbabe;
1127 iosb.Information = 0xdeadbeef;
1132 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1133 ok( !apc_count,
"apc was called\n" );
1138 ok(
iosb.Information == 0,
"wrong info %lu\n",
iosb.Information );
1140 ok( !apc_count,
"apc was called\n" );
1142 ok( apc_count == 1,
"apc was not called\n" );
1146 U(
iosb).Status = 0xdeadbabe;
1147 iosb.Information = 0xdeadbeef;
1152 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1153 ok( !apc_count,
"apc was called\n" );
1158 ok(
iosb.Information == 0xdeadbeef,
"wrong info %lu\n",
iosb.Information );
1159 ok( !apc_count,
"apc was called\n" );
1164 ok(
iosb.Information == 0,
"wrong info %lu\n",
iosb.Information );
1166 ok( !apc_count,
"apc was called\n" );
1168 ok( apc_count == 2,
"apc was not called\n" );
1174 win_skip(
"NtCancelIoFileEx not available\n");
1193 ok(
iosb.Information ==
sizeof(*device_info),
"Information = %lu\n",
iosb.Information );
1202 ok(
iosb.Information ==
sizeof(*device_info),
"Information = %lu\n",
iosb.Information );
1212#define test_file_name_fail(a,b) _test_file_name_fail(__LINE__,a,b)
1220 ok_(__FILE__,
line)(
status == expected_status,
"NtQueryInformationFile failed: %x, expected %x\n",
1221 status, expected_status );
1224#define test_file_name(a) _test_file_name(__LINE__,a)
1233 {
'\\',
'n',
't',
'd',
'l',
'l',
'_',
't',
'e',
's',
't',
's',
'_',
'p',
'i',
'p',
'e',
'.',
'c'};
1241 "Information = %lu\n",
iosb.Information );
1251 ok(
iosb.Information == 20,
"Information = %lu\n",
iosb.Information );
1289 "Failed to query object security descriptor length: %08x\n",
status);
1359#define test_group(a,b,c) _test_group(__LINE__,a,b,c)
1368 if (!sec_desc)
return;
1372 "Failed to query group from security descriptor: %08x\n",
status);
1374 ok_(__FILE__,
line)(
EqualSid(group_sid, expected_sid),
"SIDs are not equal\n");
1386 SID *world_sid, *local_sid;
1391 trace(
"security tests...\n");
1399 ok(
ret,
"InitializeSecurityDescriptor failed\n");
1402 ok(
ret,
"SetSecurityDescriptorOwner failed\n");
1405 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
1408 0x20000, 0x20000, 0,
NULL);
1419 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
1428 0x20000, 0x20000, 0,
NULL);
1434 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
1465 sec_attr.
nLength =
sizeof(sec_attr);
1469 ok(
ret,
"SetSecurityDescriptorGroup failed\n");
1471 0x20000, 0x20000, 0, &sec_attr);
1481 0x20000, 0x20000, 0, &sec_attr);
1497 trace(
"starting invalid create tests\n");
1500 trace(
"starting create tests\n");
1503 trace(
"starting overlapped tests\n");
1506 trace(
"starting completion tests\n");
1509 trace(
"starting FILE_PIPE_INFORMATION tests\n");
1512 if (!pOpenThread || !pQueueUserAPC)
1515 trace(
"starting alertable tests\n");
1518 trace(
"starting nonalertable tests\n");
1521 trace(
"starting cancelio tests\n");
1524 trace(
"starting byte read in byte mode client -> server\n");
1526 trace(
"starting byte read in message mode client -> server\n");
1528 trace(
"starting message read in message mode client -> server\n");
1530 trace(
"starting byte read in byte mode server -> client\n");
1532 trace(
"starting byte read in message mode server -> client\n");
1534 trace(
"starting message read in message mode server -> client\n");
void CALLBACK completion(DWORD dwError, DWORD cbTransferred, LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static const WCHAR nameW[]
#define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
#define STATUS_INVALID_HANDLE
#define STATUS_OBJECT_TYPE_MISMATCH
#define ERROR_INSUFFICIENT_BUFFER
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)
#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)
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)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
@ FileIoCompletionNotificationInformation
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
@ FileFsDeviceInformation
enum _FSINFOCLASS FS_INFORMATION_CLASS
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
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 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)
HANDLE WINAPI CreateIoCompletionPort(IN HANDLE FileHandle, IN HANDLE ExistingCompletionPort, IN ULONG_PTR CompletionKey, IN DWORD NumberOfConcurrentThreads)
#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)
#define FILE_FLAG_OVERLAPPED
static HANDLE ULONG_PTR dwData
static void test_overlapped(void)
#define todo_wine_if(is_todo)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
#define FSCTL_PIPE_LISTEN
static void test_create_invalid(void)
static void _test_group(unsigned line, HANDLE handle, SID *expected_sid, BOOL todo)
static void test_peek(HANDLE pipe)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG code
static TOKEN_PRIMARY_GROUP * get_current_group(void)
static NTSTATUS create_pipe(PHANDLE handle, ULONG sharing, ULONG options)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static void test_security_info(void)
static BOOL init_func_ptrs(void)
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 HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID out_buffer
static BOOL open_succeeded
#define test_file_name_fail(a, b)
static PIO_STATUS_BLOCK io_status
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG max_inst
static HANDLE PIO_APC_ROUTINE PVOID apc_context
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG inbound_quota
static BOOL userapc_called
static void CALLBACK userapc(ULONG_PTR dwParam)
static void CALLBACK ioapc(void *arg, PIO_STATUS_BLOCK io, ULONG reserved)
static ULONG POBJECT_ATTRIBUTES attr
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG completion_mode
static SID * well_known_sid(WELL_KNOWN_SID_TYPE sid_type)
static void test_create(void)
static void test_filepipeinfo(void)
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
static HANDLE PIO_APC_ROUTINE apc
static NTSTATUS listen_pipe(HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
static void test_alertable(void)
static const WCHAR testpipe[]
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG dispo
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG options
#define check_pipe_handle_state(handle, r, c)
static PIO_STATUS_BLOCK void ULONG FS_INFORMATION_CLASS info_class
static BOOL bInheritHandle
static BOOL create_pipe_pair(HANDLE *read, HANDLE *write, ULONG flags, ULONG type, ULONG size)
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
static void read_pipe_test(ULONG pipe_flags, ULONG pipe_type)
static void test_volume_info(void)
static BOOL DWORD dwThreadId
static void test_file_info(void)
static void _test_file_name(unsigned line, HANDLE pipe)
#define FILE_SYNCHRONOUS_IO_NONALERT
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG outbound_quota
static PIO_STATUS_BLOCK PVOID ULONG len
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
static void test_completion(void)
static BOOL is_signaled(HANDLE obj)
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG read_mode
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG Length
static PSECURITY_DESCRIPTOR get_security_descriptor(HANDLE handle, BOOL todo)
static void _test_file_name_fail(unsigned line, HANDLE pipe, NTSTATUS expected_status)
static PIO_STATUS_BLOCK void ULONG length
#define FILE_SYNCHRONOUS_IO_ALERT
static void test_nonalertable(void)
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG PLARGE_INTEGER timeout
static OUT PIO_STATUS_BLOCK OUT PVOID IN ULONG IN FILE_INFORMATION_CLASS FileInformationClass
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG pipe_type
static void test_cancelio(void)
#define test_group(a, b, c)
static const WCHAR testpipe_nt[]
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID in_buffer
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG in_size
static void _check_pipe_handle_state(int line, HANDLE handle, ULONG read, ULONG completion)
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)
#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
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)
NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor, OUT PSID *Group, OUT PBOOLEAN GroupDefaulted)
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_CONNECTED
#define STATUS_PIPE_BROKEN
#define STATUS_ILLEGAL_FUNCTION
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
BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
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
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 STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INFO_LENGTH_MISMATCH
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 DUPLICATE_SAME_ACCESS
#define OWNER_SECURITY_INFORMATION
#define SECURITY_DESCRIPTOR_REVISION
#define GROUP_SECURITY_INFORMATION
#define SECURITY_DESCRIPTOR_MIN_LENGTH
#define SECURITY_MAX_SID_SIZE