ReactOS  0.4.14-dev-614-gbfd8a84
fsrtl.c File Reference
#include <ntifs.h>
#include "ntndk.h"
#include "fsrtl_glue.h"
#include "fastio.h"
#include "fsrtl.h"
Include dependency graph for fsrtl.c:

Go to the source code of this file.

Functions

BOOLEAN FsRtlTest_StartTest ()
 
NTSTATUS FsRltTest_WritefileZw (HANDLE fh, PLARGE_INTEGER Offset, ULONG Length, PVOID Buffer, PIO_STATUS_BLOCK pIoStatus)
 
void FsRtlTest_FillBuffer (LARGE_INTEGER Start, ULONG Length, PVOID Buffer)
 
NTSTATUS FsRtlTest_OpenTestFile (PHANDLE Pfh, PFILE_OBJECT *Ppfo)
 
NTSTATUS FsRtlTest_OpenTestDirectory (PHANDLE Pfh, PFILE_OBJECT *Ppfo)
 
NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 
NTSTATUS FsRtlTest_DispatchCreateClose (IN PDEVICE_OBJECT devObj, IN PIRP Irp)
 
VOID FsRtlTest_Unload (IN PDRIVER_OBJECT DriverObject)
 

Function Documentation

◆ DriverEntry()

NTSTATUS DriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 803 of file fsrtl.c.

804 {
806  NTSTATUS mStatus;
807  UNICODE_STRING uniName, uniDOSName;
809 
810  DbgPrint("Loading the FSRTL test driver.\n");
811  DbgBreakPoint();
812 
813  /* register device functions */
817 
818  if (!FsRtlTest_StartTest()) {
819  DbgPrint("FsRtl test failed.\n");
820  } else {
821  DbgPrint("FsRtl test OK.\n");
822  }
823 
824  return STATUS_SUCCESS;
825 }
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define DbgPrint
Definition: loader.c:25
LONG NTSTATUS
Definition: precomp.h:26
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
void DbgBreakPoint()
Definition: mach.c:553
BOOLEAN FsRtlTest_StartTest()
Definition: fsrtl.c:19
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
NTSTATUS FsRtlTest_DispatchCreateClose(IN PDEVICE_OBJECT devObj, IN PIRP Irp)
Definition: fsrtl.c:832
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
VOID FsRtlTest_Unload(IN PDRIVER_OBJECT DriverObject)
Definition: fsrtl.c:843
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ FsRltTest_WritefileZw()

NTSTATUS FsRltTest_WritefileZw ( HANDLE  fh,
PLARGE_INTEGER  Offset,
ULONG  Length,
PVOID  Buffer,
PIO_STATUS_BLOCK  pIoStatus 
)

Definition at line 687 of file fsrtl.c.

687  {
688  NTSTATUS Return;
689 
690  Return = ZwWriteFile(
691  fh,
692  NULL,
693  NULL,
694  NULL,
695  pIoStatus,
696  Buffer,
697  Length,
698  Offset,
699  NULL
700  );
701 
702  return Return;
703 }
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101

Referenced by FsRtlTest_StartTest().

◆ FsRtlTest_DispatchCreateClose()

NTSTATUS FsRtlTest_DispatchCreateClose ( IN PDEVICE_OBJECT  devObj,
IN PIRP  Irp 
)

Definition at line 832 of file fsrtl.c.

833 {
834  DbgPrint(("FsRtl: Open / Close\n"));
835 
836  Irp->IoStatus.Information = 0;
837  Irp->IoStatus.Status = STATUS_SUCCESS;
839 
840  return STATUS_SUCCESS;
841 }
#define DbgPrint
Definition: loader.c:25
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
#define IO_NO_INCREMENT
Definition: iotypes.h:566
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by DriverEntry().

◆ FsRtlTest_FillBuffer()

void FsRtlTest_FillBuffer ( LARGE_INTEGER  Start,
ULONG  Length,
PVOID  Buffer 
)

Definition at line 706 of file fsrtl.c.

706  {
707  ULONG i = 0;
709 
710  for (i=0; i<Length/sizeof(ULONGLONG); i++) {
711  Index[i] = Start.QuadPart + i;
712  }
713 
714  return;
715  }
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
Definition: bufpool.h:45
uint64_t ULONGLONG
Definition: typedefs.h:65
static const UCHAR Index[8]
Definition: usbohci.c:18
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Definition: partlist.h:33
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:390
unsigned int ULONG
Definition: retypes.h:1

◆ FsRtlTest_OpenTestDirectory()

NTSTATUS FsRtlTest_OpenTestDirectory ( PHANDLE  Pfh,
PFILE_OBJECT Ppfo 
)

Definition at line 761 of file fsrtl.c.

761  {
765  NTSTATUS Return;
766 
767  RtlInitUnicodeString(&FileName,L"\\??\\C:\\testdir01");
768 
770  &oa,
771  &FileName,
773  NULL,
774  NULL;
775  );
776 
777  Return = IoCreateFile(Pfh,
779  &oa,
780  &IoStatus,
781  0,
783  0,
784  FILE_OPEN_IF,
786  NULL,
787  0,
789  NULL,
790  0);
791 
792  Return = ObReferenceObjectByHandle(
793  *Pfh,
795  NULL,
796  KernelMode,
797  Ppfo,
798  NULL
799  );
800 }
#define FILE_OPEN_IF
Definition: from_kernel.h:56
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define FILE_DELETE_ON_CLOSE
Definition: constants.h:494
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
struct _FileName FileName
Definition: fatprocs.h:884
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:3009
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231

Referenced by FsRtlTest_StartTest().

◆ FsRtlTest_OpenTestFile()

NTSTATUS FsRtlTest_OpenTestFile ( PHANDLE  Pfh,
PFILE_OBJECT Ppfo 
)

Definition at line 720 of file fsrtl.c.

720  {
724  NTSTATUS Return;
725 
726  RtlInitUnicodeString(&FileName,L"\\??\\C:\\fsrtl.bin");
727 
729  &oa,
730  &FileName,
732  NULL,
733  NULL;
734  );
735 
736  Return = IoCreateFile(Pfh,
738  &oa,
739  &IoStatus,
740  0,
742  0,
745  NULL,
746  0,
748  NULL,
749  0);
750 
751  Return = ObReferenceObjectByHandle(
752  *Pfh,
754  NULL,
755  KernelMode,
756  Ppfo,
757  NULL
758  );
759 }
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define FILE_OVERWRITE_IF
Definition: from_kernel.h:58
#define FILE_DELETE_ON_CLOSE
Definition: constants.h:494
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
struct _FileName FileName
Definition: fatprocs.h:884
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:3009
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231

Referenced by FsRtlTest_StartTest().

◆ FsRtlTest_StartTest()

BOOLEAN FsRtlTest_StartTest ( )

Definition at line 19 of file fsrtl.c.

