ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID NTAPI RamdiskUnmapPages ( IN PRAMDISK_DRIVE_EXTENSION  DeviceExtension,
IN PVOID  BaseAddress,
IN LARGE_INTEGER  Offset,
IN ULONG  Length 
)

Definition at line 354 of file ramdisk.c.

Referenced by RamdiskCreateDiskDevice(), RamdiskGetPartitionInfo(), RamdiskReadWriteReal(), and RamdiskSetPartitionInfo().

{
    LARGE_INTEGER ActualOffset;
    SIZE_T ActualLength;
    ULONG PageOffset;
    
    //
    // We only support boot disks for now
    //
    ASSERT(DeviceExtension->DiskType == RAMDISK_BOOT_DISK);
    
    //
    // Calculate the actual offset in the drive
    //
    ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart;
    
    //
    // Calculate pages spanned for the mapping
    //
    ActualLength = ADDRESS_AND_SIZE_TO_SPAN_PAGES(ActualOffset.QuadPart, Length);
    
    //
    // And convert this back to bytes
    //
    ActualLength <<= PAGE_SHIFT;
    
    //
    // Get the offset within the page
    //
    PageOffset = BYTE_OFFSET(ActualOffset.QuadPart);
    
    //
    // Calculate actual base address where we mapped this
    //
    BaseAddress = (PVOID)((ULONG_PTR)BaseAddress - PageOffset);
    
    //
    // Unmap the I/O space we got from the loader
    //
    MmUnmapIoSpace(BaseAddress, ActualLength);
}

Generated on Sat May 26 2012 04:46:32 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.