Detecting mass storage devices

I’m writing a small KMDF driver using the code Toaster Generic Filter Sample.

I have modified the INF file so that the FilterEvtDevideAdd gets called for all the nodes in the tree (hub, concentrator, mass storage devices).

I’m not really interested in all these nodes, although I’m interested in all USB mass storage devices.

How can I determine which node pertain to mass storage devices?

I had hoped that the Device Type property would tell it to me. Unfortunately, although I’m getting some useful (0x32 FILE_DEVICE_ACPI and 0x2a FILE_DEVICE_BUS_EXTENDER) all the other types I get are 0x22 (unknown) and no (0x2d). Why?

Is there no other to know that i’m dealing with a mass storage device but calling IoGetDeviceProperty (for instance) and comparing some Unicode String in one of those properties? If so (sigh), which one would be the best?

What is a concentrator?

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@live.ca
Sent: October 03, 2010 12:36 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Detecting mass storage devices

I’m writing a small KMDF driver using the code Toaster Generic Filter Sample.

I have modified the INF file so that the FilterEvtDevideAdd gets called for all the nodes in the tree (hub, concentrator, mass storage devices).

I’m not really interested in all these nodes, although I’m interested in all USB mass storage devices.

How can I determine which node pertain to mass storage devices?

I had hoped that the Device Type property would tell it to me. Unfortunately, although I’m getting some useful (0x32 FILE_DEVICE_ACPI and 0x2a FILE_DEVICE_BUS_EXTENDER) all the other types I get are 0x22 (unknown) and no (0x2d). Why?

Is there no other to know that i’m dealing with a mass storage device but calling IoGetDeviceProperty (for instance) and comparing some Unicode String in one of those properties? If so (sigh), which one would be the best?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I don’t quite understand what is in your inf file. Perhaps you might
post it here. See the usbstor inf file for what it is doing. If you
want to be an upper filter for usbstor devices I would suggest acting
as a lower filter for disk class and detecting which of those disks
are actually usb enumerated. But really it depends on what you are
trying to do.

Mark Roddy

On Sun, Oct 3, 2010 at 3:34 AM, wrote:
> I’m writing a small KMDF driver using the code Toaster Generic Filter Sample.
>
> I have modified the INF file so that the FilterEvtDevideAdd gets called for all the nodes in the tree (hub, concentrator, mass storage devices).
>
> I’m not really interested in all these nodes, although I’m interested in all USB mass storage devices.
>
> How can I determine which node pertain to mass storage devices?
>
> I had hoped that the Device Type property would tell it to me. Unfortunately, although I’m getting some useful (0x32 FILE_DEVICE_ACPI and 0x2a FILE_DEVICE_BUS_EXTENDER) all the other types I get are 0x22 (unknown) and no (0x2d). Why?
>
> Is there no other to know that i’m dealing with a mass storage device but calling IoGetDeviceProperty (for instance) and comparing some Unicode String in one of those properties? If so (sigh), which one would be the best?
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Here is the INF file (a concentrator is a hub I think, IoGetDeviceProperty returns localized strings).

[Version]
signature = “$Windows NT$”
DriverPackageType = ClassFilter
DriverVer=10/2/2010,0.1.0.0

[SourceDisksNames]
1 = %ClasFilt.MediaDesc%

[SourceDisksFiles]
usbtest.sys = 1

[DestinationDirs]
DefaultDestDir = 12 ; DIRID_DRIVERS

[DefaultInstall.NT]
CopyFiles = @usbtest.sys
AddReg = ClassFilter_AddReg

[ClassFilter_AddReg]
HKLM, System\CurrentControlSet\Control\Class%USB_CLASS_GUID%,

LowerFilters, 0x00010008, usbtest
; HKLM, System\CurrentControlSet\Control\Class%HID_CLASS_GUID%,

LowerFilters, 0x00010008, usbtest
; HKLM, System\CurrentControlSet\Control\Class%PORT_CLASS_GUID%,

UpperFilters, 0x00010008, usbtest

[DefaultInstall.NT.Services]
AddService = usbtest, , clasfilt_Service_Inst, clasfilt_EventLog_Inst

[clasfilt_Service_Inst]
DisplayName = %ClasFilt.SvcDesc%
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_DEMAND_START%
ErrorControl = %SERVICE_ERROR_IGNORE%
ServiceBinary = %12%\usbtest.sys

[clasfilt_EventLog_Inst]
AddReg = clasfilt_EventLog_AddReg

[clasfilt_EventLog_AddReg]
HKR,EventMessageFile, %REG_EXPAND_SZ%,"%%SystemRoot%%\System32

