[ros-bugs] [Bug 1764] New: device.c

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Sun Aug 20 20:41:58 CEST 2006


http://www.reactos.org/bugzilla/show_bug.cgi?id=1764

           Summary: device.c
           Product: ReactOS
           Version: 0.3.0
          Platform: x86 Hardware
        OS/Version: ReactOS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Kernel
        AssignedTo: ros-bugs at reactos.org
        ReportedBy: alex.vlasov at edtools.net
         QAContact: ros-bugs at reactos.org


Hi!
I was just looking at the source code, pls. see the notes prefixed with
"!!!>>".

NTSTATUS
STDCALL
IoGetDiskDeviceObject(IN  PDEVICE_OBJECT FileSystemDeviceObject,
                      OUT PDEVICE_OBJECT *DiskDeviceObject)
{
    PEXTENDED_DEVOBJ_EXTENSION DeviceExtension;
    PVPB Vpb;
    KIRQL OldIrql;

    /* Make sure there's a VPB */
    if (!FileSystemDeviceObject->Vpb) return STATUS_INVALID_PARAMETER;

    /* Acquire it */
    IoAcquireVpbSpinLock(&OldIrql);

    /* Get the Device Extension */
    DeviceExtension =
(PEXTENDED_DEVOBJ_EXTENSION)FileSystemDeviceObject->DeviceObjectExtension;

    /* Make sure this one has a VPB too */
    Vpb = DeviceExtension->Vpb;
!!!>> the next line returns without releasing the lock.
    if (!Vpb) return STATUS_INVALID_PARAMETER;

    /* Make sure someone it's mounted */
    if ((!Vpb->ReferenceCount) || (Vpb->Flags & VPB_MOUNTED)) return
STATUS_VOLUME_DISMOUNTED;
!!!>> should be if the flag is not set and also the lock should be released
before return.
    /* Return the Disk Device Object */
!!!>> RealDevice Object should be referenced according to MS!
    *DiskDeviceObject = Vpb->RealDevice;

    /* Release the lock */
    IoReleaseVpbSpinLock(OldIrql);
    return STATUS_SUCCESS;
}

Best Regards,
Alex


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
You are the assignee for the bug, or are watching the assignee.


More information about the Ros-bugs mailing list