From e09c4d3b6e5cc322f26c692b80264951d9019a34 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Tue, 18 Sep 2018 04:59:46 -0700 Subject: [PATCH] Fix windows issues. --- dfu-windows.c | 2 ++ hid-windows.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dfu-windows.c b/dfu-windows.c index 413ab6c..4432de0 100644 --- a/dfu-windows.c +++ b/dfu-windows.c @@ -530,6 +530,8 @@ void dfu_reboot() { unsigned char cmd[2] = { 0x91, 0x05 }; + if (!dev) + return; if (trace_flag) { printf("--- Send DNLOAD [2] "); print_hex(cmd, 2); diff --git a/hid-windows.c b/hid-windows.c index 6d0b42c..17b719a 100644 --- a/hid-windows.c +++ b/hid-windows.c @@ -154,7 +154,7 @@ HANDLE find_hid_device(int vid, int pid) printf("Device %d: cannot get path!\n", index); continue; } - printf("Device %d: path %s\n", index, detail->DevicePath); + //printf("Device %d: path %s\n", index, detail->DevicePath); h = CreateFile(detail->DevicePath, GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -166,7 +166,7 @@ HANDLE find_hid_device(int vid, int pid) HIDD_ATTRIBUTES attrib; attrib.Size = sizeof(HIDD_ATTRIBUTES); HidD_GetAttributes(h, &attrib); - printf("Product/Vendor: %x %x\n", attrib.ProductID, attrib.VendorID); + //printf("Vendor/Product: %04x %04x\n", attrib.VendorID, attrib.ProductID); // Check the VID/PID. if (attrib.VendorID != vid || attrib.ProductID != pid) {