From e95b5b5a24dec50854f584272e97e5e2fd47bc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Mon, 8 Oct 2012 21:00:07 -0400 Subject: [PATCH] channels: move rdpdr header --- channels/disk/client/CMakeLists.txt | 2 - channels/disk/client/disk_file.c | 9 +- channels/disk/client/disk_file.h | 6 +- channels/disk/client/disk_main.c | 7 +- channels/disk/client/statvfs.h | 2 +- channels/parallel/client/CMakeLists.txt | 2 - channels/parallel/client/parallel_main.c | 4 +- channels/printer/client/CMakeLists.txt | 2 - channels/printer/client/printer_cups.c | 5 +- channels/printer/client/printer_cups.h | 2 +- channels/printer/client/printer_main.c | 6 +- channels/printer/client/printer_main.h | 4 +- channels/printer/client/printer_win.c | 2 +- channels/printer/client/printer_win.h | 3 +- channels/rdpdr/client/CMakeLists.txt | 2 - channels/rdpdr/client/devman.c | 8 +- channels/rdpdr/client/devman.h | 12 +-- channels/rdpdr/client/irp.c | 9 +- channels/rdpdr/client/irp.h | 14 +-- channels/rdpdr/client/rdpdr_capabilities.c | 9 +- channels/rdpdr/client/rdpdr_capabilities.h | 12 +-- channels/rdpdr/client/rdpdr_main.c | 10 +- channels/rdpdr/client/rdpdr_main.h | 15 ++- channels/rdpdr/client/rdpdr_types.h | 94 ------------------- channels/serial/client/CMakeLists.txt | 2 - channels/serial/client/serial_main.c | 6 +- channels/serial/client/serial_tty.c | 3 +- channels/serial/client/serial_tty.h | 4 + channels/smartcard/client/CMakeLists.txt | 1 - channels/smartcard/client/scard_main.c | 4 +- channels/smartcard/client/scard_main.h | 4 +- channels/smartcard/client/scard_operations.c | 69 +++++++------- .../freerdp/channels/rdpdr.h | 82 ++++++++++++++-- 33 files changed, 184 insertions(+), 232 deletions(-) delete mode 100644 channels/rdpdr/client/rdpdr_types.h rename channels/rdpdr/client/rdpdr_constants.h => include/freerdp/channels/rdpdr.h (89%) diff --git a/channels/disk/client/CMakeLists.txt b/channels/disk/client/CMakeLists.txt index 586c89462..7ba321f94 100644 --- a/channels/disk/client/CMakeLists.txt +++ b/channels/disk/client/CMakeLists.txt @@ -34,8 +34,6 @@ if(MSVC AND (NOT WITH_STATIC_PLUGINS)) set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) endif() -include_directories(../../rdpdr/client) - if(NOT WITH_STATIC_PLUGINS) add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) else() diff --git a/channels/disk/client/disk_file.c b/channels/disk/client/disk_file.c index efcb52d2c..a26a6e1bb 100644 --- a/channels/disk/client/disk_file.c +++ b/channels/disk/client/disk_file.c @@ -1,10 +1,10 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * File System Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau + * Copyright 2010-2012 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee - * Copyright 2012 Gerald Richter + * Copyright 2012 Gerald Richter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,7 @@ #include #include #include +#include #include #ifdef HAVE_UNISTD_H @@ -52,8 +53,6 @@ #include #endif -#include "rdpdr_constants.h" -#include "rdpdr_types.h" #include "disk_file.h" static boolean disk_file_wildcard_match(const char* pattern, const char* filename) diff --git a/channels/disk/client/disk_file.h b/channels/disk/client/disk_file.h index ba55f3c7c..f97696bd2 100644 --- a/channels/disk/client/disk_file.h +++ b/channels/disk/client/disk_file.h @@ -1,10 +1,10 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * File System Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau + * Copyright 2010-2012 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee - * Copyright 2012 Gerald Richter + * Copyright 2012 Gerald Richter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channels/disk/client/disk_main.c b/channels/disk/client/disk_main.c index b996c6d6b..088652f4f 100644 --- a/channels/disk/client/disk_main.c +++ b/channels/disk/client/disk_main.c @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * File System Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,6 @@ #include #include -#include "rdpdr_constants.h" -#include "rdpdr_types.h" #include "disk_file.h" typedef struct _DISK_DEVICE DISK_DEVICE; diff --git a/channels/disk/client/statvfs.h b/channels/disk/client/statvfs.h index a38dc71dc..6912c29a4 100644 --- a/channels/disk/client/statvfs.h +++ b/channels/disk/client/statvfs.h @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * statvfs emulation for windows * * Copyright 2012 Gerald Richter diff --git a/channels/parallel/client/CMakeLists.txt b/channels/parallel/client/CMakeLists.txt index 70d08bfe8..4898f10e2 100644 --- a/channels/parallel/client/CMakeLists.txt +++ b/channels/parallel/client/CMakeLists.txt @@ -21,8 +21,6 @@ set(MODULE_PREFIX "CHANNEL_RDPDR_PARALLEL_CLIENT") set(${MODULE_PREFIX}_SRCS parallel_main.c) -include_directories(../../rdpdr/client) - add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c index d6c0cdb01..475fd99af 100644 --- a/channels/parallel/client/parallel_main.c +++ b/channels/parallel/client/parallel_main.c @@ -57,9 +57,7 @@ #include #include #include - -#include "rdpdr_constants.h" -#include "rdpdr_types.h" +#include struct _PARALLEL_DEVICE { diff --git a/channels/printer/client/CMakeLists.txt b/channels/printer/client/CMakeLists.txt index b4174cf64..5e3cac496 100644 --- a/channels/printer/client/CMakeLists.txt +++ b/channels/printer/client/CMakeLists.txt @@ -37,8 +37,6 @@ if(WIN32) printer_win.h) endif() -include_directories(../../rdpdr/client) - add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") diff --git a/channels/printer/client/printer_cups.c b/channels/printer/client/printer_cups.c index 84d0a2ce8..a6a076b10 100644 --- a/channels/printer/client/printer_cups.c +++ b/channels/printer/client/printer_cups.c @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Print Virtual Channel - CUPS driver * * Copyright 2010-2011 Vic Lee @@ -31,9 +31,8 @@ #include #include +#include -#include "rdpdr_constants.h" -#include "rdpdr_types.h" #include "printer_main.h" #include "printer_cups.h" diff --git a/channels/printer/client/printer_cups.h b/channels/printer/client/printer_cups.h index c6e1ff51a..434d64aba 100644 --- a/channels/printer/client/printer_cups.h +++ b/channels/printer/client/printer_cups.h @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Print Virtual Channel - CUPS driver * * Copyright 2010-2011 Vic Lee diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index bd4368a83..7686db182 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Print Virtual Channel * * Copyright 2010-2011 Vic Lee @@ -35,9 +35,7 @@ #include #include #include - -#include "rdpdr_constants.h" -#include "rdpdr_types.h" +#include #ifdef WITH_CUPS #include "printer_cups.h" diff --git a/channels/printer/client/printer_main.h b/channels/printer/client/printer_main.h index 256c4a77d..3eeb81646 100644 --- a/channels/printer/client/printer_main.h +++ b/channels/printer/client/printer_main.h @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Print Virtual Channel * * Copyright 2010-2011 Vic Lee @@ -20,7 +20,7 @@ #ifndef __PRINTER_MAIN_H #define __PRINTER_MAIN_H -#include "rdpdr_types.h" +#include /* SERVER_PRINTER_CACHE_EVENT.cachedata */ #define RDPDR_ADD_PRINTER_EVENT 0x00000001 diff --git a/channels/printer/client/printer_win.c b/channels/printer/client/printer_win.c index 6b00704b4..be80a19d2 100644 --- a/channels/printer/client/printer_win.c +++ b/channels/printer/client/printer_win.c @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Print Virtual Channel - WIN driver * * Copyright 2012 Gerald Richter diff --git a/channels/printer/client/printer_win.h b/channels/printer/client/printer_win.h index 5b694ac40..eecbb17ba 100644 --- a/channels/printer/client/printer_win.h +++ b/channels/printer/client/printer_win.h @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Print Virtual Channel - win driver * * Copyright 2012 Gerald Richter @@ -20,7 +20,6 @@ #ifndef __PRINTER_WIN_H #define __PRINTER_WIN_H - rdpPrinterDriver* printer_win_get_driver(void); #ifdef WITH_DEBUG_WINPR diff --git a/channels/rdpdr/client/CMakeLists.txt b/channels/rdpdr/client/CMakeLists.txt index c9969b253..108973128 100644 --- a/channels/rdpdr/client/CMakeLists.txt +++ b/channels/rdpdr/client/CMakeLists.txt @@ -25,8 +25,6 @@ set(${MODULE_PREFIX}_SRCS devman.h rdpdr_main.c rdpdr_main.h - rdpdr_types.h - rdpdr_constants.h rdpdr_capabilities.c rdpdr_capabilities.h) diff --git a/channels/rdpdr/client/devman.c b/channels/rdpdr/client/devman.c index a9fbe1671..fec61b52e 100644 --- a/channels/rdpdr/client/devman.c +++ b/channels/rdpdr/client/devman.c @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ #include #include -#include "rdpdr_types.h" +#include "rdpdr_main.h" #include "devman.h" DEVMAN* devman_new(rdpSvcPlugin* plugin) diff --git a/channels/rdpdr/client/devman.h b/channels/rdpdr/client/devman.h index 586034775..e9364f4d4 100644 --- a/channels/rdpdr/client/devman.h +++ b/channels/rdpdr/client/devman.h @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ * limitations under the License. */ -#ifndef __DEVMAN_H -#define __DEVMAN_H +#ifndef FREERDP_CHANNEL_RDPDR_CLIENT_DEVMAN_H +#define FREERDP_CHANNEL_RDPDR_CLIENT_DEVMAN_H DEVMAN* devman_new(rdpSvcPlugin* plugin); void devman_free(DEVMAN* devman); boolean devman_load_device_service(DEVMAN* devman, RDP_PLUGIN_DATA* plugin_data); DEVICE* devman_get_device_by_id(DEVMAN* devman, uint32 id); -#endif /* __DEVMAN_H */ +#endif /* FREERDP_CHANNEL_RDPDR_CLIENT_DEVMAN_H */ diff --git a/channels/rdpdr/client/irp.c b/channels/rdpdr/client/irp.c index 9ca5180bc..0a3fea4e3 100644 --- a/channels/rdpdr/client/irp.c +++ b/channels/rdpdr/client/irp.c @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,8 +32,7 @@ #include #include -#include "rdpdr_types.h" -#include "rdpdr_constants.h" +#include "rdpdr_main.h" #include "devman.h" #include "irp.h" diff --git a/channels/rdpdr/client/irp.h b/channels/rdpdr/client/irp.h index d33e51885..fcdeba109 100644 --- a/channels/rdpdr/client/irp.h +++ b/channels/rdpdr/client/irp.h @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,11 @@ * limitations under the License. */ -#ifndef __IRP_H -#define __IRP_H +#ifndef FREERDP_CHANNEL_RDPDR_CLIENT_IRP_H +#define FREERDP_CHANNEL_RDPDR_CLIENT_IRP_H -#include "rdpdr_types.h" +#include "rdpdr_main.h" IRP* irp_new(DEVMAN* devman, STREAM* data_in); -#endif /* __IRP_H */ +#endif /* FREERDP_CHANNEL_RDPDR_CLIENT_IRP_H */ diff --git a/channels/rdpdr/client/rdpdr_capabilities.c b/channels/rdpdr/client/rdpdr_capabilities.c index 0b1b81e51..a54052cce 100644 --- a/channels/rdpdr/client/rdpdr_capabilities.c +++ b/channels/rdpdr/client/rdpdr_capabilities.c @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,7 @@ #include #include -#include "rdpdr_types.h" -#include "rdpdr_constants.h" +#include "rdpdr_main.h" #include "rdpdr_capabilities.h" /* Output device redirection capability set header */ diff --git a/channels/rdpdr/client/rdpdr_capabilities.h b/channels/rdpdr/client/rdpdr_capabilities.h index 28b83c745..16f0b1db9 100644 --- a/channels/rdpdr/client/rdpdr_capabilities.h +++ b/channels/rdpdr/client/rdpdr_capabilities.h @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ * limitations under the License. */ -#ifndef __RDPDR_CAPABILITIES_H -#define __RDPDR_CAPABILITIES_H +#ifndef FREERDP_CHANNEL_RDPDR_CLIENT_CAPABILITIES_H +#define FREERDP_CHANNEL_RDPDR_CLIENT_CAPABILITIES_H #include "rdpdr_main.h" void rdpdr_process_capability_request(rdpdrPlugin* rdpdr, STREAM* data_in); void rdpdr_send_capability_response(rdpdrPlugin* rdpdr); -#endif /* __RDPDR_CAPABILITIES_H */ +#endif /* FREERDP_CHANNEL_RDPDR_CLIENT_CAPABILITIES_H */ diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 4794fe5cb..9bc6e5cc6 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,15 +33,15 @@ #include #include #include +#include #include #ifdef HAVE_UNISTD_H #include #endif -#include "rdpdr_types.h" -#include "rdpdr_constants.h" #include "rdpdr_capabilities.h" + #include "devman.h" #include "irp.h" diff --git a/channels/rdpdr/client/rdpdr_main.h b/channels/rdpdr/client/rdpdr_main.h index 23d58bfce..ef93f744e 100644 --- a/channels/rdpdr/client/rdpdr_main.h +++ b/channels/rdpdr/client/rdpdr_main.h @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,13 +18,12 @@ * limitations under the License. */ -#ifndef __RDPDR_MAIN_H -#define __RDPDR_MAIN_H +#ifndef FREERDP_CHANNEL_RDPDR_CLIENT_MAIN_H +#define FREERDP_CHANNEL_RDPDR_CLIENT_MAIN_H +#include #include -#include "rdpdr_types.h" - typedef struct rdpdr_plugin rdpdrPlugin; struct rdpdr_plugin @@ -39,4 +38,4 @@ struct rdpdr_plugin char computerName[256]; }; -#endif /* __RDPDR_MAIN_H */ +#endif /* FREERDP_CHANNEL_RDPDR_CLIENT_MAIN_H */ diff --git a/channels/rdpdr/client/rdpdr_types.h b/channels/rdpdr/client/rdpdr_types.h deleted file mode 100644 index 1c8ba5b47..000000000 --- a/channels/rdpdr/client/rdpdr_types.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel - * - * Copyright 2010-2011 Marc-Andre Moreau - * Copyright 2010-2011 Vic Lee - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __RDPDR_TYPES_H -#define __RDPDR_TYPES_H - -#include -#include -#include -#include - -#include -#include -#include - -typedef struct _DEVICE DEVICE; -typedef struct _IRP IRP; -typedef struct _DEVMAN DEVMAN; - -typedef void (*pcIRPRequest)(DEVICE* device, IRP* irp); -typedef void (*pcFreeDevice)(DEVICE* device); - -struct _DEVICE -{ - uint32 id; - - uint32 type; - char* name; - STREAM* data; - - pcIRPRequest IRPRequest; - pcFreeDevice Free; -}; - -typedef void (*pcIRPResponse)(IRP* irp); - -struct _IRP -{ - SLIST_ENTRY ItemEntry; - - DEVICE* device; - DEVMAN* devman; - uint32 FileId; - uint32 CompletionId; - uint32 MajorFunction; - uint32 MinorFunction; - STREAM* input; - - uint32 IoStatus; - STREAM* output; - - pcIRPResponse Complete; - pcIRPResponse Discard; -}; - -struct _DEVMAN -{ - rdpSvcPlugin* plugin; - uint32 id_sequence; /* generate unique device id */ - LIST* devices; -}; - -typedef void (*pcRegisterDevice)(DEVMAN* devman, DEVICE* device); - -struct _DEVICE_SERVICE_ENTRY_POINTS -{ - DEVMAN* devman; - - pcRegisterDevice RegisterDevice; - RDP_PLUGIN_DATA* plugin_data; -}; -typedef struct _DEVICE_SERVICE_ENTRY_POINTS DEVICE_SERVICE_ENTRY_POINTS; -typedef DEVICE_SERVICE_ENTRY_POINTS* PDEVICE_SERVICE_ENTRY_POINTS; - -typedef int (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); - -#endif /* __RDPDR_TYPES_H */ diff --git a/channels/serial/client/CMakeLists.txt b/channels/serial/client/CMakeLists.txt index fcd3039c0..5e25323cd 100644 --- a/channels/serial/client/CMakeLists.txt +++ b/channels/serial/client/CMakeLists.txt @@ -24,8 +24,6 @@ set(${MODULE_PREFIX}_SRCS serial_constants.h serial_main.c) -include_directories(../../rdpdr/client) - add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) set_target_properties(serial PROPERTIES PREFIX "") diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index 0ef98333a..12ff0c9cc 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -40,18 +40,18 @@ #include #endif -#include "rdpdr_types.h" -#include "rdpdr_constants.h" -#include "devman.h" #include "serial_tty.h" #include "serial_constants.h" +#include #include #include #include #include +#include typedef struct _SERIAL_DEVICE SERIAL_DEVICE; + struct _SERIAL_DEVICE { DEVICE device; diff --git a/channels/serial/client/serial_tty.c b/channels/serial/client/serial_tty.c index 4dfa690e7..ce65fca34 100644 --- a/channels/serial/client/serial_tty.c +++ b/channels/serial/client/serial_tty.c @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef _WIN32 #include @@ -46,8 +47,6 @@ #include #include -#include "rdpdr_constants.h" -#include "rdpdr_types.h" #include "serial_tty.h" #include "serial_constants.h" diff --git a/channels/serial/client/serial_tty.h b/channels/serial/client/serial_tty.h index d9b76414e..4333039e3 100644 --- a/channels/serial/client/serial_tty.h +++ b/channels/serial/client/serial_tty.h @@ -28,7 +28,11 @@ #include #endif +#include +#include + typedef struct _SERIAL_TTY SERIAL_TTY; + struct _SERIAL_TTY { uint32 id; diff --git a/channels/smartcard/client/CMakeLists.txt b/channels/smartcard/client/CMakeLists.txt index 239bbe69f..b8906eb08 100644 --- a/channels/smartcard/client/CMakeLists.txt +++ b/channels/smartcard/client/CMakeLists.txt @@ -22,7 +22,6 @@ set(${MODULE_PREFIX}_SRCS scard_main.c scard_operations.c) -include_directories(../../rdpdr/client) include_directories(${PCSC_INCLUDE_DIRS}) add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) diff --git a/channels/smartcard/client/scard_main.c b/channels/smartcard/client/scard_main.c index b5998fbe0..dcb266028 100644 --- a/channels/smartcard/client/scard_main.c +++ b/channels/smartcard/client/scard_main.c @@ -31,9 +31,7 @@ #include #include #include - -#include "rdpdr_types.h" -#include "rdpdr_constants.h" +#include #include "scard_main.h" diff --git a/channels/smartcard/client/scard_main.h b/channels/smartcard/client/scard_main.h index c8143ef31..c5d86f7d3 100644 --- a/channels/smartcard/client/scard_main.h +++ b/channels/smartcard/client/scard_main.h @@ -23,11 +23,9 @@ #include -#include "devman.h" -#include "rdpdr_types.h" - #include #include +#include #include diff --git a/channels/smartcard/client/scard_operations.c b/channels/smartcard/client/scard_operations.c index 88bdc6358..703ddb244 100644 --- a/channels/smartcard/client/scard_operations.c +++ b/channels/smartcard/client/scard_operations.c @@ -1,5 +1,5 @@ /** - * FreeRDP: A Remote Desktop Protocol client. + * FreeRDP: A Remote Desktop Protocol Implementation * Smartcard Device Service Virtual Channel * * Copyright (C) Alexi Volkov 2006 @@ -43,47 +43,45 @@ #include #include #include - -#include "rdpdr_types.h" -#include "rdpdr_constants.h" +#include #include "scard_main.h" /* [MS-RDPESC] 3.1.4 */ -#define SCARD_IOCTL_ESTABLISH_CONTEXT 0x00090014 /* EstablishContext */ -#define SCARD_IOCTL_RELEASE_CONTEXT 0x00090018 /* ReleaseContext */ -#define SCARD_IOCTL_IS_VALID_CONTEXT 0x0009001C /* IsValidContext */ -#define SCARD_IOCTL_LIST_READER_GROUPS 0x00090020 /* ListReaderGroups */ -#define SCARD_IOCTL_LIST_READERS 0x00090028 /* ListReadersA */ -#define SCARD_IOCTL_INTRODUCE_READER_GROUP 0x00090050 /* IntroduceReaderGroup */ -#define SCARD_IOCTL_FORGET_READER_GROUP 0x00090058 /* ForgetReader */ -#define SCARD_IOCTL_INTRODUCE_READER 0x00090060 /* IntroduceReader */ -#define SCARD_IOCTL_FORGET_READER 0x00090068 /* IntroduceReader */ -#define SCARD_IOCTL_ADD_READER_TO_GROUP 0x00090070 /* AddReaderToGroup */ -#define SCARD_IOCTL_REMOVE_READER_FROM_GROUP 0x00090078 /* RemoveReaderFromGroup */ -#define SCARD_IOCTL_GET_STATUS_CHANGE 0x000900A0 /* GetStatusChangeA */ -#define SCARD_IOCTL_CANCEL 0x000900A8 /* Cancel */ -#define SCARD_IOCTL_CONNECT 0x000900AC /* ConnectA */ -#define SCARD_IOCTL_RECONNECT 0x000900B4 /* Reconnect */ -#define SCARD_IOCTL_DISCONNECT 0x000900B8 /* Disconnect */ -#define SCARD_IOCTL_BEGIN_TRANSACTION 0x000900BC /* BeginTransaction */ -#define SCARD_IOCTL_END_TRANSACTION 0x000900C0 /* EndTransaction */ -#define SCARD_IOCTL_STATE 0x000900C4 /* State */ -#define SCARD_IOCTL_STATUS 0x000900C8 /* StatusA */ -#define SCARD_IOCTL_TRANSMIT 0x000900D0 /* Transmit */ -#define SCARD_IOCTL_CONTROL 0x000900D4 /* Control */ -#define SCARD_IOCTL_GETATTRIB 0x000900D8 /* GetAttrib */ -#define SCARD_IOCTL_SETATTRIB 0x000900DC /* SetAttrib */ -#define SCARD_IOCTL_ACCESS_STARTED_EVENT 0x000900E0 /* SCardAccessStartedEvent */ -#define SCARD_IOCTL_LOCATE_CARDS_BY_ATR 0x000900E8 /* LocateCardsByATR */ +#define SCARD_IOCTL_ESTABLISH_CONTEXT 0x00090014 /* EstablishContext */ +#define SCARD_IOCTL_RELEASE_CONTEXT 0x00090018 /* ReleaseContext */ +#define SCARD_IOCTL_IS_VALID_CONTEXT 0x0009001C /* IsValidContext */ +#define SCARD_IOCTL_LIST_READER_GROUPS 0x00090020 /* ListReaderGroups */ +#define SCARD_IOCTL_LIST_READERS 0x00090028 /* ListReadersA */ +#define SCARD_IOCTL_INTRODUCE_READER_GROUP 0x00090050 /* IntroduceReaderGroup */ +#define SCARD_IOCTL_FORGET_READER_GROUP 0x00090058 /* ForgetReader */ +#define SCARD_IOCTL_INTRODUCE_READER 0x00090060 /* IntroduceReader */ +#define SCARD_IOCTL_FORGET_READER 0x00090068 /* IntroduceReader */ +#define SCARD_IOCTL_ADD_READER_TO_GROUP 0x00090070 /* AddReaderToGroup */ +#define SCARD_IOCTL_REMOVE_READER_FROM_GROUP 0x00090078 /* RemoveReaderFromGroup */ +#define SCARD_IOCTL_GET_STATUS_CHANGE 0x000900A0 /* GetStatusChangeA */ +#define SCARD_IOCTL_CANCEL 0x000900A8 /* Cancel */ +#define SCARD_IOCTL_CONNECT 0x000900AC /* ConnectA */ +#define SCARD_IOCTL_RECONNECT 0x000900B4 /* Reconnect */ +#define SCARD_IOCTL_DISCONNECT 0x000900B8 /* Disconnect */ +#define SCARD_IOCTL_BEGIN_TRANSACTION 0x000900BC /* BeginTransaction */ +#define SCARD_IOCTL_END_TRANSACTION 0x000900C0 /* EndTransaction */ +#define SCARD_IOCTL_STATE 0x000900C4 /* State */ +#define SCARD_IOCTL_STATUS 0x000900C8 /* StatusA */ +#define SCARD_IOCTL_TRANSMIT 0x000900D0 /* Transmit */ +#define SCARD_IOCTL_CONTROL 0x000900D4 /* Control */ +#define SCARD_IOCTL_GETATTRIB 0x000900D8 /* GetAttrib */ +#define SCARD_IOCTL_SETATTRIB 0x000900DC /* SetAttrib */ +#define SCARD_IOCTL_ACCESS_STARTED_EVENT 0x000900E0 /* SCardAccessStartedEvent */ +#define SCARD_IOCTL_LOCATE_CARDS_BY_ATR 0x000900E8 /* LocateCardsByATR */ -#define SCARD_INPUT_LINKED 0xFFFFFFFF +#define SCARD_INPUT_LINKED 0xFFFFFFFF /* Decode Win CTL_CODE values */ -#define WIN_CTL_FUNCTION(ctl_code) ((ctl_code & 0x3FFC) >> 2) -#define WIN_CTL_DEVICE_TYPE(ctl_code) (ctl_code >> 16) +#define WIN_CTL_FUNCTION(ctl_code) ((ctl_code & 0x3FFC) >> 2) +#define WIN_CTL_DEVICE_TYPE(ctl_code) (ctl_code >> 16) -#define WIN_FILE_DEVICE_SMARTCARD 0x00000031 +#define WIN_FILE_DEVICE_SMARTCARD 0x00000031 static uint32 sc_output_string(IRP* irp, char *src, boolean wide) @@ -183,13 +181,14 @@ static void sc_output_buffer_start(IRP *irp, int length) static uint32 sc_input_string(IRP* irp, char **dest, uint32 dataLength, boolean wide) { - char *buffer; + char* buffer; int bufferSize; bufferSize = wide ? (2 * dataLength) : dataLength; buffer = xmalloc(bufferSize + 2); /* reserve 2 bytes for the '\0' */ stream_read(irp->input, buffer, bufferSize); + if (wide) { int i; diff --git a/channels/rdpdr/client/rdpdr_constants.h b/include/freerdp/channels/rdpdr.h similarity index 89% rename from channels/rdpdr/client/rdpdr_constants.h rename to include/freerdp/channels/rdpdr.h index a76737bbc..956595a04 100644 --- a/channels/rdpdr/client/rdpdr_constants.h +++ b/include/freerdp/channels/rdpdr.h @@ -1,9 +1,9 @@ /** - * FreeRDP: A Remote Desktop Protocol client. - * File System Virtual Channel + * FreeRDP: A Remote Desktop Protocol Implementation + * Device Redirection Virtual Channel * - * Copyright 2010-2011 Marc-Andre Moreau * Copyright 2010-2011 Vic Lee + * Copyright 2010-2012 Marc-Andre Moreau * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,17 @@ * limitations under the License. */ -#ifndef __RDPDR_CONSTANTS_H -#define __RDPDR_CONSTANTS_H +#ifndef FREERDP_CHANNEL_RDPDR_H +#define FREERDP_CHANNEL_RDPDR_H + +#include +#include +#include +#include + +#include +#include +#include /* RDPDR_HEADER.Component */ enum RDPDR_CTYP @@ -456,5 +465,66 @@ enum FILE_FS_INFORMATION_CLASS FileFsMaximumInformation }; -#endif /* __RDPDR_CONSTANTS_H */ +typedef struct _DEVICE DEVICE; +typedef struct _IRP IRP; +typedef struct _DEVMAN DEVMAN; + +typedef void (*pcIRPRequest)(DEVICE* device, IRP* irp); +typedef void (*pcFreeDevice)(DEVICE* device); + +struct _DEVICE +{ + uint32 id; + + uint32 type; + char* name; + STREAM* data; + + pcIRPRequest IRPRequest; + pcFreeDevice Free; +}; + +typedef void (*pcIRPResponse)(IRP* irp); + +struct _IRP +{ + SLIST_ENTRY ItemEntry; + + DEVICE* device; + DEVMAN* devman; + uint32 FileId; + uint32 CompletionId; + uint32 MajorFunction; + uint32 MinorFunction; + STREAM* input; + + uint32 IoStatus; + STREAM* output; + + pcIRPResponse Complete; + pcIRPResponse Discard; +}; + +struct _DEVMAN +{ + rdpSvcPlugin* plugin; + uint32 id_sequence; + LIST* devices; +}; + +typedef void (*pcRegisterDevice)(DEVMAN* devman, DEVICE* device); + +struct _DEVICE_SERVICE_ENTRY_POINTS +{ + DEVMAN* devman; + + pcRegisterDevice RegisterDevice; + RDP_PLUGIN_DATA* plugin_data; +}; +typedef struct _DEVICE_SERVICE_ENTRY_POINTS DEVICE_SERVICE_ENTRY_POINTS; +typedef DEVICE_SERVICE_ENTRY_POINTS* PDEVICE_SERVICE_ENTRY_POINTS; + +typedef int (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); + +#endif /* FREERDP_CHANNEL_RDPDR_H */