File tree Expand file tree Collapse file tree 4 files changed +22
-14
lines changed Expand file tree Collapse file tree 4 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -1311,17 +1311,19 @@ PhLoadAllImportsForDll(
1311
1311
);
1312
1312
1313
1313
PHLIBAPI
1314
- PPH_STRING
1314
+ PVOID
1315
1315
NTAPI
1316
1316
PhGetFileText (
1317
- _In_ HANDLE FileHandle
1317
+ _In_ HANDLE FileHandle ,
1318
+ _In_ BOOLEAN Unicode
1318
1319
);
1319
1320
1320
1321
PHLIBAPI
1321
- PPH_STRING
1322
+ PVOID
1322
1323
NTAPI
1323
1324
PhFileReadAllText (
1324
- _In_ PWSTR FileName
1325
+ _In_ PWSTR FileName ,
1326
+ _In_ BOOLEAN Unicode
1325
1327
);
1326
1328
1327
1329
PHLIBAPI
Original file line number Diff line number Diff line change @@ -673,7 +673,7 @@ VOID PhInitializeCapabilitySidCache(
673
673
capabilityListFileName = PhConcatStringRefZ (& applicationDirectory -> sr , L"capslist.txt" );
674
674
PhDereferenceObject (applicationDirectory );
675
675
676
- capabilityListString = PhFileReadAllText (capabilityListFileName -> Buffer );
676
+ capabilityListString = PhFileReadAllText (capabilityListFileName -> Buffer , TRUE );
677
677
PhDereferenceObject (capabilityListFileName );
678
678
}
679
679
Original file line number Diff line number Diff line change @@ -6664,11 +6664,12 @@ PPH_STRING PhGetExportNameFromOrdinal(
6664
6664
return NULL ;
6665
6665
}
6666
6666
6667
- PPH_STRING PhGetFileText (
6668
- _In_ HANDLE FileHandle
6667
+ PVOID PhGetFileText (
6668
+ _In_ HANDLE FileHandle ,
6669
+ _In_ BOOLEAN Unicode
6669
6670
)
6670
6671
{
6671
- PPH_STRING string = NULL ;
6672
+ PVOID string = NULL ;
6672
6673
PSTR data ;
6673
6674
ULONG allocatedLength ;
6674
6675
ULONG dataLength ;
@@ -6717,19 +6718,24 @@ PPH_STRING PhGetFileText(
6717
6718
if (dataLength > 0 )
6718
6719
{
6719
6720
data [dataLength ] = ANSI_NULL ;
6720
- string = PhConvertUtf8ToUtf16Ex (data , dataLength );
6721
+
6722
+ if (Unicode )
6723
+ string = PhConvertUtf8ToUtf16Ex (data , dataLength );
6724
+ else
6725
+ string = PhCreateBytesEx (data , dataLength );
6721
6726
}
6722
6727
6723
6728
PhFree (data );
6724
6729
6725
6730
return string ;
6726
6731
}
6727
6732
6728
- PPH_STRING PhFileReadAllText (
6729
- _In_ PWSTR FileName
6733
+ PVOID PhFileReadAllText (
6734
+ _In_ PWSTR FileName ,
6735
+ _In_ BOOLEAN Unicode
6730
6736
)
6731
6737
{
6732
- PPH_STRING string = NULL ;
6738
+ PVOID string = NULL ;
6733
6739
HANDLE fileHandle ;
6734
6740
6735
6741
if (NT_SUCCESS (PhCreateFileWin32 (
@@ -6742,7 +6748,7 @@ PPH_STRING PhFileReadAllText(
6742
6748
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
6743
6749
)))
6744
6750
{
6745
- string = PhGetFileText (fileHandle );
6751
+ string = PhGetFileText (fileHandle , Unicode );
6746
6752
NtClose (fileHandle );
6747
6753
}
6748
6754
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ ULONG PhCreateProcessLxss(
384
384
NtClose (outputWriteHandle );
385
385
386
386
// Read the pipe data. (dmex)
387
- lxssOutputString = PhGetFileText (outputReadHandle );
387
+ lxssOutputString = PhGetFileText (outputReadHandle , TRUE );
388
388
389
389
// Get the exit code after we finish reading the data from the pipe. (dmex)
390
390
if (NT_SUCCESS (status = PhGetProcessBasicInformation (processHandle , & basicInfo )))
You can’t perform that action at this time.
0 commit comments