@@ -1923,11 +1923,12 @@ MiQueryMemorySectionName(IN HANDLE ProcessHandle,
19231923 {
19241924 _SEH2_TRY
19251925 {
1926- RtlInitUnicodeString (& SectionName -> SectionFileName , SectionName -> NameBuffer );
1927- SectionName -> SectionFileName .MaximumLength = (USHORT )MemoryInformationLength ;
1926+ RtlInitEmptyUnicodeString (& SectionName -> SectionFileName ,
1927+ (PWSTR )(SectionName + 1 ),
1928+ MemoryInformationLength - sizeof (MEMORY_SECTION_NAME ));
19281929 RtlCopyUnicodeString (& SectionName -> SectionFileName , & ModuleFileName );
19291930
1930- if (ReturnLength ) * ReturnLength = ModuleFileName .Length ;
1931+ if (ReturnLength ) * ReturnLength = ModuleFileName .Length + sizeof ( MEMORY_SECTION_NAME ) ;
19311932
19321933 }
19331934 _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER )
@@ -1938,11 +1939,12 @@ MiQueryMemorySectionName(IN HANDLE ProcessHandle,
19381939 }
19391940 else
19401941 {
1941- RtlInitUnicodeString (& SectionName -> SectionFileName , SectionName -> NameBuffer );
1942- SectionName -> SectionFileName .MaximumLength = (USHORT )MemoryInformationLength ;
1942+ RtlInitEmptyUnicodeString (& SectionName -> SectionFileName ,
1943+ (PWSTR )(SectionName + 1 ),
1944+ MemoryInformationLength - sizeof (MEMORY_SECTION_NAME ));
19431945 RtlCopyUnicodeString (& SectionName -> SectionFileName , & ModuleFileName );
19441946
1945- if (ReturnLength ) * ReturnLength = ModuleFileName .Length ;
1947+ if (ReturnLength ) * ReturnLength = ModuleFileName .Length + sizeof ( MEMORY_SECTION_NAME ) ;
19461948
19471949 }
19481950
0 commit comments