From 173ab04b595fe2f6e487d9f9ba6d33b875f43be9 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Fri, 28 May 2021 21:20:09 +0530 Subject: [PATCH] Use same data types as calling function prototypes. --- channels/cliprdr/server/cliprdr_main.c | 2 +- channels/drive/client/drive_file.c | 4 ++-- channels/rdp2tcp/client/rdp2tcp_main.c | 2 +- channels/smartcard/client/smartcard_pack.c | 20 ++++++++++---------- client/Windows/wf_cliprdr.c | 2 +- client/Windows/wf_floatbar.c | 4 ++-- client/Windows/wf_gdi.c | 12 ++++++------ libfreerdp/codec/h264_mf.c | 2 +- libfreerdp/core/nla.c | 2 +- libfreerdp/core/nla.h | 2 +- libfreerdp/gdi/bitmap.c | 4 ++-- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index 2cbdcc3e7..80f099ba7 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -82,7 +82,7 @@ static UINT cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s size_t pos, size; BOOL status; UINT32 dataLen; - UINT32 written; + ULONG written; pos = Stream_GetPosition(s); if ((pos < 8) || (pos > UINT32_MAX)) { diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index 305438593..9e625535c 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -426,7 +426,7 @@ BOOL drive_file_seek(DRIVE_FILE* file, UINT64 Offset) BOOL drive_file_read(DRIVE_FILE* file, BYTE* buffer, UINT32* Length) { - UINT32 read; + DWORD read; if (!file || !buffer || !Length) return FALSE; @@ -444,7 +444,7 @@ BOOL drive_file_read(DRIVE_FILE* file, BYTE* buffer, UINT32* Length) BOOL drive_file_write(DRIVE_FILE* file, BYTE* buffer, UINT32 Length) { - UINT32 written; + DWORD written; if (!file || !buffer) return FALSE; diff --git a/channels/rdp2tcp/client/rdp2tcp_main.c b/channels/rdp2tcp/client/rdp2tcp_main.c index 27b0b02d4..959619da9 100644 --- a/channels/rdp2tcp/client/rdp2tcp_main.c +++ b/channels/rdp2tcp/client/rdp2tcp_main.c @@ -50,7 +50,7 @@ typedef struct static int init_external_addin(Plugin* plugin) { SECURITY_ATTRIBUTES saAttr; - STARTUPINFO siStartInfo; + STARTUPINFOA siStartInfo; /* Using ANSI type to match CreateProcessA */ PROCESS_INFORMATION procInfo; saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); saAttr.bInheritHandle = TRUE; diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index ebd84ed8f..15d039efa 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -2074,7 +2074,7 @@ LONG smartcard_pack_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, wStre { LONG status; DWORD cBytes = ret->cBytes; - DWORD index = 0; + UINT32 index = 0; smartcard_trace_list_reader_groups_return(smartcard, ret, unicode); if (ret->ReturnCode != SCARD_S_SUCCESS) @@ -2138,7 +2138,7 @@ LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s, const ListReaders_Return* ret, BOOL unicode) { LONG status; - DWORD index = 0; + UINT32 index = 0; UINT32 size = unicode ? sizeof(WCHAR) : sizeof(CHAR); size *= ret->cBytes; @@ -2687,7 +2687,7 @@ LONG smartcard_pack_state_return(SMARTCARD_DEVICE* smartcard, wStream* s, const { LONG status; DWORD cbAtrLen = ret->cbAtrLen; - DWORD index = 0; + UINT32 index = 0; smartcard_trace_state_return(smartcard, ret); if (ret->ReturnCode != SCARD_S_SUCCESS) @@ -2744,7 +2744,7 @@ LONG smartcard_pack_status_return(SMARTCARD_DEVICE* smartcard, wStream* s, const BOOL unicode) { LONG status; - DWORD index = 0; + UINT32 index = 0; DWORD cBytes = ret->cBytes; smartcard_trace_status_return(smartcard, ret, unicode); @@ -2813,7 +2813,7 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s, { LONG status; DWORD cbAttrLen; - DWORD index = 0; + UINT32 index = 0; smartcard_trace_get_attrib_return(smartcard, ret, dwAttrId); if (!Stream_EnsureRemainingCapacity(s, 4)) @@ -2892,7 +2892,7 @@ LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, { LONG status; DWORD cbDataLen = ret->cbOutBufferSize; - DWORD index = 0; + UINT32 index = 0; smartcard_trace_control_return(smartcard, ret); if (ret->ReturnCode != SCARD_S_SUCCESS) @@ -3149,7 +3149,7 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, const Transmit_Return* ret) { LONG status; - DWORD index = 0; + UINT32 index = 0; LONG error; UINT32 cbRecvLength = ret->cbRecvLength; UINT32 cbRecvPci = ret->pioRecvPci ? ret->pioRecvPci->cbPciLength : 0; @@ -3796,7 +3796,7 @@ LONG smartcard_pack_locate_cards_return(SMARTCARD_DEVICE* smartcard, wStream* s, { LONG status; DWORD cbDataLen = ret->cReaders; - DWORD index = 0; + UINT32 index = 0; smartcard_trace_locate_cards_return(smartcard, ret); if (ret->ReturnCode != SCARD_S_SUCCESS) @@ -3824,7 +3824,7 @@ LONG smartcard_pack_get_reader_icon_return(SMARTCARD_DEVICE* smartcard, wStream* const GetReaderIcon_Return* ret) { LONG status; - DWORD index = 0; + UINT32 index = 0; DWORD cbDataLen = ret->cbDataLen; smartcard_trace_get_reader_icon_return(smartcard, ret); if (ret->ReturnCode != SCARD_S_SUCCESS) @@ -3868,7 +3868,7 @@ LONG smartcard_pack_read_cache_return(SMARTCARD_DEVICE* smartcard, wStream* s, const ReadCache_Return* ret) { LONG status; - DWORD index = 0; + UINT32 index = 0; DWORD cbDataLen = ret->cbDataLen; smartcard_trace_read_cache_return(smartcard, ret); if (ret->ReturnCode != SCARD_S_SUCCESS) diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index ba73fc538..fea3b7ffa 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -1330,7 +1330,7 @@ UINT cliprdr_send_request_filecontents(wfClipboard* clipboard, const void* strea if (!clipboard || !clipboard->context || !clipboard->context->ClientFileContentsRequest) return ERROR_INTERNAL_ERROR; - fileContentsRequest.streamId = (UINT32)streamid; + fileContentsRequest.streamId = (UINT32)(ULONG_PTR)streamid; fileContentsRequest.listIndex = index; fileContentsRequest.dwFlags = flag; fileContentsRequest.nPositionLow = positionlow; diff --git a/client/Windows/wf_floatbar.c b/client/Windows/wf_floatbar.c index b5fe3207d..e07e3767a 100644 --- a/client/Windows/wf_floatbar.c +++ b/client/Windows/wf_floatbar.c @@ -125,7 +125,7 @@ static BOOL floatbar_animation(wfFloatBar* const floatbar, const BOOL show) floatbar->animating = timer; - if (SetTimer(floatbar->hwnd, timer, USER_TIMER_MINIMUM, NULL) == NULL) + if (SetTimer(floatbar->hwnd, timer, USER_TIMER_MINIMUM, NULL) == 0) { DWORD err = GetLastError(); WLog_ERR(TAG, "SetTimer failed with %08" PRIx32, err); @@ -142,7 +142,7 @@ static BOOL floatbar_trigger_hide(wfFloatBar* floatbar) if (!floatbar->locked && floatbar->shown) { - if (SetTimer(floatbar->hwnd, TIMER_HIDE, 3000, NULL) == NULL) + if (SetTimer(floatbar->hwnd, TIMER_HIDE, 3000, NULL) == 0) { DWORD err = GetLastError(); WLog_ERR(TAG, "SetTimer failed with %08" PRIx32, err); diff --git a/client/Windows/wf_gdi.c b/client/Windows/wf_gdi.c index 329f43a75..060233755 100644 --- a/client/Windows/wf_gdi.c +++ b/client/Windows/wf_gdi.c @@ -480,8 +480,8 @@ static BOOL wf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) HBRUSH brush; HBRUSH org_brush; int org_bkmode; - UINT32 fgcolor; - UINT32 bgcolor; + COLORREF fgcolor; + COLORREF bgcolor; COLORREF org_bkcolor; COLORREF org_textcolor; BOOL rc; @@ -536,7 +536,7 @@ static BOOL wf_gdi_opaque_rect(rdpContext* context, const OPAQUE_RECT_ORDER* opa { RECT rect; HBRUSH brush; - UINT32 brush_color; + COLORREF brush_color; wfContext* wfc = (wfContext*)context; if (!context || !opaque_rect) @@ -566,7 +566,7 @@ static BOOL wf_gdi_multi_opaque_rect(rdpContext* context, UINT32 i; RECT rect; HBRUSH brush; - UINT32 brush_color; + COLORREF brush_color; wfContext* wfc = (wfContext*)context; if (!context || !multi_opaque_rect) @@ -600,7 +600,7 @@ static BOOL wf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) HPEN pen; HPEN org_pen; int x, y, w, h; - UINT32 pen_color; + COLORREF pen_color; wfContext* wfc = (wfContext*)context; if (!context || !line_to) @@ -634,7 +634,7 @@ static BOOL wf_gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) int org_rop2; HPEN hpen; HPEN org_hpen; - UINT32 pen_color; + COLORREF pen_color; wfContext* wfc = (wfContext*)context; if (!context || !polyline) diff --git a/libfreerdp/codec/h264_mf.c b/libfreerdp/codec/h264_mf.c index a5da42321..d0ac632f1 100644 --- a/libfreerdp/codec/h264_mf.c +++ b/libfreerdp/codec/h264_mf.c @@ -234,7 +234,7 @@ static int mf_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSiz IMFMediaBuffer* outputBuffer = NULL; MFT_OUTPUT_DATA_BUFFER outputDataBuffer; H264_CONTEXT_MF* sys = (H264_CONTEXT_MF*)h264->pSystemData; - INT32* iStride = h264->iStride; + UINT32* iStride = h264->iStride; BYTE** pYUVData = h264->pYUVData; hr = sys->MFCreateMemoryBuffer(SrcSize, &inputBuffer); diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index f1f23f44d..16aeae0f5 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -2493,7 +2493,7 @@ BOOL nla_set_state(rdpNla* nla, NLA_STATE state) return TRUE; } -BOOL nla_set_service_principal(rdpNla* nla, LPSTR principal) +BOOL nla_set_service_principal(rdpNla* nla, LPTSTR principal) { if (!nla || !principal) return FALSE; diff --git a/libfreerdp/core/nla.h b/libfreerdp/core/nla.h index 3980ef181..30079cb34 100644 --- a/libfreerdp/core/nla.h +++ b/libfreerdp/core/nla.h @@ -58,7 +58,7 @@ FREERDP_LOCAL SEC_WINNT_AUTH_IDENTITY* nla_get_identity(rdpNla* nla); FREERDP_LOCAL NLA_STATE nla_get_state(rdpNla* nla); FREERDP_LOCAL BOOL nla_set_state(rdpNla* nla, NLA_STATE state); -FREERDP_LOCAL BOOL nla_set_service_principal(rdpNla* nla, LPSTR principal); +FREERDP_LOCAL BOOL nla_set_service_principal(rdpNla* nla, LPTSTR principal); FREERDP_LOCAL BOOL nla_impersonate(rdpNla* nla); FREERDP_LOCAL BOOL nla_revert_to_self(rdpNla* nla); diff --git a/libfreerdp/gdi/bitmap.c b/libfreerdp/gdi/bitmap.c index 8fde46556..f9eecdba3 100644 --- a/libfreerdp/gdi/bitmap.c +++ b/libfreerdp/gdi/bitmap.c @@ -214,8 +214,8 @@ static BOOL op_xor(UINT32* stack, UINT32* stackp) static UINT32 process_rop(UINT32 src, UINT32 dst, UINT32 pat, const char* rop, UINT32 format) { - DWORD stack[10] = { 0 }; - DWORD stackp = 0; + UINT32 stack[10] = { 0 }; + UINT32 stackp = 0; while (*rop != '\0') {