Changeset 53821 in vbox
- Timestamp:
- Jan 15, 2015 1:53:02 PM (10 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support/win
- Files:
-
- 2 edited
-
SUPR3HardenedMain-win.cpp (modified) (4 diffs)
-
import-template-ntdll.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r53220 r53821 1797 1797 NTSTATUS rcNtResolve = STATUS_SUCCESS; 1798 1798 bool fSkipValidation = false; 1799 bool fCheckIfLoaded = false; 1799 1800 WCHAR wszPath[260]; 1800 1801 static UNICODE_STRING const s_DefaultSuffix = RTNT_CONSTANT_UNISTR(L".dll"); … … 1933 1934 * Search for the DLL. Only System32 is allowed as the target of 1934 1935 * a search on the API level, all VBox calls will have full paths. 1936 * If the DLL is not in System32, we will resort to check if it's 1937 * refering to an already loaded DLL (fCheckIfLoaded). 1935 1938 */ 1936 1939 AssertCompile(sizeof(g_System32WinPath.awcBuffer) <= sizeof(wszPath)); … … 1955 1958 cwc += 4; 1956 1959 } 1960 fCheckIfLoaded = true; 1957 1961 } 1958 1962 … … 2031 2035 { 2032 2036 DWORD dwErr = RtlGetLastWin32Error(); 2033 SUP_DPRINTF(("supR3HardenedMonitor_LdrLoadDll: error opening '%ls': %u (NtPath=%.*ls; Input=%.*ls)\n", 2037 2038 /* 2039 * Deal with special case where the caller (first case was MS LifeCam) 2040 * is using LoadLibrary instead of GetModuleHandle to find a loaded DLL. 2041 */ 2042 NTSTATUS rcNtGetDll = STATUS_SUCCESS; 2043 if ( fCheckIfLoaded 2044 && ( rcNt == STATUS_OBJECT_NAME_NOT_FOUND 2045 || rcNt == STATUS_OBJECT_PATH_NOT_FOUND)) 2046 { 2047 rcNtGetDll = LdrGetDllHandle(NULL /*DllPath*/, NULL /*pfFlags*/, pOrgName, phMod); 2048 if (NT_SUCCESS(rcNtGetDll)) 2049 { 2050 RtlRestoreLastWin32Error(dwSavedLastError); 2051 return rcNtGetDll; 2052 } 2053 } 2054 2055 SUP_DPRINTF(("supR3HardenedMonitor_LdrLoadDll: error opening '%ls': %u (NtPath=%.*ls; Input=%.*ls; rcNtGetDll=%#x\n", 2034 2056 wszPath, dwErr, NtPathUniStr.Length / sizeof(RTUTF16), NtPathUniStr.Buffer, 2035 pOrgName->Length / sizeof(WCHAR), pOrgName->Buffer ));2057 pOrgName->Length / sizeof(WCHAR), pOrgName->Buffer, rcNtGetDll)); 2036 2058 } 2037 2059 RTNtPathFree(&NtPathUniStr, &hRootDir); -
trunk/src/VBox/HostDrivers/Support/win/import-template-ntdll.h
r52953 r53821 61 61 SUPHARNT_IMPORT_STDCALL_EARLY(LdrInitializeThunk, 12) 62 62 SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(LdrRegisterDllNotification, 16) 63 SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(LdrGetDllHandle, 16) 63 64 64 65 SUPHARNT_IMPORT_STDCALL(RtlAddAccessAllowedAce, 16)
Note:
See TracChangeset
for help on using the changeset viewer.

