Changeset 57201 in vbox
- Timestamp:
- Aug 5, 2015 7:57:08 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/err.h
r57109 r57201 1812 1812 /** A TSC-delta measurement request is currently being serviced. */ 1813 1813 #define VERR_SUPDRV_TSC_DELTA_MEASUREMENT_BUSY (-3747) 1814 /** The process trying to open VBoxDrv is not a budding VM process (1). */ 1815 #define VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_1 (-3748) 1816 /** The process trying to open VBoxDrv is not a budding VM process (2). */ 1817 #define VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_2 (-3748) 1814 1818 /** @} */ 1815 1819 -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r57108 r57201 846 846 LogRel(("vboxdrv: %p is not a budding VM process (enmProcessKind=%d).\n", 847 847 PsGetProcessId(PsGetCurrentProcess()), pNtProtect->enmProcessKind)); 848 rc = VERR_ ACCESS_DENIED;848 rc = VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_2; 849 849 } 850 850 supdrvNtProtectRelease(pNtProtect); … … 853 853 { 854 854 LogRel(("vboxdrv: %p is not a budding VM process.\n", PsGetProcessId(PsGetCurrentProcess()))); 855 rc = VERR_ ACCESS_DENIED;855 rc = VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_1; 856 856 } 857 857 } … … 1479 1479 /* 1480 1480 * Did we find error info and is the caller requesting data within it? 1481 * If so, c ehck the destination buffer and copy the data into it.1481 * If so, check the destination buffer and copy the data into it. 1482 1482 */ 1483 1483 if ( pCur … … 1489 1489 { 1490 1490 uint32_t offRead = (uint32_t)pStack->Parameters.Read.ByteOffset.QuadPart; 1491 uint32_t cbToRead = pCur->cchErrorInfo - (uint32_t)offRead; 1492 if (cbToRead > pStack->Parameters.Read.Length) 1493 { 1491 uint32_t cbToRead = pCur->cchErrorInfo - offRead; 1492 if (cbToRead < pStack->Parameters.Read.Length) 1493 RT_BZERO((uint8_t *)pvDstBuf + cbToRead, pStack->Parameters.Read.Length - cbToRead); 1494 else 1494 1495 cbToRead = pStack->Parameters.Read.Length; 1495 RT_BZERO((uint8_t *)pvDstBuf + cbToRead, pStack->Parameters.Read.Length - cbToRead);1496 }1497 1496 memcpy(pvDstBuf, &pCur->szErrorInfo[offRead], cbToRead); 1498 1497 pIrp->IoStatus.Information = cbToRead; … … 1522 1521 else 1523 1522 rcNt = STATUS_UNSUCCESSFUL; 1523 1524 /* Paranoia: Clear the buffer on failure. */ 1525 if (!NT_SUCCESS(rcNt)) 1526 { 1527 PVOID pvDstBuf = pIrp->AssociatedIrp.SystemBuffer; 1528 if ( pvDstBuf 1529 && pStack->Parameters.Read.Length) 1530 RT_BZERO(pvDstBuf, pStack->Parameters.Read.Length); 1531 } 1524 1532 } 1525 1533 else … … 4165 4173 pErrorInfo->cchErrorInfo = (uint32_t)RTStrPrintf(pErrorInfo->szErrorInfo, sizeof(pErrorInfo->szErrorInfo), 4166 4174 "supdrvNtProtectVerifyProcess: rc=%d", rc); 4167 if (RT_FAILURE(rc)) 4168 RTLogWriteDebugger(pErrorInfo->szErrorInfo, pErrorInfo->cchErrorInfo); 4175 RTLogWriteDebugger(pErrorInfo->szErrorInfo, pErrorInfo->cchErrorInfo); 4169 4176 4170 4177 int rc2 = RTSemMutexRequest(g_hErrorInfoLock, RT_INDEFINITE_WAIT); -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r57161 r57201 4189 4189 rcNt = NtReadFile(hFile, NULL /*hEvent*/, NULL /*ApcRoutine*/, NULL /*ApcContext*/, &Ios, 4190 4190 &pszErrorInfo[cchPrefix], (ULONG)(cbErrorInfo - cchPrefix - 1), &offRead, NULL); 4191 if (NT_SUCCESS(rcNt) )4191 if (NT_SUCCESS(rcNt) && NT_SUCCESS(Ios.Status) && Ios.Information > 0) 4192 4192 { 4193 4193 memcpy(pszErrorInfo, pszPrefix, cchPrefix); 4194 pszErrorInfo[ cbErrorInfo - 1] = '\0';4194 pszErrorInfo[RT_MIN(cbErrorInfo - 1, Ios.Information)] = '\0'; 4195 4195 SUP_DPRINTF(("supR3HardenedWinReadErrorInfoDevice: '%s'", &pszErrorInfo[cchPrefix])); 4196 4196 } … … 4198 4198 { 4199 4199 *pszErrorInfo = '\0'; 4200 if (rcNt != STATUS_END_OF_FILE) 4201 SUP_DPRINTF(("supR3HardenedWinReadErrorInfoDevice: NtReadFile -> %#x\n", rcNt)); 4200 if (rcNt != STATUS_END_OF_FILE || Ios.Status != STATUS_END_OF_FILE) 4201 SUP_DPRINTF(("supR3HardenedWinReadErrorInfoDevice: NtReadFile -> %#x / %#x / %p\n", 4202 rcNt, Ios.Status, Ios.Information)); 4202 4203 } 4203 4204 }
Note:
See TracChangeset
for help on using the changeset viewer.