\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\usbtest.sys"
HKR,TypesSupported, %REG_DWORD%, 7

;================================================================
;— WDF Coinstaller installation ------
;

[DestinationDirs]
CoInstaller_CopyFiles = 11

[DefaultInstall.NT.CoInstallers]
AddReg=CoInstaller_AddReg
CopyFiles=CoInstaller_CopyFiles

[CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000,“WdfCoinstaller01009.dll,WdfCoInstaller”

[CoInstaller_CopyFiles]
WdfCoinstaller01009.dll,2

[SourceDisksFiles]
WdfCoInstaller01009.dll=99

[usbtest.NT.Wdf]
KmdfService = usbtest, usbtest_wdfsect

[usbtest_wdfsect]
KmdfLibraryVersion = 1.9

;================================================================
;— Misc ------
;

[Strings]
ClasFilt.SvcDesc = “usbtest Class Filter Driver”
ClasFilt.MediaDesc = “usbtest Class Filter Driver Disc”

; Useful constants
SERVICE_KERNEL_DRIVER = 1
SERVICE_DEMAND_START = 3
SERVICE_ERROR_IGNORE = 0
REG_EXPAND_SZ = 0x00020000
REG_DWORD = 0x00010001
USB_CLASS_GUID = {36FC9E60-C465-11CF-8056-444553540000}
HID_CLASS_GUID = {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}
PORT_CLASS_GUID = {4D36E978-E325-11CE-BFC1-08002BE10318}

Hmmm… I really don’t understand what you are trying to do. HIDs? Ports? Huh?

I *think* you are trying to filter usb mass storage devices. Is that
correct? Is that all you are trying to do?

Hint: HIDs are mice and their friends. Ports are printers and a
variety of things that might be considered ‘serial’ or ‘com’ ports.

Mark Roddy
Not as “valuable” as he used to be.

On Sun, Oct 3, 2010 at 1:39 PM, wrote:
> Here is the INF file (a concentrator is a hub I think, ?IoGetDeviceProperty returns localized strings).
>
>
> [Version]
> signature = “$Windows NT$”
> DriverPackageType = ClassFilter
> DriverVer=10/2/2010,0.1.0.0
>
> [SourceDisksNames]
> 1 = %ClasFilt.MediaDesc%
>
> [SourceDisksFiles]
> usbtest.sys = 1
>
> [DestinationDirs]
> DefaultDestDir = 12 ; DIRID_DRIVERS
>
> [DefaultInstall.NT]
> CopyFiles = @usbtest.sys
> AddReg = ClassFilter_AddReg
>
> [ClassFilter_AddReg]
> HKLM, System\CurrentControlSet\Control\Class%USB_CLASS_GUID%,
>
> LowerFilters, 0x00010008, usbtest
> ; HKLM, System\CurrentControlSet\Control\Class%HID_CLASS_GUID%,
>
> LowerFilters, 0x00010008, usbtest
> ; HKLM, System\CurrentControlSet\Control\Class%PORT_CLASS_GUID%,
>
> UpperFilters, 0x00010008, usbtest
>
> [DefaultInstall.NT.Services]
> AddService = usbtest, , clasfilt_Service_Inst, clasfilt_EventLog_Inst
>
> [clasfilt_Service_Inst]
> DisplayName ? ?= %ClasFilt.SvcDesc%
> ServiceType ? ?= %SERVICE_KERNEL_DRIVER%
> StartType ? ? ?= %SERVICE_DEMAND_START%
> ErrorControl ? = %SERVICE_ERROR_IGNORE%
> ServiceBinary ?= %12%\usbtest.sys
>
> [clasfilt_EventLog_Inst]
> AddReg = clasfilt_EventLog_AddReg
>
> [clasfilt_EventLog_AddReg]
> HKR,EventMessageFile, %REG_EXPAND_SZ%,“%%SystemRoot%%\System32
>
> \IoLogMsg.dll;%%SystemRoot%%\System32\drivers\usbtest.sys”
> HKR,TypesSupported, %REG_DWORD%, 7
>
> ;================================================================
> ;— WDF Coinstaller installation ------
> ;
>
> [DestinationDirs]
> CoInstaller_CopyFiles = 11
>
> [DefaultInstall.NT.CoInstallers]
> AddReg=CoInstaller_AddReg
> CopyFiles=CoInstaller_CopyFiles
>
> [CoInstaller_AddReg]
> HKR,CoInstallers32,0x00010000,“WdfCoinstaller01009.dll,WdfCoInstaller”
>
> [CoInstaller_CopyFiles]
> WdfCoinstaller01009.dll,2
>
> [SourceDisksFiles]
> WdfCoInstaller01009.dll=99
>
> [usbtest.NT.Wdf]
> KmdfService = usbtest, usbtest_wdfsect
>
> [usbtest_wdfsect]
> KmdfLibraryVersion = 1.9
>
> ;================================================================
> ;— Misc ------
> ;
>
> [Strings]
> ClasFilt.SvcDesc = “usbtest Class Filter Driver”
> ClasFilt.MediaDesc = “usbtest Class Filter Driver Disc”
>
> ; Useful constants
> SERVICE_KERNEL_DRIVER = 1
> SERVICE_DEMAND_START ?= 3
> SERVICE_ERROR_IGNORE ?= 0
> REG_EXPAND_SZ ? ? ? ? = 0x00020000
> REG_DWORD ? ? ? ? ? ? = 0x00010001
> USB_CLASS_GUID ? ? ? ?= {36FC9E60-C465-11CF-8056-444553540000}
> HID_CLASS_GUID ? ? ? ?= {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}
> PORT_CLASS_GUID ? ? ? = {4D36E978-E325-11CE-BFC1-08002BE10318}
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Mark,

First of all thank you for answering and bearing with my questions.

I have the same problem when I only put

USB_CLASS_GUID = {36FC9E60-C465-11CF-8056-444553540000}

I try at this stage to sniff all the USB traffic and that seems to work : I see, for instance, all the device hierarchy being added (12 devices on my PC before I insert my USB drive).

But that is a bit too much. I don’t want to interact with hubs for instance. I want to interact with the USB mass storage devices (whatever their vendor).

Unfortunately, when I look at the DeviceType of the device being added, I don’t seem to get anything useful: I get 0x22 (Unknown) when I would expect 0x2d (Mass storage) even though if I do an IoGetDeviceProperty() I do see that the device is a mass storage one in the human readable strings made available (but that’s really not very useful, since these strings are localized).

The question thus is how do I know I’m dealing with USB “drive” and not a HUB for instance in a simple fashion (I could always scan the HarwareId… I would prefer not, it seems a waste). The next step being my requesting the USB descriptor (where I can see that it is a mass storage device 0x08). (I asked about getting the USB descriptor in another thread).

Again -

  1. are you only interested in filtering usb mass storage devices
  2. having filtered them, what do you intend to do?

Mark Roddy
Not as “valuable” as he used to be.

On Sun, Oct 3, 2010 at 2:19 PM, wrote:
> Mark,
>
> First of all thank you for answering and bearing with my questions.
>
> I have the same problem when I only put
>
> USB_CLASS_GUID ? ? ? ?= {36FC9E60-C465-11CF-8056-444553540000}
>
> I try at this stage to sniff all the USB traffic and that seems to work : I see, for instance, all the device hierarchy being added (12 devices on my PC before I insert my USB drive).
>
> But that is a bit too much. I don’t want to interact with hubs for instance. I want to interact with the USB mass storage devices (whatever their vendor).
>
> Unfortunately, when I look at the DeviceType of the device being added, I don’t seem to get anything useful: I get 0x22 (Unknown) when I would expect 0x2d (Mass storage) even though if I do an IoGetDeviceProperty() I do see that the device is a mass storage one in the human readable strings made available (but that’s really not very useful, since these strings are localized).
>
> The question thus is how do I know I’m dealing with USB “drive” ?and not a HUB for instance in a simple fashion (I could always scan the HarwareId… I would prefer not, it seems a waste). The next step being my requesting the USB descriptor (where I can see that it is a mass storage device 0x08). (I asked about getting the USB descriptor in another thread).
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

>Again -

  1. are you only interested in filtering usb mass storage devices

As far as this question is concerned, yes.

  1. having filtered them, what do you intend to do?

Read their device and interface descriptor at this stage.

Now, I do this in a filter in order to do other things later, but must I say everything I intend to do in my driver? At this stage, knowing how to get the USB descriptors from a KMDF Filter is what I’m looking for.

Knowing your eventual goal helps tremendously in providing good guidance. Reading descriptors is easy, you just send down the appropriately formatted URB. Wdfusbdevice makes that a little easier, but it is not really targeted for use be a filter, WDM is pretty simple here.

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@live.ca
Sent: October 03, 2010 12:05 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Detecting mass storage devices

>Again -
>1) are you only interested in filtering usb mass storage devices

