Changeset 44991 in vbox
- Timestamp:
- Mar 11, 2013 2:55:10 PM (12 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp
r44988 r44991 254 254 255 255 /* Free hardware resources. */ 256 /* @todo this should actually free I/O ports, interrupts, etc. */ 256 /** @todo this should actually free I/O ports, interrupts, etc. 257 * Update/bird: vbgdNtCleanup actually does that... So, what's there to do? */ 257 258 rc = vbgdNtCleanup(pDevObj); 258 259 Log(("VBoxGuest::vbgdNtGuestPnp: REMOVE_DEVICE: vbgdNtCleanup rc = 0x%08X\n", rc)); … … 349 350 350 351 /* Free hardware resources. */ 351 /* @todo this should actually free I/O ports, interrupts, etc. */ 352 /** @todo this should actually free I/O ports, interrupts, etc. 353 * Update/bird: vbgdNtCleanup actually does that... So, what's there to do? */ 352 354 rc = vbgdNtCleanup(pDevObj); 353 355 Log(("VBoxGuest::vbgdNtGuestPnp: STOP_DEVICE: cleaning up, rc = 0x%x\n", rc)); -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
r44990 r44991 515 515 pDevExt->pInterruptObject = NULL; 516 516 517 /** @todo r=bird: The error cleanup here is completely missing. We'll leak a 518 * whole bunch of things... */ 519 517 520 Log(("VBoxGuest::vbgdNtInit: Returned with rc = 0x%x\n", rc)); 518 521 return rc; … … 582 585 * opened, at least we'll blindly assume that here. 583 586 */ 584 UNICODE_STRING win32Name;585 RtlInitUnicodeString(& win32Name, VBOXGUEST_DEVICE_NAME_DOS);586 NTSTATUS rc = IoDeleteSymbolicLink(& win32Name);587 UNICODE_STRING DosName; 588 RtlInitUnicodeString(&DosName, VBOXGUEST_DEVICE_NAME_DOS); 589 NTSTATUS rc = IoDeleteSymbolicLink(&DosName); 587 590 588 591 IoDeleteDevice(pDrvObj->DeviceObject); 589 #else /*TARGET_NT4 */592 #else /* !TARGET_NT4 */ 590 593 /* On a PnP driver this routine will be called after 591 594 * IRP_MN_REMOVE_DEVICE (where we already did the cleanup), 592 595 * so don't do anything here (yet). */ 593 #endif 596 #endif /* !TARGET_NT4 */ 594 597 595 598 Log(("VBoxGuest::vbgdNtGuestUnload: returning\n")); … … 1103 1106 { 1104 1107 Log(("VBoxGuest::vbgdNtScanPCIResourceList: I/O range: Base = %08x:%08x, Length = %08x\n", 1105 1106 1107 1108 pPartialData->u.Port.Start.HighPart, 1109 pPartialData->u.Port.Start.LowPart, 1110 pPartialData->u.Port.Length)); 1108 1111 1109 1112 /* Save the IO port base. */ 1110 /** @todo Not so good. */ 1113 /** @todo Not so good. 1114 * Update/bird: What is not so good? That we just consider the last range? */ 1111 1115 pDevExt->Core.IOPortBase = (RTIOPORT)pPartialData->u.Port.Start.LowPart; 1112 1116 … … 1118 1122 1119 1123 Log(("VBoxGuest::vbgdNtScanPCIResourceList: I/O range for VMMDev found! Base = %08x:%08x, Length = %08x\n", 1120 1121 1122 1124 pPartialData->u.Port.Start.HighPart, 1125 pPartialData->u.Port.Start.LowPart, 1126 pPartialData->u.Port.Length)); 1123 1127 1124 1128 /* Next item ... */ … … 1210 1214 * 1211 1215 * @param pDevExt The device extension. 1212 * @param physicalAdrPhysical address to map.1213 * @param ulLength Length (in bytes)to map.1216 * @param PhysAddr Physical address to map. 1217 * @param cbToMap Number of bytes to map. 1214 1218 * @param ppvMMIOBase Pointer of mapped I/O base. 1215 1219 * @param pcbMMIO Length of mapped I/O base. 1216 1220 */ 1217 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,1221 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS PhysAddr, ULONG cbToMap, 1218 1222 void **ppvMMIOBase, uint32_t *pcbMMIO) 1219 1223 { … … 1223 1227 1224 1228 NTSTATUS rc = STATUS_SUCCESS; 1225 if ( physicalAdr.LowPart > 0) /* We're mapping below 4GB. */1226 { 1227 VMMDevMemory *pVMMDevMemory = (VMMDevMemory *)MmMapIoSpace( physicalAdr, ulLength, MmNonCached);1229 if (PhysAddr.LowPart > 0) /* We're mapping below 4GB. */ 1230 { 1231 VMMDevMemory *pVMMDevMemory = (VMMDevMemory *)MmMapIoSpace(PhysAddr, cbToMap, MmNonCached); 1228 1232 Log(("VBoxGuest::vbgdNtMapVMMDevMemory: pVMMDevMemory = 0x%x\n", pVMMDevMemory)); 1229 1233 if (pVMMDevMemory) … … 1233 1237 1234 1238 /* Check version of the structure; do we have the right memory version? */ 1235 if (pVMMDevMemory->u32Version != VMMDEV_MEMORY_VERSION) 1236 { 1237 Log(("VBoxGuest::vbgdNtMapVMMDevMemory: Wrong version (%u), refusing operation!\n", 1238 pVMMDevMemory->u32Version)); 1239 1240 /* Not our version, refuse operation and unmap the memory. */ 1241 vbgdNtUnmapVMMDevMemory(pDevExt); 1242 rc = STATUS_UNSUCCESSFUL; 1243 } 1244 else 1239 if (pVMMDevMemory->u32Version == VMMDEV_MEMORY_VERSION) 1245 1240 { 1246 1241 /* Save results. */ … … 1251 1246 Log(("VBoxGuest::vbgdNtMapVMMDevMemory: VMMDevMemory found and mapped! pvMMIOBase = 0x%p\n", 1252 1247 *ppvMMIOBase)); 1248 } 1249 else 1250 { 1251 /* Not our version, refuse operation and unmap the memory. */ 1252 Log(("VBoxGuest::vbgdNtMapVMMDevMemory: Wrong version (%u), refusing operation!\n", pVMMDevMemory->u32Version)); 1253 vbgdNtUnmapVMMDevMemory(pDevExt); 1254 rc = STATUS_UNSUCCESSFUL; 1253 1255 } 1254 1256 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.h
r44988 r44991 172 172 BOOLEAN vbgdNtIsrHandler(PKINTERRUPT interrupt, PVOID serviceContext); 173 173 NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTWIN pDevExt); 174 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,174 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS PhysAddr, ULONG cbToMap, 175 175 void **ppvMMIOBase, uint32_t *pcbMMIO); 176 176 void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt);
Note:
See TracChangeset
for help on using the changeset viewer.