Changeset 63089 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Aug 6, 2016 3:04:26 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 109703
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp
r62679 r63089 24 24 #include <tchar.h> 25 25 #include <strsafe.h> 26 #pragma warning(push) 27 #pragma warning(disable: 4995) /* warning C4995: 'lstrcpyA': name was marked as #pragma deprecated */ 26 28 #include "exdll.h" 29 #pragma warning(pop) 27 30 28 31 #include <iprt/err.h> … … 221 224 * @param stacktop Pointer to a pointer to the current stack. 222 225 */ 223 VBOXINSTALLHELPER_EXPORT DisableWFP(HWND hwndParent, int string_size, 224 TCHAR *variables, stack_t **stacktop) 225 { 226 VBOXINSTALLHELPER_EXPORT DisableWFP(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop) 227 { 228 NOREF(hwndParent); 226 229 EXDLL_INIT(); 227 230 … … 252 255 if (SUCCEEDED(hr)) 253 256 { 254 if (g_pfnSfcFileException(0, pwszFile, -1) != 0)257 if (g_pfnSfcFileException(0, pwszFile, UINT32_MAX) != 0) 255 258 hr = HRESULT_FROM_WIN32(GetLastError()); 256 259 vboxChar2WCharFree(pwszFile); … … 274 277 * @param stacktop Pointer to a pointer to the current stack. 275 278 */ 276 VBOXINSTALLHELPER_EXPORT FileGetArchitecture(HWND hwndParent, int string_size, 277 TCHAR *variables, stack_t **stacktop) 278 { 279 VBOXINSTALLHELPER_EXPORT FileGetArchitecture(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop) 280 { 281 NOREF(hwndParent); 279 282 EXDLL_INIT(); 280 283 … … 290 293 hr = __HRESULT_FROM_WIN32(ERROR_FILE_INVALID); 291 294 292 BYTE byOffsetPE; /* Absolute offset of PE signature. */295 BYTE offPeHdr = 0; /* Absolute offset of PE signature. */ 293 296 294 297 /* Do some basic validation. */ … … 302 305 { 303 306 /* Read actual offset of PE signature. */ 304 if (fread(&byOffsetPE, sizeof(BYTE), 1, pFh) == 1) 307 /** @todo r=bird: You've obviously no clue about the structure you're messing with here. The field is NOT a BYTE 308 * field but a int32_t/uint32_t! The MZ header is defined as IMAGE_DOS_HEADER by windows.h (well, winnt.h), and the 309 * field you're accessing is e_lfanew. Please rewrite this hack to use the structures! (Also, the MZ structure is 310 * OPTIONAL, just in case you didn't know.) */ 311 #ifdef DEBUG_andy 312 # error "Fix this" 313 #endif 314 if (fread(&offPeHdr, sizeof(BYTE), 1, pFh) == 1) 305 315 { 306 316 /* ... and seek to it. */ 307 if (!fseek(pFh, byOffsetPE, SEEK_SET))317 if (!fseek(pFh, offPeHdr, SEEK_SET)) 308 318 { 309 319 /* Validate PE signature. */ … … 321 331 if (SUCCEEDED(hr)) 322 332 { 323 BYTE byOffsetCOFF = byOffsetPE+ 0x4; /* Skip PE signature. */333 BYTE offFileHeaderMachineField = offPeHdr + 0x4; /* Skip PE signature. */ 324 334 325 335 /** @todo When we need to do more stuff here, we probably should … … 329 339 /* Jump to machine type (first entry, 2 bytes): 330 340 * Use absolute PE offset retrieved above. */ 331 if (!fseek(pFh, byOffsetCOFF, SEEK_SET))341 if (!fseek(pFh, offFileHeaderMachineField, SEEK_SET)) 332 342 { 333 343 WORD wMachineType; … … 376 386 * @param stacktop Pointer to a pointer to the current stack. 377 387 */ 378 VBOXINSTALLHELPER_EXPORT FileGetVendor(HWND hwndParent, int string_size, 379 TCHAR *variables, stack_t **stacktop) 380 { 388 VBOXINSTALLHELPER_EXPORT FileGetVendor(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop) 389 { 390 NOREF(hwndParent); 381 391 EXDLL_INIT(); 382 392 … … 402 412 403 413 TCHAR szQuery[MAX_PATH]; 414 #pragma warning(suppress:4995) /* warning C4995: '_sntprintf': name was marked as #pragma deprecated */ 404 415 _sntprintf(szQuery, sizeof(szQuery), _T("StringFileInfo\\%04X%04X\\CompanyName"), 405 416 wCodePage,wLanguageID); … … 438 449 * @param stacktop Pointer to a pointer to the current stack. 439 450 */ 440 VBOXINSTALLHELPER_EXPORT VBoxTrayShowBallonMsg(HWND hwndParent, int string_size, 441 TCHAR *variables, stack_t **stacktop) 442 { 451 VBOXINSTALLHELPER_EXPORT VBoxTrayShowBallonMsg(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop) 452 { 453 NOREF(hwndParent); 443 454 EXDLL_INIT(); 444 455 … … 505 516 } 506 517 507 BOOL WINAPI DllMain(HANDLE hInst, ULONG uReason, LPVOID lpReserved) 508 { 518 BOOL WINAPI DllMain(HANDLE hInst, ULONG uReason, LPVOID pReserved) 519 { 520 RT_NOREF(uReason, pReserved); 509 521 g_hInstance = (HINSTANCE)hInst; 510 522 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.