Changeset 47977 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Aug 21, 2013 4:37:27 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp
r47973 r47977 52 52 } VBOXIPCCONTEXT, *PVBOXIPCCONTEXT; 53 53 static VBOXIPCCONTEXT gCtx = {0}; 54 55 /** Function pointer for GetLastInputInfo(). */ 56 typedef BOOL (WINAPI *PFNGETLASTINPUTINFO)(PLASTINPUTINFO); 54 57 55 58 /** … … 69 72 /** The thread handle. */ 70 73 RTTHREAD hThread; 71 /** Pointer to GetLastInputInfo() function. */72 BOOL (WINAPI * pfnGetLastInputInfo)(PLASTINPUTINFO);73 74 74 75 } VBOXIPCSESSION, *PVBOXIPCSESSION; 76 77 /** Static pointer to GetLastInputInfo() function. */ 78 static PFNGETLASTINPUTINFO s_pfnGetLastInputInfo = NULL; 75 79 76 80 int vboxIPCSessionDestroyLocked(PVBOXIPCSESSION pSession); … … 118 122 bool fLastInputAvailable = false; 119 123 VBOXTRAYIPCRES_USERLASTINPUT ipcRes; 120 if ( pSession->pfnGetLastInputInfo)124 if (s_pfnGetLastInputInfo) 121 125 { 122 126 /* Note: This only works up to 49.7 days (= 2^32, 32-bit counter) … … 124 128 LASTINPUTINFO lastInput; 125 129 lastInput.cbSize = sizeof(LASTINPUTINFO); 126 BOOL fRc = pSession->pfnGetLastInputInfo(&lastInput);130 BOOL fRc = s_pfnGetLastInputInfo(&lastInput); 127 131 if (fRc) 128 132 { 129 VBOXTRAYIPCRES_USERLASTINPUT ipcRes;130 133 ipcRes.uLastInput = (GetTickCount() - lastInput.dwTime) / 1000; 131 134 fLastInputAvailable = true; … … 196 199 *ppInstance = &gCtx; 197 200 *pfStartThread = true; 201 202 /* GetLastInputInfo only is available starting at Windows 2000. */ 203 s_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO) 204 RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo"); 198 205 199 206 LogRelFunc(("Local IPC server now running at \"%s\"\n", … … 438 445 rc = VERR_NO_MEMORY; 439 446 440 if (RT_SUCCESS(rc))441 {442 *(void **)&pSession->pfnGetLastInputInfo =443 RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");444 /* GetLastInputInfo only is available starting at Windows 2000. */445 }446 447 447 int rc2 = RTCritSectLeave(&pCtx->CritSect); 448 448 AssertRC(rc2); … … 457 457 458 458 pSession->hThread = NIL_RTTHREAD; 459 pSession->pfnGetLastInputInfo = NULL;460 459 461 460 RTLOCALIPCSESSION hSession;
Note:
See TracChangeset
for help on using the changeset viewer.