[Wine-patches] [eterhack] Add Senselock key support (eterbug #4075).

Alexander Morozov amorozov на etersoft.ru
Вт Июн 30 20:42:47 MSD 2009


----------- следующая часть -----------
From 1a77bf86f510394f38f51507db2e08fb6185fb08 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 30 Jun 2009 20:36:15 +0400
Subject: [eterhack] Add Senselock key support (eterbug #4075).

---
 etersoft/reg.d/usb_senselock.reg |   16 ++++++++++++++++
 programs/winecfg/dongleui.c      |   17 ++++++++++++++++-
 tools/udev.rules                 |    3 +++
 3 files changed, 35 insertions(+), 1 deletions(-)
 create mode 100644 etersoft/reg.d/usb_senselock.reg

diff --git a/etersoft/reg.d/usb_senselock.reg b/etersoft/reg.d/usb_senselock.reg
new file mode 100644
index 0000000..d0f0af5
--- /dev/null
+++ b/etersoft/reg.d/usb_senselock.reg
@@ -0,0 +1,16 @@
+# (c) Etersoft 2009
+# Senselock key support
+
+[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum\USB\Vid_0471&Pid_485d\5&6d75465&0&1]
+"ClassGUID"="{50DD5230-BA8A-11D1-BF5D-0000F805F530}"
+"HardwareID"=hex(7):55,53,42,5c,56,69,64,5f,30,34,37,31,26,50,69,64,5f,34,38,\
+  35,64,26,52,65,76,5f,30,33,30,30,00,55,53,42,5c,56,69,64,5f,30,34,37,31,26,\
+  50,69,64,5f,34,38,35,64,00,00
+"Service"="sense4v2"
+
+[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\sense4v2]
+"ErrorControl"=dword:00000001
+"ImagePath"=hex(2):53,79,73,74,65,6d,33,32,5c,44,72,69,76,65,72,73,5c,73,65,6e,\
+  73,65,34,76,32,2e,73,79,73,00
+"Start"=dword:00000004
+"Type"=dword:00000001
diff --git a/programs/winecfg/dongleui.c b/programs/winecfg/dongleui.c
index 8d35d80..a041a0e 100644
--- a/programs/winecfg/dongleui.c
+++ b/programs/winecfg/dongleui.c
@@ -52,10 +52,11 @@ static const char* dongles[] = {"Guardant",
                                 "HASP HL",
                                 "LPT Katran",
                                 "USB Katran",
+                                "Senselock",
                                 "Sentinel",
                                 "SmartKey 3"};
 
-static const int count = 6;
+static const int count = 7;
 
 static const WCHAR grdkeyW[] = {'G','r','d','K','e','y',0};
 static const WCHAR grdusbW[] = {'G','r','d','U','s','b',0};
@@ -65,6 +66,7 @@ static const WCHAR aksusbW[] = {'a','k','s','u','s','b',0};
 static const WCHAR pkeyW[] = {'P','K','e','y',0};
 static const WCHAR nkeyW[] = {'N','K','e','y',0};
 static const WCHAR upkeyW[] = {'U','P','K','e','y',0};
+static const WCHAR sense4v2W[] = {'s','e','n','s','e','4','v','2',0};
 static const WCHAR sentinelW[] = {'S','e','n','t','i','n','e','l',0};
 static const WCHAR sntnlusbW[] = {'S','N','T','N','L','U','S','B',0};
 static const WCHAR eusk3usbW[] = {'e','u','s','k','3','u','s','b',0};
@@ -77,6 +79,7 @@ enum dongle_t
     hasp,
     katran_lpt,
     katran_usb,
+    senselock,
     sentinel,
     smartkey3
 };
@@ -134,6 +137,7 @@ static int is_loaded(enum dongle_t dongle)
     static const WCHAR skey000W[] = {'\\','\\','.','\\','s','k','e','y','-','0','0','0',0};
     static const GUID hasp_intf = {0x7ab02247, 0x3798, 0x44cd, {0x84,0x72,0x24,0x35,0x64,0x97,0x5f,0x04}};
     static const GUID grd_intf = {0x46b89760, 0xc784, 0x11d4, {0x81,0xa8,0x00,0x80,0xad,0x87,0xaf,0x5c}};
+    static const GUID sens_intf = {0x171638f7, 0x1ead, 0x4873, {0xba,0x98,0xc9,0x66,0xab,0xcf,0x01,0x42}};
 
     switch (dongle)
     {
@@ -153,6 +157,10 @@ static int is_loaded(enum dongle_t dongle)
         if (file_exists(nkey0W) && file_exists(upkey0W))
             return 1;
         break;
+    case senselock:
+        if (interface_exists(&sens_intf))
+            return 1;
+        break;
     case sentinel:
         if (file_exists(rnbodrv0W) && file_exists(skeysusbW) &&
             file_exists(sntnlusbW))
@@ -212,6 +220,9 @@ static void set_start(enum dongle_t dongle, int start)
         set_service_start(nkeyW, start ? SERVICE_DEMAND_START : SERVICE_DISABLED);
         set_service_start(upkeyW, start ? SERVICE_DEMAND_START : SERVICE_DISABLED);
         break;
+    case senselock:
+        set_service_start(sense4v2W, start ? SERVICE_DEMAND_START : SERVICE_DISABLED);
+        break;
     case sentinel:
         set_service_start(sentinelW, start ? SERVICE_AUTO_START : SERVICE_DISABLED);
         set_service_start(sntnlusbW, start ? SERVICE_DEMAND_START : SERVICE_DISABLED);
@@ -246,6 +257,10 @@ static int get_start(enum dongle_t dongle)
             get_service_start(upkeyW) == SERVICE_DEMAND_START)
             return 1;
         break;
+    case senselock:
+        if (get_service_start(sense4v2W) == SERVICE_DEMAND_START)
+            return 1;
+        break;
     case sentinel:
         if (get_service_start(sentinelW) == SERVICE_AUTO_START &&
             get_service_start(sntnlusbW) == SERVICE_DEMAND_START)
diff --git a/tools/udev.rules b/tools/udev.rules
index 318ea35..cd8c98e 100644
--- a/tools/udev.rules
+++ b/tools/udev.rules
@@ -44,4 +44,7 @@ BUS=="usb", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="0003", MODE="0666", OWNE
 # Aladdin HASP
 BUS=="usb", SYSFS{idVendor}=="0529", SYSFS{idProduct}=="0001", MODE="0666", OWNER="root", GROUP="root"
 
+# Senselock
+BUS=="usb", SYSFS{idVendor}=="0471", SYSFS{idProduct}=="485d", MODE="0666", OWNER="root", GROUP="root"
+
 LABEL="winekeys_rules_end"
-- 
1.6.3.3



Подробная информация о списке рассылки Wine-patches