Fixed some problems if special parameters are delivered like SL_RESTART_SCAN, SL_INDE...
[reactos.git] / reactos / drivers / fs / vfat / dir.c
1 /*
2 * $Id$
3 *
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS kernel
6 * FILE: drivers/fs/vfat/dir.c
7 * PURPOSE: VFAT Filesystem : directory control
8 * UPDATE HISTORY:
9 19-12-1998 : created
10
11 */
12
13 #define NDEBUG
14 #include "vfat.h"
15
16
17 // function like DosDateTimeToFileTime
18 BOOLEAN
19 FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, USHORT DosDate, USHORT DosTime, PLARGE_INTEGER SystemTime)
20 {
21 PDOSTIME pdtime = (PDOSTIME) &DosTime;
22 PDOSDATE pddate = (PDOSDATE) &DosDate;
23 TIME_FIELDS TimeFields;
24 LARGE_INTEGER LocalTime;
25
26 if (SystemTime == NULL)
27 return FALSE;
28
29 TimeFields.Milliseconds = 0;
30 TimeFields.Second = pdtime->Second * 2;
31 TimeFields.Minute = pdtime->Minute;
32 TimeFields.Hour = pdtime->Hour;
33
34 TimeFields.Day = pddate->Day;
35 TimeFields.Month = pddate->Month;
36 TimeFields.Year = (CSHORT)(DeviceExt->BaseDateYear + pddate->Year);
37
38 RtlTimeFieldsToTime (&TimeFields, &LocalTime);
39 ExLocalTimeToSystemTime(&LocalTime, SystemTime);
40
41 return TRUE;
42 }
43
44 // function like FileTimeToDosDateTime
45 BOOLEAN
46 FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, USHORT *pDosDate, USHORT *pDosTime)
47 {
48 PDOSTIME pdtime = (PDOSTIME) pDosTime;
49 PDOSDATE pddate = (PDOSDATE) pDosDate;
50 TIME_FIELDS TimeFields;
51 LARGE_INTEGER LocalTime;
52
53 if (SystemTime == NULL)
54 return FALSE;
55
56 ExSystemTimeToLocalTime (SystemTime, &LocalTime);
57 RtlTimeToTimeFields (&LocalTime, &TimeFields);
58
59 if (pdtime)
60 {
61 pdtime->Second = TimeFields.Second / 2;
62 pdtime->Minute = TimeFields.Minute;
63 pdtime->Hour = TimeFields.Hour;
64 }
65
66 if (pddate)
67 {
68 pddate->Day = TimeFields.Day;
69 pddate->Month = TimeFields.Month;
70 pddate->Year = (USHORT) (TimeFields.Year - DeviceExt->BaseDateYear);
71 }
72
73 return TRUE;
74 }
75
76 #define ULONG_ROUND_UP(x) ROUND_UP((x), (sizeof(ULONG)))
77
78 NTSTATUS
79 VfatGetFileNameInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
80 PFILE_NAMES_INFORMATION pInfo, ULONG BufferLength)
81 {
82 if ((sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
83 return STATUS_BUFFER_OVERFLOW;
84 pInfo->FileNameLength = DirContext->LongNameU.Length;
85 pInfo->NextEntryOffset =
86 ULONG_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
87 RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
88 return STATUS_SUCCESS;
89 }
90
91 NTSTATUS
92 VfatGetFileDirectoryInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
93 PDEVICE_EXTENSION DeviceExt,
94 PFILE_DIRECTORY_INFORMATION pInfo,
95 ULONG BufferLength)
96 {
97 if ((sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
98 return STATUS_BUFFER_OVERFLOW;
99 pInfo->FileNameLength = DirContext->LongNameU.Length;
100 pInfo->NextEntryOffset =
101 ULONG_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
102 RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
103 // pInfo->FileIndex=;
104 if (DeviceExt->Flags & VCB_IS_FATX)
105 {
106 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.CreationDate,
107 DirContext->DirEntry.FatX.CreationTime,
108 &pInfo->CreationTime);
109 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.AccessDate,
110 DirContext->DirEntry.FatX.AccessTime,
111 &pInfo->LastAccessTime);
112 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.UpdateDate,
113 DirContext->DirEntry.FatX.UpdateTime,
114 &pInfo->LastWriteTime);
115 pInfo->ChangeTime = pInfo->LastWriteTime;
116 if (DirContext->DirEntry.FatX.Attrib & FILE_ATTRIBUTE_DIRECTORY)
117 {
118 pInfo->EndOfFile.QuadPart = 0LL;
119 pInfo->AllocationSize.QuadPart = 0LL;
120 }
121 else
122 {
123 pInfo->EndOfFile.u.HighPart = 0;
124 pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.FatX.FileSize;
125 /* Make allocsize a rounded up multiple of BytesPerCluster */
126 pInfo->AllocationSize.u.HighPart = 0;
127 pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.FatX.FileSize, DeviceExt->FatInfo.BytesPerCluster);
128 }
129 pInfo->FileAttributes = DirContext->DirEntry.FatX.Attrib & 0x3f;
130 }
131 else
132 {
133 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.CreationDate,
134 DirContext->DirEntry.Fat.CreationTime,
135 &pInfo->CreationTime);
136 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.AccessDate, 0,
137 &pInfo->LastAccessTime);
138 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.UpdateDate,
139 DirContext->DirEntry.Fat.UpdateTime,
140 &pInfo->LastWriteTime);
141 pInfo->ChangeTime = pInfo->LastWriteTime;
142 if (DirContext->DirEntry.Fat.Attrib & FILE_ATTRIBUTE_DIRECTORY)
143 {
144 pInfo->EndOfFile.QuadPart = 0LL;
145 pInfo->AllocationSize.QuadPart = 0LL;
146 }
147 else
148 {
149 pInfo->EndOfFile.u.HighPart = 0;
150 pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.Fat.FileSize;
151 /* Make allocsize a rounded up multiple of BytesPerCluster */
152 pInfo->AllocationSize.u.HighPart = 0;
153 pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.Fat.FileSize, DeviceExt->FatInfo.BytesPerCluster);
154 }
155 pInfo->FileAttributes = DirContext->DirEntry.Fat.Attrib & 0x3f;
156 }
157
158 return STATUS_SUCCESS;
159 }
160
161 NTSTATUS
162 VfatGetFileFullDirectoryInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
163 PDEVICE_EXTENSION DeviceExt,
164 PFILE_FULL_DIR_INFORMATION pInfo,
165 ULONG BufferLength)
166 {
167 if ((sizeof (FILE_FULL_DIR_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
168 return STATUS_BUFFER_OVERFLOW;
169 pInfo->FileNameLength = DirContext->LongNameU.Length;
170 pInfo->NextEntryOffset =
171 ULONG_ROUND_UP (sizeof (FILE_FULL_DIR_INFORMATION) + DirContext->LongNameU.Length);
172 RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
173 // pInfo->FileIndex=;
174 if (DeviceExt->Flags & VCB_IS_FATX)
175 {
176 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.CreationDate,
177 DirContext->DirEntry.FatX.CreationTime,
178 &pInfo->CreationTime);
179 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.AccessDate,
180 DirContext->DirEntry.FatX.AccessTime,
181 &pInfo->LastAccessTime);
182 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.UpdateDate,
183 DirContext->DirEntry.FatX.UpdateTime,
184 &pInfo->LastWriteTime);
185 pInfo->ChangeTime = pInfo->LastWriteTime;
186 pInfo->EndOfFile.u.HighPart = 0;
187 pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.FatX.FileSize;
188 /* Make allocsize a rounded up multiple of BytesPerCluster */
189 pInfo->AllocationSize.u.HighPart = 0;
190 pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.FatX.FileSize, DeviceExt->FatInfo.BytesPerCluster);
191 pInfo->FileAttributes = DirContext->DirEntry.FatX.Attrib & 0x3f;
192 }
193 else
194 {
195 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.CreationDate,
196 DirContext->DirEntry.Fat.CreationTime,
197 &pInfo->CreationTime);
198 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.AccessDate,
199 0, &pInfo->LastAccessTime);
200 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.UpdateDate,
201 DirContext->DirEntry.Fat.UpdateTime,
202 &pInfo->LastWriteTime);
203 pInfo->ChangeTime = pInfo->LastWriteTime;
204 pInfo->EndOfFile.u.HighPart = 0;
205 pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.Fat.FileSize;
206 /* Make allocsize a rounded up multiple of BytesPerCluster */
207 pInfo->AllocationSize.u.HighPart = 0;
208 pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.Fat.FileSize, DeviceExt->FatInfo.BytesPerCluster);
209 pInfo->FileAttributes = DirContext->DirEntry.Fat.Attrib & 0x3f;
210 }
211 // pInfo->EaSize=;
212 return STATUS_SUCCESS;
213 }
214
215 NTSTATUS
216 VfatGetFileBothInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
217 PDEVICE_EXTENSION DeviceExt,
218 PFILE_BOTH_DIR_INFORMATION pInfo,
219 ULONG BufferLength)
220 {
221 if ((sizeof (FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
222 return STATUS_BUFFER_OVERFLOW;
223
224 if (DeviceExt->Flags & VCB_IS_FATX)
225 {
226 pInfo->FileNameLength = DirContext->LongNameU.Length;
227 RtlCopyMemory(pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
228 pInfo->NextEntryOffset =
229 ULONG_ROUND_UP (sizeof (FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length);
230 pInfo->ShortName[0] = 0;
231 pInfo->ShortNameLength = 0;
232 // pInfo->FileIndex=;
233 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.CreationDate,
234 DirContext->DirEntry.FatX.CreationTime,
235 &pInfo->CreationTime);
236 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.AccessDate,
237 DirContext->DirEntry.FatX.AccessTime,
238 &pInfo->LastAccessTime);
239 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.FatX.UpdateDate,
240 DirContext->DirEntry.FatX.UpdateTime,
241 &pInfo->LastWriteTime);
242 pInfo->ChangeTime = pInfo->LastWriteTime;
243 if (DirContext->DirEntry.FatX.Attrib & FILE_ATTRIBUTE_DIRECTORY)
244 {
245 pInfo->EndOfFile.QuadPart = 0LL;
246 pInfo->AllocationSize.QuadPart = 0LL;
247 }
248 else
249 {
250 pInfo->EndOfFile.u.HighPart = 0;
251 pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.FatX.FileSize;
252 /* Make allocsize a rounded up multiple of BytesPerCluster */
253 pInfo->AllocationSize.u.HighPart = 0;
254 pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.FatX.FileSize, DeviceExt->FatInfo.BytesPerCluster);
255 }
256 pInfo->FileAttributes = DirContext->DirEntry.FatX.Attrib & 0x3f;
257 }
258 else
259 {
260 pInfo->FileNameLength = DirContext->LongNameU.Length;
261 pInfo->NextEntryOffset =
262 ULONG_ROUND_UP (sizeof (FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length);
263 RtlCopyMemory(pInfo->ShortName, DirContext->ShortNameU.Buffer, DirContext->ShortNameU.Length);
264 pInfo->ShortNameLength = (CCHAR)DirContext->ShortNameU.Length;
265 RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
266 // pInfo->FileIndex=;
267 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.CreationDate,
268 DirContext->DirEntry.Fat.CreationTime,
269 &pInfo->CreationTime);
270 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.AccessDate, 0,
271 &pInfo->LastAccessTime);
272 FsdDosDateTimeToSystemTime (DeviceExt, DirContext->DirEntry.Fat.UpdateDate,
273 DirContext->DirEntry.Fat.UpdateTime,
274 &pInfo->LastWriteTime);
275 pInfo->ChangeTime = pInfo->LastWriteTime;
276 if (DirContext->DirEntry.Fat.Attrib & FILE_ATTRIBUTE_DIRECTORY)
277 {
278 pInfo->EndOfFile.QuadPart = 0LL;
279 pInfo->AllocationSize.QuadPart = 0LL;
280 }
281 else
282 {
283 pInfo->EndOfFile.u.HighPart = 0;
284 pInfo->EndOfFile.u.LowPart = DirContext->DirEntry.Fat.FileSize;
285 /* Make allocsize a rounded up multiple of BytesPerCluster */
286 pInfo->AllocationSize.u.HighPart = 0;
287 pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->DirEntry.Fat.FileSize, DeviceExt->FatInfo.BytesPerCluster);
288 }
289 pInfo->FileAttributes = DirContext->DirEntry.Fat.Attrib & 0x3f;
290 }
291 pInfo->EaSize=0;
292 return STATUS_SUCCESS;
293 }
294
295 NTSTATUS DoQuery (PVFAT_IRP_CONTEXT IrpContext)
296 {
297 NTSTATUS RC = STATUS_SUCCESS;
298 long BufferLength = 0;
299 PUNICODE_STRING pSearchPattern = NULL;
300 FILE_INFORMATION_CLASS FileInformationClass;
301 unsigned char *Buffer = NULL;
302 PFILE_NAMES_INFORMATION Buffer0 = NULL;
303 PVFATFCB pFcb;
304 PVFATCCB pCcb;
305 BOOLEAN FirstQuery = FALSE;
306 BOOLEAN FirstCall = TRUE;
307 VFAT_DIRENTRY_CONTEXT DirContext;
308 WCHAR LongNameBuffer[LONGNAME_MAX_LENGTH + 1];
309 WCHAR ShortNameBuffer[13];
310
311 PIO_STACK_LOCATION Stack = IrpContext->Stack;
312
313 pCcb = (PVFATCCB) IrpContext->FileObject->FsContext2;
314 pFcb = (PVFATFCB) IrpContext->FileObject->FsContext;
315
316 // determine Buffer for result :
317 BufferLength = Stack->Parameters.QueryDirectory.Length;
318 #if 0
319 /* Do not probe the user buffer until SEH is available */
320 if (IrpContext->Irp->RequestorMode != KernelMode &&
321 IrpContext->Irp->MdlAddress == NULL &&
322 IrpContext->Irp->UserBuffer != NULL)
323 {
324 ProbeForWrite(IrpContext->Irp->UserBuffer, BufferLength, 1);
325 }
326 #endif
327 Buffer = VfatGetUserBuffer(IrpContext->Irp);
328
329 if (!ExAcquireResourceSharedLite(&pFcb->MainResource,
330 (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
331 {
332 RC = VfatLockUserBuffer(IrpContext->Irp, BufferLength, IoWriteAccess);
333 if (NT_SUCCESS(RC))
334 {
335 RC = STATUS_PENDING;
336 }
337 return RC;
338 }
339
340 /* Obtain the callers parameters */
341 #ifdef _MSC_VER
342 /* HACKHACK: Bug in the MS ntifs.h header:
343 * FileName is really a PUNICODE_STRING, not a PSTRING */
344 pSearchPattern = (PUNICODE_STRING)Stack->Parameters.QueryDirectory.FileName;
345 #else
346 pSearchPattern = Stack->Parameters.QueryDirectory.FileName;
347 #endif
348 FileInformationClass =
349 Stack->Parameters.QueryDirectory.FileInformationClass;
350 if (pSearchPattern)
351 {
352 if (!pCcb->SearchPattern.Buffer)
353 {
354 FirstQuery = TRUE;
355 pCcb->SearchPattern.MaximumLength = pSearchPattern->Length + sizeof(WCHAR);
356 pCcb->SearchPattern.Buffer = ExAllocatePool(NonPagedPool, pCcb->SearchPattern.MaximumLength);
357 if (!pCcb->SearchPattern.Buffer)
358 {
359 ExReleaseResourceLite(&pFcb->MainResource);
360 return STATUS_INSUFFICIENT_RESOURCES;
361 }
362 RtlCopyUnicodeString(&pCcb->SearchPattern, pSearchPattern);
363 pCcb->SearchPattern.Buffer[pCcb->SearchPattern.Length / sizeof(WCHAR)] = 0;
364 }
365 }
366 else if (!pCcb->SearchPattern.Buffer)
367 {
368 FirstQuery = TRUE;
369 pCcb->SearchPattern.MaximumLength = 2 * sizeof(WCHAR);
370 pCcb->SearchPattern.Buffer = ExAllocatePool(NonPagedPool, 2 * sizeof(WCHAR));
371 if (!pCcb->SearchPattern.Buffer)
372 {
373 ExReleaseResourceLite(&pFcb->MainResource);
374 return STATUS_INSUFFICIENT_RESOURCES;
375 }
376 pCcb->SearchPattern.Buffer[0] = L'*';
377 pCcb->SearchPattern.Buffer[1] = 0;
378 pCcb->SearchPattern.Length = sizeof(WCHAR);
379 }
380
381 if (IrpContext->Stack->Flags & SL_INDEX_SPECIFIED)
382 {
383 DirContext.DirIndex = pCcb->Entry = Stack->Parameters.QueryDirectory.FileIndex;
384 }
385 else if (FirstQuery || (IrpContext->Stack->Flags & SL_RESTART_SCAN))
386 {
387 DirContext.DirIndex = pCcb->Entry = 0;
388 }
389 else
390 {
391 DirContext.DirIndex = pCcb->Entry;
392 }
393
394 DPRINT ("Buffer=%x tofind=%wZ\n", Buffer, &pCcb->SearchPattern);
395
396 DirContext.LongNameU.Buffer = LongNameBuffer;
397 DirContext.LongNameU.MaximumLength = sizeof(LongNameBuffer);
398 DirContext.ShortNameU.Buffer = ShortNameBuffer;
399 DirContext.ShortNameU.MaximumLength = sizeof(ShortNameBuffer);
400
401 while (RC == STATUS_SUCCESS && BufferLength > 0)
402 {
403 RC = FindFile (IrpContext->DeviceExt, pFcb,
404 &pCcb->SearchPattern, &DirContext, FirstCall);
405 pCcb->Entry = DirContext.DirIndex;
406 DPRINT ("Found %wZ, RC=%x, entry %x\n", &DirContext.LongNameU, RC, pCcb->Entry);
407 FirstCall = FALSE;
408 if (NT_SUCCESS (RC))
409 {
410 switch (FileInformationClass)
411 {
412 case FileNameInformation:
413 RC = VfatGetFileNameInformation (&DirContext,
414 (PFILE_NAMES_INFORMATION) Buffer,
415 BufferLength);
416 break;
417 case FileDirectoryInformation:
418 RC = VfatGetFileDirectoryInformation (&DirContext,
419 IrpContext->DeviceExt,
420 (PFILE_DIRECTORY_INFORMATION) Buffer,
421 BufferLength);
422 break;
423 case FileFullDirectoryInformation:
424 RC = VfatGetFileFullDirectoryInformation (&DirContext,
425 IrpContext->DeviceExt,
426 (PFILE_FULL_DIR_INFORMATION) Buffer,
427 BufferLength);
428 break;
429 case FileBothDirectoryInformation:
430 RC = VfatGetFileBothInformation (&DirContext,
431 IrpContext->DeviceExt,
432 (PFILE_BOTH_DIR_INFORMATION) Buffer,
433 BufferLength);
434 break;
435 default:
436 RC = STATUS_INVALID_INFO_CLASS;
437 }
438 if (RC == STATUS_BUFFER_OVERFLOW)
439 {
440 break;
441 }
442 }
443 else
444 {
445 if (FirstQuery)
446 {
447 RC = STATUS_NO_SUCH_FILE;
448 }
449 else
450 {
451 RC = STATUS_NO_MORE_FILES;
452 }
453 break;
454 }
455 Buffer0 = (PFILE_NAMES_INFORMATION) Buffer;
456 Buffer0->FileIndex = DirContext.DirIndex;
457 pCcb->Entry = ++DirContext.DirIndex;
458 BufferLength -= Buffer0->NextEntryOffset;
459 if (IrpContext->Stack->Flags & SL_RETURN_SINGLE_ENTRY)
460 {
461 break;
462 }
463 Buffer += Buffer0->NextEntryOffset;
464 }
465 if (Buffer0)
466 {
467 Buffer0->NextEntryOffset = 0;
468 RC = STATUS_SUCCESS;
469 IrpContext->Irp->IoStatus.Information = Stack->Parameters.QueryDirectory.Length - BufferLength;
470
471 }
472 ExReleaseResourceLite(&pFcb->MainResource);
473 return RC;
474 }
475
476
477 NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT IrpContext)
478 /*
479 * FUNCTION: directory control : read/write directory informations
480 */
481 {
482 NTSTATUS RC = STATUS_SUCCESS;
483 CHECKPOINT;
484 IrpContext->Irp->IoStatus.Information = 0;
485 switch (IrpContext->MinorFunction)
486 {
487 case IRP_MN_QUERY_DIRECTORY:
488 RC = DoQuery (IrpContext);
489 break;
490 case IRP_MN_NOTIFY_CHANGE_DIRECTORY:
491 DPRINT (" vfat, dir : change\n");
492 RC = STATUS_NOT_IMPLEMENTED;
493 break;
494 default:
495 // error
496 DbgPrint ("unexpected minor function %x in VFAT driver\n",
497 IrpContext->MinorFunction);
498 RC = STATUS_INVALID_DEVICE_REQUEST;
499 break;
500 }
501 if (RC == STATUS_PENDING)
502 {
503 RC = VfatQueueRequest(IrpContext);
504 }
505 else
506 {
507 IrpContext->Irp->IoStatus.Status = RC;
508 IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT);
509 VfatFreeIrpContext(IrpContext);
510 }
511 return RC;
512 }
513
514