ReactOS  r76032
pipe.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winnls.h"
#include "wine/test.h"
#include "wine/winternl.h"
#include "winioctl.h"
Include dependency graph for pipe.c:

Go to the source code of this file.

Classes

struct  FILE_PIPE_INFORMATION
 
struct  FILE_PIPE_LOCAL_INFORMATION
 

Macros

#define WIN32_NO_STATUS
 
#define FILE_SYNCHRONOUS_IO_ALERT   0x10
 
#define FILE_SYNCHRONOUS_IO_NONALERT   0x20
 
#define FSCTL_PIPE_LISTEN   CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define loadfunc(name)
 
#define check_pipe_handle_state(handle, r, c)   _check_pipe_handle_state(__LINE__, handle, r, c)
 

Functions

static NTSTATUS (WINAPI *pNtFsControlFile)(HANDLE handle
 
static void (WINAPI *pRtlInitUnicodeString)(PUNICODE_STRING target
 
static HANDLE (WINAPI *pOpenThread)(DWORD dwDesiredAccess
 
static DWORD (WINAPI *pQueueUserAPC)(PAPCFUNC pfnAPC
 
static BOOL init_func_ptrs (void)
 
static NTSTATUS create_pipe (PHANDLE handle, ULONG sharing, ULONG options)
 
static void test_create_invalid (void)
 
static void test_create (void)
 
static void CALLBACK ioapc (void *arg, PIO_STATUS_BLOCK io, ULONG reserved)
 
static NTSTATUS listen_pipe (HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
 
static void test_overlapped (void)
 
static void CALLBACK userapc (ULONG_PTR dwParam)
 
static DWORD WINAPI thread (PVOID main_thread)
 
static void test_alertable (void)
 
static void test_nonalertable (void)
 
static void test_cancelio (void)
 
static void _check_pipe_handle_state (int line, HANDLE handle, ULONG read, ULONG completion)
 
static void test_filepipeinfo (void)
 
 START_TEST (pipe)
 

Variables

static HANDLE event
 
static HANDLE PIO_APC_ROUTINE apc
 
static HANDLE PIO_APC_ROUTINE PVOID apc_context
 
static HANDLE PIO_APC_ROUTINE
PVOID PIO_STATUS_BLOCK 
io
 
static HANDLE PIO_APC_ROUTINE
PVOID PIO_STATUS_BLOCK ULONG 
code
 
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 HANDLE PIO_APC_ROUTINE
PVOID PIO_STATUS_BLOCK ULONG
PVOID ULONG PVOID 
out_buffer
 
static HANDLE PIO_APC_ROUTINE
PVOID PIO_STATUS_BLOCK ULONG
PVOID ULONG PVOID ULONG 
out_size
 
static ULONG access
 
static ULONG POBJECT_ATTRIBUTES attr
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK 
iosb
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG 
sharing
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG 
dispo
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG 
options
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG 
pipe_type
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG ULONG 
read_mode
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG ULONG ULONG 
completion_mode
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG ULONG ULONG ULONG 
max_inst
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG ULONG ULONG ULONG
ULONG 
inbound_quota
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG ULONG ULONG ULONG
ULONG ULONG 
outbound_quota
 
static ULONG
POBJECT_ATTRIBUTES
PIO_STATUS_BLOCK ULONG ULONG
ULONG ULONG ULONG ULONG ULONG
ULONG ULONG PLARGE_INTEGER 
timeout
 
static OUT PIO_STATUS_BLOCK IoStatusBlock
 
static OUT PIO_STATUS_BLOCK
OUT PVOID 
FileInformation
 
static OUT PIO_STATUS_BLOCK
OUT PVOID IN ULONG 
Length
 
static OUT PIO_STATUS_BLOCK
OUT PVOID IN ULONG IN
FILE_INFORMATION_CLASS 
FileInformationClass
 
static PIO_STATUS_BLOCK PVOID ptr
 
static PIO_STATUS_BLOCK PVOID ULONG len
 
static PIO_STATUS_BLOCK PVOID
ULONG FILE_INFORMATION_CLASS 
class
 
static PIO_STATUS_BLOCK io_status
 
static PCWSTR source
 
static BOOL bInheritHandle
 
static BOOL DWORD dwThreadId
 
static HANDLE hThread
 
static HANDLE ULONG_PTR dwData
 
static const WCHAR testpipe []
 
static const WCHAR testpipe_nt []
 
static BOOL ioapc_called
 
static BOOL userapc_called
 
static BOOL open_succeeded
 

Macro Definition Documentation

#define check_pipe_handle_state (   handle,
  r,
  c 
)    _check_pipe_handle_state(__LINE__, handle, r, c)

Definition at line 521 of file pipe.c.

Referenced by test_filepipeinfo().

#define FILE_SYNCHRONOUS_IO_ALERT   0x10

Definition at line 55 of file pipe.c.

Referenced by test_alertable().

#define FILE_SYNCHRONOUS_IO_NONALERT   0x20

Definition at line 59 of file pipe.c.

Referenced by test_create(), and test_nonalertable().

#define loadfunc (   name)
Value:
if (!(p##name = (void *)GetProcAddress(module, #name))) { \
trace("GetProcAddress(%s) failed\n", #name); \
}
#define trace(...)
Definition: kmt_test.h:172
#define FALSE
Definition: types.h:117
return(0)
Definition: name.c:23
#define GetProcAddress(x, y)
Definition: compat.h:410
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by init_func_ptrs().

#define WIN32_NO_STATUS

Definition at line 24 of file pipe.c.

Function Documentation

static void _check_pipe_handle_state ( int  line,
HANDLE  handle,
ULONG  read,
ULONG  completion 
)
static

Definition at line 505 of file pipe.c.

506 {
509  NTSTATUS res;
511  {
512  memset(&fpi, 0x55, sizeof(fpi));
513  res = pNtQueryInformationFile(handle, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
514  ok_(__FILE__, line)(!res, "NtQueryInformationFile returned %x\n", res);
515  ok_(__FILE__, line)(fpi.ReadMode == read, "Unexpected ReadMode, expected %x, got %x\n",
516  read, fpi.ReadMode);
517  ok_(__FILE__, line)(fpi.CompletionMode == completion, "Unexpected CompletionMode, expected %x, got %x\n",
519  }
520 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
Definition: parser.c:48
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: file.c:104
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
LONG NTSTATUS
Definition: DriverTester.h:11
void CALLBACK completion(DWORD dwError, DWORD cbTransferred, LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags)
Definition: WSARecv.c:21
ULONG CompletionMode
Definition: pipe.c:38
GLuint res
Definition: glext.h:9613
#define memset(x, y, z)
Definition: compat.h:39
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
#define ok_(x1, x2)
Definition: CString.cpp:56
static NTSTATUS create_pipe ( PHANDLE  handle,
ULONG  sharing,
ULONG  options 
)
static

Definition at line 112 of file pipe.c.

Referenced by test_alertable(), test_cancelio(), test_create(), test_nonalertable(), and test_overlapped().

113 {
118  NTSTATUS res;
119 
120  pRtlInitUnicodeString(&name, testpipe_nt);
121 
122  attr.Length = sizeof(attr);
123  attr.RootDirectory = 0;
124  attr.ObjectName = &name;
125  attr.Attributes = 0x40; /*case insensitive */
126  attr.SecurityDescriptor = NULL;
128 
129  timeout.QuadPart = -100000000;
130 
131  res = pNtCreateNamedPipeFile(handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, sharing, 2 /*FILE_CREATE*/,
132  options, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
133  return res;
134 }
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
Definition: pipe.c:68
GLuint const GLchar * name
Definition: glext.h:6031
static ULONG POBJECT_ATTRIBUTES attr
Definition: pipe.c:68
smooth NULL
Definition: ftsmooth.c:557
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG PLARGE_INTEGER timeout
Definition: pipe.c:68
#define SYNCHRONIZE
Definition: nt_native.h:61
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
LONG NTSTATUS
Definition: DriverTester.h:11
PVOID SecurityDescriptor
Definition: umtypes.h:175
PVOID SecurityQualityOfService
Definition: umtypes.h:176
GLuint res
Definition: glext.h:9613
PUNICODE_STRING ObjectName
Definition: umtypes.h:173
HANDLE RootDirectory
Definition: umtypes.h:172
static const WCHAR testpipe_nt[]
Definition: pipe.c:109
LONGLONG QuadPart
Definition: typedefs.h:112
static DWORD ( WINAPI pQueueUserAPC)
static
static HANDLE ( WINAPI pOpenThread)
static
static BOOL init_func_ptrs ( void  )
static

Definition at line 84 of file pipe.c.

Referenced by START_TEST().

85 {
86  HMODULE module = GetModuleHandleA("ntdll.dll");
87 
88 #define loadfunc(name) if (!(p##name = (void *)GetProcAddress(module, #name))) { \
89  trace("GetProcAddress(%s) failed\n", #name); \
90  return FALSE; \
91  }
92 
99 
100  /* not fatal */
101  module = GetModuleHandleA("kernel32.dll");
102  pOpenThread = (void *)GetProcAddress(module, "OpenThread");
103  pQueueUserAPC = (void *)GetProcAddress(module, "QueueUserAPC");
104  return TRUE;
105 }
#define TRUE
Definition: types.h:120
NTSYSCALLAPI NTSTATUS NTAPI NtFsControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG FsControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength)
static HMODULE dll
Definition: str.c:188
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
Definition: thread.c:932
return(0)
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
Definition: thread.c:387
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:818
NTSTATUS NTAPI NtQueryInformationFile(HANDLE hFile, PIO_STATUS_BLOCK io, PVOID ptr, ULONG len, FILE_INFORMATION_CLASS FileInformationClass)
#define loadfunc(name)
HANDLE HMODULE
Definition: typedefs.h:75
NTSTATUS NTAPI NtCancelIoFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock)
Definition: file.c:3575
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define GetProcAddress(x, y)
Definition: compat.h:410
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)
Definition: file.c:3414
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
Definition: iofunc.c:2817
static void CALLBACK ioapc ( void arg,
PIO_STATUS_BLOCK  io,
ULONG  reserved 
)
static

Definition at line 251 of file pipe.c.

Referenced by listen_pipe().

252 {
253  ioapc_called = TRUE;
254 }
#define TRUE
Definition: types.h:120
static BOOL ioapc_called
Definition: pipe.c:250
static NTSTATUS listen_pipe ( HANDLE  hPipe,
HANDLE  hEvent,
PIO_STATUS_BLOCK  iosb,
BOOL  use_apc 
)
static

Definition at line 256 of file pipe.c.

Referenced by test_alertable(), test_cancelio(), test_nonalertable(), and test_overlapped().

257 {
258  int dummy;
259 
261 
262  return pNtFsControlFile(hPipe, hEvent, use_apc ? &ioapc: NULL, use_apc ? &dummy: NULL, iosb, FSCTL_PIPE_LISTEN, 0, 0, 0, 0);
263 }
static HANDLE hEvent
Definition: comm.c:54
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:557
#define FSCTL_PIPE_LISTEN
Definition: pipe.c:63
static void CALLBACK ioapc(void *arg, PIO_STATUS_BLOCK io, ULONG reserved)
Definition: pipe.c:251
unsigned char dummy
Definition: maze.c:118
static BOOL ioapc_called
Definition: pipe.c:250
static NTSTATUS ( WINAPI pNtFsControlFile)
static
START_TEST ( pipe  )

Definition at line 691 of file pipe.c.

692 {
693  if (!init_func_ptrs())
694  return;
695 
696  trace("starting invalid create tests\n");
698 
699  trace("starting create tests\n");
700  test_create();
701 
702  trace("starting overlapped tests\n");
703  test_overlapped();
704 
705  trace("starting FILE_PIPE_INFORMATION tests\n");
707 
708  if (!pOpenThread || !pQueueUserAPC)
709  return;
710 
711  trace("starting alertable tests\n");
712  test_alertable();
713 
714  trace("starting nonalertable tests\n");
716 
717  trace("starting cancelio tests\n");
718  test_cancelio();
719 }
#define trace(...)
Definition: kmt_test.h:172
static void test_nonalertable(void)
Definition: pipe.c:425
static BOOL init_func_ptrs(void)
Definition: pipe.c:84
static void test_cancelio(void)
Definition: pipe.c:470
static void test_alertable(void)
Definition: pipe.c:355
static void test_filepipeinfo(void)
Definition: pipe.c:523
static void test_create_invalid(void)
Definition: pipe.c:136
static void test_overlapped(void)
Definition: pipe.c:265
static void test_create(void)
Definition: pipe.c:196
static void test_alertable ( void  )
static

Definition at line 355 of file pipe.c.

Referenced by START_TEST().

356 {
358  HANDLE hEvent;
359  HANDLE hPipe;
360  NTSTATUS res;
361  HANDLE hThread;
362  DWORD ret;
363 
364  memset(&iosb, 0x55, sizeof(iosb));
365 
366  hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
367  ok(hEvent != INVALID_HANDLE_VALUE, "can't create event, GetLastError: %x\n", GetLastError());
368 
370  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
371 
372 /* queue an user apc before calling listen */
374  ret = pQueueUserAPC(&userapc, GetCurrentThread(), 0);
375  ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
376 
377  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
378  todo_wine ok(res == STATUS_CANCELLED, "NtFsControlFile returned %x\n", res);
379 
380  todo_wine ok(userapc_called, "user apc didn't run\n");
381  ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status);
382  todo_wine ok(WaitForSingleObjectEx(hEvent, 0, TRUE) == WAIT_TIMEOUT, "hEvent signaled\n");
383  ok(!ioapc_called, "IOAPC ran\n");
384 
385 /* queue an user apc from a different thread */
386  hThread = CreateThread(NULL, 0, &thread, pOpenThread(MAXIMUM_ALLOWED, FALSE, GetCurrentThreadId()), 0, 0);
387  ok(hThread != INVALID_HANDLE_VALUE, "can't create thread, GetLastError: %x\n", GetLastError());
388 
389  /* wine_todo: the earlier NtFsControlFile call gets cancelled after the pipe gets set into listen state
390  instead of before, so this NtFsControlFile will fail STATUS_INVALID_HANDLE */
391  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
392  todo_wine ok(res == STATUS_CANCELLED, "NtFsControlFile returned %x\n", res);
393 
394  ok(userapc_called, "user apc didn't run\n");
395  ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status);
396  ok(WaitForSingleObjectEx(hEvent, 0, TRUE) == WAIT_TIMEOUT, "hEvent signaled\n");
397  ok(!ioapc_called, "IOAPC ran\n");
398 
399  WaitForSingleObject(hThread, INFINITE);
400 
401  SleepEx(0, TRUE); /* get rid of the userapc, if NtFsControlFile failed */
402 
403  ok(open_succeeded, "couldn't open client side pipe\n");
404 
405  CloseHandle(hThread);
406  DisconnectNamedPipe(hPipe);
407 
408 /* finally try without an apc */
409  hThread = CreateThread(NULL, 0, &thread, 0, 0, 0);
410  ok(hThread != INVALID_HANDLE_VALUE, "can't create thread, GetLastError: %x\n", GetLastError());
411 
412  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
413  todo_wine ok(!res, "NtFsControlFile returned %x\n", res);
414 
415  ok(open_succeeded, "couldn't open client side pipe\n");
416  ok(!U(iosb).Status, "Wrong iostatus %x\n", U(iosb).Status);
417  todo_wine ok(WaitForSingleObject(hEvent, 0) == 0, "hEvent not signaled\n");
418 
419  WaitForSingleObject(hThread, INFINITE);
420  CloseHandle(hThread);
421  CloseHandle(hEvent);
422  CloseHandle(hPipe);
423 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:94
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
static BOOL open_succeeded
Definition: pipe.c:326
static BOOL userapc_called
Definition: pipe.c:320
#define U(x)
Definition: wordpad.c:44
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
DWORD DWORD
Definition: winlogon.h:75
#define FILE_SHARE_READ
Definition: compat.h:125
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hEvent
Definition: comm.c:54
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
HANDLE WINAPI GetCurrentThread(VOID)
Definition: proc.c:1193
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)
Definition: thread.c:135
smooth NULL
Definition: ftsmooth.c:557
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:443
static NTSTATUS listen_pipe(HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
Definition: pipe.c:256
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:748
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
#define WAIT_TIMEOUT
Definition: dderror.h:14
int ret
static NTSTATUS create_pipe(PHANDLE handle, ULONG sharing, ULONG options)
Definition: pipe.c:112
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: pipe.c:55
#define todo_wine
Definition: test.h:154
BOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe)
Definition: npipe.c:828
static void CALLBACK userapc(ULONG_PTR dwParam)
Definition: pipe.c:321
Status
Definition: gdiplustypes.h:24
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
static DWORD WINAPI thread(PVOID main_thread)
Definition: pipe.c:327
static HANDLE hThread
Definition: pipe.c:40
GLuint res
Definition: glext.h:9613
#define ok(value,...)
Definition: CImage.cpp:33
#define INFINITE
Definition: serial.h:102
#define memset(x, y, z)
Definition: compat.h:39
static BOOL ioapc_called
Definition: pipe.c:250
static void test_cancelio ( void  )
static

Definition at line 470 of file pipe.c.

Referenced by START_TEST().

471 {
473  IO_STATUS_BLOCK cancel_sb;
474  HANDLE hEvent;
475  HANDLE hPipe;
476  NTSTATUS res;
477 
478  hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
479  ok(hEvent != INVALID_HANDLE_VALUE, "can't create event, GetLastError: %x\n", GetLastError());
480 
481  res = create_pipe(&hPipe, FILE_SHARE_READ | FILE_SHARE_WRITE, 0 /* OVERLAPPED */);
482  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
483 
484  memset(&iosb, 0x55, sizeof(iosb));
485 
486  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
487  ok(res == STATUS_PENDING, "NtFsControlFile returned %x\n", res);
488 
489  res = pNtCancelIoFile(hPipe, &cancel_sb);
490  ok(!res, "NtCancelIoFile returned %x\n", res);
491 
492  ok(U(iosb).Status == STATUS_CANCELLED, "Wrong iostatus %x\n", U(iosb).Status);
493  ok(WaitForSingleObject(hEvent, 0) == 0, "hEvent not signaled\n");
494 
495  ok(!ioapc_called, "IOAPC ran too early\n");
496 
497  SleepEx(0, TRUE); /* alertable wait state */
498 
499  ok(ioapc_called, "IOAPC didn't run\n");
500 
501  CloseHandle(hEvent);
502  CloseHandle(hPipe);
503 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define U(x)
Definition: wordpad.c:44
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hEvent
Definition: comm.c:54
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:557
static NTSTATUS listen_pipe(HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
Definition: pipe.c:256
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:748
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
static NTSTATUS create_pipe(PHANDLE handle, ULONG sharing, ULONG options)
Definition: pipe.c:112
Status
Definition: gdiplustypes.h:24
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
GLuint res
Definition: glext.h:9613
#define ok(value,...)
Definition: CImage.cpp:33
#define memset(x, y, z)
Definition: compat.h:39
static BOOL ioapc_called
Definition: pipe.c:250
static void test_create ( void  )
static

Definition at line 196 of file pipe.c.

Referenced by START_TEST().

197 {
198  HANDLE hserver;
199  NTSTATUS res;
200  int j, k;
203 
204  static const DWORD access[] = { 0, GENERIC_READ, GENERIC_WRITE, GENERIC_READ | GENERIC_WRITE};
205  static const DWORD sharing[] = { FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE };
206  static const DWORD pipe_config[]= { 1, 0, 2 };
207 
208  for (j = 0; j < sizeof(sharing) / sizeof(DWORD); j++) {
209  for (k = 0; k < sizeof(access) / sizeof(DWORD); k++) {
210  HANDLE hclient;
211  BOOL should_succeed = TRUE;
212 
213  res = create_pipe(&hserver, sharing[j], FILE_SYNCHRONOUS_IO_NONALERT);
214  if (res) {
215  ok(0, "NtCreateNamedPipeFile returned %x, sharing: %x\n", res, sharing[j]);
216  continue;
217  }
218 
219  res = pNtQueryInformationFile(hserver, &iosb, &info, sizeof(info), (FILE_INFORMATION_CLASS)24);
220  ok(!res, "NtQueryInformationFile for server returned %x, sharing: %x\n", res, sharing[j]);
221  ok(info.NamedPipeConfiguration == pipe_config[j], "wrong duplex status for pipe: %d, expected %d\n",
222  info.NamedPipeConfiguration, pipe_config[j]);
223 
224  hclient = CreateFileW(testpipe, access[k], 0, 0, OPEN_EXISTING, 0, 0);
225  if (hclient != INVALID_HANDLE_VALUE) {
226  res = pNtQueryInformationFile(hclient, &iosb, &info, sizeof(info), (FILE_INFORMATION_CLASS)24);
227  ok(!res, "NtQueryInformationFile for client returned %x, access: %x, sharing: %x\n",
228  res, access[k], sharing[j]);
229  ok(info.NamedPipeConfiguration == pipe_config[j], "wrong duplex status for pipe: %d, expected %d\n",
230  info.NamedPipeConfiguration, pipe_config[j]);
231  CloseHandle(hclient);
232  }
233 
234  if (access[k] & GENERIC_WRITE)
235  should_succeed &= !!(sharing[j] & FILE_SHARE_WRITE);
236  if (access[k] & GENERIC_READ)
237  should_succeed &= !!(sharing[j] & FILE_SHARE_READ);
238 
239  if (should_succeed)
240  ok(hclient != INVALID_HANDLE_VALUE, "CreateFile failed for sharing %x, access: %x, GetLastError: %d\n",
241  sharing[j], access[k], GetLastError());
242  else
243  ok(hclient == INVALID_HANDLE_VALUE, "CreateFile succeeded for sharing %x, access: %x\n", sharing[j], access[k]);
244 
245  CloseHandle(hserver);
246  }
247  }
248 }
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
Definition: pipe.c:68
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: pipe.c:59
ULONG NamedPipeConfiguration
Definition: pipe.c:43
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
DWORD DWORD
Definition: winlogon.h:75
#define FILE_SHARE_READ
Definition: compat.h:125
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OPEN_EXISTING
Definition: compat.h:426
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: file.c:104
unsigned int BOOL
Definition: ntddk_ex.h:94
static NTSTATUS create_pipe(PHANDLE handle, ULONG sharing, ULONG options)
Definition: pipe.c:112
#define GENERIC_READ
Definition: compat.h:124
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
const XML_Char XML_Encoding * info
Definition: expat.h:530
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
static const WCHAR testpipe[]
Definition: pipe.c:107
#define CreateFileW
Definition: compat.h:400
GLuint res
Definition: glext.h:9613
#define ok(value,...)
Definition: CImage.cpp:33
static ULONG access
Definition: pipe.c:68
int k
Definition: mpi.c:3369
static void test_create_invalid ( void  )
static

Definition at line 136 of file pipe.c.

Referenced by START_TEST().

137 {
142  NTSTATUS res;
143  HANDLE handle, handle2;
145 
146  pRtlInitUnicodeString(&name, testpipe_nt);
147 
148  attr.Length = sizeof(attr);
149  attr.RootDirectory = 0;
150  attr.ObjectName = &name;
151  attr.Attributes = 0x40; /*case insensitive */
152  attr.SecurityDescriptor = NULL;
154 
155  timeout.QuadPart = -100000000;
156 
157 /* create a pipe with FILE_OVERWRITE */
158  res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ, 4 /*FILE_OVERWRITE*/,
159  0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
160  todo_wine ok(res == STATUS_INVALID_PARAMETER, "NtCreateNamedPipeFile returned %x\n", res);
161  if (!res)
162  CloseHandle(handle);
163 
164 /* create a pipe with FILE_OVERWRITE_IF */
165  res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ, 5 /*FILE_OVERWRITE_IF*/,
166  0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
167  todo_wine ok(res == STATUS_INVALID_PARAMETER, "NtCreateNamedPipeFile returned %x\n", res);
168  if (!res)
169  CloseHandle(handle);
170 
171 /* create a pipe with sharing = 0 */
172  res = pNtCreateNamedPipeFile(&handle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, 0, 2 /*FILE_CREATE*/,
173  0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
174  ok(res == STATUS_INVALID_PARAMETER, "NtCreateNamedPipeFile returned %x\n", res);
175  if (!res)
176  CloseHandle(handle);
177 
178 /* create a pipe without r/w access */
179  res = pNtCreateNamedPipeFile(&handle, SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/,
180  0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
181  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
182 
183  res = pNtQueryInformationFile(handle, &iosb, &info, sizeof(info), (FILE_INFORMATION_CLASS)24);
184  ok(res == STATUS_ACCESS_DENIED, "NtQueryInformationFile returned %x\n", res);
185 
186 /* test FILE_CREATE creation disposition */
187  res = pNtCreateNamedPipeFile(&handle2, SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /*FILE_CREATE*/,
188  0, 1, 0, 0, 0xFFFFFFFF, 500, 500, &timeout);
189  todo_wine ok(res == STATUS_ACCESS_DENIED, "NtCreateNamedPipeFile returned %x\n", res);
190  if (!res)
191  CloseHandle(handle2);
192 
193  CloseHandle(handle);
194 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:79
#define CloseHandle
Definition: compat.h:398
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
GLuint const GLchar * name
Definition: glext.h:6031
static ULONG POBJECT_ATTRIBUTES attr
Definition: pipe.c:68
smooth NULL
Definition: ftsmooth.c:557
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: file.c:104
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define todo_wine
Definition: test.h:154
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG PLARGE_INTEGER timeout
Definition: pipe.c:68
#define SYNCHRONIZE
Definition: nt_native.h:61
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
const XML_Char XML_Encoding * info
Definition: expat.h:530
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
PVOID SecurityDescriptor
Definition: umtypes.h:175
PVOID SecurityQualityOfService
Definition: umtypes.h:176
GLuint res
Definition: glext.h:9613
PUNICODE_STRING ObjectName
Definition: umtypes.h:173
HANDLE RootDirectory
Definition: umtypes.h:172
#define ok(value,...)
Definition: CImage.cpp:33
static const WCHAR testpipe_nt[]
Definition: pipe.c:109
LONGLONG QuadPart
Definition: typedefs.h:112
static void test_filepipeinfo ( void  )
static

Definition at line 523 of file pipe.c.

Referenced by START_TEST().

524 {
529  HANDLE hServer, hClient;
531  NTSTATUS res;
532 
533  pRtlInitUnicodeString(&name, testpipe_nt);
534 
535  attr.Length = sizeof(attr);
536  attr.RootDirectory = 0;
537  attr.ObjectName = &name;
538  attr.Attributes = 0x40; /* case insensitive */
539  attr.SecurityDescriptor = NULL;
541 
542  timeout.QuadPart = -100000000;
543 
544  /* test with INVALID_HANDLE_VALUE */
545  res = pNtQueryInformationFile(INVALID_HANDLE_VALUE, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
546  ok(res == STATUS_OBJECT_TYPE_MISMATCH, "NtQueryInformationFile returned %x\n", res);
547 
548  fpi.ReadMode = 0;
549  fpi.CompletionMode = 0;
550  res = pNtSetInformationFile(INVALID_HANDLE_VALUE, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
551  ok(res == STATUS_OBJECT_TYPE_MISMATCH, "NtSetInformationFile returned %x\n", res);
552 
553  /* server end with read-only attributes */
554  res = pNtCreateNamedPipeFile(&hServer, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb,
555  FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /* FILE_CREATE */,
556  0, 0, 0, 1, 0xFFFFFFFF, 500, 500, &timeout);
557  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
558 
559  check_pipe_handle_state(hServer, 0, 1);
560 
561  hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
562  ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */,
563  "can't open pipe, GetLastError: %x\n", GetLastError());
564 
565  check_pipe_handle_state(hServer, 0, 1);
566  check_pipe_handle_state(hClient, 0, 0);
567 
568  fpi.ReadMode = 0;
569  fpi.CompletionMode = 0;
570  res = pNtSetInformationFile(hServer, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
571  ok(res == STATUS_ACCESS_DENIED, "NtSetInformationFile returned %x\n", res);
572 
573  check_pipe_handle_state(hServer, 0, 1);
574  check_pipe_handle_state(hClient, 0, 0);
575 
576  fpi.ReadMode = 1; /* invalid on a byte stream pipe */
577  fpi.CompletionMode = 1;
578  res = pNtSetInformationFile(hServer, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
579  ok(res == STATUS_ACCESS_DENIED, "NtSetInformationFile returned %x\n", res);
580 
581  check_pipe_handle_state(hServer, 0, 1);
582  check_pipe_handle_state(hClient, 0, 0);
583 
584  if (hClient != INVALID_HANDLE_VALUE)
585  {
586  fpi.ReadMode = 1; /* invalid on a byte stream pipe */
587  fpi.CompletionMode = 1;
588  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
589  ok(res == STATUS_INVALID_PARAMETER, "NtSetInformationFile returned %x\n", res);
590  }
591 
592  check_pipe_handle_state(hServer, 0, 1);
593  check_pipe_handle_state(hClient, 0, 0);
594 
595  if (hClient != INVALID_HANDLE_VALUE)
596  {
597  fpi.ReadMode = 0;
598  fpi.CompletionMode = 1;
599  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
600  ok(!res, "NtSetInformationFile returned %x\n", res);
601  }
602 
603  check_pipe_handle_state(hServer, 0, 1);
604  check_pipe_handle_state(hClient, 0, 1);
605 
606  if (hClient != INVALID_HANDLE_VALUE)
607  {
608  fpi.ReadMode = 0;
609  fpi.CompletionMode = 2; /* not in range 0-1 */
610  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
611  ok(res == STATUS_INVALID_PARAMETER || broken(!res) /* < Vista */, "NtSetInformationFile returned %x\n", res);
612 
613  fpi.ReadMode = 2; /* not in range 0-1 */
614  fpi.CompletionMode = 0;
615  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
616  ok(res == STATUS_INVALID_PARAMETER || broken(!res) /* < Vista */, "NtSetInformationFile returned %x\n", res);
617  }
618 
619  CloseHandle(hClient);
620 
621  check_pipe_handle_state(hServer, 0, 1);
622 
623  fpi.ReadMode = 0;
624  fpi.CompletionMode = 0;
625  res = pNtSetInformationFile(hServer, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
626  ok(res == STATUS_ACCESS_DENIED, "NtSetInformationFile returned %x\n", res);
627 
628  CloseHandle(hServer);
629 
630  /* message mode server with read/write attributes */
631  res = pNtCreateNamedPipeFile(&hServer, FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb,
632  FILE_SHARE_READ | FILE_SHARE_WRITE, 2 /* FILE_CREATE */,
633  0, 1, 1, 0, 0xFFFFFFFF, 500, 500, &timeout);
634  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
635 
636  check_pipe_handle_state(hServer, 1, 0);
637 
638  hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
639  ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */,
640  "can't open pipe, GetLastError: %x\n", GetLastError());
641 
642  check_pipe_handle_state(hServer, 1, 0);
643  check_pipe_handle_state(hClient, 0, 0);
644 
645  if (hClient != INVALID_HANDLE_VALUE)
646  {
647  fpi.ReadMode = 1;
648  fpi.CompletionMode = 1;
649  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
650  ok(!res, "NtSetInformationFile returned %x\n", res);
651  }
652 
653  check_pipe_handle_state(hServer, 1, 0);
654  check_pipe_handle_state(hClient, 1, 1);
655 
656  fpi.ReadMode = 0;
657  fpi.CompletionMode = 1;
658  res = pNtSetInformationFile(hServer, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
659  ok(!res, "NtSetInformationFile returned %x\n", res);
660 
661  check_pipe_handle_state(hServer, 0, 1);
662  check_pipe_handle_state(hClient, 1, 1);
663 
664  if (hClient != INVALID_HANDLE_VALUE)
665  {
666  fpi.ReadMode = 0;
667  fpi.CompletionMode = 2; /* not in range 0-1 */
668  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
669  ok(res == STATUS_INVALID_PARAMETER || broken(!res) /* < Vista */, "NtSetInformationFile returned %x\n", res);
670 
671  fpi.ReadMode = 2; /* not in range 0-1 */
672  fpi.CompletionMode = 0;
673  res = pNtSetInformationFile(hClient, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
674  ok(res == STATUS_INVALID_PARAMETER || broken(!res) /* < Vista */, "NtSetInformationFile returned %x\n", res);
675  }
676 
677  CloseHandle(hClient);
678 
679  check_pipe_handle_state(hServer, 0, 1);
680 
681  fpi.ReadMode = 1;
682  fpi.CompletionMode = 0;
683  res = pNtSetInformationFile(hServer, &iosb, &fpi, sizeof(fpi), (FILE_INFORMATION_CLASS)23);
684  ok(!res, "NtSetInformationFile returned %x\n", res);
685 
686  check_pipe_handle_state(hServer, 1, 0);
687 
688  CloseHandle(hServer);
689 }
#define check_pipe_handle_state(handle, r, c)
Definition: pipe.c:521
#define CloseHandle
Definition: compat.h:398
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
#define FILE_SHARE_READ
Definition: compat.h:125
GLuint const GLchar * name
Definition: glext.h:6031
#define GENERIC_WRITE
Definition: nt_native.h:90
static ULONG POBJECT_ATTRIBUTES attr
Definition: pipe.c:68
smooth NULL
Definition: ftsmooth.c:557
#define OPEN_EXISTING
Definition: compat.h:426
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: file.c:104
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:259
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define ERROR_PIPE_BUSY
Definition: winerror.h:283
#define GENERIC_READ
Definition: compat.h:124
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG ULONG PLARGE_INTEGER timeout
Definition: pipe.c:68
#define SYNCHRONIZE
Definition: nt_native.h:61
#define broken(x)
Definition: _sntprintf.h:21
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
PVOID SecurityDescriptor
Definition: umtypes.h:175
ULONG CompletionMode
Definition: pipe.c:38
static const WCHAR testpipe[]
Definition: pipe.c:107
#define CreateFileW
Definition: compat.h:400
PVOID SecurityQualityOfService
Definition: umtypes.h:176
GLuint res
Definition: glext.h:9613
PUNICODE_STRING ObjectName
Definition: umtypes.h:173
HANDLE RootDirectory
Definition: umtypes.h:172
#define ok(value,...)
Definition: CImage.cpp:33
static const WCHAR testpipe_nt[]
Definition: pipe.c:109
LONGLONG QuadPart
Definition: typedefs.h:112
static void test_nonalertable ( void  )
static

Definition at line 425 of file pipe.c.

Referenced by START_TEST().

426 {
428  HANDLE hEvent;
429  HANDLE hPipe;
430  NTSTATUS res;
431  HANDLE hThread;
432  DWORD ret;
433 
434  memset(&iosb, 0x55, sizeof(iosb));
435 
436  hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
437  ok(hEvent != INVALID_HANDLE_VALUE, "can't create event, GetLastError: %x\n", GetLastError());
438 
440  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
441 
442  hThread = CreateThread(NULL, 0, &thread, 0, 0, 0);
443  ok(hThread != INVALID_HANDLE_VALUE, "can't create thread, GetLastError: %x\n", GetLastError());
444 
446  ret = pQueueUserAPC(&userapc, GetCurrentThread(), 0);
447  ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
448 
449  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
450  todo_wine ok(!res, "NtFsControlFile returned %x\n", res);
451 
452  ok(open_succeeded, "couldn't open client side pipe\n");
453  todo_wine ok(!U(iosb).Status, "Wrong iostatus %x\n", U(iosb).Status);
454  todo_wine ok(WaitForSingleObject(hEvent, 0) == 0, "hEvent not signaled\n");
455 
456  ok(!ioapc_called, "IOAPC ran too early\n");
457  ok(!userapc_called, "user apc ran too early\n");
458 
459  SleepEx(0, TRUE); /* alertable wait state */
460 
461  ok(ioapc_called, "IOAPC didn't run\n");
462  ok(userapc_called, "user apc didn't run\n");
463 
464  WaitForSingleObject(hThread, INFINITE);
465  CloseHandle(hThread);
466  CloseHandle(hEvent);
467  CloseHandle(hPipe);
468 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: pipe.c:59
static BOOL open_succeeded
Definition: pipe.c:326
static BOOL userapc_called
Definition: pipe.c:320
#define U(x)
Definition: wordpad.c:44
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
DWORD DWORD
Definition: winlogon.h:75
#define FILE_SHARE_READ
Definition: compat.h:125
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hEvent
Definition: comm.c:54
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
HANDLE WINAPI GetCurrentThread(VOID)
Definition: proc.c:1193
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)
Definition: thread.c:135
smooth NULL
Definition: ftsmooth.c:557
static NTSTATUS listen_pipe(HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
Definition: pipe.c:256
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:748
int ret
static NTSTATUS create_pipe(PHANDLE handle, ULONG sharing, ULONG options)
Definition: pipe.c:112
#define todo_wine
Definition: test.h:154
static void CALLBACK userapc(ULONG_PTR dwParam)
Definition: pipe.c:321
Status
Definition: gdiplustypes.h:24
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
static DWORD WINAPI thread(PVOID main_thread)
Definition: pipe.c:327
static HANDLE hThread
Definition: pipe.c:40
GLuint res
Definition: glext.h:9613
#define ok(value,...)
Definition: CImage.cpp:33
#define INFINITE
Definition: serial.h:102
#define memset(x, y, z)
Definition: compat.h:39
static BOOL ioapc_called
Definition: pipe.c:250
static void test_overlapped ( void  )
static

Definition at line 265 of file pipe.c.

Referenced by START_TEST().

266 {
268  HANDLE hEvent;
269  HANDLE hPipe;
270  HANDLE hClient;
271  NTSTATUS res;
272 
273  hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
274  ok(hEvent != INVALID_HANDLE_VALUE, "can't create event, GetLastError: %x\n", GetLastError());
275 
276  res = create_pipe(&hPipe, FILE_SHARE_READ | FILE_SHARE_WRITE, 0 /* OVERLAPPED */);
277  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
278 
279  memset(&iosb, 0x55, sizeof(iosb));
280  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
281  ok(res == STATUS_PENDING, "NtFsControlFile returned %x\n", res);
282  ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status);
283 
284  hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
285  ok(hClient != INVALID_HANDLE_VALUE, "can't open pipe, GetLastError: %x\n", GetLastError());
286 
287  ok(U(iosb).Status == 0, "Wrong iostatus %x\n", U(iosb).Status);
288  ok(WaitForSingleObject(hEvent, 0) == 0, "hEvent not signaled\n");
289 
290  ok(!ioapc_called, "IOAPC ran too early\n");
291 
292  SleepEx(0, TRUE); /* alertable wait state */
293 
294  ok(ioapc_called, "IOAPC didn't run\n");
295 
296  CloseHandle(hPipe);
297  CloseHandle(hClient);
298 
299  res = create_pipe(&hPipe, FILE_SHARE_READ | FILE_SHARE_WRITE, 0 /* OVERLAPPED */);
300  ok(!res, "NtCreateNamedPipeFile returned %x\n", res);
301 
302  hClient = CreateFileW(testpipe, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
303  ok(hClient != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_PIPE_BUSY) /* > Win 8 */,
304  "can't open pipe, GetLastError: %x\n", GetLastError());
305 
306  if (hClient != INVALID_HANDLE_VALUE)
307  {
308  memset(&iosb, 0x55, sizeof(iosb));
309  res = listen_pipe(hPipe, hEvent, &iosb, TRUE);
310  ok(res == STATUS_PIPE_CONNECTED, "NtFsControlFile returned %x\n", res);
311  ok(U(iosb).Status == 0x55555555, "iosb.Status got changed to %x\n", U(iosb).Status);
312 
313  CloseHandle(hClient);
314  }
315 
316  CloseHandle(hPipe);
317  CloseHandle(hEvent);
318 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define U(x)
Definition: wordpad.c:44
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hEvent
Definition: comm.c:54
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:557
#define OPEN_EXISTING
Definition: compat.h:426
static NTSTATUS listen_pipe(HANDLE hPipe, HANDLE hEvent, PIO_STATUS_BLOCK iosb, BOOL use_apc)
Definition: pipe.c:256
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:748
#define STATUS_PENDING
Definition: ntstatus.h:82
#define ERROR_PIPE_BUSY
Definition: winerror.h:283
static NTSTATUS create_pipe(PHANDLE handle, ULONG sharing, ULONG options)
Definition: pipe.c:112
#define STATUS_PIPE_CONNECTED
Definition: ntstatus.h:400
#define GENERIC_READ
Definition: compat.h:124
#define broken(x)
Definition: _sntprintf.h:21
Status
Definition: gdiplustypes.h:24
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK iosb
Definition: pipe.c:68
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
static const WCHAR testpipe[]
Definition: pipe.c:107
#define CreateFileW
Definition: compat.h:400
GLuint res
Definition: glext.h:9613
#define ok(value,...)
Definition: CImage.cpp:33
#define memset(x, y, z)
Definition: compat.h:39
static BOOL ioapc_called
Definition: pipe.c:250
static DWORD WINAPI thread ( PVOID  main_thread)
static

Definition at line 327 of file pipe.c.

Referenced by _test_flush_async(), RpcReadFile(), test_alertable(), test_nonalertable(), and test_overlapped().

328 {
329  HANDLE h;
330 
331  Sleep(400);
332 
333  if (main_thread) {
334  DWORD ret;
336  ret = pQueueUserAPC(&userapc, main_thread, 0);
337  ok(ret, "can't queue user apc, GetLastError: %x\n", GetLastError());
338  CloseHandle(main_thread);
339  }
340 
341  Sleep(400);
342 
344 
345  if (h != INVALID_HANDLE_VALUE) {
347  Sleep(100);
348  CloseHandle(h);
349  } else
351 
352  return 0;
353 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:736
static BOOL open_succeeded
Definition: pipe.c:326
static BOOL userapc_called
Definition: pipe.c:320
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1056
DWORD DWORD
Definition: winlogon.h:75
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define FALSE
Definition: types.h:117
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OPEN_EXISTING
Definition: compat.h:426
int ret
static void CALLBACK userapc(ULONG_PTR dwParam)
Definition: pipe.c:321
#define GENERIC_READ
Definition: compat.h:124
DWORD *typedef HANDLE
Definition: winlogon.h:52
static const WCHAR testpipe[]
Definition: pipe.c:107
#define CreateFileW
Definition: compat.h:400
#define ok(value,...)
Definition: CImage.cpp:33
static void CALLBACK userapc ( ULONG_PTR  dwParam)
static

Definition at line 321 of file pipe.c.

Referenced by test_alertable(), test_nonalertable(), and thread().

322 {
324 }
#define TRUE
Definition: types.h:120
static BOOL userapc_called
Definition: pipe.c:320
static void ( WINAPI pRtlInitUnicodeString)
static

Variable Documentation

Definition at line 68 of file pipe.c.

Referenced by test_create().

Definition at line 67 of file pipe.c.

Definition at line 67 of file pipe.c.

BOOL bInheritHandle

Definition at line 80 of file pipe.c.

Referenced by DuplicateConsoleHandle(), and OpenConsoleW().

Definition at line 76 of file pipe.c.

Definition at line 67 of file pipe.c.

Referenced by _test_status_code(), bdf_cmap_char_index(), bdf_cmap_char_next(), bitmap_decompress1(), bitmap_decompress2(), bitmap_decompress3(), bitmap_decompress4(), bytecode_addref(), cf2_getSeacComponent(), cff_cmap_encoding_char_next(), cff_parser_init(), cff_parser_run(), child_process(), chmc_system_done(), chmcerr_set(), COMBOEX_Notify(), compile_script(), compress_block(), construct_function(), create_copy_error(), create_parseError(), create_source_function(), CreateCaseDiff(), DATETIME_SendSimpleNotify(), decode_source(), DetectJapaneseCode(), dll_entry_point(), emit_catch_jmp(), Ext2DeviceControl(), FillTable(), FreeBT_DispatchDevCtrl(), ft_lzwstate_io(), fxt1_decode_1(), generate_nibble(), get_notifycode(), getreply(), GetResponse(), gif_compress(), handle_edit_event(), handle_WM_HSCROLL(), handle_WM_VSCROLL(), HEADER_NotifyCodeWtoA(), HEADER_SendNotify(), HLPFILE_Uncompress2(), iso_connect(), jpeg_huff_decode(), jpeg_make_c_derived_tbl(), jpeg_make_d_derived_tbl(), JScriptParse_ParseScriptText(), JScriptParseProcedure_ParseProcedureText(), JSGlobal_eval(), QMyScrollView::keyPressEvent(), QMyScrollView::keyReleaseEvent(), lznt1_decompress_chunk(), marshal_nfs41_dirquery(), marshal_nfs41_rw(), ME_HandleMessage(), mi_check_modifier(), mi_read_keyboard_state(), MonSelNotify(), MonthCalNotifyControlParent(), navigate_javascript_proc(), notify_hdr(), NotifyControlParent(), TKeyDef::operator=(), parse_option_buffer(), parse_script(), pcf_cmap_char_index(), pcf_cmap_char_next(), pfr_lookup_bitmap_data(), pretty_print_option(), process_nibble(), process_plane(), progress_callback_http(), push_error(), ReadChmSystem(), REBAR_Notify(), remove_product_upgrade_code(), script_parse(), STATUSBAR_SendMouseNotify(), store_options(), StringConstr_fromCharCode(), SYSLINK_SendParentNotify(), t1_cmap_std_char_index(), TAB_SendSimpleNotify(), test_bitmap_font_glyph_index(), test_domdoc(), test_exec_script(), test_ExitCode(), test_Handles(), test_timers_exception(), test_WM_GETDLGCODE(), TKeyDef::TKeyDef(), TOOLBAR_SendNotify(), tr_static_init(), trace_extended_error(), TREEVIEW_ScrollKeyDown(), tt_name_ascii_from_other(), tt_name_ascii_from_utf16(), unmarshal_nfs41_dirquery(), unmarshal_nfs41_rw(), VBScriptParse_ParseScriptText(), VBScriptParseProcedure_ParseProcedureText(), and WshExec_get_Status().

Definition at line 68 of file pipe.c.

Definition at line 68 of file pipe.c.

HANDLE ULONG_PTR dwData

Definition at line 81 of file pipe.c.

BOOL DWORD dwThreadId

Definition at line 80 of file pipe.c.

Definition at line 67 of file pipe.c.

Referenced by test_overlapped_error(), and test_readfileex_pending().

HANDLE hThread

Definition at line 81 of file pipe.c.

PIO_STATUS_BLOCK io_status

Definition at line 77 of file pipe.c.

BOOL ioapc_called
static
_Out_ PIO_STATUS_BLOCK IoStatusBlock

Definition at line 75 of file pipe.c.

Referenced by AccpOpenNamedObject(), AcsHlpSendCommand(), AddRemoteDatabaseEntry(), AllocConsole(), ApphelpCacheQueryInfo(), BaseMarkFileForDelete(), BasepCopyFileExW(), BasepDoTapeOperation(), BasepMapFile(), BasepNotifyTrackingService(), BasepOpenFileForMove(), BatteryIoctl(), Beep(), BroadcastOpen(), CabinetExtractFile(), CabinetOpen(), CallCacheControl(), CancelIo(), ClassCompletionRoutine(), CmBattSendDownStreamIrp(), CmpFileFlush(), CmpFileRead(), CmpFileSetSize(), CmpFileWrite(), CmpInitializeHive(), CmpOpenHiveFiles(), CommandDumpSector(), CommandPartInfo(), CompareFileContents(), CompBattGetDeviceObjectPointer(), CopyLoop(), CreateDirectoryExW(), CreateDirectoryW(), CreateFileW(), CreateHardLinkW(), CreateIoCompletionPort(), CreateProcessInternalW(), CreateRegistryFile(), CreateRemoteDatabaseWorker(), DbgkCreateThread(), DbgkpPostFakeModuleMessages(), DbgkpSectionToFileHandle(), DeleteFileW(), DeleteRemoteDatabaseEntry(), DoesFileExist(), DoesPathExist(), EngLoadModuleEx(), ExtractFont(), Fat12WriteBootSector(), Fat12WriteFAT(), Fat12WriteRootDirectory(), Fat16WriteBootSector(), Fat16WriteFAT(), Fat16WriteRootDirectory(), Fat32WriteBootSector(), Fat32WriteFAT(), Fat32WriteFsInfo(), Fat32WriteRootDirectory(), FatWipeSectors(), Fatx16WriteFAT(), Fatx32WriteFAT(), FatxWriteBootSector(), FatxWriteRootDirectory(), FillConsoleOutputAttribute(), FillConsoleOutputCharacterA(), FilterConnectCommunicationPort(), FindFirstChangeNotificationW(), FindFirstFileExW(), FindFirstStreamW(), FindNextFileW(), FlushConsoleInputBuffer(), FlushFileBuffers(), FlushViewOfFile(), FsRecGetDeviceSectors(), FsRecGetDeviceSectorSize(), FsRecReadBlock(), FsRtlBalanceReads(), FsRtlpOpenDev(), FsRtlpRegisterProviderWithMUP(), FsRtlProcessFileLock(), FstubGetDiskGeometry(), FstubReadSector(), FstubWriteSector(), GetCompressedFileSizeW(), GetConnectionHandle(), GetConsoleScreenBufferInfo(), GetDiskFreeSpaceExW(), GetDiskFreeSpaceW(), GetDriveTypeW(), GetFileAttributesByHandle(), GetFileInformationByHandle(), GetFileSize(), GetFileSizeEx(), GetFileSystem(), GetFileTime(), GetRemoteDatabaseEntry(), GetRemoteDatabaseSize(), GetVolumeInformationW(), GetVolumeNameForRoot(), HalpGetFullGeometry(), HidUsb_ResetPort(), InfOpenFile(), InfWriteFile(), IniCacheLoad(), IniCacheSave(), InstallExt2BootCodeToDisk(), InstallFat12BootCodeToFloppy(), InstallFat16BootCodeToDisk(), InstallFat16BootCodeToFile(), InstallFat32BootCodeToDisk(), InstallFat32BootCodeToFile(), InstallMbrBootCodeToDisk(), IntAgpGetInterface(), InternalOpenDirW(), IntGetFullFileName(), IntUpdateControlKeyState(), IoBuildAsynchronousFsdRequest(), IoBuildDeviceIoControlRequest(), IoGetBootDiskInformation(), IoGetDmaAdapter(), IoInvalidateDeviceState(), IopActionInterrogateDeviceStack(), IopCancelPrepareDeviceForRemoval(), IopCreateArcNamesCd(), IopCreateArcNamesDisk(), IopCreateDeviceInstancePath(), IopCreateLogFile(), IopDeviceFsIoControl(), IopEnumerateDevice(), IopFilterResourceRequirements(), IopGetBasicInformationFile(), IopGetDeviceRelations(), IopGetFileInformation(), IopGetSetSecurityObject(), IopLoadFileSystemDriver(), IopMarkBootPartition(), IopMountVolume(), IopOpenLinkOrRenameTarget(), IopParseDevice(), IopPrepareDeviceForRemoval(), IopQueryCompatibleIds(), IopQueryDeviceInformation(), IopQueryHardwareIds(), IopStartRamdisk(), IopSynchronousCall(), IopWriteLogFile(), IoRequestDeviceEject(), IoSetInformation(), IoVerifyVolume(), IoVolumeDeviceToDosName(), IsFtVolume(), IsThereAValidBootSector(), IsThisARootDirectory(), KdbpSymLoadModuleSymbols(), KernelModeTest(), KmtInitTestFiles(), KsecDeviceIoControl(), KsecOpenDevice(), KsiCreateObjectType(), KspCreateObjectType(), KspSynchronousIoControlDeviceCompletion(), KsSynchronousIoControlDevice(), LdrpCreateDllSection(), LdrVerifyImageMatchesChecksum(), LockFile(), LogfBackupFile(), LogfCreate(), LogfpFlushFile(), LogfpReadFile(), LogfpSetFileSize(), LogfpWriteFile(), main(), MakeBeep(), MapFile(), MmCheckSystemImage(), MmLoadSystemImage(), MountMgrNotifyNameChange(), MountMgrValidateBackPointer(), MountMgrVolumeMountPointChanged(), MoveFileWithProgressW(), MyDeleteFile(), NdisOpenFile(), NpCheckClientPipe_(), NpCheckServerPipe_(), NpControlPipe(), NpCreatePipeEx(), NpOpenPipeEx(), NpQueryPipe_(), NpReadPipe(), NpWaitPipe(), NpWritePipe(), nt_mailslot_test(), NtLockFile(), NtNotifyChangeDirectoryFile(), NtQueryDirectoryFile(), NtQueryInformationFile(), NtReadFile(), NtSetInformationFile(), NtWriteFile(), OnlineMountedVolumes(), OpenDevice(), OpenDirectory(), OpenDirectoryByHandleOrPath(), OpenFile(), OpenRemoteDatabase(), PciGetDeviceCapabilities(), PciQueryForPciBusInterface(), PciSendIoctl(), PopAddRemoveSysCapsCallback(), PopFlushVolumeWorker(), PopSendQuerySystemPowerState(), PopSendSetSystemPowerState(), PrivMoveFileIdentityW(), ProtectBootIni(), PsLocateSystemDll(), QueryDeviceInformation(), QueryFileInfo(), QuerySuggestedLinkName(), QueryVolumeName(), RawQueryFsSizeInfo(), ReadBlock(), ReadConsoleInput(), ReadDirectoryChangesW(), ReconcileThisDatabaseWithMasterWorker(), RegisterUncProvider(), RegNotifyChangeKeyValue(), RegRestoreKeyW(), RegSaveKeyW(), RemoveDirectoryW(), ReplaceFileW(), RosSymZwReadFile(), RosSymZwSeekFile(), RtlCreateBootStatusDataFile(), RtlCreateSystemVolumeInformationFolder(), RtlGetSetBootStatusData(), RtlLockBootStatusData(), RtlpMapFile(), RtlpSysVolTakeOwnership(), RtlpWorkerThreadProc(), RtlSetCurrentDirectory_U(), RtlSetIoCompletionCallback(), RtlUnlockBootStatusData(), SaveBootSector(), SdbpOpenMemMappedFile(), SendIoctl(), SendLinkCreated(), SendLinkDeleted(), SendOnlineNotification(), SetAttributesOnFile(), SetConsoleCursorInfo(), SetConsoleCursorPosition(), SetConsoleOutputCP(), SetConsoleTextAttribute(), SetEndOfFile(), SetFileAttributesByHandle(), SetFileAttributesW(), SetFileInformationByHandle(), SetFilePointer(), SetFilePointerEx(), SetFileShortNameW(), SetFileTime(), SetFileValidData(), SetLastWriteTime(), SetupCopyFile(), SetupCreateSingleDirectory(), SetVolumeLabelW(), SimpleErrorChecks(), SmpCreateVolumeDescriptors(), SmpDeletePagingFile(), SmpGetPagingFileSize(), SmpGetVolumeFreeSpace(), SmpInitializeKnownDllsInternal(), SmpProcessFileRenames(), SpeakerInitialize(), SpiSendInquiry(), START_TEST(), StreamClassRWCompletion(), TCPSendIoctl(), TdiCall(), Test_ImageSection(), Test_ImageSection2(), TestFileFsAttributeInformation(), TestFileFsDeviceInformation(), TestFileFsVolumeInformation(), TestFileInfo(), TestIoCreateFile(), TestKM(), TestSymlinks(), TestVolumeInfo(), TruncateRemoteDatabase(), UnprotectBootIni(), USBH_EnableParentPort(), USBH_GetPortStatus(), USBH_SyncGetDeviceHandle(), USBH_SyncGetHubCount(), USBH_SyncGetRootHubPdo(), USBH_SyncSubmitUrb(), USBPORT_IsCompanionController(), USBPORT_QueryPciBusInterface(), UserModeTest(), VfatFlushVolume(), VfatSetRenameInformation(), VideoPortCheckForDeviceExistence(), W32kOpenFile(), WahCreateSocketHandle(), WahOpenHandleHelper(), WaitNamedPipeW(), WdmAudOpenSysAudioDevice(), WIN32read(), WIN32write(), WriteConsole(), WriteConsoleOutputCharacterA(), WriteConsoleOutputCharacterW(), WriteRemoteDatabaseEntry(), WSPCloseSocket(), xHalExamineMBR(), xHalGetPartialGeometry(), xHalIoReadPartitionTable(), xHalIoSetPartitionInformation(), xHalIoWritePartitionTable(), and xOpenFile().

Definition at line 76 of file pipe.c.

Definition at line 75 of file pipe.c.

BOOL open_succeeded
static

Definition at line 326 of file pipe.c.

Referenced by test_alertable(), test_nonalertable(), and thread().

Definition at line 68 of file pipe.c.

Definition at line 76 of file pipe.c.

Definition at line 68 of file pipe.c.

Referenced by create_overlapped_pipe().

Definition at line 68 of file pipe.c.

Referenced by _wsopen_s(), sc_cb_open(), and test_create().

Definition at line 78 of file pipe.c.

const WCHAR testpipe[]
static
Initial value:
= { '\\', '\\', '.', '\\', 'p', 'i', 'p', 'e', '\\',
't', 'e', 's', 't', 'p', 'i', 'p', 'e', 0 }

Definition at line 107 of file pipe.c.

Referenced by test_create(), test_filepipeinfo(), test_overlapped(), and thread().

const WCHAR testpipe_nt[]
static
Initial value:
= { '\\', '?', '?', '\\', 'p', 'i', 'p', 'e', '\\',
't', 'e', 's', 't', 'p', 'i', 'p', 'e', 0 }

Definition at line 109 of file pipe.c.

Referenced by create_pipe(), test_create_invalid(), and test_filepipeinfo().

BOOL userapc_called
static

Definition at line 320 of file pipe.c.

Referenced by test_alertable(), test_nonalertable(), thread(), and userapc().