Skip to content

Commit

Permalink
Addition by Arjan Mels on 16 Feb 2011:
Browse files Browse the repository at this point in the history
I modified the build script and code slightly to allow a x64 driver to compile.
I have tested this and it works, there are some issues however:

1) x64 drivers for Vista & Windows 7 need to be signed with a special type of 
	code signing certificate (kernel mode driver code signing certificate)
	otherwise they will not operate. 
	Workaround in a administrative command prompt enter: "bcdedit /set testsigning on"
	Now all drivers will be accepted: THIS IS A SECURITY RISK
	I will try to get a version signed by the people of ReactOS 
	(http://reactos.org/wiki/Driver_Signing)

2) Mass Storage USB devices do not work for me under Window 7 x64 (It is not clear to
	me yet if it is due to x64 or Windows 7). Other USB devices do work.
  • Loading branch information
arjanmels committed Feb 16, 2011
1 parent e53b05b commit 3dc6982
Show file tree
Hide file tree
Showing 24 changed files with 315 additions and 255 deletions.
1 change: 1 addition & 0 deletions userspace/MAKEFILE.INC
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ $(OBJ_PATH)\$(O)\busenum.bmf : busenum.mof




19 changes: 19 additions & 0 deletions userspace/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
Addition by Arjan Mels on 16 Feb 2011:

I modified the build script and code slightly to allow a x64 driver to compile.
I have tested this and it works, there are some issues however:

1) x64 drivers for Vista & Windows 7 need to be signed with a special type of
code signing certificate (kernel mode driver code signing certificate)
otherwise they will not operate.
Workaround in a administrative command prompt enter: "bcdedit /set testsigning on"
Now all drivers will be accepted: THIS IS A SECURITY RISK
I will try to get a version signed by the people of ReactOS
(http://reactos.org/wiki/Driver_Signing)

2) Mass Storage USB devices do not work for me under Window 7 x64 (It is not clear to
me yet if it is due to x64 or Windows 7). Other USB devices do work.


Original by Lepton Wu:

Because I haven't implemented all the interfaces that a windows usb bus
driver should provided, and perhaps some bug in my code, so some devices
won't work now.
Expand Down
16 changes: 15 additions & 1 deletion userspace/USAGE
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,24 @@ To install the virtual usb bus driver on Windows XP:
6. Select 'Install the hardware that I manually select from a list(Advanced)', and then click next.
7. Select 'System Devices', then click Next.
8. Click 'Have Disk', click 'Browse', choose the uncompressed directory, and click OK.
9. Click on the 'Virtual USB Bus Enumerator', and then click Next.
9. Click on the 'USB/IP Enumerator', and then click Next.
10. At 'The wizard is ready to install your hardware', click Next.
11. Click Finish at 'Completing the Add/Remove Hardware Wizard.'

For Window 7 :
1. For x64 allow unsigned drivers: Enter "bcdedit /set testsigning on" in an administrative cmd window
2. Uncompress the downloaded binary package to a directory.
3. Start a the Device Manager
4. Click Any hardware node
5. Choose "Add Legacy Hardware" from the "Action" menu
6. At the 'Welcome to the Add Hardware Wizard', click 'Next'.
7. Select 'Install the hardware that I manually select from the list'
8. click 'Next'
9. Click 'Have Disk', click 'Browse', choose the uncompressed directory, and click OK.
10. Click on the 'USB/IP Enumerator', and then click Next.
11. At 'The wizard is ready to install your hardware', click Next.
12. Click Finish at 'Completing the Add/Remove Hardware Wizard.'

To use it:

1. open a command prompt window, cd to the uncompressed directory.
Expand Down
80 changes: 80 additions & 0 deletions userspace/USBIPEnum.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
;/*++
;
; INF file for installing USB/IP bus enumerator driver
;
;--*/
[Version]
Signature="$WINDOWS NT$"
Class=System
ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}
Provider=%OpenSource%
DriverVer=02/13/2011,0.1.0.0
CatalogFile=USBIPEnum.cat

[Manufacturer]
%StdMfg%=Standard
%StdMfg%=Standard,NTamd64

[Standard]
%DeviceDesc%=USBIP_Device, root\USBIPEnum

[Standard.NTamd64]
%DeviceDesc%=USBIP_Device, root\USBIPEnum

