Skip to content

Commit

Permalink
[build,mingw] fix build issues found
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Apr 3, 2024
1 parent 0712d0c commit 1956fff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions client/Windows/cli/wfreerdp.c
Expand Up @@ -35,8 +35,8 @@

#include "../resource/resource.h"

#include "wf_client.h"
#include "wf_defaults.h"
#include <wf_client.h>
#include <wf_defaults.h>

#include <shellapi.h>

Expand Down
22 changes: 11 additions & 11 deletions client/Windows/wf_cliprdr.c
Expand Up @@ -775,7 +775,6 @@ static CliprdrDataObject* CliprdrDataObject_New(FORMATETC* fmtetc, STGMEDIUM* st

if (count > 0)
{
ULONG i;
instance->m_pFormatEtc = (FORMATETC*)calloc(count, sizeof(FORMATETC));

if (!instance->m_pFormatEtc)
Expand Down Expand Up @@ -1247,7 +1246,7 @@ static UINT cliprdr_send_format_list(wfClipboard* clipboard)
}
else
{
while (formatId = EnumClipboardFormats(formatId))
while ((formatId = EnumClipboardFormats(formatId)) != 0)
formats[index++].formatId = formatId;
}

Expand Down Expand Up @@ -1755,9 +1754,9 @@ static BOOL wf_cliprdr_traverse_directory(wfClipboard* clipboard, WCHAR* Dir, si

while (FindNextFile(hFind, &FindFileData))
{
if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 &&
wcscmp(FindFileData.cFileName, _T(".")) == 0 ||
wcscmp(FindFileData.cFileName, _T("..")) == 0)
if ((((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) &&
(wcscmp(FindFileData.cFileName, _T(".")) == 0)) ||
(wcscmp(FindFileData.cFileName, _T("..")) == 0))
{
continue;
}
Expand Down Expand Up @@ -2006,7 +2005,7 @@ static BOOL wf_cliprdr_process_filename(wfClipboard* clipboard, WCHAR* wFileName
return TRUE;
}

static SSIZE_T wf_cliprdr_tryopen(wfClipboard* clipboard, UINT32 requestedFormatId, void** pData)
static SSIZE_T wf_cliprdr_tryopen(wfClipboard* clipboard, UINT32 requestedFormatId, BYTE** pData)
{
SSIZE_T rc = -1;
WINPR_ASSERT(clipboard);
Expand Down Expand Up @@ -2044,7 +2043,7 @@ static SSIZE_T wf_cliprdr_tryopen(wfClipboard* clipboard, UINT32 requestedFormat
return rc;
}

static SSIZE_T wf_cliprdr_get_filedescriptor(wfClipboard* clipboard, void** pData)
static SSIZE_T wf_cliprdr_get_filedescriptor(wfClipboard* clipboard, BYTE** pData)
{
WINPR_ASSERT(clipboard);
WINPR_ASSERT(pData);
Expand Down Expand Up @@ -2111,7 +2110,8 @@ static SSIZE_T wf_cliprdr_get_filedescriptor(wfClipboard* clipboard, void** pDat
GlobalUnlock(stg_medium.hGlobal);
ReleaseStgMedium(&stg_medium);
exit:
const size_t size = 4 + clipboard->nFiles * sizeof(FILEDESCRIPTORW);
{
const size_t size = 4ull + clipboard->nFiles * sizeof(FILEDESCRIPTORW);
FILEGROUPDESCRIPTORW* groupDsc = (FILEGROUPDESCRIPTORW*)calloc(size, 1);

if (groupDsc)
Expand All @@ -2124,9 +2124,10 @@ static SSIZE_T wf_cliprdr_get_filedescriptor(wfClipboard* clipboard, void** pDat
groupDsc->fgd[i] = *clipboard->fileDescriptor[i];
}

*pData = groupDsc;
*pData = (BYTE*)groupDsc;
rc = size;
}
}

IDataObject_Release(dataObj);
return rc;
Expand Down Expand Up @@ -2155,8 +2156,7 @@ wf_cliprdr_server_format_data_request(CliprdrClientContext* context,

if (requestedFormatId == RegisterClipboardFormat(CFSTR_FILEDESCRIPTORW))
{
const SSIZE_T res = wf_cliprdr_get_filedescriptor(clipboard, requestedFormatId,
&response.requestedFormatData);
const SSIZE_T res = wf_cliprdr_get_filedescriptor(clipboard, &response.requestedFormatData);
if (res > 0)
response.common.dataLen = (UINT32)res;
}
Expand Down
2 changes: 2 additions & 0 deletions client/Windows/wf_defaults.c
Expand Up @@ -22,6 +22,8 @@
#include <malloc.h>
#include <freerdp/settings.h>

#include "wf_defaults.h"

static PCWSTR ValidateString(const BYTE* pb, ULONG cb)
{
if (!pb || !cb)
Expand Down
4 changes: 3 additions & 1 deletion client/Windows/wf_defaults.h
Expand Up @@ -19,8 +19,10 @@
#ifndef FREERDP_CLIENT_WIN_DEFAULTS_H
#define FREERDP_CLIENT_WIN_DEFAULTS_H

#include <winpr/wtypes.h>
#include <freerdp/api.h>
#include <freerdp/settings.h>

void WINAPI AddDefaultSettings(_Inout_ rdpSettings* settings);
FREERDP_API void WINAPI AddDefaultSettings(_Inout_ rdpSettings* settings);

#endif /* FREERDP_CLIENT_WIN_DEFAULTS_H */

0 comments on commit 1956fff

Please sign in to comment.