Changeset 77816 in vbox
- Timestamp:
- Mar 21, 2019 12:01:49 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129490
- Location:
- trunk
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r77802 r77816 4506 4506 TEMPLATE_VBOXR0DRV_DEFS.x86 += WIN9X_COMPAT_SPINLOCK # Avoid multiply defined _KeInitializeSpinLock@4 4507 4507 TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_ 4508 TEMPLATE_VBOXR0DRV_DEFS.win = IPRT_NT_MAP_TO_ZW 4508 4509 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -Gz -GS- -Zc:wchar_t- $(VBOX_VCC_FP) -Gs4096 $(VBOX_VCC_OPT) \ 4509 4510 $(VBOX_VCC_WARN_ALL) $(VBOX_VCC_WERR) -
trunk/include/iprt/nt/nt.h
r76585 r77816 40 40 41 41 #ifdef IPRT_NT_MAP_TO_ZW 42 # define NtQueryDirectoryFile ZwQueryDirectoryFile 42 43 # define NtQueryInformationFile ZwQueryInformationFile 43 44 # define NtQueryInformationProcess ZwQueryInformationProcess … … 388 389 */ 389 390 RTDECL(int) RTNtPathExpand8dot3Path(struct _UNICODE_STRING *pUniStr, bool fPathOnly); 391 392 /** 393 * Wrapper around RTNtPathExpand8dot3Path that allocates a buffer instead of 394 * working on the input buffer. 395 * 396 * @returns IPRT status code, see RTNtPathExpand8dot3Path(). 397 * @param pUniStrSrc The path to fix up. MaximumLength is the max buffer 398 * length. 399 * @param fPathOnly Whether to only process the path and leave the filename 400 * as passed in. 401 * @param pUniStrDst Output string. On success, the caller must use 402 * RTUtf16Free to free what the Buffer member points to. 403 * This is all zeros and NULL on failure. 404 */ 405 RTDECL(int) RTNtPathExpand8dot3PathA(struct _UNICODE_STRING const *pShort, bool fPathOnly, struct _UNICODE_STRING *pUniStrDst); 390 406 391 407 -
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r77803 r77816 393 393 $(VBOX_PATH_RUNTIME_SRC)/nt/RTNtPathFindPossible8dot3Name.cpp \ 394 394 $(VBOX_PATH_RUNTIME_SRC)/nt/RTNtPathExpand8dot3Path.cpp \ 395 $(VBOX_PATH_RUNTIME_SRC)/nt/RTNtPathExpand8dot3PathA.cpp \ 395 396 $(VBOX_PATH_RUNTIME_SRC)/r3/nt/pathint-nt.cpp \ 396 397 $(VBOX_PATH_RUNTIME_SRC)/win/RTErrConvertFromWin32.cpp \ -
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 -
trunk/src/VBox/Runtime/Makefile.kmk
r77797 r77816 840 840 nt/RTErrConvertFromNtStatus.cpp \ 841 841 nt/RTNtPathExpand8dot3Path.cpp \ 842 nt/RTNtPathExpand8dot3PathA.cpp \ 842 843 nt/RTNtPathFindPossible8dot3Name.cpp \ 843 844 nt/fileioutils-nt.cpp \ … … 2930 2931 nt/RTErrConvertFromNtStatus.cpp \ 2931 2932 nt/RTNtPathExpand8dot3Path.cpp \ 2933 nt/RTNtPathExpand8dot3PathA.cpp \ 2932 2934 nt/RTNtPathFindPossible8dot3Name.cpp \ 2933 2935 r0drv/generic/threadctxhooks-r0drv-generic.cpp \ -
trunk/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp
r76553 r77816 85 85 case STATUS_SHARING_VIOLATION: return VERR_SHARING_VIOLATION; 86 86 case STATUS_NO_MEDIA_IN_DEVICE: return VERR_DRIVE_IS_EMPTY; 87 case STATUS_ACCESS_VIOLATION: return VERR_INVALID_POINTER; 87 88 88 89 case STATUS_REPARSE_POINT_NOT_RESOLVED: -
trunk/src/VBox/Runtime/nt/RTNtPathExpand8dot3Path.cpp
r76553 r77816 30 30 *********************************************************************************************************************************/ 31 31 #define LOG_GROUP RTLOGGROUP_FS 32 #if !defined(IPRT_NT_MAP_TO_ZW) && defined(IN_RING0) 33 # define IPRT_NT_MAP_TO_ZW 34 #endif 32 35 #ifdef IN_SUP_HARDENED_R3 33 36 # include <iprt/nt/nt-and-windows.h> -
trunk/src/VBox/Runtime/r0drv/nt/dbgkrnlinfo-r0drv-nt.cpp
r77473 r77816 35 35 #define PIMAGE_NT_HEADERS32 NT_PIMAGE_NT_HEADERS32 36 36 #define PIMAGE_NT_HEADERS64 NT_PIMAGE_NT_HEADERS64 37 #define IPRT_NT_MAP_TO_ZW 37 #ifndef IPRT_NT_MAP_TO_ZW 38 # define IPRT_NT_MAP_TO_ZW 39 #endif 38 40 #include "the-nt-kernel.h" 39 41 #include <iprt/dbg.h>
Note:
See TracChangeset
for help on using the changeset viewer.