As far as this question is concerned, yes.

>2) having filtered them, what do you intend to do?

Read their device and interface descriptor at this stage.

Now, I do this in a filter in order to do other things later, but must I say everything I intend to do in my driver? At this stage, knowing how to get the USB descriptors from a KMDF Filter is what I’m looking for.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doran,

I understand, but what I’m afraid of (fear of the blue screen) is that if I just send down the appropriately formatted URB from different devices at different altutudes (some of them being hubs and not the “leaf” mass storage device), I might get duplicated descriptors returned and I don’t want that.

But okay, I’m going to see what happens.

Not that I feel reassured.

On Mon, Oct 4, 2010 at 6:17 AM, wrote:
> I understand, but what I’m afraid of (fear of the blue screen) is
> that if I just send down the appropriately formatted URB from
> different devices at different altutudes (some of them being hubs
> and not the “leaf” mass storage device), I might get duplicated
> descriptors returned and I don’t want that.
>
> But okay, I’m going to see what happens.
>
> Not that I feel reassured.

You can try libusb-win32 1.2.2.0 just released.
http://sourceforge.net/projects/libusb-win32/files/

Use the filter driver (WDM based), install it as a class
filter to the USB mass storage device using
the command line “install-filter.exe”.

The filter mode is not recommended to be deployed to end
users, but you can try it as a developer.

