Changeset 70346 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Dec 26, 2017 3:52:28 PM (7 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk
r70330 r70346 189 189 190 190 VBoxService_USES.win += vboximportchecker 191 VBoxService_VBOX_IMPORT_CHECKER.win.x86 = nt 4191 VBoxService_VBOX_IMPORT_CHECKER.win.x86 = nt31 192 192 VBoxService_VBOX_IMPORT_CHECKER.win.amd64 = xp64 193 193 -
trunk/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp
r70267 r70346 78 78 decltype(Module32First) *g_pfnModule32First; /**< W2K+, but Geoff says NT4. Hmm. */ 79 79 decltype(Module32Next) *g_pfnModule32Next; /**< W2K+, but Geoff says NT4. Hmm. */ 80 decltype(GetSystemTimeAdjustment) *g_pfnGetSystemTimeAdjustment; /**< NT 3.50+ */ 81 decltype(SetSystemTimeAdjustment) *g_pfnSetSystemTimeAdjustment; /**< NT 3.50+ */ 80 82 /** @} */ 81 83 … … 136 138 RESOLVE_SYMBOL(Module32First); 137 139 RESOLVE_SYMBOL(Module32Next); 140 RESOLVE_SYMBOL(GetSystemTimeAdjustment); 141 RESOLVE_SYMBOL(SetSystemTimeAdjustment); 138 142 RTLdrClose(hLdrMod); 139 143 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r70214 r70346 209 209 extern decltype(Module32Next) *g_pfnModule32Next; 210 210 # endif 211 extern decltype(GetSystemTimeAdjustment) *g_pfnGetSystemTimeAdjustment; 212 extern decltype(SetSystemTimeAdjustment) *g_pfnSetSystemTimeAdjustment; 211 213 # ifdef ___iprt_nt_nt_h___ 212 214 extern decltype(ZwQuerySystemInformation) *g_pfnZwQuerySystemInformation; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
r70072 r70346 367 367 } 368 368 369 if (GetSystemTimeAdjustment(&g_dwWinTimeAdjustment, &g_dwWinTimeIncrement, &g_bWinTimeAdjustmentDisabled)) 370 vgsvcTimeSyncLog(0, "vgsvcTimeSyncInit: Initially %ld (100ns) units per %ld (100 ns) units interval, disabled=%d\n", 371 g_dwWinTimeAdjustment, g_dwWinTimeIncrement, g_bWinTimeAdjustmentDisabled ? 1 : 0); 372 else 373 { 374 DWORD dwErr = GetLastError(); 375 rc = RTErrConvertFromWin32(dwErr); 376 VGSvcError("vgsvcTimeSyncInit: Could not get time adjustment values! Last error: %ld!\n", dwErr); 369 if (g_pfnGetSystemTimeAdjustment) 370 { 371 if (g_pfnGetSystemTimeAdjustment(&g_dwWinTimeAdjustment, &g_dwWinTimeIncrement, &g_bWinTimeAdjustmentDisabled)) 372 vgsvcTimeSyncLog(0, "vgsvcTimeSyncInit: Initially %ld (100ns) units per %ld (100 ns) units interval, disabled=%d\n", 373 g_dwWinTimeAdjustment, g_dwWinTimeIncrement, g_bWinTimeAdjustmentDisabled ? 1 : 0); 374 else 375 { 376 DWORD dwErr = GetLastError(); 377 rc = RTErrConvertFromWin32(dwErr); 378 VGSvcError("vgsvcTimeSyncInit: Could not get time adjustment values! Last error: %ld!\n", dwErr); 379 } 377 380 } 378 381 #endif /* RT_OS_WINDOWS */ … … 400 403 return false; 401 404 405 /* The API appeared in NT 3.50. */ 406 if ( !g_pfnSetSystemTimeAdjustment 407 || !g_pfnGetSystemTimeAdjustment) 408 return false; 409 402 410 DWORD dwWinTimeAdjustment, dwWinNewTimeAdjustment, dwWinTimeIncrement; 403 411 BOOL fWinTimeAdjustmentDisabled; 404 if ( GetSystemTimeAdjustment(&dwWinTimeAdjustment, &dwWinTimeIncrement, &fWinTimeAdjustmentDisabled))412 if (g_pfnGetSystemTimeAdjustment(&dwWinTimeAdjustment, &dwWinTimeIncrement, &fWinTimeAdjustmentDisabled)) 405 413 { 406 414 DWORD dwDiffMax = g_dwWinTimeAdjustment * 0.50; … … 429 437 vgsvcTimeSyncLog(3, "vgsvcTimeSyncAdjust: OrgTA=%ld, CurTA=%ld, NewTA=%ld, DiffNew=%ld, DiffMax=%ld\n", 430 438 g_dwWinTimeAdjustment, dwWinTimeAdjustment, dwWinNewTimeAdjustment, dwDiffNew, dwDiffMax); 431 if ( SetSystemTimeAdjustment(dwWinNewTimeAdjustment, FALSE /* Periodic adjustments enabled. */))439 if (g_pfnSetSystemTimeAdjustment(dwWinNewTimeAdjustment, FALSE /* Periodic adjustments enabled. */)) 432 440 { 433 441 g_cTimeSyncErrors = 0; … … 475 483 if (g_hTokenProcess == NULL) /* No process token (anymore)? */ 476 484 return; 477 if (SetSystemTimeAdjustment(0, TRUE /* Periodic adjustments disabled. */)) 485 if (!g_pfnSetSystemTimeAdjustment) 486 return; 487 if (g_pfnSetSystemTimeAdjustment(0, TRUE /* Periodic adjustments disabled. */)) 478 488 vgsvcTimeSyncLog(5, "vgsvcTimeSyncCancelAdjust: Windows Time Adjustment is now disabled.\n"); 479 489 else if (g_cTimeSyncErrors++ < 10)
Note:
See TracChangeset
for help on using the changeset viewer.