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.
20 * PROJECT: ReactOS kernel
21 * FILE: drivers/fs/vfat/create.c
22 * PURPOSE: VFAT Filesystem
23 * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
27 /* INCLUDES *****************************************************************/
32 /* FUNCTIONS *****************************************************************/
35 vfat8Dot3ToString (PFAT_DIR_ENTRY pEntry
, PUNICODE_STRING NameU
)
41 RtlCopyMemory(cString
, pEntry
->ShortName
, 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
;
180 PDEVICE_EXTENSION DeviceExt
,
182 PUNICODE_STRING FileToFindU
,
183 PVFAT_DIRENTRY_CONTEXT DirContext
,
186 * FUNCTION: Find a file
189 PWCHAR PathNameBuffer
;
190 USHORT PathNameBufferLength
;
192 PVOID Context
= NULL
;
196 UNICODE_STRING PathNameU
;
197 UNICODE_STRING FileToFindUpcase
;
200 DPRINT ("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n",
201 Parent
, FileToFindU
, DirContext
->DirIndex
);
202 DPRINT ("FindFile: Path %wZ)\n",&Parent
->PathNameU
);
204 PathNameBufferLength
= LONGNAME_MAX_LENGTH
* sizeof(WCHAR
);
205 PathNameBuffer
= ExAllocatePool(NonPagedPool
, PathNameBufferLength
+ sizeof(WCHAR
));
209 return STATUS_INSUFFICIENT_RESOURCES
;
212 PathNameU
.Buffer
= PathNameBuffer
;
213 PathNameU
.Length
= 0;
214 PathNameU
.MaximumLength
= PathNameBufferLength
;
216 DirContext
->LongNameU
.Length
= 0;
217 DirContext
->ShortNameU
.Length
= 0;
219 WildCard
= FsRtlDoesNameContainWildCards(FileToFindU
);
221 if (WildCard
== FALSE
)
223 /* if there is no '*?' in the search name, than look first for an existing fcb */
224 RtlCopyUnicodeString(&PathNameU
, &Parent
->PathNameU
);
225 if (!vfatFCBIsRoot(Parent
))
227 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = L
'\\';
228 PathNameU
.Length
+= sizeof(WCHAR
);
230 RtlAppendUnicodeStringToString(&PathNameU
, FileToFindU
);
231 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = 0;
232 rcFcb
= vfatGrabFCBFromTable(DeviceExt
, &PathNameU
);
235 ULONG startIndex
= rcFcb
->startIndex
;
236 if ((rcFcb
->Flags
& FCB_IS_FATX_ENTRY
) && !vfatFCBIsRoot(Parent
))
240 if(startIndex
>= DirContext
->DirIndex
)
242 RtlCopyUnicodeString(&DirContext
->LongNameU
, &rcFcb
->LongNameU
);
243 RtlCopyUnicodeString(&DirContext
->ShortNameU
, &rcFcb
->ShortNameU
);
244 RtlCopyMemory(&DirContext
->DirEntry
, &rcFcb
->entry
, sizeof(DIR_ENTRY
));
245 DirContext
->StartIndex
= rcFcb
->startIndex
;
246 DirContext
->DirIndex
= rcFcb
->dirIndex
;
247 DPRINT("FindFile: new Name %wZ, DirIndex %d (%d)\n",
248 &DirContext
->LongNameU
, DirContext
->DirIndex
, DirContext
->StartIndex
);
249 Status
= STATUS_SUCCESS
;
254 Status
= STATUS_UNSUCCESSFUL
;
256 vfatReleaseFCB(DeviceExt
, rcFcb
);
257 ExFreePool(PathNameBuffer
);
262 /* FsRtlIsNameInExpression need the searched string to be upcase,
263 * even if IgnoreCase is specified */
264 Status
= RtlUpcaseUnicodeString(&FileToFindUpcase
, FileToFindU
, TRUE
);
265 if (!NT_SUCCESS(Status
))
268 ExFreePool(PathNameBuffer
);
274 Status
= DeviceExt
->GetNextDirEntry(&Context
, &Page
, Parent
, DirContext
, First
);
276 if (Status
== STATUS_NO_MORE_ENTRIES
)
280 if (ENTRY_VOLUME(DeviceExt
, &DirContext
->DirEntry
))
282 DirContext
->DirIndex
++;
287 Found
= FsRtlIsNameInExpression(&FileToFindUpcase
, &DirContext
->LongNameU
, TRUE
, NULL
) ||
288 FsRtlIsNameInExpression(&FileToFindUpcase
, &DirContext
->ShortNameU
, TRUE
, NULL
);
292 Found
= FsRtlAreNamesEqual(&DirContext
->LongNameU
, FileToFindU
, TRUE
, NULL
) ||
293 FsRtlAreNamesEqual(&DirContext
->ShortNameU
, FileToFindU
, TRUE
, NULL
);
300 RtlCopyUnicodeString(&PathNameU
, &Parent
->PathNameU
);
301 if (!vfatFCBIsRoot(Parent
))
303 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = L
'\\';
304 PathNameU
.Length
+= sizeof(WCHAR
);
306 RtlAppendUnicodeStringToString(&PathNameU
, &DirContext
->LongNameU
);
307 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = 0;
308 rcFcb
= vfatGrabFCBFromTable(DeviceExt
, &PathNameU
);
311 RtlCopyMemory(&DirContext
->DirEntry
, &rcFcb
->entry
, sizeof(DIR_ENTRY
));
312 vfatReleaseFCB(DeviceExt
, rcFcb
);
315 DPRINT("%d\n", DirContext
->LongNameU
.Length
);
316 DPRINT("FindFile: new Name %wZ, DirIndex %d\n",
317 &DirContext
->LongNameU
, DirContext
->DirIndex
);
321 CcUnpinData(Context
);
323 RtlFreeUnicodeString(&FileToFindUpcase
);
324 ExFreePool(PathNameBuffer
);
325 return STATUS_SUCCESS
;
327 DirContext
->DirIndex
++;
332 CcUnpinData(Context
);
335 RtlFreeUnicodeString(&FileToFindUpcase
);
336 ExFreePool(PathNameBuffer
);
342 PDEVICE_EXTENSION DeviceExt
,
343 PFILE_OBJECT FileObject
,
344 PVFATFCB
* ParentFcb
)
346 * FUNCTION: Opens a file
351 UNICODE_STRING PathNameU
;
354 DPRINT ("VfatOpenFile(%08lx, %08lx, '%wZ')\n", DeviceExt
, FileObject
, &FileObject
->FileName
);
356 if (FileObject
->RelatedFileObject
)
358 DPRINT ("'%wZ'\n", &FileObject
->RelatedFileObject
->FileName
);
360 *ParentFcb
= FileObject
->RelatedFileObject
->FsContext
;
361 (*ParentFcb
)->RefCount
++;
368 if (!DeviceExt
->FatInfo
.FixedMedia
)
370 Status
= VfatBlockDeviceIoControl (DeviceExt
->StorageDevice
,
371 IOCTL_DISK_CHECK_VERIFY
,
378 if (Status
== STATUS_VERIFY_REQUIRED
)
381 PDEVICE_OBJECT DeviceToVerify
;
383 DPRINT ("Media change detected!\n");
384 DPRINT ("Device %p\n", DeviceExt
->StorageDevice
);
386 DeviceToVerify
= IoGetDeviceToVerify (PsGetCurrentThread ());
388 IoSetDeviceToVerify (PsGetCurrentThread (),
390 Status
= IoVerifyVolume (DeviceExt
->StorageDevice
,
393 if (!NT_SUCCESS(Status
))
395 DPRINT ("Status %lx\n", Status
);
403 (*ParentFcb
)->RefCount
++;
406 PathNameU
.Buffer
= Buffer
;
407 PathNameU
.Length
= 0;
408 PathNameU
.MaximumLength
= sizeof(Buffer
);
409 RtlCopyUnicodeString(&PathNameU
, &FileObject
->FileName
);
410 if (PathNameU
.Length
> sizeof(WCHAR
) &&
411 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
) - 1] == L
'\\')
413 PathNameU
.Length
-= sizeof(WCHAR
);
415 PathNameU
.Buffer
[PathNameU
.Length
/ sizeof(WCHAR
)] = 0;
417 /* try first to find an existing FCB in memory */
418 DPRINT ("Checking for existing FCB in memory\n");
420 Status
= vfatGetFCBForFile (DeviceExt
, ParentFcb
, &Fcb
, &PathNameU
);
421 if (!NT_SUCCESS (Status
))
423 DPRINT ("Could not make a new FCB, status: %x\n", Status
);
426 if (Fcb
->Flags
& FCB_DELETE_PENDING
)
428 vfatReleaseFCB (DeviceExt
, Fcb
);
429 return STATUS_DELETE_PENDING
;
431 DPRINT ("Attaching FCB to fileObject\n");
432 Status
= vfatAttachFCBToFileObject (DeviceExt
, Fcb
, FileObject
);
433 if (!NT_SUCCESS(Status
))
435 vfatReleaseFCB (DeviceExt
, Fcb
);
441 VfatCreateFile ( PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
443 * FUNCTION: Create or open a file
446 PIO_STACK_LOCATION Stack
;
447 PFILE_OBJECT FileObject
;
448 NTSTATUS Status
= STATUS_SUCCESS
;
449 PDEVICE_EXTENSION DeviceExt
;
450 ULONG RequestedDisposition
, RequestedOptions
;
452 PVFATFCB pFcb
= NULL
;
455 BOOLEAN PagingFileCreate
= FALSE
;
456 LARGE_INTEGER AllocationSize
;
458 UNICODE_STRING FileNameU
;
460 /* Unpack the various parameters. */
461 Stack
= IoGetCurrentIrpStackLocation (Irp
);
462 RequestedDisposition
= ((Stack
->Parameters
.Create
.Options
>> 24) & 0xff);
464 Stack
->Parameters
.Create
.Options
& FILE_VALID_OPTION_FLAGS
;
465 PagingFileCreate
= (Stack
->Flags
& SL_OPEN_PAGING_FILE
) ? TRUE
: FALSE
;
466 FileObject
= Stack
->FileObject
;
467 DeviceExt
= DeviceObject
->DeviceExtension
;
469 /* Check their validity. */
470 if (RequestedOptions
& FILE_DIRECTORY_FILE
&&
471 RequestedDisposition
== FILE_SUPERSEDE
)
473 return(STATUS_INVALID_PARAMETER
);
476 /* This a open operation for the volume itself */
477 if (FileObject
->FileName
.Length
== 0 &&
478 FileObject
->RelatedFileObject
== NULL
)
480 if (RequestedDisposition
== FILE_CREATE
||
481 RequestedDisposition
== FILE_OVERWRITE_IF
||
482 RequestedDisposition
== FILE_SUPERSEDE
)
484 return(STATUS_ACCESS_DENIED
);
486 if (RequestedOptions
& FILE_DIRECTORY_FILE
)
488 return(STATUS_NOT_A_DIRECTORY
);
490 pFcb
= DeviceExt
->VolumeFcb
;
491 pCcb
= ExAllocateFromNPagedLookasideList(&VfatGlobalData
->CcbLookasideList
);
494 return (STATUS_INSUFFICIENT_RESOURCES
);
496 RtlZeroMemory(pCcb
, sizeof(VFATCCB
));
497 FileObject
->SectionObjectPointer
= &pFcb
->SectionObjectPointers
;
498 FileObject
->FsContext
= pFcb
;
499 FileObject
->FsContext2
= pCcb
;
502 Irp
->IoStatus
.Information
= FILE_OPENED
;
503 return(STATUS_SUCCESS
);
507 * Check for illegal characters and illegale dot sequences in the file name
509 c
= FileObject
->FileName
.Buffer
+ FileObject
->FileName
.Length
/ sizeof(WCHAR
);
512 while (c
-- > FileObject
->FileName
.Buffer
)
514 if (*c
== L
'\\' || c
== FileObject
->FileName
.Buffer
)
516 if (Dots
&& last
> c
)
518 return(STATUS_OBJECT_NAME_INVALID
);
528 if (*c
!= '\\' && vfatIsLongIllegal(*c
))
530 return(STATUS_OBJECT_NAME_INVALID
);
534 /* Try opening the file. */
535 Status
= VfatOpenFile (DeviceExt
, FileObject
, &ParentFcb
);
538 * If the directory containing the file to open doesn't exist then
541 if (Status
== STATUS_OBJECT_PATH_NOT_FOUND
||
542 Status
== STATUS_INVALID_PARAMETER
||
543 Status
== STATUS_DELETE_PENDING
)
547 vfatReleaseFCB (DeviceExt
, ParentFcb
);
553 * If the file open failed then create the required file
555 if (!NT_SUCCESS (Status
))
557 if (RequestedDisposition
== FILE_CREATE
||
558 RequestedDisposition
== FILE_OPEN_IF
||
559 RequestedDisposition
== FILE_OVERWRITE_IF
||
560 RequestedDisposition
== FILE_SUPERSEDE
)
563 Attributes
= Stack
->Parameters
.Create
.FileAttributes
;
565 vfatSplitPathName(&FileObject
->FileName
, NULL
, &FileNameU
);
566 Status
= VfatAddEntry (DeviceExt
, &FileNameU
, &pFcb
, ParentFcb
, RequestedOptions
,
567 (UCHAR
)(Attributes
& FILE_ATTRIBUTE_VALID_FLAGS
));
568 vfatReleaseFCB (DeviceExt
, ParentFcb
);
569 if (NT_SUCCESS (Status
))
571 Status
= vfatAttachFCBToFileObject (DeviceExt
, pFcb
, FileObject
);
572 if ( !NT_SUCCESS(Status
) )
574 vfatReleaseFCB (DeviceExt
, pFcb
);
578 Irp
->IoStatus
.Information
= FILE_CREATED
;
580 VfatSetAllocationSizeInformation(FileObject
,
583 &Irp
->Overlay
.AllocationSize
);
584 VfatSetExtendedAttributes(FileObject
,
585 Irp
->AssociatedIrp
.SystemBuffer
,
586 Stack
->Parameters
.Create
.EaLength
);
588 if (PagingFileCreate
)
590 pFcb
->Flags
|= FCB_IS_PAGE_FILE
;
600 vfatReleaseFCB (DeviceExt
, ParentFcb
);
608 vfatReleaseFCB (DeviceExt
, ParentFcb
);
610 /* Otherwise fail if the caller wanted to create a new file */
611 if (RequestedDisposition
== FILE_CREATE
)
613 Irp
->IoStatus
.Information
= FILE_EXISTS
;
614 VfatCloseFile (DeviceExt
, FileObject
);
615 return(STATUS_OBJECT_NAME_COLLISION
);
618 pFcb
= FileObject
->FsContext
;
620 if (pFcb
->OpenHandleCount
!= 0)
622 Status
= IoCheckShareAccess(Stack
->Parameters
.Create
.SecurityContext
->DesiredAccess
,
623 Stack
->Parameters
.Create
.ShareAccess
,
625 &pFcb
->FCBShareAccess
,
627 if (!NT_SUCCESS(Status
))
629 VfatCloseFile (DeviceExt
, FileObject
);
635 * Check the file has the requested attributes
637 if (RequestedOptions
& FILE_NON_DIRECTORY_FILE
&&
638 *pFcb
->Attributes
& FILE_ATTRIBUTE_DIRECTORY
)
640 VfatCloseFile (DeviceExt
, FileObject
);
641 return(STATUS_FILE_IS_A_DIRECTORY
);
643 if (RequestedOptions
& FILE_DIRECTORY_FILE
&&
644 !(*pFcb
->Attributes
& FILE_ATTRIBUTE_DIRECTORY
))
646 VfatCloseFile (DeviceExt
, FileObject
);
647 return(STATUS_NOT_A_DIRECTORY
);
650 if (PagingFileCreate
)
653 * Do more checking for page files. It is possible,
654 * that the file was opened and closed previously
655 * as a normal cached file. In this case, the cache
656 * manager has referenced the fileobject and the fcb
657 * is held in memory. Try to remove the fileobject
658 * from cache manager and use the fcb.
660 if (pFcb
->RefCount
> 1)
662 if(!(pFcb
->Flags
& FCB_IS_PAGE_FILE
))
664 VfatCloseFile(DeviceExt
, FileObject
);
665 return(STATUS_INVALID_PARAMETER
);
670 pFcb
->Flags
|= FCB_IS_PAGE_FILE
;
675 if (pFcb
->Flags
& FCB_IS_PAGE_FILE
)
677 VfatCloseFile(DeviceExt
, FileObject
);
678 return(STATUS_INVALID_PARAMETER
);
683 if (RequestedDisposition
== FILE_OVERWRITE
||
684 RequestedDisposition
== FILE_OVERWRITE_IF
)
686 AllocationSize
.QuadPart
= 0;
687 Status
= VfatSetAllocationSizeInformation (FileObject
,
691 if (!NT_SUCCESS (Status
))
693 VfatCloseFile (DeviceExt
, FileObject
);
699 /* Supersede the file */
700 if (RequestedDisposition
== FILE_SUPERSEDE
)
702 AllocationSize
.QuadPart
= 0;
703 VfatSetAllocationSizeInformation(FileObject
, pFcb
, DeviceExt
, &AllocationSize
);
704 Irp
->IoStatus
.Information
= FILE_SUPERSEDED
;
706 else if (RequestedDisposition
== FILE_OVERWRITE
|| RequestedDisposition
== FILE_OVERWRITE_IF
)
708 Irp
->IoStatus
.Information
= FILE_OVERWRITTEN
;
712 Irp
->IoStatus
.Information
= FILE_OPENED
;
716 if (pFcb
->OpenHandleCount
== 0)
718 IoSetShareAccess(Stack
->Parameters
.Create
.SecurityContext
->DesiredAccess
,
719 Stack
->Parameters
.Create
.ShareAccess
,
721 &pFcb
->FCBShareAccess
);
727 &pFcb
->FCBShareAccess
732 pFcb
->OpenHandleCount
++;
734 /* FIXME : test write access if requested */
741 VfatCreate (PVFAT_IRP_CONTEXT IrpContext
)
743 * FUNCTION: Create or open a file
750 if (IrpContext
->DeviceObject
== VfatGlobalData
->DeviceObject
)
752 /* DeviceObject represents FileSystem instead of logical volume */
753 DPRINT ("FsdCreate called with file system\n");
754 IrpContext
->Irp
->IoStatus
.Information
= FILE_OPENED
;
755 IrpContext
->Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
756 IoCompleteRequest (IrpContext
->Irp
, IO_DISK_INCREMENT
);
757 VfatFreeIrpContext(IrpContext
);
758 return(STATUS_SUCCESS
);
761 if (!(IrpContext
->Flags
& IRPCONTEXT_CANWAIT
))
763 return(VfatQueueRequest (IrpContext
));
766 IrpContext
->Irp
->IoStatus
.Information
= 0;
767 ExAcquireResourceExclusiveLite (&IrpContext
->DeviceExt
->DirResource
, TRUE
);
768 Status
= VfatCreateFile (IrpContext
->DeviceObject
, IrpContext
->Irp
);
769 ExReleaseResourceLite (&IrpContext
->DeviceExt
->DirResource
);
771 IrpContext
->Irp
->IoStatus
.Status
= Status
;
772 IoCompleteRequest (IrpContext
->Irp
,
773 (CCHAR
)(NT_SUCCESS(Status
) ? IO_DISK_INCREMENT
: IO_NO_INCREMENT
));
774 VfatFreeIrpContext(IrpContext
);