============

WARNING:
Improper use of libusb-win32 install-filter can cause devices to
malfunction and in some cases complete system failure.

DISCLAIMER:
THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE ORGANIZATION SHALL
NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

USAGE: install-filter [install|uninstall|list] <-ac> <-dc> <-ad>
<-c=> <-d=> <-f=>
<-p=> <-w=>

Commands: Compatible Switches:
install (i/-i) <-ac> <-c=> <-d=> <-f=> <-p=> <-w=>
uninstall (u/-u) <-ac> <-c=> <-d=> <-f=> <-p=> <-w=> <-ad>
list (l/-l) <-ac> <-dc> <-c=> <-p=> <-w=>

NOTE:
* If no switches are specified, the default class key list is used.
* 64bit OSes must use the 64bit version of this application.

Switches For Class Filters:
--all-classes (-ac)
install : Adds libusb-win32 as an upper class filter for all
classes in the USB enumerator. (Same as -dc in install mode)
uninstall: Removes libusb-win32 as an upper class filter for all
known classes. This is a FULL class removal.
list : Displays all known classes.

–device-classes (-dc)
install : Adds libusb-win32 as an upper class filter for all
classes in the USB enumerator.
uninstall: Removes libusb-win32 as an upper class filter for all
classes in the USB enumerator.
list : Displays all classes in the USB enumerator and the devices
contained within them.

–class= (-c=)
install : Adds libusb-win32 as an upper class filter for the
specified class only. Classes can be specified by name or
guid.
uninstall: Removes libusb-win32 as an upper class filter for the
specified class only. Classes can be specified by name or
guid.
list : Displays information about the specified classes and the
devices contained within them.

Switches For Device Filters:
--device= (-d=)
install : Adds libusb-win32 as an upper device filter for the
specified device.
uninstall: Removes libusb-win32 as an upper device filter for the
specified device.
list :

–all-devices (-ad)
install
install :
uninstall: Removes libusb-win32 device filters from all devices in the
USB enumerator.
list :

Switches For INF Files:
--inf=<your_file.inf> (-f=)
install : Installs usb device(s) from an inf file.
uninstall: Attempts to roll back a device driver installation. If
rollback fails or is unavailable, the device is removed and
all root hubs are restarted.
list :

Common Switches:
--prompt=<your_prompt_string> (-p=)
Prompts the user with the specified string before running. To include
spaces in the prompt string, place the entire switch in double quotes.
Example: “-p=Are you sure?”

–wait=<your_wait_string> (-w=)
After the operation completes, displays the specified string and waits for
user input. To include spaces in the prompt string, place the entire
switch in double quotes.
Example: “-w=Press any key…”

Examples:
install-filter install --device-classes
install-filter uninstall --all-classes
install-filter list --device-classes
install-filter install --class={00000000-0000-0000-0000-000000000000}
install-filter install “–device=USB\Vid_04d8&Pid_000c&Rev_0000”
install-filter install --device=USB\Vid_04d8.Pid_000c.Rev_0000
install-filter install --inf=your_file.inf


Xiaofan</your_wait_string></your_prompt_string></your_file.inf>

Why would you get duplicated descriptors? Each stack you send the get descriptor request will be a different device

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@live.ca
Sent: Sunday, October 03, 2010 3:18 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Detecting mass storage devices

Doran,

I understand, but what I’m afraid of (fear of the blue screen) is that if I just send down the appropriately formatted URB from different devices at different altutudes (some of them being hubs and not the “leaf” mass storage device), I might get duplicated descriptors returned and I don’t want that.

