Disk Class Upper Filter - FILE_REMOVABLE_MEDIA

Discussion in 'Windows Vista Drivers' started by Dan Malloy, Jan 30, 2006.

  1. Dan Malloy

    Dan Malloy Guest

    Using the DDK samples (toaster, diskperf), I've been able to write a basic
    disk class upper filter. I would like to correctly determine if the device
    is removable media (i.e. usb thumb drive, iPod, etc).

    If my filter driver is added before PartMgr in the UpperFilter reg value,
    the below code works correctly. If it's listed after PartMgr,
    FILE_REMOVABLE_MEDIA is never set in my filter device's characteristics. Is
    this expected? Can I get this info elsewhere, or do I need to control the
    order of the UpperFilters?

    From the toaster filter example (IRP_MJ_PNP -> IRP_MN_START_DEVICE):

    // On the way up inherit FILE_REMOVABLE_MEDIA during Start.
    // This characteristic is available only after the driver stack is started!.
    if(deviceExtension->NextLowerDriver->Characteristics & FILE_REMOVABLE_MEDIA)
    {
    DeviceObject->Characteristics |= FILE_REMOVABLE_MEDIA;
    }

    **** Any info or pointers would be greatly appreciated. Thanks
     
    Dan Malloy, Jan 30, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.