ReactOS 0.4.15-dev-8109-gd7be748
NpfsHelpers.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite Helper functions for NPFS tests
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8#include <kmt_test.h>
9#include "npfs.h"
10
13 OUT PHANDLE ServerHandle,
14 IN PCWSTR PipePath,
15 IN ULONG ReadMode,
16 IN ULONG CompletionMode,
17 IN ULONG NamedPipeType,
19 IN ULONG MaximumInstances,
20 IN ULONG InboundQuota,
21 IN ULONG OutboundQuota,
25 IN PLARGE_INTEGER DefaultTimeout OPTIONAL)
26{
32
37 NULL,
38 NULL);
39
40 Params.NamedPipeType = NamedPipeType;
41 Params.ReadMode = ReadMode;
42 Params.CompletionMode = CompletionMode;
43 Params.MaximumInstances = MaximumInstances;
44 Params.InboundQuota = InboundQuota;
45 Params.OutboundQuota = OutboundQuota;
46 if (DefaultTimeout)
47 {
48 Params.DefaultTimeout.QuadPart = DefaultTimeout->QuadPart;
49 Params.TimeoutSpecified = TRUE;
50 }
51 else
52 {
53 Params.DefaultTimeout.QuadPart = 0;
54 Params.TimeoutSpecified = FALSE;
55 }
56
58 Status = IoCreateFile(ServerHandle,
62 NULL, /* AllocationSize */
63 0, /* FileAttributes */
67 NULL, /* EaBuffer */
68 0, /* EaLength */
70 &Params,
71 0);
72 if (NT_SUCCESS(Status))
73 {
76 }
77 else
78 {
79 ok_eq_hex(IoStatusBlock.Status, 0x55555555UL);
80 ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL);
81 }
82 return Status;
83}
84
87 OUT PHANDLE ServerHandle,
88 PCWSTR PipePath,
89 ULONG ReadMode,
90 ULONG CompletionMode,
91 ULONG NamedPipeType,
92 ULONG NamedPipeConfiguration,
93 ULONG MaximumInstances,
94 ULONG InboundQuota,
95 ULONG OutboundQuota)
96{
98 LARGE_INTEGER DefaultTimeout;
99
100 if (NamedPipeConfiguration == FILE_PIPE_INBOUND)
102 else if (NamedPipeConfiguration == FILE_PIPE_OUTBOUND)
104 else if (NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX)
106 else
107 {
108 ASSERTMSG("Invalid NamedPipeConfiguration parameter value!\n", FALSE);
110 }
111
112 DefaultTimeout.QuadPart = -50 * 1000 * 10;
113
114 return NpCreatePipeEx(ServerHandle,
115 PipePath,
116 ReadMode,
117 CompletionMode,
118 NamedPipeType,
120 MaximumInstances,
121 InboundQuota,
122 OutboundQuota,
126 &DefaultTimeout);
127}
128
131 OUT PHANDLE ClientHandle,
132 IN PCWSTR PipePath,
137{
142
145 &ObjectName,
147 NULL,
148 NULL);
149
151 Status = IoCreateFile(ClientHandle,
155 NULL, /* AllocationSize */
156 0, /* FileAttributes */
160 NULL, /* EaBuffer */
161 0, /* EaLength */
163 NULL,
164 0);
165 if (NT_SUCCESS(Status))
166 {
167 ok(Status != STATUS_PENDING, "IoCreateFile returned pending\n");
170 }
171 else
172 {
173 ok_eq_hex(IoStatusBlock.Status, 0x55555555UL);
174 ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL);
175 }
176 return Status;
177}
178
181 OUT PHANDLE ClientHandle,
182 IN PCWSTR PipePath,
183 IN ULONG NamedPipeConfiguration)
184{
186
187 if (NamedPipeConfiguration == FILE_PIPE_INBOUND)
189 else if (NamedPipeConfiguration == FILE_PIPE_OUTBOUND)
191 else if (NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX)
193 else
194 {
195 ASSERTMSG("Invalid NamedPipeConfiguration parameter value!\n", FALSE);
197 }
198
199 return NpOpenPipeEx(ClientHandle,
200 PipePath,
203 FILE_OPEN,
205}
206
209 IN HANDLE ServerHandle,
213{
216
218 Status = ZwFsControlFile(ServerHandle,
219 NULL,
220 NULL,
221 NULL,
226 NULL,
227 0);
228 if (Status == STATUS_PENDING)
229 {
230 Status = ZwWaitForSingleObject(ServerHandle,
231 FALSE,
232 NULL);
235 }
236 if (NT_SUCCESS(Status))
237 {
240 }
241 else
242 {
243 ok_eq_hex(IoStatusBlock.Status, 0x55555555UL);
244 ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL);
245 }
246 return Status;
247}
248
251 IN PCWSTR PipeName,
253{
255 HANDLE RootHandle;
259 PFILE_PIPE_WAIT_FOR_BUFFER WaitForBuffer;
260 ULONG NameLength;
262
264 &RootDirectoryName,
266 NULL,
267 NULL);
268
270 Status = IoCreateFile(&RootHandle,
274 NULL,
275 0,
277 FILE_OPEN,
279 NULL,
280 0,
282 NULL,
283 0);
284 if (!NT_SUCCESS(Status))
285 {
286 ok_eq_hex(IoStatusBlock.Status, 0x55555555UL);
287 ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL);
288 return Status;
289 }
290 ok(Status != STATUS_PENDING, "IoCreateFile returned pending\n");
293
294 NameLength = (ULONG)(wcslen(PipeName) * sizeof(WCHAR));
296 Name[NameLength / sizeof(WCHAR)]);
297 WaitForBuffer = ExAllocatePoolWithTag(NonPagedPool, BufferSize, 'WPmK');
298 if (WaitForBuffer == NULL)
300
301 if (Timeout)
302 {
303 WaitForBuffer->Timeout.QuadPart = Timeout->QuadPart;
304 WaitForBuffer->TimeoutSpecified = TRUE;
305 }
306 else
307 {
308 WaitForBuffer->Timeout.QuadPart = 0;
309 WaitForBuffer->TimeoutSpecified = FALSE;
310 }
311 WaitForBuffer->NameLength = NameLength;
312 RtlCopyMemory(WaitForBuffer->Name, PipeName, NameLength);
313 Status = NpControlPipe(RootHandle,
315 WaitForBuffer,
316 BufferSize);
317 ExFreePoolWithTag(WaitForBuffer, 'WPmK');
318 return Status;
319}
320
327{
330 BOOLEAN PendingReturned = FALSE;
331
333 Status = ZwReadFile(PipeHandle,
334 NULL,
335 NULL,
336 NULL,
338 Buffer,
340 NULL,
341 NULL);
342 if (Status == STATUS_PENDING)
343 {
344 Status = ZwWaitForSingleObject(PipeHandle,
345 FALSE,
346 NULL);
349 PendingReturned = TRUE;
350 }
351 if (NT_SUCCESS(Status))
352 {
355 }
356 else
357 {
358 if (PendingReturned)
359 {
362 }
363 else
364 {
365 ok_eq_hex(IoStatusBlock.Status, 0x55555555UL);
366 ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL);
367 }
368 *BytesRead = 0;
369 }
370 return Status;
371}
372
376 IN const VOID *Buffer,
379{
382
384 Status = ZwWriteFile(PipeHandle,
385 NULL,
386 NULL,
387 NULL,
389 (PVOID)Buffer,
391 NULL,
392 NULL);
393 if (Status == STATUS_PENDING)
394 {
395 Status = ZwWaitForSingleObject(PipeHandle,
396 FALSE,
397 NULL);
400 }
401 if (NT_SUCCESS(Status))
402 {
405 }
406 else
407 {
408 ok_eq_hex(IoStatusBlock.Status, 0x55555555UL);
409 ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL);
410 *BytesWritten = 0;
411 }
412 return Status;
413}
414
415static
419 SIZE_T Size,
420 UCHAR Value)
421{
422 PUCHAR Array = Buffer;
423 SIZE_T i;
424
425 for (i = 0; i < Size; i++)
426 if (Array[i] != Value)
427 {
428 trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i);
429 return FALSE;
430 }
431 return TRUE;
432}
433
434#define ok_eq_print_(value, expected, spec, FileAndLine) \
435 KmtOk((value) == (expected), FileAndLine, #value " = " spec ", expected " spec "\n", value, expected)
436#define ok_eq_ulong_(value, expected) ok_eq_print_(value, expected, "%lu", FileAndLine)
437#define ok_eq_ulonglong_(value, expected) ok_eq_print_(value, expected, "%I64u", FileAndLine)
438#ifndef _WIN64
439#define ok_eq_ulongptr_(value, expected) ok_eq_print_(value, (ULONG_PTR)(expected), "%lu", FileAndLine)
440#elif defined _WIN64
441#define ok_eq_ulongptr_(value, expected) ok_eq_print_(value, (ULONG_PTR)(expected), "%I64u", FileAndLine)
442#endif
443#define ok_eq_hex_(value, expected) ok_eq_print_(value, expected, "0x%08lx", FileAndLine)
444
445VOID
447 IN HANDLE ServerHandle,
448 /* PipeInformation */
449 IN ULONG ReadMode,
450 IN ULONG CompletionMode,
451 /* PipeLocalInformation */
452 IN ULONG NamedPipeType,
453 IN ULONG NamedPipeConfiguration,
454 IN ULONG MaximumInstances,
455 IN ULONG CurrentInstances,
456 IN ULONG InboundQuota,
457 IN ULONG ReadDataAvailable,
458 IN ULONG OutboundQuota,
459 IN ULONG WriteQuotaAvailable,
460 IN ULONG NamedPipeState,
461 /* PipeRemoteInformation */
462 /* */
463 IN PCSTR FileAndLine)
464{
468 FILE_PIPE_LOCAL_INFORMATION PipeLocalInfo;
469 FILE_PIPE_REMOTE_INFORMATION PipeRemoteInfo;
470
472 RtlFillMemory(&PipeInfo, sizeof(PipeInfo), 0x55);
473 Status = ZwQueryInformationFile(ServerHandle,
475 &PipeInfo,
476 sizeof(PipeInfo),
481 ok_eq_ulong_(PipeInfo.ReadMode, ReadMode);
482 ok_eq_ulong_(PipeInfo.CompletionMode, CompletionMode);
483
485 RtlFillMemory(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55);
486 Status = ZwQueryInformationFile(ServerHandle,
488 &PipeLocalInfo,
489 sizeof(PipeLocalInfo),
493 ok_eq_ulongptr_(IoStatusBlock.Information, sizeof(PipeLocalInfo));
494 ok_eq_ulong_(PipeLocalInfo.NamedPipeType, NamedPipeType);
495 ok_eq_ulong_(PipeLocalInfo.NamedPipeConfiguration, NamedPipeConfiguration);
496 ok_eq_ulong_(PipeLocalInfo.MaximumInstances, MaximumInstances);
497 ok_eq_ulong_(PipeLocalInfo.CurrentInstances, CurrentInstances);
498 ok_eq_ulong_(PipeLocalInfo.InboundQuota, InboundQuota);
499 ok_eq_ulong_(PipeLocalInfo.ReadDataAvailable, ReadDataAvailable);
500 ok_eq_ulong_(PipeLocalInfo.OutboundQuota, OutboundQuota);
501 ok_eq_ulong_(PipeLocalInfo.WriteQuotaAvailable, WriteQuotaAvailable);
502 ok_eq_ulong_(PipeLocalInfo.NamedPipeState, NamedPipeState);
504
506 RtlFillMemory(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55);
507 Status = ZwQueryInformationFile(ServerHandle,
509 &PipeRemoteInfo,
510 sizeof(PipeRemoteInfo),
516 ok_eq_ulong_(PipeRemoteInfo.MaximumCollectionCount, 0x55555555UL);
517}
518
519VOID
521 IN HANDLE ClientHandle,
522 /* PipeInformation */
523 IN ULONG ReadMode,
524 IN ULONG CompletionMode,
525 /* PipeLocalInformation */
526 IN ULONG NamedPipeType,
527 IN ULONG NamedPipeConfiguration,
528 IN ULONG MaximumInstances,
529 IN ULONG CurrentInstances,
530 IN ULONG InboundQuota,
531 IN ULONG ReadDataAvailable,
532 IN ULONG OutboundQuota,
533 IN ULONG WriteQuotaAvailable,
534 IN ULONG NamedPipeState,
535 /* PipeRemoteInformation */
536 /* */
537 IN PCSTR FileAndLine)
538{
542 FILE_PIPE_LOCAL_INFORMATION PipeLocalInfo;
543 FILE_PIPE_REMOTE_INFORMATION PipeRemoteInfo;
544
546 RtlFillMemory(&PipeInfo, sizeof(PipeInfo), 0x55);
547 Status = ZwQueryInformationFile(ClientHandle,
549 &PipeInfo,
550 sizeof(PipeInfo),
555 ok_eq_ulong_(PipeInfo.ReadMode, ReadMode);
556 ok_eq_ulong_(PipeInfo.CompletionMode, CompletionMode);
557
559 RtlFillMemory(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55);
560 Status = ZwQueryInformationFile(ClientHandle,
562 &PipeLocalInfo,
563 sizeof(PipeLocalInfo),
567 ok_eq_ulongptr_(IoStatusBlock.Information, sizeof(PipeLocalInfo));
568 ok_eq_ulong_(PipeLocalInfo.NamedPipeType, NamedPipeType);
569 ok_eq_ulong_(PipeLocalInfo.NamedPipeConfiguration, NamedPipeConfiguration);
570 ok_eq_ulong_(PipeLocalInfo.MaximumInstances, MaximumInstances);
571 ok_eq_ulong_(PipeLocalInfo.CurrentInstances, CurrentInstances);
572 ok_eq_ulong_(PipeLocalInfo.InboundQuota, InboundQuota);
573 ok_eq_ulong_(PipeLocalInfo.ReadDataAvailable, ReadDataAvailable);
574 ok_eq_ulong_(PipeLocalInfo.OutboundQuota, OutboundQuota);
575 ok_eq_ulong_(PipeLocalInfo.WriteQuotaAvailable, WriteQuotaAvailable);
576 ok_eq_ulong_(PipeLocalInfo.NamedPipeState, NamedPipeState);
578
580 RtlFillMemory(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55);
581 Status = ZwQueryInformationFile(ClientHandle,
583 &PipeRemoteInfo,
584 sizeof(PipeRemoteInfo),
590 ok_eq_ulong_(PipeRemoteInfo.MaximumCollectionCount, 0x55555555UL);
591}
592
593VOID
596 IN NTSTATUS ExpectedStatus,
597 IN PCSTR FileAndLine)
598{
602 FILE_PIPE_LOCAL_INFORMATION PipeLocalInfo;
603 FILE_PIPE_REMOTE_INFORMATION PipeRemoteInfo;
604
605 ASSERT(!NT_SUCCESS(ExpectedStatus));
606
608 RtlFillMemory(&PipeInfo, sizeof(PipeInfo), 0x55);
609 Status = ZwQueryInformationFile(PipeHandle,
611 &PipeInfo,
612 sizeof(PipeInfo),
614 ok_eq_hex_(Status, ExpectedStatus);
615 ok_bool_true(CheckBuffer(&IoStatusBlock, sizeof(IoStatusBlock), 0x55), "CheckBuffer returned");
616 ok_bool_true(CheckBuffer(&PipeInfo, sizeof(PipeInfo), 0x55), "CheckBuffer returned");
617
619 RtlFillMemory(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55);
620 Status = ZwQueryInformationFile(PipeHandle,
622 &PipeLocalInfo,
623 sizeof(PipeLocalInfo),
625 ok_eq_hex_(Status, ExpectedStatus);
626 ok_bool_true(CheckBuffer(&IoStatusBlock, sizeof(IoStatusBlock), 0x55), "CheckBuffer returned");
627 ok_bool_true(CheckBuffer(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55), "CheckBuffer returned");
628
630 RtlFillMemory(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55);
631 Status = ZwQueryInformationFile(PipeHandle,
633 &PipeRemoteInfo,
634 sizeof(PipeRemoteInfo),
636 ok_eq_hex_(Status, ExpectedStatus);
637 ok_bool_true(CheckBuffer(&IoStatusBlock, sizeof(IoStatusBlock), 0x55), "CheckBuffer returned");
638 ok_bool_true(CheckBuffer(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55), "CheckBuffer returned");
639}
640
641static KSTART_ROUTINE PipeWorkerThread;
642static
643VOID
644NTAPI
646 IN PVOID ThreadContext)
647{
648 PTHREAD_CONTEXT Context = ThreadContext;
649 PVOID WaitEvents[2] = { &Context->ThreadDoneEvent,
650 &Context->StartWorkEvent };
652
653 while (TRUE)
654 {
656 WaitEvents,
657 WaitAny,
658 Executive,
660 FALSE,
661 NULL,
662 NULL);
663 if (Status == STATUS_WAIT_0)
664 break;
666
667 Context->Work(Context);
668
669 KeSetEvent(&Context->WorkCompleteEvent, IO_NO_INCREMENT, TRUE);
670 }
671}
672
673VOID
676{
679 KeInitializeEvent(&Context->WorkCompleteEvent, NotificationEvent, TRUE);
680
682}
683
684VOID
687{
688 KmtFinishThread(Context->Thread, &Context->ThreadDoneEvent);
689}
690
694 IN ULONG MilliSeconds)
695{
698
699 Timeout.QuadPart = -10 * 1000 * (LONGLONG)MilliSeconds;
700 Status = KeWaitForSingleObject(&Context->WorkCompleteEvent,
701 Executive,
703 FALSE,
704 &Timeout);
705 ok(Status == STATUS_SUCCESS || Status == STATUS_TIMEOUT, "Wait status %lx\n", Status);
706 return Status != STATUS_TIMEOUT;
707}
708
712 IN ULONG MilliSeconds)
713{
715
716 Status = KeWaitForSingleObject(&Context->WorkCompleteEvent,
717 Executive,
719 FALSE,
720 NULL);
722 KeClearEvent(&Context->WorkCompleteEvent);
723 KeSetEvent(&Context->StartWorkEvent, IO_NO_INCREMENT, TRUE);
724 return WaitForWork(Context, MilliSeconds);
725}
VOID NpCheckServerPipe_(IN HANDLE ServerHandle, IN ULONG ReadMode, IN ULONG CompletionMode, IN ULONG NamedPipeType, IN ULONG NamedPipeConfiguration, IN ULONG MaximumInstances, IN ULONG CurrentInstances, IN ULONG InboundQuota, IN ULONG ReadDataAvailable, IN ULONG OutboundQuota, IN ULONG WriteQuotaAvailable, IN ULONG NamedPipeState, IN PCSTR FileAndLine)
Definition: NpfsHelpers.c:446
#define ok_eq_ulongptr_(value, expected)
Definition: NpfsHelpers.c:439
NTSTATUS NpCreatePipe(OUT PHANDLE ServerHandle, PCWSTR PipePath, ULONG ReadMode, ULONG CompletionMode, ULONG NamedPipeType, ULONG NamedPipeConfiguration, ULONG MaximumInstances, ULONG InboundQuota, ULONG OutboundQuota)
Definition: NpfsHelpers.c:86
NTSTATUS NpOpenPipeEx(OUT PHANDLE ClientHandle, IN PCWSTR PipePath, IN ACCESS_MASK DesiredAccess, IN ULONG ShareAccess, IN ULONG Disposition, IN ULONG CreateOptions)
Definition: NpfsHelpers.c:130
BOOLEAN WaitForWork(IN PTHREAD_CONTEXT Context, IN ULONG MilliSeconds)
Definition: NpfsHelpers.c:692
NTSTATUS NpOpenPipe(OUT PHANDLE ClientHandle, IN PCWSTR PipePath, IN ULONG NamedPipeConfiguration)
Definition: NpfsHelpers.c:180
NTSTATUS NpCreatePipeEx(OUT PHANDLE ServerHandle, IN PCWSTR PipePath, IN ULONG ReadMode, IN ULONG CompletionMode, IN ULONG NamedPipeType, IN ULONG ShareAccess, IN ULONG MaximumInstances, IN ULONG InboundQuota, IN ULONG OutboundQuota, IN ACCESS_MASK DesiredAccess, IN ULONG Disposition, IN ULONG CreateOptions, IN PLARGE_INTEGER DefaultTimeout OPTIONAL)
Definition: NpfsHelpers.c:12
NTSTATUS NpWritePipe(IN HANDLE PipeHandle, IN const VOID *Buffer, IN ULONG BufferSize, OUT PULONG_PTR BytesWritten)
Definition: NpfsHelpers.c:374
VOID FinishWorkerThread(IN PTHREAD_CONTEXT Context)
Definition: NpfsHelpers.c:685
NTSTATUS NpControlPipe(IN HANDLE ServerHandle, IN ULONG FsControlCode, IN PVOID InputBuffer, IN ULONG InputBufferLength)
Definition: NpfsHelpers.c:208
NTSTATUS NpReadPipe(IN HANDLE PipeHandle, OUT PVOID Buffer, IN ULONG BufferSize, OUT PULONG_PTR BytesRead)
Definition: NpfsHelpers.c:322
BOOLEAN TriggerWork(IN PTHREAD_CONTEXT Context, IN ULONG MilliSeconds)
Definition: NpfsHelpers.c:710
static KSTART_ROUTINE PipeWorkerThread
Definition: NpfsHelpers.c:641
VOID StartWorkerThread(OUT PTHREAD_CONTEXT Context)
Definition: NpfsHelpers.c:674
#define ok_eq_hex_(value, expected)
Definition: NpfsHelpers.c:443
NTSTATUS NpWaitPipe(IN PCWSTR PipeName, IN PLARGE_INTEGER Timeout)
Definition: NpfsHelpers.c:250
#define ok_eq_ulonglong_(value, expected)
Definition: NpfsHelpers.c:437
VOID NpCheckClientPipe_(IN HANDLE ClientHandle, IN ULONG ReadMode, IN ULONG CompletionMode, IN ULONG NamedPipeType, IN ULONG NamedPipeConfiguration, IN ULONG MaximumInstances, IN ULONG CurrentInstances, IN ULONG InboundQuota, IN ULONG ReadDataAvailable, IN ULONG OutboundQuota, IN ULONG WriteQuotaAvailable, IN ULONG NamedPipeState, IN PCSTR FileAndLine)
Definition: NpfsHelpers.c:520
VOID NpQueryPipe_(IN HANDLE PipeHandle, IN NTSTATUS ExpectedStatus, IN PCSTR FileAndLine)
Definition: NpfsHelpers.c:594
#define ok_eq_ulong_(value, expected)
Definition: NpfsHelpers.c:436
static BOOLEAN CheckBuffer(PVOID Buffer, SIZE_T Size, UCHAR Value)
Definition: NpfsHelpers.c:417
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
#define ok_bool_true(value, desc)
Definition: apitest.h:78
#define ok_eq_ulongptr(value, expected)
Definition: apitest.h:71
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define BufferSize
Definition: mmc.h:75
static HANDLE PipeHandle
Definition: dhcpcsvc.c:22
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
Definition: create.c:4147
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define NonPagedPool
Definition: env_spec_w32.h:307
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG FsControlCode
Definition: fltkernel.h:1370
@ FilePipeLocalInformation
Definition: from_kernel.h:85
@ FilePipeInformation
Definition: from_kernel.h:84
#define FILE_OPEN
Definition: from_kernel.h:54
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define FILE_OPEN_IF
Definition: from_kernel.h:56
Status
Definition: gdiplustypes.h:25
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
Definition: glfuncs.h:248
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
PKTHREAD KmtStartThread(IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext OPTIONAL)
VOID KmtFinishThread(IN PKTHREAD Thread OPTIONAL, IN PKEVENT Event OPTIONAL)
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define DEVICE_NAMED_PIPE
Definition: npfs.h:11
#define ULL(a, b)
Definition: format_msg.c:27
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define KernelMode
Definition: asm.h:34
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56
#define FILE_PIPE_FULL_DUPLEX
Definition: iotypes.h:83
#define FILE_PIPE_OUTBOUND
Definition: iotypes.h:82
#define FILE_PIPE_INBOUND
Definition: iotypes.h:81
#define FILE_PIPE_CLIENT_END
Definition: iotypes.h:84
#define FILE_PIPE_SERVER_END
Definition: iotypes.h:85
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SYNCHRONIZE
Definition: nt_native.h:61
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define FILE_CREATED
Definition: nt_native.h:770
#define FILE_OPENED
Definition: nt_native.h:769
#define GENERIC_WRITE
Definition: nt_native.h:90
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
Definition: ntbasedef.h:672
@ NotificationEvent
@ SynchronizationEvent
@ WaitAny
NTSYSAPI NTSTATUS NTAPI ZwFsControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
NTSTATUS NTAPI IoCreateFile(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 Disposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength, IN CREATE_FILE_TYPE CreateFileType, IN PVOID ExtraCreateParameters OPTIONAL, IN ULONG Options)
Definition: file.c:3010
NTSTATUS NTAPI KeWaitForMultipleObjects(IN ULONG Count, IN PVOID Object[], IN WAIT_TYPE WaitType, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL, OUT PKWAIT_BLOCK WaitBlockArray OPTIONAL)
Definition: wait.c:586
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define STATUS_TIMEOUT
Definition: ntstatus.h:81
#define STATUS_WAIT_0
Definition: ntstatus.h:237
#define STATUS_WAIT_1
Definition: ntstatus.h:71
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_INVALID_PARAMETER_6
Definition: ntstatus.h:480
#define STATUS_INVALID_PARAMETER_3
Definition: ntstatus.h:477
static ULONG Timeout
Definition: ping.c:61
#define FSCTL_PIPE_WAIT
Definition: winioctl.h:199
#define STATUS_SUCCESS
Definition: shellext.h:65
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
ULONG NamedPipeConfiguration
Definition: pipe.c:43
LARGE_INTEGER CollectDataTime
Definition: iotypes.h:5916
LARGE_INTEGER Timeout
Definition: winioctl.h:457
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
uint32_t * PULONG_PTR
Definition: typedefs.h:65
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
const char * PCSTR
Definition: typedefs.h:52
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG CreateOptions
Definition: wdfregistry.h:118
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_opt_ PWDF_USB_PIPE_INFORMATION PipeInfo
Definition: wdfusb.h:2543
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
Definition: cmfuncs.h:64
#define IO_NO_INCREMENT
Definition: iotypes.h:598
@ CreateFileTypeNone
Definition: iotypes.h:535
@ CreateFileTypeNamedPipe
Definition: iotypes.h:536
@ Executive
Definition: ketypes.h:415
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180