Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WinUSB "Safely Remove Hardware" list

384 views
Skip to first unread message

Mac

unread,
Jun 4, 2009, 2:32:01 PM6/4/09
to
Hi,

Does anyone know how to make a device that uses a WinUSB driver NOT be
displayed in the "Safely Remove Hardware" list?

Thanks

MAC

Maxim S. Shatskih

unread,
Jun 4, 2009, 2:51:36 PM6/4/09
to
In WDM, it is SurpriseRemovalOk bit in DEVICE_CAPABILITIES.

Look for similar things in UMDF.

--
Maxim S. Shatskih
Windows DDK MVP
ma...@storagecraft.com
http://www.storagecraft.com

"Mac" <M...@discussions.microsoft.com> wrote in message news:C57A4239-2097-4333...@microsoft.com...

Mac

unread,
Jun 4, 2009, 3:01:01 PM6/4/09
to
Thanks Max.

I tried adding the following to the INF file but I have not had success to
date?

HKR,,"SurpriseRemovalOK",0x00010001,1
HKR,,"Removable",0x00010001,1
HKR,,"RemovalPolicy",0x00010001,3

Doron Holan [MSFT]

unread,
Jun 5, 2009, 4:24:51 PM6/5/09
to
where in in the INF did you put these directives?

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"Mac" <M...@discussions.microsoft.com> wrote in message

news:146CD61C-5562-4461...@microsoft.com...

Mac

unread,
Jun 7, 2009, 8:50:01 PM6/7/09
to
Hi,

I put those directives in the [Dev_AddReg] section.

I read a post online and that is the reason I tried that.

I should add I am using the WinUSB as the function driver.

Is there a way to modify the "Capabilities" value from the INF file. (If I
do this manually the device is removed from the list!

Thanks.

MAC

Doron Holan [MSFT]

unread,
Jun 8, 2009, 2:44:29 PM6/8/09
to
what section refers to Dev_AddReg via the AddReg directive? this must be
eventually referenced by the .HW section in the INF. you might as well just
post the entire INF at this point

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"Mac" <M...@discussions.microsoft.com> wrote in message

news:6B597C87-0372-42FA...@microsoft.com...

Mac

unread,
Jun 8, 2009, 3:20:01 PM6/8/09
to
Hi Doron,

As you can probably tell I am quite new to driver development.

Yes, the Dev_AddReg section is called by the .HW section.

See the full INF file below.

Do you know if it is even possible to remove a device from the "Safely
Remove Hardware" list if it is using WinUSB as the function driver?

##################################################
; Adapted from the example INF in the Microsoft document "How to Use WinUSB
to Communicate with a USB Device"

[Version]
Signature = "$Windows NT$"
Class = USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
Provider = %ProviderName%
DriverVer=02/07/2008,1.0.0
;CatalogFile=MyCatFile.cat

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ProviderName% = MyDevice_WinUSB,NTx86,NTamd64

[MyDevice_WinUSB.NTx86]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_####&PID_####

[MyDevice_WinUSB.NTamd64]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_####&PID_####

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUSB,0x00000002,WinUSB_ServiceInstall

[WinUSB_ServiceInstall]
DisplayName = %WinUSB_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install
UmdfServiceOrder=WINUSB

[WinUSB_Install]
KmdfLibraryVersion=1.7

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{MY_GUID}"

[USB_Install.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WinUSBCoInstaller.dll","WUDFUpdate_01007.dll","WdfCoInstaller01007.dll,WdfCoInstaller"

[CoInstallers_CopyFiles]
WinUSBCoInstaller.dll
WdfCoInstaller01007.dll
WUDFUpdate_01007.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

; ================= Source Media Section =====================

[SourceDisksNames]
1 = %DISK_NAME%,,,\i386
2 = %DISK_NAME%,,,\amd64

[SourceDisksFiles.x86]
WinUSBCoInstaller.dll=1
WdfCoInstaller01007.dll=1
WUDFUpdate_01007.dll=1

[SourceDisksFiles.amd64]
WinUSBCoInstaller.dll=2
WdfCoInstaller01007.dll=2
WUDFUpdate_01007.dll=2

; Copy Files section
;------------------------------------------------------------------------------
[_CopyFiles_sys]
winusb.sys

;*************************************************
*****************************
; Destination Directories
;------------------------------------------------------------------------------
[DestinationDirs]
DefaultDestDir = 12 ; %SystemRoot%\system32\drivers
_CopyFiles_sys = 12

; =================== Strings ===================

[Strings]
ProviderName="MCM"
USB\MyDevice.DeviceDesc="MTest"
WinUSB_SvcDesc="WinUSB Demo"
DISK_NAME="My Install Disk"

#######################################################

Doron Holan [MSFT]

unread,
Jun 9, 2009, 2:18:24 PM6/9/09
to
it looks like you are installing a umdf driver as ewll, or at least
partially. also, I don't not see the sections adding the SurpriseRemovalOK
value in the inf

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"Mac" <M...@discussions.microsoft.com> wrote in message

news:092918AE-CA55-4EEE...@microsoft.com...

Mac

unread,
Jun 9, 2009, 3:26:01 PM6/9/09
to
Hi,

Thank you for your reply.

I am using WinUSB.dll as the UMDF driver (if that makes sense?) Much like
this MS example:

http://www.microsoft.com/whdc/connect/usb/winusb_howto.mspx

I have been trying a few things so I did not show the Surprise Removal
directive I tried.

Here is what it looked like:

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{MY_GUID}"

HKR,,"SurpriseRemovalOK",0x00010001,1
HKR,,"Removable",0x00010001,1
HKR,,"RemovalPolicy",0x00010001,3

I appreciate your efforts.

Thanks.

MAC

Doron Holan [MSFT]

unread,
Jun 11, 2009, 11:49:48 AM6/11/09
to
winusb.dll cannot be a umdf driver by itself. there are two modes that you
can use winusb. the first is to use it in conjunction with umdf and use the
umdf wdf usb io targets. the 2nd is to talk to the device directly from
your app using winusb.dll

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"Mac" <M...@discussions.microsoft.com> wrote in message

news:F11B44C5-9CC1-491D...@microsoft.com...

Mac

unread,
Jun 11, 2009, 12:02:01 PM6/11/09
to
Thank you.

I am using the winusb.dll from my application. (2nd option)

Is there a way to setup the INF file such that the device is not in the
"Safely Remove Hardware" list?

Thanks,

MAC

Mac

unread,
Jun 19, 2009, 8:37:01 AM6/19/09
to
I still looking for a solution for this.

If anyone has any ideas please help!!

Thanks.

MAC

Mac

unread,
Jun 24, 2009, 8:50:15 AM6/24/09
to

Hello,

I've been looking for a solution (or a definite answer) on how to set up my
INF file so that my device does not appear in the "Safely Remove Hardware"
list.

I am using the winusb.dll from my application.

Is there a way to setup the INF file such that the device is not in the

0 new messages