Changeset 16954 in vbox
- Timestamp:
- Feb 19, 2009 4:55:55 PM (16 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp
r15811 r16954 1363 1363 1364 1364 /** 1365 * Worker thread to do periodic things such as synchronize the1366 * system time and notify otherdrivers of events.1365 * Worker thread to do periodic things such as notify other 1366 * drivers of events. 1367 1367 * 1368 1368 * @param pDevExt device extension pointer … … 1375 1375 dprintf(("VBoxGuest::vboxWorkerThread entered\n")); 1376 1376 1377 VMMDevReqHostTime *req = NULL;1378 1379 int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqHostTime), VMMDevReq_GetHostTime);1380 1381 if (RT_FAILURE(rc))1382 {1383 dprintf(("VBoxGuest::vboxWorkerThread: could not allocate request buffer, exiting rc = %d!\n", rc));1384 return;1385 }1386 1387 1377 /* perform the hypervisor address space reservation */ 1388 1378 reserveHypervisorMemory(pDevExt); … … 1390 1380 do 1391 1381 { 1392 /* 1393 * Do the time sync 1394 */ 1395 { 1396 LARGE_INTEGER systemTime; 1397 #define TICKSPERSEC 10000000 1398 #define TICKSPERMSEC 10000 1399 #define SECSPERDAY 86400 1400 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (uint64_t)SECSPERDAY) 1401 #define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC) 1402 1403 1404 req->header.rc = VERR_GENERAL_FAILURE; 1405 1406 rc = VbglGRPerform (&req->header); 1407 1408 if (RT_SUCCESS(rc) && RT_SUCCESS(req->header.rc)) 1409 { 1410 uint64_t hostTime = req->time; 1411 1412 // Windows was originally designed in 1601... 1413 systemTime.QuadPart = hostTime * (uint64_t)TICKSPERMSEC + (uint64_t)TICKS_1601_TO_1970; 1414 dprintf(("VBoxGuest::vboxWorkerThread: synching time with host time (msec/UTC): %llu\n", hostTime)); 1415 ZwSetSystemTime(&systemTime, NULL); 1416 } 1417 else 1418 { 1419 dprintf(("VBoxGuest::PowerStateRequest: error performing request to VMMDev." 1420 "rc = %d, VMMDev rc = %Rrc\n", rc, req->header.rc)); 1421 } 1422 } 1382 /* Nothing to do here yet. */ 1423 1383 1424 1384 /* … … 1440 1400 1441 1401 dprintf(("VBoxGuest::vboxWorkerThread: we've been asked to terminate!\n")); 1442 1443 /* free our request buffer */1444 VbglGRFree (&req->header);1445 1402 1446 1403 if (pDevExt->workerThread) -
trunk/src/VBox/Additions/WINNT/VBoxService/Makefile.kmk
r15176 r16954 33 33 VBoxService.cpp \ 34 34 VBoxUtils.cpp \ 35 VBoxService.rc 36 35 VBoxService.rc \ 36 VBoxTimeSync.cpp 37 37 ifdef VBOX_WITH_GUEST_PROPS 38 38 VBoxService_SOURCES += \ -
trunk/src/VBox/Additions/WINNT/VBoxService/VBoxService.cpp
r13837 r16954 24 24 #include "VBoxVMInfo.h" 25 25 #endif 26 #include "VBoxTimeSync.h" 26 27 #include "resource.h" 27 28 … … 53 54 }, 54 55 #endif 56 { 57 "TimeSync", 58 vboxTimeSyncInit, 59 vboxTimeSyncThread, 60 vboxTimeSyncDestroy, 61 }, 55 62 { 56 63 NULL -
trunk/src/VBox/Additions/WINNT/VBoxService/VBoxService.h
r13462 r16954 35 35 #include <iprt/assert.h> 36 36 #include <iprt/initterm.h> 37 #include <iprt/log.h> 37 38 #include <iprt/string.h> 38 #include <iprt/ log.h>39 #include <iprt/time.h> 39 40 40 41 #include <VBox/version.h> -
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r12446 r16954 98 98 VBoxGuestR3LibGR.cpp \ 99 99 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 100 VBoxGuestR3LibMisc.cpp 100 VBoxGuestR3LibMisc.cpp \ 101 VBoxGuestR3LibTime.cpp 101 102 endif 102 103
Note:
See TracChangeset
for help on using the changeset viewer.