815{
818
820
821
822
823
824
825
826
827 if ((*PathEntry->DirName == 0) &&
828 (PathEntry->DirNameLen == 1)) {
829
830
831
832
833
835
836
837
838
839
841
842
843
844
845
846 PathEntry->CdDirName.VersionString.
Length = 0;
847
848
849
850
851
852 PathEntry->CdCaseDirName = PathEntry->CdDirName;
853
854
855
856
857
858 return;
859 }
860
861
862
863
864
865
866
867 Length = PathEntry->DirNameLen;
868
870
872 }
873
875
877 }
878
879
880
881
882
883
884
885
886
887
888
890 (
Length <=
sizeof( PathEntry->NameBuffer ))) {
891
892 PathEntry->CdDirName.FileName.MaximumLength = sizeof( PathEntry->NameBuffer );
893 PathEntry->CdDirName.FileName.Buffer = PathEntry->NameBuffer;
894
895 } else {
896
897
898
899
900
901
902 if (
Length > PathEntry->CdDirName.FileName.MaximumLength) {
903
904
905
906
907
909
910 CdFreePool( &PathEntry->CdDirName.FileName.Buffer );
912 }
913
917
919
920 PathEntry->CdDirName.FileName.MaximumLength = (
USHORT)
Length;
921 }
922 }
923
924
925
926
927
928
930
932 PathEntry->CdDirName.FileName.MaximumLength,
934 PathEntry->DirName,
935 PathEntry->DirNameLen );
936
940
941 } else {
942
943
944
945
946
948 PathEntry->DirName,
949 PathEntry->DirNameLen,
950 (
PCHAR) PathEntry->CdDirName.FileName.Buffer );
951
952 PathEntry->CdDirName.FileName.Length = (
USHORT) PathEntry->DirNameLen;
953 }
954
955
956
957
958
959 PathEntry->CdDirName.VersionString.Length =
960 PathEntry->CdCaseDirName.VersionString.Length = 0;
961
962
963
964
965
966
967 if (PathEntry->CdDirName.FileName.Buffer[(PathEntry->CdDirName.FileName.Length -
sizeof(
WCHAR )) / 2] ==
L'.') {
968
969
970
971
972
973 PathEntry->CdDirName.FileName.Length -=
sizeof(
WCHAR );
974 }
975
976
977
978
979
980
982
983 PathEntry->CdCaseDirName.FileName.Buffer =
Add2Ptr( PathEntry->CdDirName.FileName.Buffer,
984 PathEntry->CdDirName.FileName.MaximumLength / 2,
986
987 PathEntry->CdCaseDirName.FileName.MaximumLength = PathEntry->CdDirName.FileName.MaximumLength / 2;
988
990 &PathEntry->CdDirName,
991 &PathEntry->CdCaseDirName );
992
993 } else {
994
995 PathEntry->CdCaseDirName = PathEntry->CdDirName;
996 }
997
998 return;
999}
UNICODE_STRING CdUnicodeDirectoryNames[]
VOID CdConvertBigToLittleEndian(_In_ PIRP_CONTEXT IrpContext, _In_reads_bytes_(ByteCount) PCHAR BigEndian, _In_ ULONG ByteCount, _Out_writes_bytes_(ByteCount) PCHAR LittleEndian)
VOID CdUpcaseName(_In_ PIRP_CONTEXT IrpContext, _In_ PCD_NAME Name, _Inout_ PCD_NAME UpcaseName)
#define TAG_PATH_ENTRY_NAME
#define PATH_ENTRY_FLAG_ALLOC_BUFFER
#define ClearFlag(_F, _SF)
_Use_decl_annotations_ NTSTATUS NTAPI RtlOemToUnicodeN(_Out_ PWCHAR UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH OemString, _In_ ULONG OemSize)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define __analysis_assert(e)