3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * PROJECT: ReactOS kernel
22 * FILE: drivers/fs/vfat/create.c
23 * PURPOSE: VFAT Filesystem
24 * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
28 /* INCLUDES *****************************************************************/
33 /* FUNCTIONS *****************************************************************/
35 void vfat8Dot3ToString (PFAT_DIR_ENTRY pEntry
, PUNICODE_STRING NameU
)
41 RtlCopyMemory(cString
, pEntry
->Filename
, 11);
43 if (cString
[0] == 0x05)
48 StringA
.Buffer
= cString
;
49 for (StringA
.Length
= 0;
50 StringA
.Length
< 8 && StringA
.Buffer
[StringA
.Length
] != ' ';
52 StringA
.MaximumLength
= StringA
.Length
;
54 RtlOemStringToUnicodeString(NameU
, &StringA
, FALSE
);
56 if (pEntry
->lCase
& VFAT_CASE_LOWER_BASE
)
58 RtlDowncaseUnicodeString(NameU
, NameU
, FALSE
);
60 if (cString
[8] != ' ')
62 Length
= NameU
->Length
;
63 NameU
->Buffer
+= Length
/ sizeof(WCHAR
);
64 if (!FAT_ENTRY_VOLUME(pEntry
))
66 Length
+= sizeof(WCHAR
);
67 NameU
->Buffer
[0] = L
'.';
71 NameU
->MaximumLength
-= Length
;
73 StringA
.Buffer
= &cString
[8];
74 for (StringA
.Length
= 0;
75 StringA
.Length
< 3 && StringA
.Buffer
[StringA
.Length
] != ' ';
77 StringA
.MaximumLength
= StringA
.Length
;
78 RtlOemStringToUnicodeString(NameU
, &StringA
, FALSE
);
79 if (pEntry
->lCase
& VFAT_CASE_LOWER_EXT
)
81 RtlDowncaseUnicodeString(NameU
, NameU
, FALSE
);
83 NameU
->Buffer
-= Length
/ sizeof(WCHAR
);
84 NameU
->Length
+= Length
;
85 NameU
->MaximumLength
+= Length
;
87 NameU
->Buffer
[NameU
->Length
/ sizeof(WCHAR
)] = 0;
88 DPRINT("'%wZ'\n", NameU
);
92 ReadVolumeLabel (PDEVICE_EXTENSION DeviceExt
, PVPB Vpb
)
94 * FUNCTION: Read the volume label
101 LARGE_INTEGER FileOffset
;
102 UNICODE_STRING NameU
;
104 ULONG EntriesPerPage
;
107 NameU
.Buffer
= Vpb
->VolumeLabel
;
109 NameU
.MaximumLength
= sizeof(Vpb
->VolumeLabel
);
110 *(Vpb
->VolumeLabel
) = 0;
111 Vpb
->VolumeLabelLength
= 0;
113 if (DeviceExt
->Flags
& VCB_IS_FATX
)
115 SizeDirEntry
= sizeof(FATX_DIR_ENTRY
);
116 EntriesPerPage
= FATX_ENTRIES_PER_PAGE
;
120 SizeDirEntry
= sizeof(FAT_DIR_ENTRY
);
121 EntriesPerPage
= FAT_ENTRIES_PER_PAGE
;
124 ExAcquireResourceExclusiveLite (&DeviceExt
->DirResource
, TRUE
);
125 pFcb
= vfatOpenRootFCB (DeviceExt
);
126 ExReleaseResourceLite (&DeviceExt
->DirResource
);
128 FileOffset
.QuadPart
= 0;
129 if (CcMapData(pFcb
->FileObject
, &FileOffset
, PAGE_SIZE
, TRUE
, &Context
, (PVOID
*)&Entry
))
133 if (ENTRY_VOLUME(DeviceExt
, Entry
))
135 /* copy volume label */
136 if (DeviceExt
->Flags
& VCB_IS_FATX
)
138 StringO
.Buffer
= (PCHAR
)Entry
->FatX
.Filename
;
139 StringO
.MaximumLength
= StringO
.Length
= Entry
->FatX
.FilenameLength
;
140 RtlOemStringToUnicodeString(&NameU
, &StringO
, FALSE
);
144 vfat8Dot3ToString (&Entry
->Fat
, &NameU
);
146 Vpb
->VolumeLabelLength
= NameU
.Length
;
149 if (ENTRY_END(DeviceExt
, Entry
))
154 Entry
= (PDIR_ENTRY
)((ULONG_PTR
)Entry
+ SizeDirEntry
);
155 if ((DirIndex
% EntriesPerPage
) == 0)
157 CcUnpinData(Context
);
158 FileOffset
.u
.LowPart
+= PAGE_SIZE
;
159 if (!CcMapData(pFcb
->FileObject
, &FileOffset
, PAGE_SIZE
, TRUE
, &Context
, (PVOID
*)&Entry
))
168 CcUnpinData(Context
);
171 ExAcquireResourceExclusiveLite (&DeviceExt
->DirResource
, TRUE
);
172 vfatReleaseFCB (DeviceExt
, pFcb
);
173 ExReleaseResourceLite (&DeviceExt
->DirResource
);
175 return STATUS_SUCCESS
;
179 FindFile (PDEVICE_EXTENSION DeviceExt
,
181 PUNICODE_STRING FileToFindU
,
182 PVFAT_DIRENTRY_CONTEXT DirContext
,
185 * FUNCTION: Find a file
188 PWCHAR PathNameBuffer
;
189 USHORT PathNameBufferLength
;
191 PVOID Context
= NULL
;
195 UNICODE_STRING PathNameU
;
196 UNICODE_STRING FileToFindUpcase
;
199 DPRINT ("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n",
200 Parent
, FileToFindU
, DirContext
->DirIndex
);
201 DPRINT ("FindFile: Path %wZ)\n",&Parent
->PathNameU
);
203 PathNameBufferLength
= LONGNAME_MAX_LENGTH
* sizeof(WCHAR
);
204 PathNameBuffer
= ExAllocatePool(NonPagedPool
, PathNameBufferLength
+ sizeof(WCHAR
));
208 return STATUS_INSUFFICIENT_RESOURCES
;
211 PathNameU
.Buffer
= PathNameBuffer
;
212 PathNameU
.Length
= 0;
213 PathNameU
.MaximumLength
= PathNameBufferLength
;
215 DirContext
->LongNameU
.Length
= 0;
216 DirContext
->ShortNameU
.Length
= 0;
218 WildCard
= FsRtlDoesNameContainWildCards(FileToFindU
);
220 if (WildCard
== FALSE
)
222 /* if there is no '*?' in the search name, than look first for an existing fcb */
223 RtlCopyUnicodeString(&PathNameU
, &Parent
->PathNameU
);
224 if (!vfatFCBIsRoot(Parent
))
226 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = L
'\\';
227 PathNameU
.Length
+= sizeof(WCHAR
);
229 RtlAppendUnicodeStringToString(&PathNameU
, FileToFindU
);
230 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = 0;
231 rcFcb
= vfatGrabFCBFromTable(DeviceExt
, &PathNameU
);
234 ULONG startIndex
= rcFcb
->startIndex
;
235 if ((rcFcb
->Flags
& FCB_IS_FATX_ENTRY
) && !vfatFCBIsRoot(Parent
))
239 if(startIndex
>= DirContext
->DirIndex
)
241 RtlCopyUnicodeString(&DirContext
->LongNameU
, &rcFcb
->LongNameU
);
242 RtlCopyUnicodeString(&DirContext
->ShortNameU
, &rcFcb
->ShortNameU
);
243 RtlCopyMemory(&DirContext
->DirEntry
, &rcFcb
->entry
, sizeof(DIR_ENTRY
));
244 DirContext
->StartIndex
= rcFcb
->startIndex
;
245 DirContext
->DirIndex
= rcFcb
->dirIndex
;
246 DPRINT("FindFile: new Name %wZ, DirIndex %d (%d)\n",
247 &DirContext
->LongNameU
, DirContext
->DirIndex
, DirContext
->StartIndex
);
248 Status
= STATUS_SUCCESS
;
253 Status
= STATUS_UNSUCCESSFUL
;
255 vfatReleaseFCB(DeviceExt
, rcFcb
);
256 ExFreePool(PathNameBuffer
);
261 /* FsRtlIsNameInExpression need the searched string to be upcase,
262 * even if IgnoreCase is specified */
263 Status
= RtlUpcaseUnicodeString(&FileToFindUpcase
, FileToFindU
, TRUE
);
264 if (!NT_SUCCESS(Status
))
267 ExFreePool(PathNameBuffer
);
273 Status
= DeviceExt
->GetNextDirEntry(&Context
, &Page
, Parent
, DirContext
, First
);
275 if (Status
== STATUS_NO_MORE_ENTRIES
)
279 if (ENTRY_VOLUME(DeviceExt
, &DirContext
->DirEntry
))
281 DirContext
->DirIndex
++;
286 Found
= FsRtlIsNameInExpression(&FileToFindUpcase
, &DirContext
->LongNameU
, TRUE
, NULL
) ||
287 FsRtlIsNameInExpression(&FileToFindUpcase
, &DirContext
->ShortNameU
, TRUE
, NULL
);
291 Found
= FsRtlAreNamesEqual(&DirContext
->LongNameU
, FileToFindU
, TRUE
, NULL
) ||
292 FsRtlAreNamesEqual(&DirContext
->ShortNameU
, FileToFindU
, TRUE
, NULL
);
299 RtlCopyUnicodeString(&PathNameU
, &Parent
->PathNameU
);
300 if (!vfatFCBIsRoot(Parent
))
302 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = L
'\\';
303 PathNameU
.Length
+= sizeof(WCHAR
);
305 RtlAppendUnicodeStringToString(&PathNameU
, &DirContext
->LongNameU
);
306 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = 0;
307 rcFcb
= vfatGrabFCBFromTable(DeviceExt
, &PathNameU
);
310 RtlCopyMemory(&DirContext
->DirEntry
, &rcFcb
->entry
, sizeof(DIR_ENTRY
));
311 vfatReleaseFCB(DeviceExt
, rcFcb
);
314 DPRINT("%d\n", DirContext
->LongNameU
.Length
);
315 DPRINT("FindFile: new Name %wZ, DirIndex %d\n",
316 &DirContext
->LongNameU
, DirContext
->DirIndex
);
320 CcUnpinData(Context
);
322 RtlFreeUnicodeString(&FileToFindUpcase
);
323 ExFreePool(PathNameBuffer
);
324 return STATUS_SUCCESS
;
326 DirContext
->DirIndex
++;
331 CcUnpinData(Context
);
334 RtlFreeUnicodeString(&FileToFindUpcase
);
335 ExFreePool(PathNameBuffer
);
340 VfatOpenFile (PDEVICE_EXTENSION DeviceExt
, PFILE_OBJECT FileObject
, PVFATFCB
* ParentFcb
)
342 * FUNCTION: Opens a file
347 UNICODE_STRING PathNameU
;
350 DPRINT ("VfatOpenFile(%08lx, %08lx, '%wZ')\n", DeviceExt
, FileObject
, &FileObject
->FileName
);
352 if (FileObject
->RelatedFileObject
)
354 DPRINT ("'%wZ'\n", &FileObject
->RelatedFileObject
->FileName
);
356 *ParentFcb
= FileObject
->RelatedFileObject
->FsContext
;
357 (*ParentFcb
)->RefCount
++;
364 if (!DeviceExt
->FatInfo
.FixedMedia
)
366 Status
= VfatBlockDeviceIoControl (DeviceExt
->StorageDevice
,
367 IOCTL_DISK_CHECK_VERIFY
,
374 if (Status
== STATUS_VERIFY_REQUIRED
)
377 PDEVICE_OBJECT DeviceToVerify
;
379 DPRINT ("Media change detected!\n");
380 DPRINT ("Device %p\n", DeviceExt
->StorageDevice
);
382 DeviceToVerify
= IoGetDeviceToVerify (PsGetCurrentThread ());
384 IoSetDeviceToVerify (PsGetCurrentThread (),
386 Status
= IoVerifyVolume (DeviceExt
->StorageDevice
,
389 if (!NT_SUCCESS(Status
))
391 DPRINT ("Status %lx\n", Status
);
399 (*ParentFcb
)->RefCount
++;
402 PathNameU
.Buffer
= Buffer
;
403 PathNameU
.Length
= 0;
404 PathNameU
.MaximumLength
= sizeof(Buffer
);
405 RtlCopyUnicodeString(&PathNameU
, &FileObject
->FileName
);
406 if (PathNameU
.Length
> sizeof(WCHAR
) &&
407 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
) - 1] == L
'\\')
409 PathNameU
.Length
-= sizeof(WCHAR
);
411 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = 0;
413 /* try first to find an existing FCB in memory */
414 DPRINT ("Checking for existing FCB in memory\n");
416 Status
= vfatGetFCBForFile (DeviceExt
, ParentFcb
, &Fcb
, &PathNameU
);
417 if (!NT_SUCCESS (Status
))
419 DPRINT ("Could not make a new FCB, status: %x\n", Status
);
422 if (Fcb
->Flags
& FCB_DELETE_PENDING
)
424 vfatReleaseFCB (DeviceExt
, Fcb
);
425 return STATUS_DELETE_PENDING
;
427 DPRINT ("Attaching FCB to fileObject\n");
428 Status
= vfatAttachFCBToFileObject (DeviceExt
, Fcb
, FileObject
);
429 if (!NT_SUCCESS(Status
))
431 vfatReleaseFCB (DeviceExt
, Fcb
);
437 VfatCreateFile (PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
439 * FUNCTION: Create or open a file
442 PIO_STACK_LOCATION Stack
;
443 PFILE_OBJECT FileObject
;
444 NTSTATUS Status
= STATUS_SUCCESS
;
445 PDEVICE_EXTENSION DeviceExt
;
446 ULONG RequestedDisposition
, RequestedOptions
;
451 BOOLEAN PagingFileCreate
= FALSE
;
452 LARGE_INTEGER AllocationSize
;
454 UNICODE_STRING FileNameU
;
456 /* Unpack the various parameters. */
457 Stack
= IoGetCurrentIrpStackLocation (Irp
);
458 RequestedDisposition
= ((Stack
->Parameters
.Create
.Options
>> 24) & 0xff);
460 Stack
->Parameters
.Create
.Options
& FILE_VALID_OPTION_FLAGS
;
461 PagingFileCreate
= (Stack
->Flags
& SL_OPEN_PAGING_FILE
) ? TRUE
: FALSE
;
462 FileObject
= Stack
->FileObject
;
463 DeviceExt
= DeviceObject
->DeviceExtension
;
465 /* Check their validity. */
466 if (RequestedOptions
& FILE_DIRECTORY_FILE
&&
467 RequestedDisposition
== FILE_SUPERSEDE
)
469 return(STATUS_INVALID_PARAMETER
);
472 /* This a open operation for the volume itself */
473 if (FileObject
->FileName
.Length
== 0 &&
474 FileObject
->RelatedFileObject
== NULL
)
476 if (RequestedDisposition
== FILE_CREATE
||
477 RequestedDisposition
== FILE_OVERWRITE_IF
||
478 RequestedDisposition
== FILE_SUPERSEDE
)
480 return(STATUS_ACCESS_DENIED
);
482 if (RequestedOptions
& FILE_DIRECTORY_FILE
)
484 return(STATUS_NOT_A_DIRECTORY
);
486 pFcb
= DeviceExt
->VolumeFcb
;
487 pCcb
= ExAllocateFromNPagedLookasideList(&VfatGlobalData
->CcbLookasideList
);
490 return (STATUS_INSUFFICIENT_RESOURCES
);
492 RtlZeroMemory(pCcb
, sizeof(VFATCCB
));
493 FileObject
->SectionObjectPointer
= &pFcb
->SectionObjectPointers
;
494 FileObject
->FsContext
= pFcb
;
495 FileObject
->FsContext2
= pCcb
;
498 Irp
->IoStatus
.Information
= FILE_OPENED
;
499 return(STATUS_SUCCESS
);
503 * Check for illegal characters and illegale dot sequences in the file name
505 c
= FileObject
->FileName
.Buffer
+ FileObject
->FileName
.Length
/ sizeof(WCHAR
);
508 while (c
-- > FileObject
->FileName
.Buffer
)
510 if (*c
== L
'\\' || c
== FileObject
->FileName
.Buffer
)
512 if (Dots
&& last
> c
)
514 return(STATUS_OBJECT_NAME_INVALID
);
524 if (*c
!= '\\' && vfatIsLongIllegal(*c
))
526 return(STATUS_OBJECT_NAME_INVALID
);
530 /* Try opening the file. */
531 Status
= VfatOpenFile (DeviceExt
, FileObject
, &ParentFcb
);
534 * If the directory containing the file to open doesn't exist then
537 if (Status
== STATUS_OBJECT_PATH_NOT_FOUND
||
538 Status
== STATUS_INVALID_PARAMETER
||
539 Status
== STATUS_DELETE_PENDING
)
543 vfatReleaseFCB (DeviceExt
, ParentFcb
);
549 * If the file open failed then create the required file
551 if (!NT_SUCCESS (Status
))
553 if (RequestedDisposition
== FILE_CREATE
||
554 RequestedDisposition
== FILE_OPEN_IF
||
555 RequestedDisposition
== FILE_OVERWRITE_IF
||
556 RequestedDisposition
== FILE_SUPERSEDE
)
559 Attributes
= Stack
->Parameters
.Create
.FileAttributes
;
561 vfatSplitPathName(&FileObject
->FileName
, NULL
, &FileNameU
);
562 Status
= VfatAddEntry (DeviceExt
, &FileNameU
, &pFcb
, ParentFcb
, RequestedOptions
,
563 (UCHAR
)(Attributes
& FILE_ATTRIBUTE_VALID_FLAGS
));
564 vfatReleaseFCB (DeviceExt
, ParentFcb
);
565 if (NT_SUCCESS (Status
))
567 vfatAttachFCBToFileObject (DeviceExt
, pFcb
, FileObject
);
569 Irp
->IoStatus
.Information
= FILE_CREATED
;
571 VfatSetAllocationSizeInformation(FileObject
,
574 &Irp
->Overlay
.AllocationSize
);
575 VfatSetExtendedAttributes(FileObject
,
576 Irp
->AssociatedIrp
.SystemBuffer
,
577 Stack
->Parameters
.Create
.EaLength
);
579 if (PagingFileCreate
)
581 pFcb
->Flags
|= FCB_IS_PAGE_FILE
;
591 vfatReleaseFCB (DeviceExt
, ParentFcb
);
599 vfatReleaseFCB (DeviceExt
, ParentFcb
);
601 /* Otherwise fail if the caller wanted to create a new file */
602 if (RequestedDisposition
== FILE_CREATE
)
604 Irp
->IoStatus
.Information
= FILE_EXISTS
;
605 VfatCloseFile (DeviceExt
, FileObject
);
606 return(STATUS_OBJECT_NAME_COLLISION
);
609 pFcb
= FileObject
->FsContext
;
611 if (pFcb
->OpenHandleCount
!= 0)
613 Status
= IoCheckShareAccess(Stack
->Parameters
.Create
.SecurityContext
->DesiredAccess
,
614 Stack
->Parameters
.Create
.ShareAccess
,
616 &pFcb
->FCBShareAccess
,
618 if (!NT_SUCCESS(Status
))
620 VfatCloseFile (DeviceExt
, FileObject
);
626 * Check the file has the requested attributes
628 if (RequestedOptions
& FILE_NON_DIRECTORY_FILE
&&
629 *pFcb
->Attributes
& FILE_ATTRIBUTE_DIRECTORY
)
631 VfatCloseFile (DeviceExt
, FileObject
);
632 return(STATUS_FILE_IS_A_DIRECTORY
);
634 if (RequestedOptions
& FILE_DIRECTORY_FILE
&&
635 !(*pFcb
->Attributes
& FILE_ATTRIBUTE_DIRECTORY
))
637 VfatCloseFile (DeviceExt
, FileObject
);
638 return(STATUS_NOT_A_DIRECTORY
);
641 if (PagingFileCreate
)
644 * Do more checking for page files. It is possible,
645 * that the file was opened and closed previously
646 * as a normal cached file. In this case, the cache
647 * manager has referenced the fileobject and the fcb
648 * is held in memory. Try to remove the fileobject
649 * from cache manager and use the fcb.
651 if (pFcb
->RefCount
> 1)
653 if(!(pFcb
->Flags
& FCB_IS_PAGE_FILE
))
655 VfatCloseFile(DeviceExt
, FileObject
);
656 return(STATUS_INVALID_PARAMETER
);
661 pFcb
->Flags
|= FCB_IS_PAGE_FILE
;
666 if (pFcb
->Flags
& FCB_IS_PAGE_FILE
)
668 VfatCloseFile(DeviceExt
, FileObject
);
669 return(STATUS_INVALID_PARAMETER
);
674 if (RequestedDisposition
== FILE_OVERWRITE
||
675 RequestedDisposition
== FILE_OVERWRITE_IF
)
677 AllocationSize
.QuadPart
= 0;
678 Status
= VfatSetAllocationSizeInformation (FileObject
,
682 if (!NT_SUCCESS (Status
))
684 VfatCloseFile (DeviceExt
, FileObject
);
690 /* Supersede the file */
691 if (RequestedDisposition
== FILE_SUPERSEDE
)
693 LARGE_INTEGER AllocationSize
;
694 AllocationSize
.QuadPart
= 0LL;
695 VfatSetAllocationSizeInformation(FileObject
, pFcb
, DeviceExt
, &AllocationSize
);
696 Irp
->IoStatus
.Information
= FILE_SUPERSEDED
;
698 else if (RequestedDisposition
== FILE_OVERWRITE
|| RequestedDisposition
== FILE_OVERWRITE_IF
)
700 Irp
->IoStatus
.Information
= FILE_OVERWRITTEN
;
704 Irp
->IoStatus
.Information
= FILE_OPENED
;
708 if (pFcb
->OpenHandleCount
== 0)
710 IoSetShareAccess(Stack
->Parameters
.Create
.SecurityContext
->DesiredAccess
,
711 Stack
->Parameters
.Create
.ShareAccess
,
713 &pFcb
->FCBShareAccess
);
719 &pFcb
->FCBShareAccess
724 pFcb
->OpenHandleCount
++;
726 /* FIXME : test write access if requested */
732 NTSTATUS
VfatCreate (PVFAT_IRP_CONTEXT IrpContext
)
734 * FUNCTION: Create or open a file
741 if (IrpContext
->DeviceObject
== VfatGlobalData
->DeviceObject
)
743 /* DeviceObject represents FileSystem instead of logical volume */
744 DPRINT ("FsdCreate called with file system\n");
745 IrpContext
->Irp
->IoStatus
.Information
= FILE_OPENED
;
746 IrpContext
->Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
747 IoCompleteRequest (IrpContext
->Irp
, IO_DISK_INCREMENT
);
748 VfatFreeIrpContext(IrpContext
);
749 return(STATUS_SUCCESS
);
752 if (!(IrpContext
->Flags
& IRPCONTEXT_CANWAIT
))
754 return(VfatQueueRequest (IrpContext
));
757 IrpContext
->Irp
->IoStatus
.Information
= 0;
758 ExAcquireResourceExclusiveLite (&IrpContext
->DeviceExt
->DirResource
, TRUE
);
759 Status
= VfatCreateFile (IrpContext
->DeviceObject
, IrpContext
->Irp
);
760 ExReleaseResourceLite (&IrpContext
->DeviceExt
->DirResource
);
762 IrpContext
->Irp
->IoStatus
.Status
= Status
;
763 IoCompleteRequest (IrpContext
->Irp
,
764 (CCHAR
)(NT_SUCCESS(Status
) ? IO_DISK_INCREMENT
: IO_NO_INCREMENT
));
765 VfatFreeIrpContext(IrpContext
);