Commit c29a1855 authored by Vitaly Lipatov's avatar Vitaly Lipatov

import 0.5.7

parent cfbd1701
...@@ -8,6 +8,6 @@ For udev: ...@@ -8,6 +8,6 @@ For udev:
(Vendor ID: 0a89; Product ID: 000c, 000d) (Vendor ID: 0a89; Product ID: 000c, 000d)
# cp etc/grdnt_hid.udev /etc/udev/rules.d/95-grdnt_hid.rules # cp etc/grdnt_hid.udev /etc/udev/rules.d/95-grdnt_hid.rules
(Vendor ID: 0a89; Product ID: 0008, 0009) (Vendor ID: 0a89; Product ID: 0008, 0009, 00c2, 00c3)
# cp etc/grdnt.udev /etc/udev/rules.d/95-grdnt.rules # cp etc/grdnt.udev /etc/udev/rules.d/95-grdnt.rules
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT([GrdWine],[0.5.5],[hotline@guardant.ru]) AC_INIT([GrdWine],[0.5.6],[hotline@guardant.ru])
AC_CONFIG_SRCDIR([src/grdwine.c]) AC_CONFIG_SRCDIR([src/grdwine.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
...@@ -12,24 +12,15 @@ AC_ARG_ENABLE([win64], ...@@ -12,24 +12,15 @@ AC_ARG_ENABLE([win64],
AC_ARG_WITH([winedlls], AC_ARG_WITH([winedlls],
[AC_HELP_STRING([--with-winedlls=PATH],[PATH to install .dll.so for Wine @<:@LIBDIR/wine@:>@])], [AC_HELP_STRING([--with-winedlls=PATH],[PATH to install .dll.so for Wine @<:@LIBDIR/wine@:>@])],
[winedlls="${withval}"],[winedlls="\$(libdir)/wine"]) [winedlls="${withval}"],[winedlls="\$(libdir)/wine"])
AC_ARG_WITH([wineso],
[AC_HELP_STRING([--with-wineso=PATH],[PATH to install .dll.so for Wine @<:@LIBDIR/wine@:>@])],
[wineso="${withval}"],[wineso="\$(libdir)/wine"])
AC_ARG_WITH([winepe],
[AC_HELP_STRING([--with-winepe=PATH],[PATH to install .dll for Wine @<:@LIBDIR/wine@:>@])],
[winepe="${withval}"],[wineso="\$(libdir)/wine"])
AC_ARG_WITH([wineincs], AC_ARG_WITH([wineincs],
[AC_HELP_STRING([--with-wineincs=PATH],[PATH to Wine C header files @<:@INCLUDEDIR@:>@])], [AC_HELP_STRING([--with-wineincs=PATH],[PATH to Wine C header files @<:@INCLUDEDIR@:>@])],
[wineincs="${withval}"],[wineincs="\$(includedir)"]) [wineincs="${withval}"],[wineincs="\$(includedir)"])
AC_SUBST([wineso]) AC_SUBST([winedlls])
AC_SUBST([winepe])
AC_SUBST([wineincs]) AC_SUBST([wineincs])
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_SYS_LARGEFILE
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
......
...@@ -6,4 +6,10 @@ SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0a89", SYSFS{idProduct ...@@ -6,4 +6,10 @@ SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0a89", SYSFS{idProduct
# (for device created by udev in /dev/bus/usb) # (for device created by udev in /dev/bus/usb)
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="0009", MODE="0666" SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="0009", MODE="0666"
SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="0009", MODE="0666" SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="0009", MODE="0666"
# Guardant Sign WinUsb
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="00c2", MODE="0666"
SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="00c2", MODE="0666"
# Guardant Code WinUsb
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="00c3", MODE="0666"
SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0a89", SYSFS{idProduct}=="00c3", MODE="0666"
...@@ -11,11 +11,6 @@ grdwine$(EXEEXT): grdwine.spec grdwine.o grdimpl_linux.o grdwine.dll.so ...@@ -11,11 +11,6 @@ grdwine$(EXEEXT): grdwine.spec grdwine.o grdimpl_linux.o grdwine.dll.so
grdwine.dll.so: grdwine.spec grdwine.o grdimpl_linux.o grdwine.dll.so: grdwine.spec grdwine.o grdimpl_linux.o
$(WINEGCC) -shared $^ -o $@ -lkernel32 $(WINEGCC) -shared $^ -o $@ -lkernel32
grdwine.dll: grdwine.spec install-am: grdwine.dll.so
$(WINEGCC) -o $@ -Wb,--fake-module -shared $^ -mno-cygwin $(INSTALL_PROGRAM) $^ $(winedlls)/$^
install-am: grdwine.dll.so grdwine.dll
$(MKDIR_P) $(winepe) $(wineso)
$(INSTALL_PROGRAM) grdwine.dll.so $(wineso)/grdwine.dll.so
$(INSTALL_PROGRAM) grdwine.dll $(winepe)/grdwine.dll
...@@ -42,8 +42,10 @@ ...@@ -42,8 +42,10 @@
#define GRD_VENDOR 0x0a89 #define GRD_VENDOR 0x0a89
#define GRD_PRODID_S3S 0x08 /* Guardant Sign/Time USB */ #define GRD_PRODID_S3S 0x08 /* Guardant Sign/Time USB */
#define GRD_PRODID_S3S_HID 0x0C /* Guardant Sign/Time USB HID */ #define GRD_PRODID_S3S_HID 0x0C /* Guardant Sign/Time USB HID */
#define GRD_PRODID_S3S_WINUSB 0xC2 /* Guardant Sign/Time USB (WINUSB) */
#define GRD_PRODID_S3C 0x09 /* Guardant Code USB */ #define GRD_PRODID_S3C 0x09 /* Guardant Code USB */
#define GRD_PRODID_S3C_HID 0x0D /* Guardant Code USB HID */ #define GRD_PRODID_S3C_HID 0x0D /* Guardant Code USB HID */
#define GRD_PRODID_S3C_WINUSB 0xC3 /* Guardant Code USB (WINSUB) */
#define USBFS_PATH_ENV "USB_DEVFS_PATH" #define USBFS_PATH_ENV "USB_DEVFS_PATH"
#define GRD_IPC_NAME_ENV "GRD_IPC_NAME" #define GRD_IPC_NAME_ENV "GRD_IPC_NAME"
#define USBFS_PATH_1 "/dev/bus/usb" #define USBFS_PATH_1 "/dev/bus/usb"
...@@ -385,10 +387,7 @@ int grd_ioctl_device(const char* dev_path, unsigned int prod_id, size_t pack_siz ...@@ -385,10 +387,7 @@ int grd_ioctl_device(const char* dev_path, unsigned int prod_id, size_t pack_siz
*/ */
int grd_probe_device(const char* dev_path, unsigned int* prod_id) int grd_probe_device(const char* dev_path, unsigned int* prod_id)
{ {
unsigned char buf_tmpl[16] = { unsigned char buf_tmpl[4] = {0x89, 0x0a, 0x00, 0x00};
0x12, 0x01, 0x00, 0x02, 0xff, 0x00, 0x00, 0x40,
0x89, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02
};
unsigned char buf[16]; unsigned char buf[16];
struct lock_descr lock; struct lock_descr lock;
unsigned int id; unsigned int id;
...@@ -415,18 +414,19 @@ int grd_probe_device(const char* dev_path, unsigned int* prod_id) ...@@ -415,18 +414,19 @@ int grd_probe_device(const char* dev_path, unsigned int* prod_id)
ret = -1; ret = -1;
else else
{ {
ret = 0; unsigned char p = 0;
assert(sizeof(buf) == sizeof(buf_tmpl) && sizeof(buf_tmpl) == 16); unsigned char prod_ids[4] = {GRD_PRODID_S3S, GRD_PRODID_S3S_WINUSB, GRD_PRODID_S3C, GRD_PRODID_S3C_WINUSB};
buf_tmpl[10] = GRD_PRODID_S3S;
if (!memcmp(buf, buf_tmpl, sizeof(buf_tmpl)))
id = GRD_PRODID_S3S;
else
{
buf_tmpl[10] = GRD_PRODID_S3C;
if (!memcmp(buf, buf_tmpl, sizeof(buf_tmpl)))
id = GRD_PRODID_S3C;
else
ret = -1; ret = -1;
assert(sizeof(buf_tmpl) == 4);
for (; p < sizeof(prod_ids); ++p)
{
buf_tmpl[2] = prod_ids[p];
if (!memcmp(buf + 8, buf_tmpl, sizeof(buf_tmpl)))
{
id = prod_ids[p];
ret = 0;
break;
}
} }
} }
} }
......
...@@ -105,8 +105,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -105,8 +105,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch (fdwReason) switch (fdwReason)
{ {
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL); // DisableThreadLibraryCalls(hinstDLL);
break; break;
} }
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment