198{
202
204
205 DPRINT(
"IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
212
214 Irp->IoStatus.Information = 0;
215
217 {
218 ULONG RequestedDisposition = ((IoStack->Parameters.Create.Options >> 24) & 0xff);
219 ok(RequestedDisposition ==
FILE_CREATE || RequestedDisposition ==
FILE_OPEN,
"Invalid disposition: %lu\n", RequestedDisposition);
220
221 if (IoStack->FileObject->FileName.Length >= 2 *
sizeof(
WCHAR))
222 {
225 }
229 FsRtlSetupAdvancedHeader(&
Fcb->
Header, &
Fcb->HeaderMutex);
230
231
233 {
236 Fcb->
Header.ValidDataLength.QuadPart = 0;
237 }
238 else
239 {
240 Fcb->
Header.AllocationSize.QuadPart = 512;
242 Fcb->
Header.ValidDataLength.QuadPart = 512;
243 }
245
246 DPRINT1(
"File: %wZ\n", &IoStack->FileObject->FileName);
247
248 IoStack->FileObject->FsContext =
Fcb;
250 {
252 }
253
254 if (IoStack->FileObject->FileName.Length == 0 ||
256 {
258
262 }
263
266 }
268 {
273
274 Offset = IoStack->Parameters.Read.ByteOffset;
275 Length = IoStack->Parameters.Read.Length;
277
280
282 {
284 }
286 {
288 }
289 else
290 {
292 {
293 Buffer =
Irp->AssociatedIrp.SystemBuffer;
295
297 {
298 if (IoStack->FileObject->PrivateCacheMap ==
NULL)
299 {
305 }
306
310 }
312 {
314 }
316
318 }
319 else
320 {
321 ok(
Irp->AssociatedIrp.SystemBuffer ==
NULL,
"A SystemBuffer was allocated!\n");
325
327 }
328 }
329
331 {
333 IoStack->FileObject->CurrentByteOffset.QuadPart =
Offset.QuadPart +
Length;
334 }
335 }
337 {
342
343 Offset = IoStack->Parameters.Write.ByteOffset;
344 Length = IoStack->Parameters.Write.Length;
346
349
351 {
353 }
354 else
355 {
357 {
358 Buffer =
Irp->AssociatedIrp.SystemBuffer;
360
362 {
363 if (IoStack->FileObject->PrivateCacheMap ==
NULL)
364 {
369 }
370
373 }
375 {
377 }
379
381 }
382 else
383 {
385
387 ok(
Mdl !=
NULL,
"Null pointer for MDL!\n");
392
394 }
395
397 {
399 {
403
405 {
407 }
408 }
409 }
410 }
411 }
413 {
416 if (IoStack->FileObject->SectionObjectPointer !=
NULL)
417 {
419
420 if (IoStack->FileObject->SectionObjectPointer->DataSectionObject)
421 {
424 }
425
429 }
431 IoStack->FileObject->FsContext =
NULL;
433 }
435 {
437
441
443 {
446
448 {
450 }
451 else
452 {
453 ok(StandardInfo !=
NULL,
"Null pointer!\n");
455
461
464 }
465 }
466 else
467 {
469 }
470 }
472 {
474
478
480 {
483
485 {
487 }
488 else
489 {
491
492 ok(EOFInfo !=
NULL,
"Null pointer!\n");
494 ok_bool_false(IoStack->Parameters.SetFile.AdvanceOnly,
"AdvanceOnly set!\n");
496
497 if (
Fcb->
Header.AllocationSize.QuadPart != 0)
498 {
499 TestSize = 512;
500 }
501
505
507 {
509 }
510
513
515 }
516 }
517 else
518 {
520 }
521 }
522
524 {
528 }
529 else
530 {
533 }
534
536}
static PDEVICE_OBJECT TestDeviceObject
static PFILE_OBJECT TestFileObject
static UNICODE_STRING InitOnCreate
static UNICODE_STRING InitOnRW
static UNICODE_STRING InvalidInit
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
static CACHE_MANAGER_CALLBACKS Callbacks
#define ok_eq_pointer(value, expected)
#define ok_eq_ulong(value, expected)
#define ok_bool_false(value, desc)
#define ok_bool_true(value, desc)
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
#define CcIsFileCached(FO)
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
@ FileEndOfFileInformation
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
#define RtlFillMemory(Dest, Length, Fill)
#define ExFreePoolWithTag(_P, _T)
#define FILE_STANDARD_INFORMATION
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
BOOLEAN NTAPI CcCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN PVOID Buffer)
BOOLEAN NTAPI CcCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus)
#define IoCompleteRequest
#define _SEH2_GetExceptionCode()
#define FileStandardInformation
#define STATUS_END_OF_FILE
#define STATUS_BUFFER_OVERFLOW
SECTION_OBJECT_POINTERS SectionObjectPointers
FSRTL_ADVANCED_FCB_HEADER Header
#define RtlZeroMemory(Destination, Length)
_In_ PDEVICE_OBJECT DeviceObject
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
#define MDL_SOURCE_IS_NONPAGED_POOL