Module: wine Branch: master Commit: af0e0d9b6212da9cb20a9a57608dd676842bd737 URL: https://source.winehq.org/git/wine.git/?a=commit;h=af0e0d9b6212da9cb20a9a576...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Jun 5 08:36:39 2019 +0200
hidclass.sys: Build with msvcrt.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/hidclass.sys/Makefile.in | 2 ++ dlls/hidclass.sys/buffer.c | 1 - dlls/hidclass.sys/descriptor.c | 2 -- dlls/hidclass.sys/device.c | 5 +---- dlls/hidclass.sys/main.c | 1 - dlls/hidclass.sys/pnp.c | 20 ++++++++++---------- 6 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in index 209c2df..be4af74 100644 --- a/dlls/hidclass.sys/Makefile.in +++ b/dlls/hidclass.sys/Makefile.in @@ -3,6 +3,8 @@ IMPORTLIB = hidclass IMPORTS = hal ntoskrnl DELAYIMPORTS = setupapi hid
+EXTRADLLFLAGS = -mno-cygwin + C_SRCS = \ buffer.c \ descriptor.c \ diff --git a/dlls/hidclass.sys/buffer.c b/dlls/hidclass.sys/buffer.c index 731f1e0..eccc3ed 100644 --- a/dlls/hidclass.sys/buffer.c +++ b/dlls/hidclass.sys/buffer.c @@ -17,7 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" #include <stdarg.h> #define NONAMELESSUNION #include "hid.h" diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index 12f7ebd..5e164f3 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h> #include <stdlib.h> #include <stdio.h> diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 4495300..86b6d1b 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -18,13 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h> #define NONAMELESSUNION #define NONAMELESSSTRUCT #include "hid.h" -#include "wine/unicode.h" #include "winreg.h" #include "winuser.h" #include "setupapi.h" @@ -50,7 +47,7 @@ NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRAT NTSTATUS status; BASE_DEVICE_EXTENSION *ext;
- sprintfW(dev_name, device_name_fmtW, driver->DriverObject, native_device); + swprintf(dev_name, ARRAY_SIZE(dev_name), device_name_fmtW, driver->DriverObject, native_device); RtlInitUnicodeString( &nameW, dev_name );
TRACE("Create base hid device %s\n", debugstr_w(dev_name)); diff --git a/dlls/hidclass.sys/main.c b/dlls/hidclass.sys/main.c index 8bb423b..1c7a3ca 100644 --- a/dlls/hidclass.sys/main.c +++ b/dlls/hidclass.sys/main.c @@ -23,7 +23,6 @@ #include <stdarg.h> #include "hid.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL(hid); diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index a283d63..363d82d 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -26,7 +26,6 @@ #include "ddk/wdm.h" #include "regstr.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL(hid); @@ -191,14 +190,15 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ext->information.DescriptorSize = ext->preparseData->dwSize;
lstrcpyW(ext->instance_id, device_enumeratorW); - strcatW(ext->instance_id, separator_W); + lstrcatW(ext->instance_id, separator_W); /* Skip the original enumerator */ - id_ptr = strchrW(PDO_id, '\'); + id_ptr = wcschr(PDO_id, '\'); id_ptr++; - strcatW(ext->instance_id, id_ptr); + lstrcatW(ext->instance_id, id_ptr); HeapFree(GetProcessHeap(), 0, PDO_id);
- sprintfW(ext->device_id, device_deviceid_fmtW, device_enumeratorW, ext->information.VendorID, ext->information.ProductID); + swprintf(ext->device_id, ARRAY_SIZE(ext->device_id), device_deviceid_fmtW, + device_enumeratorW, ext->information.VendorID, ext->information.ProductID);
HID_LinkDevice(device);
@@ -262,13 +262,13 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp) WCHAR *ptr; ptr = id; /* Instance ID */ - strcpyW(ptr, ext->instance_id); + lstrcpyW(ptr, ext->instance_id); ptr += lstrlenW(ext->instance_id) + 1; /* Device ID */ - strcpyW(ptr, ext->device_id); + lstrcpyW(ptr, ext->device_id); ptr += lstrlenW(ext->device_id) + 1; /* Bus ID */ - strcpyW(ptr, device_enumeratorW); + lstrcpyW(ptr, device_enumeratorW); ptr += lstrlenW(device_enumeratorW) + 1; *ptr = 0; irp->IoStatus.Information = (ULONG_PTR)id; @@ -276,12 +276,12 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp) break; } case BusQueryDeviceID: - strcpyW(id, ext->device_id); + lstrcpyW(id, ext->device_id); irp->IoStatus.Information = (ULONG_PTR)id; rc = STATUS_SUCCESS; break; case BusQueryInstanceID: - strcpyW(id, ext->instance_id); + lstrcpyW(id, ext->instance_id); irp->IoStatus.Information = (ULONG_PTR)id; rc = STATUS_SUCCESS; break;