Fixed #5713: Use proper types to generate tables.c where possible.
authorArmin Novak <armin.novak@thincast.com>
Tue, 12 Nov 2019 10:04:11 +0000 (11:04 +0100)
committerArmin Novak <armin.novak@thincast.com>
Thu, 14 Nov 2019 10:42:50 +0000 (11:42 +0100)
Use the correct type for function arguments of DVCPluginEntry type
and void* for type DeviceServiceEntry when generating tables.c

channels/client/CMakeLists.txt
channels/client/addin.c
channels/client/tables.c.in

index 5f1fb31..d48428e 100644 (file)
@@ -43,7 +43,11 @@ foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES})
                                set(ENTRY_POINT_IMPORT "extern BOOL VCAPITYPE ${ENTRY_POINT_NAME}(PCHANNEL_ENTRY_POINTS);")
                        elseif(${${STATIC_MODULE}_CLIENT_ENTRY} STREQUAL "VirtualChannelEntryEx")
                                set(ENTRY_POINT_IMPORT "extern BOOL VCAPITYPE ${ENTRY_POINT_NAME}(PCHANNEL_ENTRY_POINTS,PVOID);")
-                       else()
+                       elseif(${${STATIC_MODULE}_CLIENT_ENTRY} MATCHES "DVCPluginEntry$")
+                               set(ENTRY_POINT_IMPORT "extern UINT ${ENTRY_POINT_NAME}(IDRDYNVC_ENTRY_POINTS* pEntryPoints);")
+                       elseif(${${STATIC_MODULE}_CLIENT_ENTRY} MATCHES "DeviceServiceEntry$")
+                               set(ENTRY_POINT_IMPORT "extern UINT ${ENTRY_POINT_NAME}(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints);")
+                       else()                            
                                set(ENTRY_POINT_IMPORT "extern UINT ${ENTRY_POINT_NAME}(void);")
                        endif()
                        set(${STATIC_ENTRY}_IMPORTS "${${STATIC_ENTRY}_IMPORTS}\n${ENTRY_POINT_IMPORT}")
index 5bd6276..ee30c53 100644 (file)
@@ -46,7 +46,7 @@ extern const STATIC_ENTRY_TABLE CLIENT_STATIC_ENTRY_TABLES[];
 void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABLE* table,
                                                   const char* identifier)
 {
-       int index = 0;
+       size_t index = 0;
        STATIC_ENTRY* pEntry;
        pEntry = (STATIC_ENTRY*)&table->table[index++];
 
@@ -65,7 +65,7 @@ void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABLE* tabl
 
 void* freerdp_channels_client_find_static_entry(const char* name, const char* identifier)
 {
-       int index = 0;
+       size_t index = 0;
        STATIC_ENTRY_TABLE* pEntry;
        pEntry = (STATIC_ENTRY_TABLE*)&CLIENT_STATIC_ENTRY_TABLES[index++];
 
index cc789d8..aafc71d 100644 (file)
@@ -19,6 +19,7 @@
  * limitations under the License.
  */
 
+#include <freerdp/channels/rdpdr.h>
 #include "tables.h"
 
 ${CLIENT_STATIC_TYPEDEFS}