Changeset 46593 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 17, 2013 2:32:51 PM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/win/dllmain.cpp
r44528 r46593 46 46 47 47 // idempotent, so doesn't harm, and needed for COM embedding scenario 48 RTR3InitDll( 0);48 RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); 49 49 } 50 50 else if (dwReason == DLL_PROCESS_DETACH) -
trunk/src/VBox/Main/src-server/win/PerformanceWin.cpp
r46460 r46593 34 34 35 35 #include <iprt/err.h> 36 #include <iprt/ldr.h> 36 37 #include <iprt/mp.h> 37 38 #include <iprt/mem.h> … … 87 88 PFNGST mpfnGetSystemTimes; 88 89 PFNNQSI mpfnNtQuerySystemInformation; 89 HMODULE mhNtDll;90 90 91 91 ULONG totalRAM; … … 97 97 } 98 98 99 CollectorWin::CollectorWin() : CollectorHAL(), m hNtDll(0)100 { 101 mpfnGetSystemTimes = (PFNGST)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),102 99 CollectorWin::CollectorWin() : CollectorHAL(), mpfnNtQuerySystemInformation(NULL) 100 { 101 /* Note! Both kernel32.dll and ntdll.dll can be assumed to always be present. */ 102 mpfnGetSystemTimes = (PFNGST)RTLdrGetSystemSymbol("kernel32.dll", "GetSystemTimes"); 103 103 if (!mpfnGetSystemTimes) 104 104 { 105 105 /* Fall back to deprecated NtQuerySystemInformation */ 106 if (!(mhNtDll = LoadLibrary(TEXT("ntdll.dll")))) 107 { 108 LogRel(("Failed to load NTDLL.DLL with error 0x%x. GetSystemTimes() is" 109 " not available either. CPU and VM metrics will not be collected.\n", 110 GetLastError())); 111 mpfnNtQuerySystemInformation = 0; 112 } 113 else if (!(mpfnNtQuerySystemInformation = (PFNNQSI)GetProcAddress(mhNtDll, 114 "NtQuerySystemInformation"))) 115 { 116 LogRel(("Neither GetSystemTimes() nor NtQuerySystemInformation() is" 117 " not available. CPU and VM metrics will not be collected.\n")); 118 mpfnNtQuerySystemInformation = 0; 119 } 106 mpfnNtQuerySystemInformation = (PFNNQSI)RTLdrGetSystemSymbol("ntdll.dll", "NtQuerySystemInformation"); 107 if (!mpfnNtQuerySystemInformation) 108 LogRel(("Warning! Neither GetSystemTimes() nor NtQuerySystemInformation() is not available.\n" 109 " CPU and VM metrics will not be collected! (lasterr %u)\n", GetLastError())); 120 110 } 121 111 … … 130 120 CollectorWin::~CollectorWin() 131 121 { 132 if (mhNtDll)133 FreeLibrary(mhNtDll);134 122 } 135 123
Note:
See TracChangeset
for help on using the changeset viewer.