Changeset 46593 in vbox for trunk/src/VBox/Additions/WINNT/Installer
- Timestamp:
- Jun 17, 2013 2:32:51 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86471
- Location:
- trunk/src/VBox/Additions/WINNT/Installer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp
r44529 r46593 197 197 198 198 /** 199 * Loads a system DLL. 200 * 201 * @returns Module handle or NULL 202 * @param pszName The DLL name. 203 */ 204 static HMODULE loadSystemDll(const char *pszName) 205 { 206 char szPath[MAX_PATH]; 207 UINT cchPath = GetSystemDirectoryA(szPath, sizeof(szPath)); 208 size_t cbName = strlen(pszName) + 1; 209 if (cchPath + 1 + cbName > sizeof(szPath)) 210 return NULL; 211 szPath[cchPath] = '\\'; 212 memcpy(&szPath[cchPath + 1], pszName, cbName); 213 return LoadLibraryA(szPath); 214 } 215 216 /** 199 217 * Disables the Windows File Protection for a specified file 200 218 * using an undocumented SFC API call. Don't try this at home! … … 214 232 if (SUCCEEDED(hr)) 215 233 { 216 HMODULE hSFC = LoadLibrary("sfc_os.dll");234 HMODULE hSFC = loadSystemDll("sfc_os.dll"); 217 235 if (NULL != hSFC) 218 236 { -
trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp
r45938 r46593 130 130 if (pCallbackContext) 131 131 fwprintf((FILE*)pCallbackContext, _T("(%u) %u - %s\n"), Event, dwError, pEventDescription); 132 } 133 134 /** 135 * Loads a system DLL. 136 * 137 * @returns Module handle or NULL 138 * @param pszName The DLL name. 139 */ 140 static HMODULE loadSystemDll(const char *pszName) 141 { 142 char szPath[MAX_PATH]; 143 UINT cchPath = GetSystemDirectoryA(szPath, sizeof(szPath)); 144 size_t cbName = strlen(pszName) + 1; 145 if (cchPath + 1 + cbName > sizeof(szPath)) 146 return NULL; 147 szPath[cchPath] = '\\'; 148 memcpy(&szPath[cchPath + 1], pszName, cbName); 149 return LoadLibraryA(szPath); 132 150 } 133 151 … … 146 164 { 147 165 HRESULT hr = S_OK; 148 HMODULE hDIFxAPI = LoadLibrary(_T("DIFxAPI.dll"));166 HMODULE hDIFxAPI = loadSystemDll("DIFxAPI.dll"); 149 167 if (NULL == hDIFxAPI) 150 168 {
Note:
See TracChangeset
for help on using the changeset viewer.