Changeset 57378 in vbox for trunk/src/VBox/HostDrivers/Support/win
- Timestamp:
- Aug 17, 2015 11:54:27 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 102142
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r57358 r57378 1843 1843 1844 1844 /** 1845 * memcmp + log.1845 * memcmp + errormsg + log. 1846 1846 * 1847 1847 * @returns Same as memcmp. … … 1850 1850 * @param uRva The RVA to start comparing at. 1851 1851 * @param cb The number of bytes to compare. 1852 */ 1853 static int supdrvNtCompare(PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, uint32_t uRva, uint32_t cb) 1852 * @param pReq The load request. 1853 */ 1854 static int supdrvNtCompare(PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, uint32_t uRva, uint32_t cb, PSUPLDRLOAD pReq) 1854 1855 { 1855 1856 int iDiff = memcmp((uint8_t const *)pImage->pvImage + uRva, pbImageBits + uRva, cb); … … 1861 1862 if (pbNativeBits[off] != pbImageBits[off]) 1862 1863 { 1863 char szBytes[128]; 1864 RTStrPrintf(szBytes, sizeof(szBytes), "native: %.*Rhxs our: %.*Rhxs", 1865 RT_MIN(12, cbLeft), &pbNativeBits[off], 1866 RT_MIN(12, cbLeft), &pbImageBits[off]); 1867 SUPR0Printf("VBoxDrv: Mismatch at %#x of %s: %s\n", off, pImage->szName, szBytes); 1864 /* Note! We need to copy image bits into a temporary stack buffer here as we'd 1865 otherwise risk overwriting them while formatting the error message. */ 1866 uint8_t abBytes[64]; 1867 memcpy(abBytes, &pbImageBits[off], RT_MIN(64, cbLeft)); 1868 supdrvLdrLoadError(VERR_LDR_MISMATCH_NATIVE, pReq, 1869 "Mismatch at %#x of %s:\n" 1870 "ntld: %.*Rhxs\n" 1871 "iprt: %.*Rhxs", 1872 off, pImage->szName, 1873 RT_MIN(64, cbLeft), &pbNativeBits[off], 1874 RT_MIN(64, cbLeft), &abBytes[0]); 1875 SUPR0Printf("VBoxDrv: %s", pReq->u.Out.szError); 1868 1876 break; 1869 1877 } … … 1872 1880 } 1873 1881 1882 1874 1883 int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) 1875 1884 { 1876 NOREF(pDevExt); NOREF(pReq);1885 NOREF(pDevExt); 1877 1886 if (pImage->pvNtSectionObj) 1878 1887 { … … 1955 1964 { 1956 1965 if (uRvaNext < aExcludeRgns[i].uRva) 1957 iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, aExcludeRgns[i].uRva - uRvaNext );1966 iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, aExcludeRgns[i].uRva - uRvaNext, pReq); 1958 1967 uRvaNext = aExcludeRgns[i].uRva + aExcludeRgns[i].cb; 1959 1968 } 1960 1969 if (!iDiff && uRvaNext < pImage->cbImageBits) 1961 iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, pImage->cbImageBits - uRvaNext );1970 iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, pImage->cbImageBits - uRvaNext, pReq); 1962 1971 if (!iDiff) 1963 1972 return VINF_SUCCESS; 1964 1973 } 1965 1974 else 1966 supdrvNtCompare(pImage, pbImageBits, 0, pImage->cbImageBits );1975 supdrvNtCompare(pImage, pbImageBits, 0, pImage->cbImageBits, pReq); 1967 1976 return VERR_LDR_MISMATCH_NATIVE; 1968 1977 } 1969 return VERR_INTERNAL_ERROR_4;1978 return supdrvLdrLoadError(VERR_INTERNAL_ERROR_4, pReq, "No NT section object! Impossible!"); 1970 1979 } 1971 1980
Note:
See TracChangeset
for help on using the changeset viewer.