3 * Copyright (C) 2002, 2004 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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS kernel
22 * FILE: services/fs/cdfs/dirctl.c
23 * PURPOSE: CDROM (ISO 9660) filesystem driver
24 * PROGRAMMER: Art Yerkes
29 /* INCLUDES *****************************************************************/
36 /* FUNCTIONS ****************************************************************/
38 #define ROUND_DOWN(N, S) (((N) / (S)) * (S))
39 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
41 /* FUNCTIONS ****************************************************************/
44 * FUNCTION: Retrieves the file name, be it in short or long file name format
47 CdfsGetEntryName(PDEVICE_EXTENSION DeviceExt
,
50 PLARGE_INTEGER StreamOffset
,
57 PDIR_RECORD Record
= *Ptr
;
60 if (*CurrentOffset
>= DirLength
)
61 return(STATUS_NO_MORE_ENTRIES
);
63 if (*CurrentOffset
== 0)
66 Record
= (PDIR_RECORD
)*Block
;
67 while (Index
< *pIndex
)
69 (*Ptr
) = (PVOID
)((ULONG_PTR
)(*Ptr
) + Record
->RecordLength
);
70 (*CurrentOffset
) += Record
->RecordLength
;
72 if ((ULONG_PTR
)(*Ptr
) - (ULONG_PTR
)(*Block
) >= BLOCKSIZE
|| Record
->RecordLength
== 0)
74 DPRINT("Map next sector\n");
75 CcUnpinData(*Context
);
76 StreamOffset
->QuadPart
+= BLOCKSIZE
;
77 *CurrentOffset
= ROUND_UP(*CurrentOffset
, BLOCKSIZE
);
78 if (!CcMapData(DeviceExt
->StreamFileObject
,
83 DPRINT("CcMapData() failed\n");
84 return(STATUS_UNSUCCESSFUL
);
87 Record
= (PDIR_RECORD
)*Ptr
;
89 if (*CurrentOffset
>= DirLength
)
90 return(STATUS_NO_MORE_ENTRIES
);
96 if ((ULONG_PTR
)(*Ptr
) - (ULONG_PTR
)(*Block
) >= BLOCKSIZE
|| Record
->RecordLength
== 0)
98 DPRINT("Map next sector\n");
99 CcUnpinData(*Context
);
100 StreamOffset
->QuadPart
+= BLOCKSIZE
;
101 *CurrentOffset
= ROUND_UP(*CurrentOffset
, BLOCKSIZE
);
102 if (!CcMapData(DeviceExt
->StreamFileObject
,
107 DPRINT("CcMapData() failed\n");
108 return(STATUS_UNSUCCESSFUL
);
111 Record
= (PDIR_RECORD
)*Ptr
;
114 if (*CurrentOffset
>= DirLength
)
115 return STATUS_NO_MORE_ENTRIES
;
117 DPRINT("Index %lu RecordLength %lu Offset %lu\n",
118 *pIndex
, Record
->RecordLength
, *CurrentOffset
);
120 if (Record
->FileIdLength
== 1 && Record
->FileId
[0] == 0)
124 else if (Record
->FileIdLength
== 1 && Record
->FileId
[0] == 1)
130 if (DeviceExt
->CdInfo
.JolietLevel
== 0)
134 for (i
= 0; i
< Record
->FileIdLength
&& Record
->FileId
[i
] != ';'; i
++)
135 Name
[i
] = (WCHAR
)Record
->FileId
[i
];
140 CdfsSwapString(Name
, Record
->FileId
, Record
->FileIdLength
);
144 DPRINT("Name '%S'\n", Name
);
148 return(STATUS_SUCCESS
);
153 * FUNCTION: Find a file
156 CdfsFindFile(PDEVICE_EXTENSION DeviceExt
,
159 PUNICODE_STRING FileToFind
,
164 WCHAR ShortNameBuffer
[13];
165 UNICODE_STRING TempString
;
166 UNICODE_STRING ShortName
;
167 UNICODE_STRING LongName
;
168 UNICODE_STRING FileToFindUpcase
;
175 PVOID Context
= NULL
;
178 LARGE_INTEGER StreamOffset
, OffsetOfEntry
;
180 DPRINT("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %u)\n",
181 Parent
, FileToFind
, pDirIndex
? *pDirIndex
: 0);
182 DPRINT("FindFile: old Pathname %p, old Objectname %p)\n",
183 Fcb
->PathName
, Fcb
->ObjectName
);
188 if (FileToFind
== NULL
|| FileToFind
->Length
== 0)
190 RtlInitUnicodeString(&TempString
, L
".");
191 FileToFind
= &TempString
;
196 if (Parent
->Entry
.ExtentLocationL
== DeviceExt
->CdInfo
.RootStart
)
208 StreamOffset
.QuadPart
= (LONGLONG
)DeviceExt
->CdInfo
.RootStart
* (LONGLONG
)BLOCKSIZE
;
209 DirSize
= DeviceExt
->CdInfo
.RootSize
;
212 if (FileToFind
->Buffer
[0] == 0 ||
213 (FileToFind
->Buffer
[0] == '\\' && FileToFind
->Buffer
[1] == 0) ||
214 (FileToFind
->Buffer
[0] == '.' && FileToFind
->Buffer
[1] == 0))
216 /* it's root : complete essentials fields then return ok */
217 RtlZeroMemory(Fcb
, sizeof(FCB
));
219 Fcb
->PathName
[0] = '\\';
220 Fcb
->ObjectName
= &Fcb
->PathName
[1];
221 Fcb
->Entry
.ExtentLocationL
= DeviceExt
->CdInfo
.RootStart
;
222 Fcb
->Entry
.DataLengthL
= DeviceExt
->CdInfo
.RootSize
;
223 Fcb
->Entry
.FileFlags
= 0x02; //FILE_ATTRIBUTE_DIRECTORY;
229 DPRINT("CdfsFindFile: new Pathname %S, new Objectname %S)\n",Fcb
->PathName
, Fcb
->ObjectName
);
230 return STATUS_SUCCESS
;
235 StreamOffset
.QuadPart
= (LONGLONG
)Parent
->Entry
.ExtentLocationL
* (LONGLONG
)BLOCKSIZE
;
236 DirSize
= Parent
->Entry
.DataLengthL
;
239 DPRINT("StreamOffset %I64d DirSize %u\n", StreamOffset
.QuadPart
, DirSize
);
241 if (pDirIndex
&& (*pDirIndex
))
242 DirIndex
= *pDirIndex
;
244 if (pOffset
&& (*pOffset
))
247 StreamOffset
.QuadPart
+= ROUND_DOWN(Offset
, BLOCKSIZE
);
250 if (!CcMapData(DeviceExt
->StreamFileObject
, &StreamOffset
,
251 BLOCKSIZE
, TRUE
, &Context
, &Block
))
253 DPRINT("CcMapData() failed\n");
254 return STATUS_UNSUCCESSFUL
;
257 Record
= (PDIR_RECORD
) ((ULONG_PTR
)Block
+ Offset
% BLOCKSIZE
);
260 Offset
+= Record
->RecordLength
;
261 Record
= (PDIR_RECORD
)((ULONG_PTR
)Record
+ Record
->RecordLength
);
264 /* Upper case the expression for FsRtlIsNameInExpression */
265 Status
= RtlUpcaseUnicodeString(&FileToFindUpcase
, FileToFind
, TRUE
);
266 if (!NT_SUCCESS(Status
))
273 DPRINT("RecordLength %u ExtAttrRecordLength %u NameLength %u\n",
274 Record
->RecordLength
, Record
->ExtAttrRecordLength
, Record
->FileIdLength
);
276 Status
= CdfsGetEntryName
277 (DeviceExt
, &Context
, &Block
, &StreamOffset
,
278 DirSize
, (PVOID
*)&Record
, name
, &DirIndex
, &Offset
);
280 if (Status
== STATUS_NO_MORE_ENTRIES
)
284 else if (Status
== STATUS_UNSUCCESSFUL
)
286 /* Note: the directory cache has already been unpinned */
287 RtlFreeUnicodeString(&FileToFindUpcase
);
291 DPRINT("Name '%S'\n", name
);
293 RtlInitUnicodeString(&LongName
, name
);
294 ShortName
.Length
= 0;
295 ShortName
.MaximumLength
= 26;
296 ShortName
.Buffer
= ShortNameBuffer
;
298 OffsetOfEntry
.QuadPart
= StreamOffset
.QuadPart
+ Offset
;
299 CdfsShortNameCacheGet(Parent
, &OffsetOfEntry
, &LongName
, &ShortName
);
301 DPRINT("ShortName '%wZ'\n", &ShortName
);
303 if (FsRtlIsNameInExpression(&FileToFindUpcase
, &LongName
, TRUE
, NULL
) ||
304 FsRtlIsNameInExpression(&FileToFindUpcase
, &ShortName
, TRUE
, NULL
))
306 if (Parent
->PathName
[0])
308 len
= wcslen(Parent
->PathName
);
309 memcpy(Fcb
->PathName
, Parent
->PathName
, len
*sizeof(WCHAR
));
310 Fcb
->ObjectName
=&Fcb
->PathName
[len
];
311 if (len
!= 1 || Fcb
->PathName
[0] != '\\')
313 Fcb
->ObjectName
[0] = '\\';
314 Fcb
->ObjectName
= &Fcb
->ObjectName
[1];
319 Fcb
->ObjectName
=Fcb
->PathName
;
320 Fcb
->ObjectName
[0]='\\';
321 Fcb
->ObjectName
=&Fcb
->ObjectName
[1];
324 DPRINT("PathName '%S' ObjectName '%S'\n", Fcb
->PathName
, Fcb
->ObjectName
);
326 memcpy(&Fcb
->Entry
, Record
, sizeof(DIR_RECORD
));
327 wcsncpy(Fcb
->ObjectName
, name
, min(wcslen(name
) + 1,
328 MAX_PATH
- wcslen(Fcb
->PathName
) + wcslen(Fcb
->ObjectName
)));
330 /* Copy short name */
331 Fcb
->ShortNameU
.Length
= ShortName
.Length
;
332 Fcb
->ShortNameU
.MaximumLength
= ShortName
.Length
;
333 Fcb
->ShortNameU
.Buffer
= Fcb
->ShortNameBuffer
;
334 memcpy(Fcb
->ShortNameBuffer
, ShortName
.Buffer
, ShortName
.Length
);
337 *pDirIndex
= DirIndex
;
341 DPRINT("FindFile: new Pathname %S, new Objectname %S, DirIndex %u\n",
342 Fcb
->PathName
, Fcb
->ObjectName
, DirIndex
);
344 RtlFreeUnicodeString(&FileToFindUpcase
);
345 CcUnpinData(Context
);
347 return STATUS_SUCCESS
;
350 Offset
+= Record
->RecordLength
;
351 Record
= (PDIR_RECORD
)((ULONG_PTR
)Record
+ Record
->RecordLength
);
355 RtlFreeUnicodeString(&FileToFindUpcase
);
356 CcUnpinData(Context
);
359 *pDirIndex
= DirIndex
;
364 return STATUS_UNSUCCESSFUL
;
369 CdfsGetNameInformation(PFCB Fcb
,
370 PDEVICE_EXTENSION DeviceExt
,
371 PFILE_NAMES_INFORMATION Info
,
376 DPRINT("CdfsGetNameInformation() called\n");
378 UNREFERENCED_PARAMETER(DeviceExt
);
380 Length
= wcslen(Fcb
->ObjectName
) * sizeof(WCHAR
);
381 if ((sizeof(FILE_NAMES_INFORMATION
) + Length
) > BufferLength
)
382 return(STATUS_BUFFER_OVERFLOW
);
384 Info
->FileNameLength
= Length
;
385 Info
->NextEntryOffset
=
386 ROUND_UP(sizeof(FILE_NAMES_INFORMATION
) + Length
, sizeof(ULONG
));
387 RtlCopyMemory(Info
->FileName
, Fcb
->ObjectName
, Length
);
391 return(STATUS_SUCCESS
);
396 CdfsGetDirectoryInformation(PFCB Fcb
,
397 PDEVICE_EXTENSION DeviceExt
,
398 PFILE_DIRECTORY_INFORMATION Info
,
403 DPRINT("CdfsGetDirectoryInformation() called\n");
405 UNREFERENCED_PARAMETER(DeviceExt
);
407 Length
= wcslen(Fcb
->ObjectName
) * sizeof(WCHAR
);
408 if ((sizeof (FILE_DIRECTORY_INFORMATION
) + Length
) > BufferLength
)
409 return(STATUS_BUFFER_OVERFLOW
);
411 Info
->FileNameLength
= Length
;
412 Info
->NextEntryOffset
=
413 ROUND_UP(sizeof(FILE_DIRECTORY_INFORMATION
) + Length
, sizeof(ULONG
));
414 RtlCopyMemory(Info
->FileName
, Fcb
->ObjectName
, Length
);
416 /* Convert file times */
417 CdfsDateTimeToSystemTime(Fcb
,
418 &Info
->CreationTime
);
419 Info
->LastWriteTime
= Info
->CreationTime
;
420 Info
->ChangeTime
= Info
->CreationTime
;
422 /* Convert file flags */
423 CdfsFileFlagsToAttributes(Fcb
,
424 &Info
->FileAttributes
);
425 if (CdfsFCBIsDirectory(Fcb
))
427 Info
->EndOfFile
.QuadPart
= 0;
428 Info
->AllocationSize
.QuadPart
= 0;
432 Info
->EndOfFile
.QuadPart
= Fcb
->Entry
.DataLengthL
;
434 /* Make AllocSize a rounded up multiple of the sector size */
435 Info
->AllocationSize
.QuadPart
= ROUND_UP(Fcb
->Entry
.DataLengthL
, BLOCKSIZE
);
440 return(STATUS_SUCCESS
);
445 CdfsGetFullDirectoryInformation(PFCB Fcb
,
446 PDEVICE_EXTENSION DeviceExt
,
447 PFILE_FULL_DIR_INFORMATION Info
,
452 DPRINT("CdfsGetFullDirectoryInformation() called\n");
454 UNREFERENCED_PARAMETER(DeviceExt
);
456 Length
= wcslen(Fcb
->ObjectName
) * sizeof(WCHAR
);
457 if ((sizeof (FILE_FULL_DIR_INFORMATION
) + Length
) > BufferLength
)
458 return(STATUS_BUFFER_OVERFLOW
);
460 Info
->FileNameLength
= Length
;
461 Info
->NextEntryOffset
=
462 ROUND_UP(sizeof(FILE_FULL_DIR_INFORMATION
) + Length
, sizeof(ULONG
));
463 RtlCopyMemory(Info
->FileName
, Fcb
->ObjectName
, Length
);
465 /* Convert file times */
466 CdfsDateTimeToSystemTime(Fcb
,
467 &Info
->CreationTime
);
468 Info
->LastWriteTime
= Info
->CreationTime
;
469 Info
->ChangeTime
= Info
->CreationTime
;
471 /* Convert file flags */
472 CdfsFileFlagsToAttributes(Fcb
,
473 &Info
->FileAttributes
);
475 if (CdfsFCBIsDirectory(Fcb
))
477 Info
->EndOfFile
.QuadPart
= 0;
478 Info
->AllocationSize
.QuadPart
= 0;
482 Info
->EndOfFile
.QuadPart
= Fcb
->Entry
.DataLengthL
;
484 /* Make AllocSize a rounded up multiple of the sector size */
485 Info
->AllocationSize
.QuadPart
= ROUND_UP(Fcb
->Entry
.DataLengthL
, BLOCKSIZE
);
491 return(STATUS_SUCCESS
);
496 CdfsGetBothDirectoryInformation(PFCB Fcb
,
497 PDEVICE_EXTENSION DeviceExt
,
498 PFILE_BOTH_DIR_INFORMATION Info
,
503 DPRINT("CdfsGetBothDirectoryInformation() called\n");
505 UNREFERENCED_PARAMETER(DeviceExt
);
507 Length
= wcslen(Fcb
->ObjectName
) * sizeof(WCHAR
);
508 if ((sizeof (FILE_BOTH_DIR_INFORMATION
) + Length
) > BufferLength
)
509 return(STATUS_BUFFER_OVERFLOW
);
511 Info
->FileNameLength
= Length
;
512 Info
->NextEntryOffset
=
513 ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION
) + Length
, sizeof(ULONG
));
514 RtlCopyMemory(Info
->FileName
, Fcb
->ObjectName
, Length
);
516 /* Convert file times */
517 CdfsDateTimeToSystemTime(Fcb
,
518 &Info
->CreationTime
);
519 Info
->LastWriteTime
= Info
->CreationTime
;
520 Info
->ChangeTime
= Info
->CreationTime
;
522 /* Convert file flags */
523 CdfsFileFlagsToAttributes(Fcb
,
524 &Info
->FileAttributes
);
526 if (CdfsFCBIsDirectory(Fcb
))
528 Info
->EndOfFile
.QuadPart
= 0;
529 Info
->AllocationSize
.QuadPart
= 0;
533 Info
->EndOfFile
.QuadPart
= Fcb
->Entry
.DataLengthL
;
535 /* Make AllocSize a rounded up multiple of the sector size */
536 Info
->AllocationSize
.QuadPart
= ROUND_UP(Fcb
->Entry
.DataLengthL
, BLOCKSIZE
);
542 /* Copy short name */
543 ASSERT(Fcb
->ShortNameU
.Length
/ sizeof(WCHAR
) <= 12);
544 Info
->ShortNameLength
= (CCHAR
)Fcb
->ShortNameU
.Length
;
545 RtlCopyMemory(Info
->ShortName
, Fcb
->ShortNameU
.Buffer
, Fcb
->ShortNameU
.Length
);
547 return(STATUS_SUCCESS
);
552 CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject
,
555 PDEVICE_EXTENSION DeviceExtension
;
556 LONG BufferLength
= 0;
557 PUNICODE_STRING SearchPattern
= NULL
;
558 FILE_INFORMATION_CLASS FileInformationClass
;
560 PUCHAR Buffer
= NULL
;
561 PFILE_NAMES_INFORMATION Buffer0
= NULL
;
565 BOOLEAN First
= FALSE
;
566 PIO_STACK_LOCATION Stack
;
567 PFILE_OBJECT FileObject
;
568 NTSTATUS Status
= STATUS_SUCCESS
;
570 DPRINT("CdfsQueryDirectory() called\n");
572 DeviceExtension
= DeviceObject
->DeviceExtension
;
573 Stack
= IoGetCurrentIrpStackLocation(Irp
);
574 FileObject
= Stack
->FileObject
;
576 Ccb
= (PCCB
)FileObject
->FsContext2
;
577 Fcb
= (PFCB
)FileObject
->FsContext
;
579 /* Obtain the callers parameters */
580 BufferLength
= Stack
->Parameters
.QueryDirectory
.Length
;
581 SearchPattern
= Stack
->Parameters
.QueryDirectory
.FileName
;
582 FileInformationClass
=
583 Stack
->Parameters
.QueryDirectory
.FileInformationClass
;
584 FileIndex
= Stack
->Parameters
.QueryDirectory
.FileIndex
;
586 /* Determine Buffer for result */
589 Buffer
= MmGetSystemAddressForMdl(Irp
->MdlAddress
);
593 Buffer
= Irp
->UserBuffer
;
596 /* Allocate search pattern in case:
597 * -> We don't have one already in context
598 * -> We have been given an input pattern
599 * -> The pattern length is not null
600 * -> The pattern buffer is not null
601 * Otherwise, we'll fall later and allocate a match all (*) pattern
603 if (SearchPattern
!= NULL
&&
604 SearchPattern
->Length
!= 0 && SearchPattern
->Buffer
!= NULL
)
606 if (Ccb
->DirectorySearchPattern
.Buffer
== NULL
)
609 Ccb
->DirectorySearchPattern
.Buffer
=
610 ExAllocatePoolWithTag(NonPagedPool
, SearchPattern
->Length
+ sizeof(WCHAR
), TAG_CCB
);
611 if (Ccb
->DirectorySearchPattern
.Buffer
== NULL
)
613 return STATUS_INSUFFICIENT_RESOURCES
;
615 Ccb
->DirectorySearchPattern
.MaximumLength
= SearchPattern
->Length
+ sizeof(WCHAR
);
616 RtlCopyUnicodeString(&Ccb
->DirectorySearchPattern
, SearchPattern
);
617 Ccb
->DirectorySearchPattern
.Buffer
[SearchPattern
->Length
/ sizeof(WCHAR
)] = 0;
620 else if (Ccb
->DirectorySearchPattern
.Buffer
== NULL
)
623 Ccb
->DirectorySearchPattern
.Buffer
= ExAllocatePoolWithTag(NonPagedPool
, 2 * sizeof(WCHAR
), TAG_CCB
);
624 if (Ccb
->DirectorySearchPattern
.Buffer
== NULL
)
626 return STATUS_INSUFFICIENT_RESOURCES
;
629 Ccb
->DirectorySearchPattern
.Length
= sizeof(WCHAR
);
630 Ccb
->DirectorySearchPattern
.MaximumLength
= 2 * sizeof(WCHAR
);
631 Ccb
->DirectorySearchPattern
.Buffer
[0] = L
'*';
632 Ccb
->DirectorySearchPattern
.Buffer
[1] = 0;
634 DPRINT("Search pattern '%wZ'\n", &Ccb
->DirectorySearchPattern
);
636 /* Determine directory index */
637 if (Stack
->Flags
& SL_INDEX_SPECIFIED
)
639 Ccb
->Entry
= Stack
->Parameters
.QueryDirectory
.FileIndex
;
640 Ccb
->Offset
= Ccb
->CurrentByteOffset
.u
.LowPart
;
642 else if (First
|| (Stack
->Flags
& SL_RESTART_SCAN
))
647 DPRINT("Buffer = %p tofind = %wZ\n", Buffer
, &Ccb
->DirectorySearchPattern
);
649 TempFcb
.ObjectName
= TempFcb
.PathName
;
650 while (Status
== STATUS_SUCCESS
&& BufferLength
> 0)
652 Status
= CdfsFindFile(DeviceExtension
,
655 &Ccb
->DirectorySearchPattern
,
658 DPRINT("Found %S, Status=%x, entry %x\n", TempFcb
.ObjectName
, Status
, Ccb
->Entry
);
660 if (NT_SUCCESS(Status
))
662 switch (FileInformationClass
)
664 case FileNameInformation
:
665 Status
= CdfsGetNameInformation(&TempFcb
,
667 (PFILE_NAMES_INFORMATION
)Buffer
,
671 case FileDirectoryInformation
:
672 Status
= CdfsGetDirectoryInformation(&TempFcb
,
674 (PFILE_DIRECTORY_INFORMATION
)Buffer
,
678 case FileFullDirectoryInformation
:
679 Status
= CdfsGetFullDirectoryInformation(&TempFcb
,
681 (PFILE_FULL_DIR_INFORMATION
)Buffer
,
685 case FileBothDirectoryInformation
:
686 Status
= CdfsGetBothDirectoryInformation(&TempFcb
,
688 (PFILE_BOTH_DIR_INFORMATION
)Buffer
,
693 Status
= STATUS_INVALID_INFO_CLASS
;
696 if (Status
== STATUS_BUFFER_OVERFLOW
)
700 Buffer0
->NextEntryOffset
= 0;
709 Buffer0
->NextEntryOffset
= 0;
714 Status
= STATUS_NO_SUCH_FILE
;
718 Status
= STATUS_NO_MORE_FILES
;
723 Buffer0
= (PFILE_NAMES_INFORMATION
)Buffer
;
724 Buffer0
->FileIndex
= FileIndex
++;
727 if (Stack
->Flags
& SL_RETURN_SINGLE_ENTRY
)
731 BufferLength
-= Buffer0
->NextEntryOffset
;
732 Buffer
+= Buffer0
->NextEntryOffset
;
737 Buffer0
->NextEntryOffset
= 0;
742 Status
= STATUS_SUCCESS
;
751 CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject
,
754 PIO_STACK_LOCATION Stack
;
757 DPRINT("CdfsDirectoryControl() called\n");
758 FsRtlEnterFileSystem();
760 Stack
= IoGetCurrentIrpStackLocation(Irp
);
762 switch (Stack
->MinorFunction
)
764 case IRP_MN_QUERY_DIRECTORY
:
765 Status
= CdfsQueryDirectory(DeviceObject
,
769 case IRP_MN_NOTIFY_CHANGE_DIRECTORY
:
770 DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n");
771 Status
= STATUS_NOT_IMPLEMENTED
;
775 DPRINT1("CDFS: MinorFunction %u\n", Stack
->MinorFunction
);
776 Status
= STATUS_INVALID_DEVICE_REQUEST
;
780 Irp
->IoStatus
.Status
= Status
;
781 Irp
->IoStatus
.Information
= 0;
783 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
784 FsRtlExitFileSystem();