[DestinationDirs]
DefaultDestDir = 12

[SourceDisksNames]
1 = %DiskId1%,,,""

[SourceDisksFiles]
USBIPEnum_x86.sys = 1,,
USBIPEnum_x64.sys = 1,,

[Drivers_Dir_x86]
USBIPEnum.sys,USBIPEnum_x86.sys

[Drivers_Dir_x64]
USBIPEnum.sys,USBIPEnum_x64.sys

[USBIP_Device]
CopyFiles=Drivers_Dir_x86

[USBIP_Device.NTamd64]
CopyFiles=Drivers_Dir_x64

[USBIP_Device.NT.HW]
AddReg=USBIP_Device_AddReg

[USBIP_Device.NTamd64.HW]
AddReg=USBIP_Device_AddReg

[USBIP_Device_AddReg]
HKR,,DeviceCharacteristics,0x10001,0x0100 ; Use same security checks on relative opens
HKR,,Security,,"D:P(A;;GA;;;BA)(A;;GA;;;SY)" ; Allow generic-all access to Built-in administrators and Local system

;-------------- Service installation
[USBIP_Device.Services]
AddService = USBIPEnum,%SPSVCINST_ASSOCSERVICE%, USBIP_Service_Inst

[USBIP_Device.NTamd64.Services]
AddService = USBIPEnum,%SPSVCINST_ASSOCSERVICE%, USBIP_Service_Inst

; -------------- busenum driver install sections
[USBIP_Service_Inst]
DisplayName = %ServiceDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\USBIPEnum.sys
LoadOrderGroup = Extended Base


[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
OpenSource = "Open Source"
StdMfg = "(Standard system devices)"
DiskId1 = "USB/IP Enumerator Disk"
DeviceDesc = "USB/IP Enumerator"
ServiceDesc = "USB/IP Enumerator Service"

Binary file added userspace/USBIP_TestCert.cer
Binary file not shown.
Binary file added userspace/USBIP_TestCert.pfx
Binary file not shown.
Binary file added userspace/USBIP_TestCert.pvk
Binary file not shown.
26 changes: 0 additions & 26 deletions userspace/Wmi.c
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
PURPOSE.
Module Name:
WMI.C
Abstract:
This module handles all the WMI Irps.
Environment:
Kernel mode
Revision History:
--*/

#include "busenum.h"
#include <wmistr.h>

Expand Down
29 changes: 25 additions & 4 deletions userspace/b.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
devcon remove "root\busenum"
build
if exist objchk_wxp_x86\i386\busenum.sys copy objchk_wxp_x86\i386\busenum.sys .
if exist objchk_wxp_x86\i386\busenum.sys devcon install bus.inf "root\busenum"
rem batch file to build complete drivers: output will be put in output directory

rem build 32-bit version in XP environment
rem build 64-bit version in Windows Server 2003 environment

set OCD=%CD%

cmd /C "set DDKBUILDENV=&& %NTMAKEENV%/setenv %BASEDIR% fre WXP && cd /d %OCD% && build"
cmd /C "set DDKBUILDENV=&& %NTMAKEENV%/setenv %BASEDIR% fre x64 WNET && cd /d %OCD% && build"

rem copy files to output folder
del /Q output
mkdir output
copy USBIPEnum.inf output
copy objfre_wxp_x86\i386\USBIPEnum.sys output\USBIPEnum_x86.sys
copy objfre_wnet_amd64\amd64\USBIPEnum.sys output\USBIPEnum_x64.sys

rem sign files and create catalog file
signtool sign /f USBIP_TestCert.pfx /t http://timestamp.verisign.com/scripts/timestamp.dll output\USBIPEnum_x86.sys
signtool sign /f USBIP_TestCert.pfx /t http://timestamp.verisign.com/scripts/timestamp.dll output\USBIPEnum_x64.sys

inf2cat /driver:output /os:XP_x86,XP_x64,Server2003_X86,Server2003_X64,Vista_X86,Vista_X64,Server2008_X86,Server2008_X64,7_X86,7_X64,Server2008R2_X64

signtool sign /f USBIP_TestCert.pfx /t http://timestamp.verisign.com/scripts/timestamp.dll output\USBIPEnum.cat

Loading

0 comments on commit 3dc6982

Please sign in to comment.