Changeset 6231 in vbox for trunk/src/VBox/Additions/linux/module
- Timestamp:
- Jan 3, 2008 3:28:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/vboxmod.c
r6042 r6231 362 362 int rc = 0; 363 363 364 switch (cmd) { 365 case IOCTL_VBOXGUEST_WAITEVENT: 366 rc = vboxadd_wait_event((void *) arg); 367 break; 368 369 case VBOXGUEST_IOCTL_WAITEVENT_INTERRUPT_ALL: 370 ++vboxDev->u32GuestInterruptions; 371 break; 372 373 case IOCTL_VBOXGUEST_VMMREQUEST: { 364 /* Deal with variable size ioctls first. */ 365 if (VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_LOG(0)) == VBOXGUEST_IOCTL_NUMBER(cmd)) { 366 char *pszMessage = kmalloc(VBOXGUEST_IOCTL_SIZE(cmd), GFP_KERNEL); 367 if (NULL == pszMessage) { 368 LogRelFunc(("VBOXGUEST_IOCTL_LOG: cannot allocate %d bytes of memory!\n", 369 VBOXGUEST_IOCTL_SIZE(cmd))); 370 rc = -ENOMEM; 371 } 372 if ( (0 == rc) 373 && copy_from_user(pszMessage, (void*)arg, VBOXGUEST_IOCTL_SIZE(cmd))) { 374 LogRelFunc(("VBOXGUEST_IOCTL_LOG: copy_from_user failed!\n")); 375 rc = -EFAULT; 376 } 377 if (0 == rc) { 378 Log(("%.*s", VBOXGUEST_IOCTL_SIZE(cmd), pszMessage)); 379 } 380 if (NULL != pszMessage) { 381 kfree(pszMessage); 382 } 383 return rc; 384 } 385 386 if ( VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_VMMREQUEST(0)) 387 == VBOXGUEST_IOCTL_NUMBER(cmd)) { 374 388 VMMDevRequestHeader reqHeader; 375 389 VMMDevRequestHeader *reqFull = NULL; … … 446 460 } 447 461 VbglGRFree(reqFull); 448 break; 449 } 462 return rc; 463 } 464 465 switch (cmd) { 466 case IOCTL_VBOXGUEST_WAITEVENT: 467 rc = vboxadd_wait_event((void *) arg); 468 break; 469 470 case VBOXGUEST_IOCTL_WAITEVENT_INTERRUPT_ALL: 471 ++vboxDev->u32GuestInterruptions; 472 break; 450 473 451 474 case IOCTL_VBOXGUEST_HGCM_CALL:
Note:
See TracChangeset
for help on using the changeset viewer.