19  {
20  HANDLE Fh = NULL;
21  PFILE_OBJECT Pfo = NULL;
22 
23  HANDLE DirFh = NULL;
24  PFILE_OBJECT DirPfo = NULL;
25 
26 
28  BOOLEAN Return;
30  LONGLONG i = 0;
31 
32  PCHAR Buffer;
33  PMDL MdlChain = 0;
34 
36  ULONG Length = 0;
37  LARGE_INTEGER OldSize;
38 
39  /* Parameters we are going to use in the test from the FCB */
40  PFSRTL_COMMON_FCB_HEADER FcbHeader;
42  PLARGE_INTEGER ValidDataLength;
44 
45  PDEVICE_OBJECT pRelatedDo = NULL;
46 
47  /* Allocate a 100KB buffer to do IOs */
49 
50  /* ------------------------------------------------------------------------
51  TESTING:
52  BOOLEAN
53  NTAPI
54  FsRtlCopyWrite(IN PFILE_OBJECT FileObject,
55  IN PLARGE_INTEGER FileOffset,
56  IN ULONG Length,
57  IN BOOLEAN Wait,
58  IN ULONG LockKey,
59  OUT PVOID Buffer,
60  OUT PIO_STATUS_BLOCK IoStatus,
61  IN PDEVICE_OBJECT DeviceObject)
62 
63  with Wait = TRUE
64 
65  ------------------------------------------------------------------------ */
66  FsRtlTest_OpenTestFile(&Fh, &Pfo);
67  FSRTL_TEST("Opening Test File.",((Pfo != NULL) && (Fh != NULL)));
68 
69  /* Extract the test variable from the FCB struct */
70  FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext;
71  AllocationSize = &FcbHeader->AllocationSize;
72  ValidDataLength = &FcbHeader->ValidDataLength;
73  FileSize = &FcbHeader->FileSize;
74 
75  /* Try to cache without caching having been initialized. This should fail.*/
76  Length = 10*_1KB;
77  FSRTL_TEST("FsRtlCopyWrite() - No cache map test.",!FsRtlCopyWrite(Pfo,AllocationSize,Length,TRUE,0,Buffer,&IoStatus,NULL));
78 
79  /* We are going to build a 100k file */
80  /* This will inititate caching and build some size */
81  Offset.QuadPart = 0;
82  Length = 100*_1KB;
84  FSRTL_TEST("FsRtlCopyWrite() - Building 100k filesize.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
85  Return = TRUE;
86 
87  /* Extending the file by 1/2 sector, 256 bytes. */
88  Offset.QuadPart = 0x7fffffffffff;
89  Length = 0x100;
91  FSRTL_TEST("FsRtlCopyWrite() - Extending by 1/2 sector.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
92  Return = TRUE;
93 
94  /* Append to the file past the allocation size*/
95  Offset.LowPart = 0xFFFFFFFF;
96  Offset.HighPart = 0xFFFFFFFF;
97  OldSize.QuadPart = FileSize->QuadPart;
98  Length = (ULONG) (AllocationSize->QuadPart -ValidDataLength->QuadPart);
99  FSRTL_TEST("FsRtlCopyWrite() - Testing extending past allocation size",!FsRtlCopyWrite(Pfo,&Offset,Length+1,TRUE,0,Buffer,&IoStatus,NULL));
100  FSRTL_TEST("FsRtlCopyWrite() - Testing extending not past allocation size",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL));
101  FSRTL_TEST("FsRtlCopyWrite() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length)));
102 
103  /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */
104  Offset.QuadPart = 0;
105  Length = 65*_1KB;
106  FSRTL_TEST("FsRtlCopyWrite() - 65KB IO Test",!FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL));
107 
108  /* Try do write a 64kb IO. Maximum IO size for thus function is 64KB */
109  Length = 64*_1KB;
110  FSRTL_TEST("FsRtlCopyWrite() - 64KB IO Test",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL))
111 
112  /* Test the fast Io questionable flag
113  This test fails and should succeed. I am not sure why. When FsRtlCopyWrite() queries the FastIoTable of the related
114  device object, it comes back with no.
115  FcbHeader->IsFastIoPossible = FastIoIsQuestionable;
116  FSRTL_TEST("FastIo is questionable flag",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL))
117  */
118 
119  /* Test the fast Io not possible flag */
121  FSRTL_TEST("FsRtlCopyWrite() - FastIo is not possible flag",!FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL))
122  /* Set the flag back to what it was */
123  FcbHeader->IsFastIoPossible = FastIoIsPossible;
124  FSRTL_TEST("FsRtlCopyWrite() - FastIo is possbile flag",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL))
125 
126  if (Pfo)
127  {
128  ObDereferenceObject(Pfo);
129  Pfo = NULL;
130  }
131 
132  if (Fh)
133  {
134  ZwClose(Fh);
135  Fh = NULL;
136  }
137 
138  /* ------------------------------------------------------------------------
139  TESTING:
140  BOOLEAN
141  NTAPI
142  FsRtlCopyWrite(IN PFILE_OBJECT FileObject,
143  IN PLARGE_INTEGER FileOffset,
144  IN ULONG Length,
145  IN BOOLEAN Wait,
146  IN ULONG LockKey,
147  OUT PVOID Buffer,
148  OUT PIO_STATUS_BLOCK IoStatus,
149  IN PDEVICE_OBJECT DeviceObject)
150 
151  with Wait = FALSE
152 
153  ------------------------------------------------------------------------ */
154 
155  /* We are going to repeat the same bunch of tests but with Wait = FALSE. So we exercise the second part of the function. */
156  FsRtlTest_OpenTestFile(&Fh, &Pfo);
157 
158  /* Extract the test variable from the FCB struct */
159  FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext;
160  AllocationSize = &FcbHeader->AllocationSize;
161  ValidDataLength = &FcbHeader->ValidDataLength;
162  FileSize = &FcbHeader->FileSize;
163 
164  /* Try to cache without caching having been initialized. This should fail.*/
165  Length = 10*_1KB;
166  FSRTL_TEST("FsRtlCopyWrite() - No cache map test. Wait = FALSE",!FsRtlCopyWrite(Pfo,AllocationSize,Length,FALSE,0,Buffer,&IoStatus,NULL));
167 
168  /* We are going to build a 100k file */
169  /* This will inititate caching and build some size */
170  Offset.QuadPart = 0;
171  Length = 100*_1KB;
173  FSRTL_TEST("FsRtlCopyWrite() - Building 100k filesize. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
174  Return = TRUE;
175 
176  /* Extending the file by 1/2 sector, 256 bytes. */
177  Offset.QuadPart = 0x7fffffffffff;
178  Length = 0x100;
180  FSRTL_TEST("FsRtlCopyWrite() - Extending by 1/2 sector. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
181  Return = TRUE;
182 
183  /* Append to the file past the allocation size*/
184  Offset.LowPart = 0xFFFFFFFF;
185  Offset.HighPart = 0xFFFFFFFF;
186  OldSize.QuadPart = FileSize->QuadPart;
187  Length = (ULONG) (AllocationSize->QuadPart -ValidDataLength->QuadPart);
188  FSRTL_TEST("FsRtlCopyWrite() - Testing extending past allocation size Wait = FALSE",!FsRtlCopyWrite(Pfo,&Offset,Length+1,FALSE,0,Buffer,&IoStatus,NULL));
189  FSRTL_TEST("FsRtlCopyWrite() - Testing extending not past allocation size. Wait = FALSE",FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL));
190  FSRTL_TEST("FsRtlCopyWrite() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length)));
191 
192  /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */
193  Offset.QuadPart = 0;
194  Length = 65*_1KB;
195  FSRTL_TEST("FsRtlCopyWrite() - 65KB IO Test. Wait = FALSE",!FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL));
196 
197  /* Try do write a 64kb IO. Maximum IO size for thus function is 64KB */
198  Length = 64*_1KB;
199  FSRTL_TEST("FsRtlCopyWrite() - 64KB IO Test. Wait = FALSE",FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL))
200 
201  /* Test the fast Io questionable flag
202  This test fails and should succeed. I am not sure why. When FsRtlCopyWrite() queries the FastIoTable of the related
203  device object, it comes back with no.
204  FcbHeader->IsFastIoPossible = FastIoIsQuestionable;
205  FSRTL_TEST("FastIo is questionable flag",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL))
206  */
207 
208  /* Test the fast Io not possible flag */
210  FSRTL_TEST("FsRtlCopyWrite() - FastIo is not possible flag. Wait = FALSE",!FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL))
211  /* Set the flag back to what it was */
212  FcbHeader->IsFastIoPossible = FastIoIsPossible;
213  FSRTL_TEST("FsRtlCopyWrite() - FastIo is possbile flag. Wait = FALSE",FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL))
214 
215 
216  /* ------------------------------------------------------------------------------------------
217  TESTING:
218 
219  BOOLEAN
220  NTAPI
221  FsRtlCopyRead(IN PFILE_OBJECT FileObject,
222  IN PLARGE_INTEGER FileOffset,
223  IN ULONG Length,
224  IN BOOLEAN Wait,
225  IN ULONG LockKey,
226  OUT PVOID Buffer,
227  OUT PIO_STATUS_BLOCK IoStatus,
228  IN PDEVICE_OBJECT DeviceObject)
229 
230  ------------------------------------------------------------------------------------------ */
231 
232  Offset.LowPart = 0x0;
233  Offset.HighPart = 0x0;
234  Length = 0x10000;
235 
236  /* Testing a 64KB read with Wait = TRUE */
237  Return = FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL);
238  FSRTL_TEST("FsRtlCopyRead() - Testing 64k IO Wait=TRUE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
239  Return = TRUE;
240 
241  /* Testing a 64KB read with Wait = FALSE */
242  Return = FsRtlCopyRead(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL);
243  FSRTL_TEST("FsRtlCopyRead() - Testing 64k IO Wait=FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
244  Return = TRUE;
245 
246  /* Testing read past the end of the file */
247  Offset.QuadPart = FileSize->QuadPart - (5 * _1KB);
248  Length = 10 * _1KB;
249  Return = FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL);
250  FSRTL_TEST("FsRtlCopyRead() - Testing reading past end of file but starting before EOF",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status) && IoStatus.Information == (FileSize->QuadPart-Offset.QuadPart)));
251 
252  Offset.QuadPart = FileSize->QuadPart + 1;
253  Length = 10 * _1KB;
254  Return = FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL);
255  FSRTL_TEST("FsRtlCopyRead() - Testing reading past end of file but starting after EOF",(NT_SUCCESS(Return) && (IoStatus.Status == STATUS_END_OF_FILE) && IoStatus.Information == 0));
256 
257 
258  /* Testing a 64KB read with Wait = TRUE */
259  Offset.LowPart = 0x0;
260  Offset.HighPart = 0x0;
261  Length = 0x10000;
263  FSRTL_TEST("FsRtlCopyRead() - FastIo is not possible flag. Wait = FALSE",!FsRtlCopyRead(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL));
264  FSRTL_TEST("FsRtlCopyRead() - FastIo is not possible flag. Wait = TRUE",!FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL));
265  FcbHeader->IsFastIoPossible = FastIoIsPossible;
266  Return = TRUE;
267 
268  if (Pfo)
269  {
270  ObDereferenceObject(Pfo);
271  Pfo = NULL;
272  }
273 
274  if (Fh)
275  {
276  ZwClose(Fh);
277  Fh = NULL;
278  }
279 
280  /* ------------------------------------------------------------------------
281  TESTING:
282  BOOLEAN
283  NTAPI
284  FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject,
285  IN PLARGE_INTEGER FileOffset,
286  IN ULONG Length,
287  IN ULONG LockKey,
288  OUT PMDL *MdlChain,
289  OUT PIO_STATUS_BLOCK IoStatus,
290  IN PDEVICE_OBJECT DeviceObject)
291 
292  ------------------------------------------------------------------------ */
293 
294  /* We are going to repeat the same bunch of tests but with Wait = FALSE. So we exercise the second part of the function. */
295  FsRtlTest_OpenTestFile(&Fh, &Pfo);
296 
297  /* Extract the test variable from the FCB struct */
298  FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext;
299  AllocationSize = &FcbHeader->AllocationSize;
300  ValidDataLength = &FcbHeader->ValidDataLength;
301  FileSize = &FcbHeader->FileSize;
302 
303  /* Try to cache without caching having been initialized. This should fail.*/
304  Length = 10*_1KB;
305  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - No cache map test. Wait = FALSE",
307 
308  /* We are going to build a 100k file */
309  /* This will inititate caching and build some size */
310  Offset.QuadPart = 0;
311  Length = 100*_1KB;
313  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Building 100k filesize. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
314  Return = TRUE;
315 
316  /* Extending the file by 1/2 sector, 256 bytes. */
317  Offset.QuadPart = 0x7fffffffffff;
318  Length = 0x100;
320  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Extending by 1/2 sector. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
321  Return = TRUE;
322 
323 
324  pRelatedDo = IoGetRelatedDeviceObject(Pfo);
325  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Did we get related DO ?",pRelatedDo);
326 
327 
328  /* Append to the file past the allocation size*/
329  Offset.QuadPart = FileSize->QuadPart;
330  OldSize.QuadPart = FileSize->QuadPart;
331  Length = (ULONG) (AllocationSize->QuadPart -ValidDataLength->QuadPart);
332  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Testing extending past allocation size.",
333  !FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length+1,0,&MdlChain,&IoStatus,pRelatedDo));
334 
335  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Testing extending not past allocation size.",
336  FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,pRelatedDo));
337  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length)));
338  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Release the MDL.",FsRtlMdlWriteCompleteDev(Pfo,&Offset,MdlChain,pRelatedDo));
339 
340 
341  /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */
342  Offset.QuadPart = 0;
343  MdlChain = NULL;
344  Length = 65*_1KB;
345  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - 65KB IO Test.",
346  FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,pRelatedDo));
347  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Release the MDL.",FsRtlMdlWriteCompleteDev(Pfo,&Offset,MdlChain,pRelatedDo));
348 
349  /* Try do write a 64kb IO. Maximum IO size for thus function is 64KB */
350  Length = 64*_1KB;
351  MdlChain = NULL;
352  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - 64KB IO Test.",
354  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Release the MDL.",FsRtlMdlWriteCompleteDev(Pfo,&Offset,MdlChain,NULL));
355 
356  /* Test the fast Io not possible flag */
358  FSRTL_TEST("FsRtlPrepareMdlWriteDev() - FastIo is not possible flag.",
360 
361  if (Pfo)
362  {
363  ObDereferenceObject(Pfo);
364  Pfo = NULL;
365  }
366 
367  if (Fh)
368  {
369  ZwClose(Fh);
370  Fh = NULL;
371  }
372 
373  /* ------------------------------------------------------------------------
374  TESTING:
375  BOOLEAN
376  NTAPI
377  FsRtlPrepareMdlWrite( IN PFILE_OBJECT FileObject,
378  IN PLARGE_INTEGER FileOffset,
379  IN ULONG Length,
380  IN ULONG LockKey,
381  OUT PMDL *MdlChain,
382  OUT PIO_STATUS_BLOCK IoStatus,
383  IN PDEVICE_OBJECT DeviceObject)
384 
385  ------------------------------------------------------------------------ */
386 
387  /* We are going to repeat the same bunch of tests but with Wait = FALSE. So we exercise the second part of the function. */
388  FsRtlTest_OpenTestFile(&Fh, &Pfo);
389 
390  /* Extract the test variable from the FCB struct */
391  FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext;
392  AllocationSize = &FcbHeader->AllocationSize;
393  ValidDataLength = &FcbHeader->ValidDataLength;
394  FileSize = &FcbHeader->FileSize;
395 
396  /* Try to cache without caching having been initialized. This should fail.*/
397  Length = 10*_1KB;
398  FSRTL_TEST("FsRtlPrepareMdlWrite() - No cache map test. Wait = FALSE",
400 
401  /* We are going to build a 100k file */
402  /* This will inititate caching and build some size */
403  Offset.QuadPart = 0;
404  Length = 100*_1KB;
406  FSRTL_TEST("FsRtlPrepareMdlWrite() - Building 100k filesize. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
407  Return = TRUE;
408 
409  /* Extending the file by 1/2 sector, 256 bytes. */
410  Offset.QuadPart = 0x7fffffffffff;
411  Length = 0x100;
413  FSRTL_TEST("FsRtlPrepareMdlWrite() - Extending by 1/2 sector. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
414  Return = TRUE;
415 
416 
417  /* Append to the file past the allocation size*/
418  MdlChain = NULL;
419  Offset.QuadPart = FileSize->QuadPart;
420  OldSize.QuadPart = FileSize->QuadPart;
421  Length = (ULONG) (AllocationSize->QuadPart -ValidDataLength->QuadPart);
422  FSRTL_TEST("FsRtlPrepareMdlWrite() - Testing extending past allocation size.",
424 
425  FSRTL_TEST("FsRtlPrepareMdlWrite() - Testing extending not past allocation size.",
427  FSRTL_TEST("FsRtlPrepareMdlWrite() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length)));
428  FSRTL_TEST("FsRtlPrepareMdlWrite() - Release the MDL.",FsRtlMdlWriteComplete(Pfo,&Offset,MdlChain));
429 
430 
431  /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */
432  Offset.QuadPart = 0;
433  MdlChain = NULL;
434  Length = 65*_1KB;
435  FSRTL_TEST("FsRtlPrepareMdlWrite() - 65KB IO Test.",
437  //FSRTL_TEST("FsRtlPrepareMdlWrite() - Release the MDL.",FsRtlMdlWriteComplete(Pfo,&Offset,MdlChain));
438 
439  /* Try do write a 64kb IO. Maximum IO size for thus function is 64KB */
440  Length = 64*_1KB;
441  MdlChain = NULL;
442  FSRTL_TEST("FsRtlPrepareMdlWrite() - 64KB IO Test.",
444  FSRTL_TEST("FsRtlPrepareMdlWrite() - Release the MDL.",FsRtlMdlWriteComplete(Pfo,&Offset,MdlChain));
445 
446  /* Test the fast Io not possible flag */
448  FSRTL_TEST("FsRtlPrepareMdlWrite() - FastIo is not possible flag.",
450 
451  if (Pfo)
452  {
453  ObDereferenceObject(Pfo);
454  Pfo = NULL;
455  }
456 
457  if (Fh)
458  {
459  ZwClose(Fh);
460  Fh = NULL;
461  }
462 
463  /* ------------------------------------------------------------------------------------------
464  TESTING:
465 
466  FsRtlMdlReadDev(IN PFILE_OBJECT FileObject,
467  IN PLARGE_INTEGER FileOffset,
468  IN ULONG Length,
469  IN ULONG LockKey,
470  OUT PMDL *MdlChain,
471  OUT PIO_STATUS_BLOCK IoStatus,
472  IN PDEVICE_OBJECT DeviceObject)
473 
474  FsRtlMdlReadCompleteDev(IN PFILE_OBJECT FileObject,
475  IN PMDL MemoryDescriptorList,
476  IN PDEVICE_OBJECT DeviceObject)
477 
478  ------------------------------------------------------------------------------------------
479  */
480 
481  FsRtlTest_OpenTestFile(&Fh, &Pfo);
482 
483  /* Extract the test variable from the FCB struct */
484  FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext;
485  AllocationSize = &FcbHeader->AllocationSize;
486  ValidDataLength = &FcbHeader->ValidDataLength;
487  FileSize = &FcbHeader->FileSize;
488 
489 
490  /* We are going to build a 100k file */
491  /* This will inititate caching and build some size */
492  Offset.QuadPart = 0;
493  Length = 100*_1KB;
495  FSRTL_TEST("FsRtlMdlReadDev() - Building 100k filesize.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
496  Return = TRUE;
497 
498 
499  Offset.LowPart = 0x0;
500  Offset.HighPart = 0x0;
501  Length = 0x10000;
502 
503  /* Testing a 64KB read */
504  MdlChain = NULL;
505  Return = FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL);
506  FSRTL_TEST("FsRtlMdlReadDev() - Testing 64k IO",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
507  FSRTL_TEST("FsRtlMdlReadDev() - Releasing the MDL",FsRtlMdlReadCompleteDev(Pfo,MdlChain,NULL));
508 
509 
510  /* Testing read past the end of the file */
511  Offset.QuadPart = FileSize->QuadPart - (5 * _1KB);
512  Length = 10 * _1KB;
513  MdlChain = NULL;
514  Return = FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL);
515  FSRTL_TEST("FsRtlMdlReadDev() - Testing reading past end of file but starting before EOF",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status) && IoStatus.Information == (FileSize->QuadPart-Offset.QuadPart)));
516  FSRTL_TEST("FsRtlMdlReadDev() - Releasing the MDL",FsRtlMdlReadCompleteDev(Pfo,MdlChain,NULL));
517 
518  Offset.QuadPart = FileSize->QuadPart + 1;
519  Length = 10 * _1KB;
520  MdlChain = NULL;
521  Return = FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL);
522  FSRTL_TEST("FsRtlMdlReadDev() - Testing reading past end of file but starting after EOF",(NT_SUCCESS(Return) && (IoStatus.Status == STATUS_END_OF_FILE) && IoStatus.Information == 0));
523 
524  /* Testing FastIoIsNotPossible */
525  Offset.LowPart = 0x0;
526  Offset.HighPart = 0x0;
527  MdlChain = NULL;
528  Length = 0x10000;
530  FSRTL_TEST("FsRtlMdlReadDev() - FastIo is not possible flag. Wait = TRUE",!FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL));
531 
532  Return = TRUE;
533 
534  if (Pfo)
535  {
536  ObDereferenceObject(Pfo);
537  Pfo = NULL;
538  }
539 
540  if (Fh)
541  {
542  ZwClose(Fh);
543  Fh = NULL;
544  }
545 
546  /* ------------------------------------------------------------------------------------------
547  TESTING:
548 
549  FsRtlMdlRead(IN PFILE_OBJECT FileObject,
550  IN PLARGE_INTEGER FileOffset,
551  IN ULONG Length,
552  IN ULONG LockKey,
553  OUT PMDL *MdlChain,
554  OUT PIO_STATUS_BLOCK IoStatus)
555 
556  FsRtlMdlReadComplete(IN PFILE_OBJECT FileObject,
557  IN PMDL MemoryDescriptorList)
558 
559  ------------------------------------------------------------------------------------------
560  */
561 
562  FsRtlTest_OpenTestFile(&Fh, &Pfo);
563 
564  /* Extract the test variable from the FCB struct */
565  FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext;
566  AllocationSize = &FcbHeader->AllocationSize;
567  ValidDataLength = &FcbHeader->ValidDataLength;
568  FileSize = &FcbHeader->FileSize;
569 
570 
571  /* We are going to build a 100k file */
572  /* This will inititate caching and build some size */
573  Offset.QuadPart = 0;
574  Length = 100*_1KB;
576  FSRTL_TEST("FsRtlMdlRead() - Building 100k filesize.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
577  Return = TRUE;
578 
579 
580  Offset.LowPart = 0x0;
581  Offset.HighPart = 0x0;
582  Length = 0x10000;
583 
584  /* Testing a 64KB read */
585  MdlChain = NULL;
586  Return = FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus);
587  FSRTL_TEST("FsRtlMdlRead() - Testing 64k IO",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length));
588  FSRTL_TEST("FsRtlMdlRead() - Releasing the MDL",FsRtlMdlReadComplete(Pfo,MdlChain));
589 
590 
591  /* Testing read past the end of the file */
592  Offset.QuadPart = FileSize->QuadPart - (5 * _1KB);
593  Length = 10 * _1KB;
594  MdlChain = NULL;
595  Return = FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus);
596  FSRTL_TEST("FsRtlMdlRead() - Testing reading past end of file but starting before EOF",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status) && IoStatus.Information == (FileSize->QuadPart-Offset.QuadPart)));
597  FSRTL_TEST("FsRtlMdlRead() - Releasing the MDL",FsRtlMdlReadComplete(Pfo,MdlChain));
598 
599  Offset.QuadPart = FileSize->QuadPart + 1;
600  Length = 10 * _1KB;
601  MdlChain = NULL;
602  Return = FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus);
603  FSRTL_TEST("FsRtlMdlRead() - Testing reading past end of file but starting after EOF",(NT_SUCCESS(Return) && (IoStatus.Status == STATUS_END_OF_FILE) && IoStatus.Information == 0));
604 
605  /* Testing FastIoIsNotPossible */
606  Offset.LowPart = 0x0;
607  Offset.HighPart = 0x0;
608  MdlChain = NULL;
609  Length = 0x10000;
611  FSRTL_TEST("FsRtlMdlRead() - FastIo is not possible flag. Wait = TRUE",!FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus));
612 
613  Return = TRUE;
614 
615  if (Pfo)
616  {
617  ObDereferenceObject(Pfo);
618  Pfo = NULL;
619  }
620 
621  if (Fh)
622  {
623  ZwClose(Fh);
624  Fh = NULL;
625  }
626 
627 
628 
629  /* ------------------------------------------------------------------------------------------
630  TESTING:
631 
632  FsRtlGetFileSize(IN PFILE_OBJECT FileObject,
633  IN OUT PLARGE_INTEGER FileSize)
634 
635  ------------------------------------------------------------------------------------------
636  */
637  FsRtlTest_OpenTestFile(&Fh, &Pfo);
638  FSRTL_TEST("FsRtlGetFileSize() - Opening Test File.",((Pfo != NULL) && (Fh != NULL)));
639 
640  FsRtlTest_OpenTestDirectory(&DirFh, &DirPfo);
641  FSRTL_TEST("FsRtlGetFileSize() - Opening Test Directory.",((DirPfo != NULL) && (DirFh != NULL)));
642 
643  Status = FsRtlGetFileSize(Pfo,&OldSize);
644  FSRTL_TEST("FsRtlGetFileSize() - Get the size of a real file",NT_SUCCESS(Status));
645 
646  Status = FsRtlGetFileSize(DirPfo,&OldSize);
647  FSRTL_TEST("FsRtlGetFileSize() - Get the size of a directory file",(Status == STATUS_FILE_IS_A_DIRECTORY));
648 
649 
650  /* The test if over. Do clean up */
651 
652 Cleanup:
653 
654  if (DirPfo)
655  {
656  ObDereferenceObject(DirPfo);
657  DirPfo = NULL;
658  }
659 
660  if (DirFh)
661  {
662  ZwClose(DirFh);
663  DirFh = NULL;
664  }
665  if (Pfo)
666  {
667  ObDereferenceObject(Pfo);
668  Pfo = NULL;
669  }
670 
671  if (Fh)
672  {
673  ZwClose(Fh);
674  Fh = NULL;
675  }
676 
677  if (Buffer != NULL) {
679  Buffer = NULL;
680  }
681 
682  return Return;
683 
684 }
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
#define STATUS_FILE_IS_A_DIRECTORY
Definition: udferr_usr.h:164
BOOLEAN NTAPI FsRtlMdlReadCompleteDev(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1011
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
BOOLEAN NTAPI FsRtlMdlWriteCompleteDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1198
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
LONG NTSTATUS
Definition: precomp.h:26
#define _1KB
Definition: miarm.h:14
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
Definition: device.c:1539
BOOLEAN NTAPI FsRtlMdlReadComplete(IN PFILE_OBJECT FileObject, IN OUT PMDL MdlChain)
Definition: fastio.c:973
NTSTATUS NTAPI FsRtlGetFileSize(IN PFILE_OBJECT FileObject, IN OUT PLARGE_INTEGER FileSize)
Definition: fastio.c:815
BOOLEAN NTAPI FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG LockKey, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1272
BOOLEAN NTAPI FsRtlPrepareMdlWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG LockKey, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
Definition: fastio.c:1218
#define STATUS_END_OF_FILE
Definition: shellext.h:67
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
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
BOOLEAN NTAPI FsRtlMdlReadDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG LockKey, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1025
int64_t LONGLONG
Definition: typedefs.h:66
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
* PFILE_OBJECT
Definition: iotypes.h:1955
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
LARGE_INTEGER AllocationSize
Definition: env_spec_w32.h:755
static const WCHAR Cleanup[]
Definition: register.c:80
Status
Definition: gdiplustypes.h:24
NTSTATUS FsRtlTest_OpenTestFile(PHANDLE Pfh, PFILE_OBJECT *Ppfo)
Definition: fsrtl.c:720
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:310
NTSTATUS FsRltTest_WritefileZw(HANDLE fh, PLARGE_INTEGER Offset, ULONG Length, PVOID Buffer, PIO_STATUS_BLOCK pIoStatus)
Definition: fsrtl.c:687
BOOLEAN NTAPI FsRtlCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:64
BOOLEAN NTAPI FsRtlCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:264
BOOLEAN NTAPI FsRtlMdlWriteComplete(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
Definition: fastio.c:1153
unsigned int ULONG
Definition: retypes.h:1
LARGE_INTEGER ValidDataLength
Definition: env_spec_w32.h:757
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2938
BOOLEAN NTAPI FsRtlMdlRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG LockKey, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
Definition: fastio.c:921
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
struct _FSRTL_COMMON_FCB_HEADER * PFSRTL_COMMON_FCB_HEADER
LONGLONG QuadPart
Definition: typedefs.h:112
NTSTATUS FsRtlTest_OpenTestDirectory(PHANDLE Pfh, PFILE_OBJECT *Ppfo)
Definition: fsrtl.c:761

Referenced by DriverEntry().

◆ FsRtlTest_Unload()

VOID FsRtlTest_Unload ( IN PDRIVER_OBJECT  DriverObject)

Definition at line 843 of file fsrtl.c.

844 {
845  DbgPrint(("FsRtl: Unloading.\n"));
846 }
#define DbgPrint
Definition: loader.c:25

Referenced by DriverEntry().