From bf9f1eccc1404fcc2ef5da41d3f569340194f473 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 17 Feb 2022 15:18:18 +0100 Subject: [PATCH] Fixed issued with mingw build --- channels/urbdrc/client/data_transfer.c | 6 +++--- channels/urbdrc/common/urbdrc_helpers.c | 8 ++++---- channels/urbdrc/common/urbdrc_helpers.h | 2 +- libfreerdp/core/settings.c | 4 +++- winpr/include/winpr/sspi.h | 2 +- winpr/include/winpr/wtypes.h.in | 2 +- winpr/libwinpr/sspi/NTLM/ntlm.h | 4 ++++ 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c index 5ac972014..cc06a5e24 100644 --- a/channels/urbdrc/client/data_transfer.c +++ b/channels/urbdrc/client/data_transfer.c @@ -1329,7 +1329,7 @@ static UINT urb_control_get_interface_request(IUDEVICE* pdev, URBDRC_CHANNEL_CAL { size_t out_size; UINT32 InterfaceId, OutputBufferSize, usbd_status; - UINT16 interface; + UINT16 InterfaceNr; wStream* out; URBDRC_PLUGIN* urbdrc; const BOOL noAck = (RequestField & 0x80000000U) != 0; @@ -1354,7 +1354,7 @@ static UINT urb_control_get_interface_request(IUDEVICE* pdev, URBDRC_CHANNEL_CAL } InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev)); - Stream_Read_UINT16(s, interface); + Stream_Read_UINT16(s, InterfaceNr); Stream_Seek(s, 2); Stream_Read_UINT32(s, OutputBufferSize); if (OutputBufferSize > UINT32_MAX - 36) @@ -1369,7 +1369,7 @@ static UINT urb_control_get_interface_request(IUDEVICE* pdev, URBDRC_CHANNEL_CAL if (!pdev->control_transfer( pdev, RequestId, 0, 0, 0x80 | 0x01, 0x0A, /* REQUEST_GET_INTERFACE */ - 0, interface, &usbd_status, &OutputBufferSize, Stream_Pointer(out), 1000)) + 0, InterfaceNr, &usbd_status, &OutputBufferSize, Stream_Pointer(out), 1000)) { WLog_Print(urbdrc->log, WLOG_DEBUG, "control_transfer failed"); Stream_Free(out, TRUE); diff --git a/channels/urbdrc/common/urbdrc_helpers.c b/channels/urbdrc/common/urbdrc_helpers.c index bb4c29cc5..6d62693cb 100644 --- a/channels/urbdrc/common/urbdrc_helpers.c +++ b/channels/urbdrc/common/urbdrc_helpers.c @@ -197,15 +197,15 @@ static const char* call_to_string_proxy(BOOL client, UINT32 interfaceId, UINT32 } } -static const char* call_to_string_stub(BOOL client, UINT32 interfaceId, UINT32 functionId) +static const char* call_to_string_stub(BOOL client, UINT32 interfaceNr, UINT32 functionId) { return "QUERY_DEVICE_TEXT_RSP [stub |client]"; } -const char* call_to_string(BOOL client, UINT32 interface, UINT32 functionId) +const char* call_to_string(BOOL client, UINT32 interfaceNr, UINT32 functionId) { - const UINT32 mask = (interface & STREAM_ID_MASK) >> 30; - const UINT32 interfaceId = interface & INTERFACE_ID_MASK; + const UINT32 mask = (interfaceNr & STREAM_ID_MASK) >> 30; + const UINT32 interfaceId = interfaceNr & INTERFACE_ID_MASK; switch (mask) { diff --git a/channels/urbdrc/common/urbdrc_helpers.h b/channels/urbdrc/common/urbdrc_helpers.h index e9e25af3a..d766ac55e 100644 --- a/channels/urbdrc/common/urbdrc_helpers.h +++ b/channels/urbdrc/common/urbdrc_helpers.h @@ -34,7 +34,7 @@ extern "C" const char* urb_function_string(UINT16 urb); const char* mask_to_string(UINT32 mask); const char* interface_to_string(UINT32 id); - const char* call_to_string(BOOL client, UINT32 interface, UINT32 functionId); + const char* call_to_string(BOOL client, UINT32 interfaceNr, UINT32 functionId); void urbdrc_dump_message(wLog* log, BOOL client, BOOL write, wStream* s); diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 6029abc70..cab706d8b 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -158,16 +158,18 @@ static void settings_client_load_hkey_local_machine(rdpSettings* settings) settings_reg_query_dword(settings, FreeRDP_BitmapCacheV2NumCells, hKey, _T("NumCells")); for (x = 0; x < 5; x++) { + DWORD val; TCHAR numentries[64] = { 0 }; TCHAR persist[64] = { 0 }; BITMAP_CACHE_V2_CELL_INFO cache = { 0 }; _sntprintf(numentries, ARRAYSIZE(numentries), _T("Cell%uNumEntries"), x); _sntprintf(persist, ARRAYSIZE(persist), _T("Cell%uPersistent"), x); - if (!settings_reg_query_dword_val(hKey, numentries, &cache.numEntries) || + if (!settings_reg_query_dword_val(hKey, numentries, &val) || !settings_reg_query_bool_val(hKey, persist, &cache.persistent) || !freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, x, &cache)) WLog_WARN(TAG, "Failed to load registry keys to settings!"); + cache.numEntries = val; } settings_reg_query_bool(settings, FreeRDP_AllowCacheWaitingList, hKey, diff --git a/winpr/include/winpr/sspi.h b/winpr/include/winpr/sspi.h index 481d575e9..00cc52726 100644 --- a/winpr/include/winpr/sspi.h +++ b/winpr/include/winpr/sspi.h @@ -484,7 +484,7 @@ typedef SecPkgCredentials_NamesW* PSecPkgCredentials_NamesW; #endif -#if !defined(_WIN32) || defined(_UWP) || defined(__MINGW32__) +#if !defined(_WIN32) || defined(_UWP) || !defined(__MINGW32__) typedef struct { UINT32 BindingsLength; diff --git a/winpr/include/winpr/wtypes.h.in b/winpr/include/winpr/wtypes.h.in index fa8988db1..05c2c9f6c 100644 --- a/winpr/include/winpr/wtypes.h.in +++ b/winpr/include/winpr/wtypes.h.in @@ -51,7 +51,7 @@ #include -#ifdef _WIN32 +#if defined(_WIN32) || defined(__MINGW32__) #include /* Handle missing ssize_t on Windows */ diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.h b/winpr/libwinpr/sspi/NTLM/ntlm.h index 6b14032cd..746517153 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.h +++ b/winpr/libwinpr/sspi/NTLM/ntlm.h @@ -89,6 +89,10 @@ enum MsvAvSingleHost = MsvAvRestrictions }; +#else +#ifndef MsvAvSingleHost +#define MsvAvSingleHost MsvAvRestrictions +#endif #endif #else typedef enum