Changeset 28887 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Apr 29, 2010 11:19:17 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
r28800 r28887 110 110 VBoxGuestCtrlHGCMMsgType Msg; 111 111 112 Msg.hdr.u32Timeout = u32Timeout; 113 Msg.hdr.fInterruptible = true; 114 115 Msg.hdr.info.result = VERR_WRONG_ORDER; 116 Msg.hdr.info.u32ClientID = u32ClientId; 117 Msg.hdr.info.u32Function = GUEST_GET_HOST_MSG; /* Tell the host we want our next command. */ 118 Msg.hdr.info.cParms = 2; /* Just peek for the next message! */ 112 Msg.hdr.result = VERR_WRONG_ORDER; 113 Msg.hdr.u32ClientID = u32ClientId; 114 Msg.hdr.u32Function = GUEST_GET_HOST_MSG; /* Tell the host we want our next command. */ 115 Msg.hdr.cParms = 2; /* Just peek for the next message! */ 119 116 120 117 VbglHGCMParmUInt32Set(&Msg.msg, 0); 121 118 VbglHGCMParmUInt32Set(&Msg.num_parms, 0); 122 119 123 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL _TIMED(sizeof(Msg)), &Msg, sizeof(Msg));120 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 124 121 if (RT_SUCCESS(rc)) 125 122 { … … 128 125 rc = VbglHGCMParmUInt32Get(&Msg.num_parms, puNumParms); 129 126 if (RT_SUCCESS(rc)) 130 rc = Msg.hdr. info.result;127 rc = Msg.hdr.result; 131 128 /* Ok, so now we know what message type and how much parameters there are. */ 132 129 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r28800 r28887 298 298 { 299 299 int rc; 300 301 300 /* 302 301 * Initialize the services. … … 314 313 } 315 314 } 316 317 315 /* 318 316 * Start the service(s). -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r28833 r28887 239 239 VBoxServiceVerbose(4, "Control: Waiting for host msg ...\n"); 240 240 rc = VbglR3GuestCtrlGetHostMsg(g_GuestControlSvcClientID, &uMsg, &uNumParms, 1000 /* 1s timeout */); 241 if (rc == VERR_TOO_MUCH_DATA) 242 { 243 VBoxServiceVerbose(3, "Control: Message requires %ld parameters, but only 2 supplied -- retrying request ...\n", uNumParms); 244 rc = VINF_SUCCESS; 245 } 246 else if (rc == VERR_TIMEOUT) 247 { 248 VBoxServiceVerbose(3, "Control: Wait timed out, waiting for next round ...\n"); 249 RTThreadSleep(100); 250 } 241 if (RT_FAILURE(rc)) 242 { 243 if (rc == VERR_TOO_MUCH_DATA) 244 { 245 VBoxServiceVerbose(3, "Control: Message requires %ld parameters, but only 2 supplied -- retrying request ...\n", uNumParms); 246 rc = VINF_SUCCESS; /* Try to get "real" message in next block below. */ 247 } 248 else 249 VBoxServiceVerbose(3, "Control: Getting host message failed with %Rrc\n", rc); /* VERR_GEN_IO_FAILURE seems to be normal if ran into timeout. */ 250 } 251 251 252 if (RT_SUCCESS(rc)) 252 253 { … … 272 273 } 273 274 274 /* 275 * Block for a while. 276 * 277 * The event semaphore takes care of ignoring interruptions and it 278 * allows us to implement service wakeup later. 279 */ 275 /* Do we need to shutdown? */ 280 276 if (*pfShutdown) 281 277 { … … 283 279 break; 284 280 } 285 int rc2 = RTSemEventMultiWait(g_hControlEvent, g_ControlInterval); 286 if (*pfShutdown) 287 { 288 rc = 0; 289 break; 290 } 291 if (rc2 != VERR_TIMEOUT && RT_FAILURE(rc2)) 292 { 293 VBoxServiceError("Control: RTSemEventMultiWait failed; rc2=%Rrc\n", rc2); 294 rc = rc2; 295 break; 296 } 281 282 /* Let's sleep for a bit and let others run ... */ 283 RTThreadYield(); 297 284 } 298 285
Note:
See TracChangeset
for help on using the changeset viewer.