From 42d40261c58307508299deae58a75ef08d14283d Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 10 Apr 2020 14:11:15 +0200 Subject: [PATCH] Fixed return type for subsystem entry --- channels/client/CMakeLists.txt | 2 +- channels/client/tables.h | 2 +- channels/urbdrc/client/libusb/libusb_udevman.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/channels/client/CMakeLists.txt b/channels/client/CMakeLists.txt index a0d3a73581..eb0c80f129 100644 --- a/channels/client/CMakeLists.txt +++ b/channels/client/CMakeLists.txt @@ -97,7 +97,7 @@ foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES}) set(STATIC_SUBSYSTEM_ENTRY "${STATIC_SUBSYSTEM_NAME}_freerdp_${STATIC_MODULE_CHANNEL}_client_subsystem_entry") endif() set(SUBSYSTEM_TABLE "${SUBSYSTEM_TABLE}\n\t{ \"${STATIC_SUBSYSTEM_NAME}\", \"${STATIC_SUBSYSTEM_TYPE}\", ${STATIC_SUBSYSTEM_ENTRY} },") - set(SUBSYSTEM_IMPORT "extern void ${STATIC_SUBSYSTEM_ENTRY}(void);") + set(SUBSYSTEM_IMPORT "extern UINT ${STATIC_SUBSYSTEM_ENTRY}(void*);") set(CLIENT_STATIC_SUBSYSTEM_IMPORTS "${CLIENT_STATIC_SUBSYSTEM_IMPORTS}\n${SUBSYSTEM_IMPORT}") endforeach() set(SUBSYSTEM_TABLE "${SUBSYSTEM_TABLE}\n\t{ NULL, NULL, NULL }\n};") diff --git a/channels/client/tables.h b/channels/client/tables.h index fd998a6ae1..b6b3f9ca27 100644 --- a/channels/client/tables.h +++ b/channels/client/tables.h @@ -37,7 +37,7 @@ struct _STATIC_SUBSYSTEM_ENTRY { const char* name; const char* type; - void (*entry)(void); + UINT (*entry)(); }; typedef struct _STATIC_SUBSYSTEM_ENTRY STATIC_SUBSYSTEM_ENTRY; diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index 67360ad430..7509326c22 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -861,9 +861,9 @@ static DWORD poll_thread(LPVOID lpThreadParameter) #else #define freerdp_urbdrc_client_subsystem_entry FREERDP_API freerdp_urbdrc_client_subsystem_entry #endif -int freerdp_urbdrc_client_subsystem_entry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS pEntryPoints) +UINT freerdp_urbdrc_client_subsystem_entry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS pEntryPoints) { - int rc; + UINT rc; UINT status; UDEVMAN* udevman; ADDIN_ARGV* args = pEntryPoints->args; @@ -922,5 +922,5 @@ int freerdp_urbdrc_client_subsystem_entry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS p return 0; fail: udevman_free(&udevman->iface); - return -1; + return ERROR_INTERNAL_ERROR; } From aa39e08c29a43c2353b9f158edb0b113c7e0751f Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 10 Apr 2020 14:16:19 +0200 Subject: [PATCH] Fixed URBDRC DEVICE_ADD_FLAG definitions --- channels/urbdrc/client/urbdrc_main.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/channels/urbdrc/client/urbdrc_main.h b/channels/urbdrc/client/urbdrc_main.h index 5ec839983b..749aaf8727 100644 --- a/channels/urbdrc/client/urbdrc_main.h +++ b/channels/urbdrc/client/urbdrc_main.h @@ -222,14 +222,12 @@ struct _IUDEVMAN UINT32 status; }; -enum -{ - DEVICE_ADD_FLAG_BUS, - DEVICE_ADD_FLAG_DEV, - DEVICE_ADD_FLAG_VENDOR, - DEVICE_ADD_FLAG_PRODUCT, - DEVICE_ADD_FLAG_REGISTER -} device_add_flag_t; +#define DEVICE_ADD_FLAG_BUS 0x01 +#define DEVICE_ADD_FLAG_DEV 0x02 +#define DEVICE_ADD_FLAG_VENDOR 0x04 +#define DEVICE_ADD_FLAG_PRODUCT 0x08 +#define DEVICE_ADD_FLAG_REGISTER 0x10 + #define DEVICE_ADD_FLAG_ALL \ (DEVICE_ADD_FLAG_BUS | DEVICE_ADD_FLAG_DEV | DEVICE_ADD_FLAG_VENDOR | \ DEVICE_ADD_FLAG_PRODUCT | DEVICE_ADD_FLAG_REGISTER)