But okay, I’m going to see what happens.

Not that I feel reassured.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Xiaofan Chen,

Thank you for the link to the usblib.

I looked at the libusb_driver.c and its add_device method and noticed that it also filters the device on their hardware id as I was doing (but found annoying, strings are inefficient).

if (!strstr(id, “usb\”) ||
strstr(id, “hub”) ||
!strstr(id, “vid_”) ||
!strstr(id, “pid_”))

It’s reassuring.

The first problem is that you are filtering the wrong FDOs. Your usb
class filter will filter usb adapters and hubs and perhaps the odd
device that still wrongly uses the USB class guid to identify itself,
which oddly enough might include usbstor FDOs.

But I digress. You have to explain your intentions beyond “get the usb
pnp id string”. Filtering the usbstor stack is complicated, and how
you do it really depends on what you are trying to do.

Mark Roddy
Not as “valuable” as he used to be.

On Sun, Oct 3, 2010 at 3:02 PM, wrote:
>>Again -
>>1) are you only interested in filtering usb mass storage devices
>
> As far as this question is concerned, yes.
>
>>2) having filtered them, what do you intend to do?
>
> Read their device and interface descriptor at this stage.
>
> Now, I do this in a filter in order to do other things later, but must I say everything I intend to do in my driver? At this stage, knowing how to get the USB descriptors from a KMDF Filter is what I’m looking for.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Mark wrote :

The first problem is that you are filtering the wrong FDOs.

Yes, and how do you filter all USB mass storage devices (already installed and future ones) and only them?

Your usb class filter will filter usb adapters and hubs

Yes, I noticed, hence my questions.

and perhaps the odd
device that still wrongly uses the USB class guid to identify itself,
which oddly enough might include usbstor FDOs.

Okay, what to do?

But I digress. You have to explain your intentions beyond “get the usb
pnp id string”.

I want to list them.

Filtering the usbstor stack is complicated, and how you do it really depends on what you are trying >to do.

I want to get the usb descriptor of all the mass storage devices hooked in at any time.

On Mon, Oct 4, 2010 at 9:39 AM, wrote:
> I want to get the usb descriptor of all the mass storage devices hooked in at any time.
>
That can be done from user mode. See the usbview sample application.
Just look for the appropriate usb mass storage descriptors using win32
apis.

Mark Roddy
Not as “valuable” as he used to be.

If all you want is the IDs, thar can be done from user mode. I guess you want to do more. In km, you can get the hw and compat IDs by calling IoGetDeviceProperty or WdfDeviceQueryAndAllocProperty

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@live.ca
Sent: October 04, 2010 6:40 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Detecting mass storage devices

Mark wrote :

>The first problem is that you are filtering the wrong FDOs.

Yes, and how do you filter all USB mass storage devices (already installed and future ones) and only them?

> Your usb class filter will filter usb adapters and hubs

Yes, I noticed, hence my questions.

> and perhaps the odd
>device that still wrongly uses the USB class guid to identify itself,
>which oddly enough might include usbstor FDOs.

Okay, what to do?

>But I digress. You have to explain your intentions beyond “get the usb
>pnp id string”.

I want to list them.

>Filtering the usbstor stack is complicated, and how you do it really depends on what you are trying >to do.

I want to get the usb descriptor of all the mass storage devices hooked in at any time.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron Holan wrote :

If all you want is the IDs, thar can be done from user mode. I guess you want to do more.

Yes.

In km, you can get the hw and compat IDs by calling IoGetDeviceProperty
or WdfDeviceQueryAndAllocProperty

Okay, this is what I resorted to do (WdfDeviceQueryAndAllocProperty) and then a few strstr()…

No need for safe string versions of strstr I suppose (no string allocation) ? I could not find them.

Did you find RtlStringCchXxxx or RtlStringCcbXxxx?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@live.ca
Sent: Monday, October 04, 2010 5:37 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Detecting mass storage devices

Doron Holan wrote :

If all you want is the IDs, thar can be done from user mode. I guess you
want to do more.

Yes.

In km, you can get the hw and compat IDs by calling IoGetDeviceProperty
or WdfDeviceQueryAndAllocProperty

Okay, this is what I resorted to do (WdfDeviceQueryAndAllocProperty) and
then a few strstr()…

No need for safe string versions of strstr I suppose (no string allocation)
? I could not find them.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Yes, Gary, I found about RtlStringCchXxxx or RtlStringCcbXxxx. But these concatenate, I believe, while I wanted to compare (strstr).