Fixed clipboard 'called with invalid type' warning

This commit is contained in:
akallabeth 2020-04-20 16:02:02 +02:00
parent 8ec50b6cc1
commit cbee45aace
7 changed files with 11 additions and 5 deletions

View File

@ -43,7 +43,7 @@
UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen,
UINT16 msgFlags)
{
CLIPRDR_FORMAT_LIST formatList;
CLIPRDR_FORMAT_LIST formatList = { 0 };
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
UINT error = CHANNEL_RC_OK;
@ -82,7 +82,7 @@ error_out:
UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen,
UINT16 msgFlags)
{
CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse;
CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse = { 0 };
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
UINT error = CHANNEL_RC_OK;

View File

@ -81,6 +81,7 @@ UINT android_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr)
formatList.msgFlags = CB_RESPONSE_OK;
formatList.numFormats = numFormats;
formatList.formats = formats;
formatList.msgType = CB_FORMAT_LIST;
if (!afc->cliprdr->ClientFormatList)
goto fail;

View File

@ -28,7 +28,7 @@ int mac_cliprdr_send_client_format_list(CliprdrClientContext *cliprdr)
UINT32 *pFormatIds;
const char *formatName;
CLIPRDR_FORMAT *formats;
CLIPRDR_FORMAT_LIST formatList;
CLIPRDR_FORMAT_LIST formatList = { 0 };
mfContext *mfc = (mfContext *)cliprdr->custom;
ZeroMemory(&formatList, sizeof(CLIPRDR_FORMAT_LIST));
@ -56,6 +56,7 @@ int mac_cliprdr_send_client_format_list(CliprdrClientContext *cliprdr)
formatList.msgFlags = CB_RESPONSE_OK;
formatList.numFormats = numFormats;
formatList.formats = formats;
formatList.msgType = CB_FORMAT_LIST;
mfc->cliprdr->ClientFormatList(mfc->cliprdr, &formatList);

View File

@ -174,6 +174,7 @@ static UINT wlf_cliprdr_send_client_format_list(wfClipboard* clipboard)
formatList.msgFlags = CB_RESPONSE_OK;
formatList.numFormats = (UINT32)clipboard->numClientFormats;
formatList.formats = clipboard->clientFormats;
formatList.msgType = CB_FORMAT_LIST;
return clipboard->context->ClientFormatList(clipboard->context, &formatList);
}

View File

@ -1235,7 +1235,7 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard)
UINT32 formatId = 0;
char formatName[1024];
CLIPRDR_FORMAT* formats = NULL;
CLIPRDR_FORMAT_LIST formatList;
CLIPRDR_FORMAT_LIST formatList = { 0 };
if (!clipboard)
return ERROR_INTERNAL_ERROR;
@ -1287,6 +1287,7 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard)
formatList.numFormats = numFormats;
formatList.formats = formats;
formatList.msgType = CB_FORMAT_LIST;
rc = clipboard->context->ClientFormatList(clipboard->context, &formatList);
for (index = 0; index < numFormats; index++)

View File

@ -533,6 +533,7 @@ static void xf_cliprdr_get_requested_targets(xfClipboard* clipboard)
formatList.msgFlags = CB_RESPONSE_OK;
formatList.numFormats = numFormats;
formatList.formats = formats;
formatList.msgType = CB_FORMAT_LIST;
clipboard->context->ClientFormatList(clipboard->context, &formatList);
xf_cliprdr_free_formats(formats, numFormats);
}
@ -1100,6 +1101,7 @@ static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard)
formatList.msgFlags = CB_RESPONSE_OK;
formatList.numFormats = numFormats;
formatList.formats = formats;
formatList.msgType = CB_FORMAT_LIST;
ret = clipboard->context->ClientFormatList(clipboard->context, &formatList);
free(formats);

View File

@ -294,7 +294,7 @@ static UINT pf_cliprdr_ServerFormatList(CliprdrClientContext* context,
if (pdata->config->TextOnly)
{
CLIPRDR_FORMAT_LIST list;
CLIPRDR_FORMAT_LIST list = { 0 };
pf_cliprdr_create_text_only_format_list(&list);
return server->ServerFormatList(server, &list);
}