123 :26165, "Esp:1153")
124#endif
125CdCommonCreate (
128 )
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167{
170
172
175
179
181
185
188
190
191
192
193
194
195
196
197
198
199
200
201
202
206
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
233
237
239
240
241
242
243
244
245 if (IrpContext->Vcb ==
NULL) {
246
249 }
250
251
252
253
254
258
259
260
261
262
263
264
265
266
267
268
272
275 }
276
277#if (NTDDI_VERSION >= NTDDI_WIN7)
278
279
280
281
283
286 }
287#endif
288
289
290
291
292
293 Vcb = IrpContext->Vcb;
294 NextFcb =
Vcb->RootIndexFcb;
295
296
297
298
299
301 RelatedFileObject =
NULL;
302
304
305
306
307
308
309
311
312 RelatedFileObject =
FileObject->RelatedFileObject;
314
315 RelatedTypeOfOpen = CdDecodeFileObject( IrpContext, RelatedFileObject, &NextFcb, &RelatedCcb );
316
317
318
319
320
322
325 }
326
327
328
329
330
331 RelatedFileName = &RelatedFileObject->FileName;
332 }
333
334
335
336
337
338
339
340
341
342
343
344
345
346 Status = CdNormalizeFileNames( IrpContext,
350 RelatedTypeOfOpen,
351 RelatedCcb,
352 RelatedFileName,
355
356
357
358
359
361
364 }
365
366
367
368
369
370
374
377
378 } else {
379
381 }
382
383
384
385
386
388
389
390
391
392
393
395
396
397
398
399
401
403 }
404
405
406
407
408
409
411
412
413
414
415
416
418
420 }
421
422
423
424
425
428
430 }
431
432
433
434
435
437
439 }
440
445 }
446
447
448
449
450
451
452 if (VolumeOpen) {
453
454
455
456
457
460
462 }
463
464
465
466
467
469
471 }
472
473
474
475
476
479
486 }
487
488
489
490
491
492
493
496
497
498
499
500
502
503
504
505
506
507 CdFindPrefix( IrpContext,
511 }
512
513
514
515
516
517
519
520
521
522
523
524
526
529
531 }
532
533
534
535
536
539
541 }
542
548 RelatedCcb ));
549
550
551
552
553
554
556
558
559
560
561
562
563 } else {
564
565
566
567
568
571
573 }
574
580 RelatedCcb ));
581 }
582 }
583
584
585
586
587
588
589
590
591
592
593
595
597 }
598
599
600
601
602
604
606 }
607
608
609
610
611
613
615
616 ShortNameMatch =
FALSE;
617
618
619
620
621
625
626
627
628
629
631 CleanupCompoundPathEntry =
TRUE;
632
633 FoundEntry = CdFindPathEntry( IrpContext,
635 &FinalName,
638
639
640
641
642
643
644 if (!FoundEntry) {
645
647
648
649
650
651
652
654
655 if (CleanupFileContext) {
656
658 }
659
661 CleanupFileContext =
TRUE;
662
663 FoundEntry = CdFindFileByShortName( IrpContext,
665 &FinalName,
669
670
671
672
673
674
675 if (FoundEntry) {
676
677 ShortNameMatch =
TRUE;
678
681
684
685 FoundEntry = CdFindPathEntry( IrpContext,
690
691
692
693
694
695 if (!FoundEntry) {
696
698 }
699
700
701
702
703
704
706
708 }
709
710
711
712
713
714
715
717
718
719
720
721
722
724 break;
725
726 } else {
727
729 }
730 }
731 }
732
733
734
735
736
737
738
739
740 if (!FoundEntry) {
741
743
744 break;
745
746
747
748
749
750 } else {
751
753 }
754 }
755 }
756
757
758
759
760
761
762
764
768 }
769
770
771
772
773
774
776
778
780 }
781
782
783
784
785
788
790 }
791
796 &FinalName,
798 ShortNameMatch,
801 RelatedCcb ));
802 }
803
804
805
806
807
808 CdOpenDirectoryFromPathEntry( IrpContext,
812 &FinalName,
814 ShortNameMatch,
818
820 CleanupCompoundPathEntry =
FALSE;
821 }
822
823
824
825
826
827
828 if (!FoundEntry) {
829
830 if (CleanupFileContext) {
831
833 }
834
836 CleanupFileContext =
TRUE;
837
838
839
840
841
842 CdConvertNameToCdName( IrpContext, &FinalName );
843
844 FoundEntry = CdFindFile( IrpContext,
846 &FinalName,
850 }
851
852
853
854
855
856
857 if (!FoundEntry) {
858
861
863 }
864
865
866
867
868
870 }
871
872
873
874
875
876
878
880 }
881
882
883
884
885
888
890 }
891
892
893
894
895
898
900 }
901
902
903
904
905
906
907
909
913 }
914
915
916
917
918
919
924 &FinalName,
928 RelatedCcb ));
929
932
933
934
935
936
937 if (CleanupCompoundPathEntry) {
938
940 }
941
942
943
944
945
946 if (CleanupFileContext) {
947
949 }
950
951
952
953
954
955
957
958
959
960
961
962
963
966
968
969 CdTeardownStructures( IrpContext,
CurrentFcb, &RemovedFcb );
970
971 if (RemovedFcb) {
972
974 }
975 }
976
977
978
979
980
983
984
985
986
987
988
990
993 }
994
995
996
997
998
1002 }
1003
1004
1005
1006
1007
1009
1010
1011
1012
1013
1014
1017
1019}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
VOID CdDissectName(_In_ PIRP_CONTEXT IrpContext, _Inout_ PUNICODE_STRING RemainingName, _Out_ PUNICODE_STRING FinalName)
#define CdReleaseVcb(IC, V)
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _Inout_ PFILE_ENUM_CONTEXT _Out_ PCD_NAME * MatchingName
VOID CdVerifyVcb(_In_ PIRP_CONTEXT IrpContext, _Inout_ PVCB Vcb)
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
VOID CdUpcaseName(_In_ PIRP_CONTEXT IrpContext, _In_ PCD_NAME Name, _Inout_ PCD_NAME UpcaseName)
#define CdAcquireVcbShared(IC, V, I)
#define CdAcquireVcbExclusive(IC, V, I)
ULONG CdShortNameDirentOffset(_In_ PIRP_CONTEXT IrpContext, _In_ PUNICODE_STRING Name)
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _In_ ULONG ShortNameDirentOffset
#define CdRaiseStatus(IC, S)
#define IRP_CONTEXT_FLAG_WAIT
#define VCB_STATE_AUDIO_DISK
#define IRP_CONTEXT_FLAG_TRAIL_BACKSLASH
#define _Analysis_assume_lock_held_(lock)
#define NT_SUCCESS(StatCode)
#define SafeNodeType(Ptr)
#define BooleanFlagOn(F, SF)
struct _FileName FileName
#define FILE_OPEN_BY_FILE_ID
#define FILE_OPEN_REQUIRING_OPLOCK
#define _SEH2_AbnormalTermination()
UNICODE_STRING VersionString
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_OBJECT_PATH_NOT_FOUND
#define STATUS_DISK_CORRUPT_ERROR
#define STATUS_FILE_CORRUPT_ERROR
#define STATUS_OBJECT_NAME_NOT_FOUND
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG _Out_opt_ PULONG CreateDisposition
#define SL_OPEN_PAGING_FILE
#define SL_OPEN_TARGET_DIRECTORY
#define SL_CASE_SENSITIVE