prevents user from replacing the drivers --- usbclerk.cpp | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/usbclerk.cpp b/usbclerk.cpp index 441f4a1..9100811 100644 --- a/usbclerk.cpp +++ b/usbclerk.cpp @@ -17,7 +17,7 @@ #define USB_CLERK_LOG_PATH TEXT("%susbclerk.log") #define USB_CLERK_PIPE_TIMEOUT 10000 #define USB_CLERK_PIPE_BUF_SIZE 1024 -#define USB_DRIVER_PATH "%Swdi_usb_driver" +#define USB_DRIVER_PATH "%S\\wdi_usb_driver" #define USB_DRIVER_INFNAME_LEN 64 #define USB_DRIVER_INSTALL_RETRIES 10 #define USB_DRIVER_INSTALL_INTERVAL 2000 @@ -206,13 +206,15 @@ VOID WINAPI USBClerk::main(DWORD argc, TCHAR* argv[]) SERVICE_STATUS* status; TCHAR log_path[MAX_PATH]; - TCHAR temp_path[MAX_PATH]; + TCHAR path[MAX_PATH]; - if (GetTempPath(MAX_PATH, temp_path)) { - sprintf_s(s->_wdi_path, MAX_PATH, USB_DRIVER_PATH, temp_path); - swprintf_s(log_path, MAX_PATH, USB_CLERK_LOG_PATH, temp_path); + if (GetTempPath(MAX_PATH, path)) { + swprintf_s(log_path, MAX_PATH, USB_CLERK_LOG_PATH, path); s->_log = VDLog::get(log_path); } + if (GetSystemDirectory(path, MAX_PATH)) { + sprintf_s(s->_wdi_path, MAX_PATH, USB_DRIVER_PATH, path); + } vd_printf("***Service started***"); SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS); status = &s->_status; -- 1.7.4.1 _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel