Changeset 25484 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Dec 18, 2009 2:04:56 PM (15 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r25465 r25484 337 337 * @returns IPRT status code. 338 338 * @param pDevExt The device extension to initialize. 339 */ 340 int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt) 339 * @param cbSession The size of the session structure. The size of 340 * SUPDRVSESSION may be smaller when SUPDRV_AGNOSTIC is 341 * defined because we're skipping the OS specific members 342 * then. 343 */ 344 int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt, size_t cbSession) 341 345 { 342 346 int rc; … … 385 389 { 386 390 pDevExt->u32Cookie = BIRD; /** @todo make this random? */ 391 pDevExt->cbSession = cbSession; 387 392 388 393 /* … … 554 559 * Allocate memory for the session data. 555 560 */ 556 int rc = VERR_NO_MEMORY;557 PSUPDRVSESSION pSession = *ppSession = (PSUPDRVSESSION)RTMemAllocZ(sizeof(*pSession));561 int rc; 562 PSUPDRVSESSION pSession = *ppSession = (PSUPDRVSESSION)RTMemAllocZ(pDevExt->cbSession); 558 563 if (pSession) 559 564 { … … 599 604 Log(("Failed to create spinlock, rc=%d!\n", rc)); 600 605 } 606 else 607 rc = VERR_NO_MEMORY; 601 608 602 609 return rc; -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r25465 r25484 465 465 /** Global cookie. */ 466 466 uint32_t u32Cookie; 467 468 /** The IDT entry number. 469 * Only valid if pIdtPatches is set. */ 470 uint8_t volatile u8Idt; 467 /** The actual size of SUPDRVSESSION. (SUPDRV_AGNOSTIC) */ 468 uint32_t cbSession; 471 469 472 470 /** Loader mutex. … … 600 598 int VBOXCALL supdrvIOCtlFast(uintptr_t uIOCtl, VMCPUID idCpu, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession); 601 599 int VBOXCALL supdrvIDC(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPDRVIDCREQHDR pReqHdr); 602 int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt );600 int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt, size_t cbSession); 603 601 void VBOXCALL supdrvDeleteDevExt(PSUPDRVDEVEXT pDevExt); 604 602 int VBOXCALL supdrvCreateSession(PSUPDRVDEVEXT pDevExt, bool fUser, PSUPDRVSESSION *ppSession); -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r25466 r25484 235 235 * Initialize the device extension. 236 236 */ 237 rc = supdrvInitDevExt(&g_DevExt );237 rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION)); 238 238 if (RT_SUCCESS(rc)) 239 239 { -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
r25465 r25484 172 172 * Initialize the device extension. 173 173 */ 174 rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt );174 rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); 175 175 if (RT_SUCCESS(rc)) 176 176 { -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r25465 r25484 609 609 */ 610 610 if (RT_SUCCESS(rc)) 611 rc = supdrvInitDevExt(&g_DevExt );611 rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION)); 612 612 if (RT_SUCCESS(rc)) 613 613 { … … 732 732 * Call common code for the rest. 733 733 */ 734 rc = supdrvCreateSession(&g_DevExt, true /* fUser */, (PSUPDRVSESSION *)&pSession);734 rc = supdrvCreateSession(&g_DevExt, true /* fUser */, &pSession); 735 735 if (!rc) 736 736 { -
trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
r25465 r25484 102 102 * Initialize the device extension. 103 103 */ 104 rc = supdrvInitDevExt(&g_DevExt );104 rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION)); 105 105 if (RT_SUCCESS(rc)) 106 106 { -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r25465 r25484 212 212 * Initialize the device extension 213 213 */ 214 rc = supdrvInitDevExt(&g_DevExt );214 rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION)); 215 215 if (RT_SUCCESS(rc)) 216 216 { -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r25465 r25484 134 134 memset(pDevExt, 0, sizeof(*pDevExt)); 135 135 136 vrc = supdrvInitDevExt(pDevExt );136 vrc = supdrvInitDevExt(pDevExt, sizeof(SUPDRVSESSION)); 137 137 if (!vrc) 138 138 {
Note:
See TracChangeset
for help on using the changeset viewer.