Changeset 77816 in vbox for trunk/src/VBox/HostDrivers/Support/win
- Timestamp:
- Mar 21, 2019 12:01:49 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129490
- Location:
- trunk/src/VBox/HostDrivers/Support/win
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r76785 r77816 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #define IPRT_NT_MAP_TO_ZW 31 #ifndef IPRT_NT_MAP_TO_ZW 32 # define IPRT_NT_MAP_TO_ZW 33 #endif 32 34 #define LOG_GROUP LOG_GROUP_SUP_DRV 33 35 #include "../SUPDrvInternal.h" -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
r76553 r77816 30 30 *********************************************************************************************************************************/ 31 31 #ifdef IN_RING0 32 # define IPRT_NT_MAP_TO_ZW 32 # ifndef IPRT_NT_MAP_TO_ZW 33 # define IPRT_NT_MAP_TO_ZW 34 # endif 33 35 # include <iprt/nt/nt.h> 34 36 # include <ntimage.h> -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
r76818 r77816 30 30 *********************************************************************************************************************************/ 31 31 #ifdef IN_RING0 32 # define IPRT_NT_MAP_TO_ZW 32 # ifndef IPRT_NT_MAP_TO_ZW 33 # define IPRT_NT_MAP_TO_ZW 34 # endif 33 35 # include <iprt/nt/nt.h> 34 36 # include <ntimage.h> … … 1166 1168 return true; 1167 1169 } 1170 } 1171 1172 1173 /** 1174 * Compares two paths, expanding 8.3 short names as needed. 1175 * 1176 * @returns true / false. 1177 * @param pUniStr1 The first path. Must be zero terminated! 1178 * @param pUniStr2 The second path. Must be zero terminated! 1179 */ 1180 static bool supHardNtVpArePathsEqual(PCUNICODE_STRING pUniStr1, PCUNICODE_STRING pUniStr2) 1181 { 1182 /* Both strings must be null terminated. */ 1183 Assert(pUniStr1->Buffer[pUniStr1->Length / sizeof(WCHAR)] == '\0'); 1184 Assert(pUniStr2->Buffer[pUniStr1->Length / sizeof(WCHAR)] == '\0'); 1185 1186 /* Simple compare first.*/ 1187 if (supHardNtVpAreUniStringsEqual(pUniStr1, pUniStr2)) 1188 return true; 1189 1190 /* Make long names if needed. */ 1191 UNICODE_STRING UniStrLong1 = { 0, 0, NULL }; 1192 if (RTNtPathFindPossible8dot3Name(pUniStr1->Buffer)) 1193 { 1194 int rc = RTNtPathExpand8dot3PathA(pUniStr1, false /*fPathOnly*/, &UniStrLong1); 1195 if (RT_SUCCESS(rc)) 1196 pUniStr1 = &UniStrLong1; 1197 } 1198 1199 UNICODE_STRING UniStrLong2 = { 0, 0, NULL }; 1200 if (RTNtPathFindPossible8dot3Name(pUniStr2->Buffer)) 1201 { 1202 int rc = RTNtPathExpand8dot3PathA(pUniStr2, false /*fPathOnly*/, &UniStrLong2); 1203 if (RT_SUCCESS(rc)) 1204 pUniStr2 = &UniStrLong2; 1205 } 1206 1207 /* Compare again. */ 1208 bool fCompare = supHardNtVpAreUniStringsEqual(pUniStr1, pUniStr2); 1209 1210 /* Clean up. */ 1211 if (UniStrLong1.Buffer) 1212 RTUtf16Free(UniStrLong1.Buffer); 1213 if (UniStrLong2.Buffer) 1214 RTUtf16Free(UniStrLong2.Buffer); 1215 1216 return fCompare; 1168 1217 } 1169 1218 … … 2264 2313 if (NT_SUCCESS(rcNt)) 2265 2314 { 2266 if (supHardNtVpAreUniStringsEqual(pUniStr, &pImage->Name.UniStr)) 2315 pUniStr->Buffer[pUniStr->Length / sizeof(WCHAR)] = '\0'; 2316 if (supHardNtVpArePathsEqual(pUniStr, &pImage->Name.UniStr)) 2267 2317 rc = VINF_SUCCESS; 2268 2318 else 2269 {2270 pUniStr->Buffer[pUniStr->Length / sizeof(WCHAR)] = '\0';2271 2319 rc = supHardNtVpSetInfo2(pThis, VERR_SUP_VP_EXE_VS_PROC_NAME_MISMATCH, 2272 2320 "Process image name does not match the exectuable we found: %ls vs %ls.", 2273 2321 pUniStr->Buffer, pImage->Name.UniStr.Buffer); 2274 }2275 2322 } 2276 2323 else
Note:
See TracChangeset
for help on using the changeset viewer.