On Mon, Jul 07, 2008 at 12:10:17PM +0400, Alexander Morozov wrote:
Hello All,
I created a patch which adds support of USB hardware tokens with native Windows drivers (.sys): ftp://ftp.etersoft.ru/pub/download/amorozov/0001-Support-of-native-Windows-drivers-for-USB-tokens.txt Now SafeNet UltraPro (driver sntnlusb.sys, vid/pid 04b9:0300) and Eutron SmartKey 3 (driver eusk3usb.sys, vid/pid 073d:0025) are supported. These devices are used by some Windows applications for piracy defense.
This patch adds dlls/usbd.sys, dlls/wineusbhub and programs/wineusb. Usbd.sys is exist also in Windows. This is a kernel level DLL exporting some functions required for USB drivers. Wineusbhub plays a role of a lower driver in device stack (under USB token driver). Wineusb is a service calling driver`s AddDevice routine if there is a registry key corresponding to device and device is plugged. Now this check is executed only when wineusb is starting.
USB driver is loaded by programs/winedevice. Now AddDevice and some PNP functions are called in addition to DriverEntry. Calling DriverEntry is realized by means of wineserver requests. Some required ntoskrnl.exe functions are added.
For using native USB driver should copy HKLM\System\CurrentControlSet\Enum\USB\Vid_<vid>&Pid_<pid> and HKLM\System\CurrentControlSet\Services<driver_name> from Windows registry. HKLM\System\CurrentControlSet\Services<driver_name>\Start should be setted to 2.
I`d like to add this patch to Wine. What about this? I think should split my patch into many little commits. Should also add some tests or make some changes?
Split it at least into the sub driver/dll parts.
You can leave out the "configure" part, it will be regenerated form configure. ac anyway. Same for dlls/Makefile.in
The ntoskrnl changes might break the already working copy protection drivers, so either try them yourself after the patch or ask someone to try them. The ntoskrnl changes are also so large that you split them into parts, like perhaps: - stubs - header file changes / additions - new implementation functions - hook those functions into current framework (if the two steps are seperable)
Ciao, Marcus