* Mark WTSVirtualChannelOpen and WTSVirtualChannelOpenEx with
WINPR_ATTR_MALLOC to enforce compiler checks for resource cleanup
* Fix unused result warnings, use the result or cast to (void) where not
requierd
found by coverity
655 if (Stream_Write_UTF16_String_From_UTF8(s, tmpDirCharLen - 1, tempDirectory->szTempDir,
656 ARRAYSIZE(tempDirectory->szTempDir), TRUE) < 0)
CID 424748: (#1 of 1): Resource leak (RESOURCE_LEAK)
9. leaked_storage: Variable s going out of scope leaks the storage it points to.
657 return ERROR_INTERNAL_ERROR;
658 /* Path must be 260 UTF16 characters with '\0' termination.
659 * ensure this here */
C requires prototypes or compilers will complain about them missing. Our
library entry points do not have such, therefore add the macro
FREERDP_ENTRY_POINT which declares the function prototype automatically
before the function.
This PR fixes an issue caused by clipboard format filtering which
discarded all formats but `FileGroupDescriptorW` to enable clipboard
file transfer. However at least on windows we also need `FileContents`
to be placed in the clipboard to make file transfer work correctly.
The PR also unifies list filtering into a single functions instead of
having two different functions.
* Filter remote -> local or local -> remote clipboard depending on
setting.
* Filter remote -> local or local -> remote file clipboard
depending on setting.
The old implementation used `Stream_GetLength` to obtain the amount of
data to send. However some PDUs (i.e. CLIPRDR_FILECONTENTS_REQUEST) are
overallocated as they contain optional data (clipDataId in this case).
We now use the position to determine the actual data written to the PDU
instead of the amount of bytes allocated, avoid sending garbage data to
the client.
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions