Fixed naming of FILEDESCRIPTORW
This commit is contained in:
parent
67cfcb0af6
commit
1546a8b655
@ -206,7 +206,7 @@ static FILETIME uint64_to_filetime(UINT64 value)
|
|||||||
* @returns 0 on success, otherwise a Win32 error code.
|
* @returns 0 on success, otherwise a Win32 error code.
|
||||||
*/
|
*/
|
||||||
UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
|
UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
|
||||||
FILEDESCRIPTOR** file_descriptor_array, UINT32* file_descriptor_count)
|
FILEDESCRIPTORW** file_descriptor_array, UINT32* file_descriptor_count)
|
||||||
{
|
{
|
||||||
UINT result = NO_ERROR;
|
UINT result = NO_ERROR;
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
@ -240,7 +240,7 @@ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*file_descriptor_count = count;
|
*file_descriptor_count = count;
|
||||||
*file_descriptor_array = calloc(count, sizeof(FILEDESCRIPTOR));
|
*file_descriptor_array = calloc(count, sizeof(FILEDESCRIPTORW));
|
||||||
if (!*file_descriptor_array)
|
if (!*file_descriptor_array)
|
||||||
{
|
{
|
||||||
result = ERROR_NOT_ENOUGH_MEMORY;
|
result = ERROR_NOT_ENOUGH_MEMORY;
|
||||||
@ -251,7 +251,7 @@ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
UINT64 lastWriteTime;
|
UINT64 lastWriteTime;
|
||||||
FILEDESCRIPTOR* file = &((*file_descriptor_array)[i]);
|
FILEDESCRIPTORW* file = &((*file_descriptor_array)[i]);
|
||||||
|
|
||||||
Stream_Read_UINT32(s, file->dwFlags); /* flags (4 bytes) */
|
Stream_Read_UINT32(s, file->dwFlags); /* flags (4 bytes) */
|
||||||
Stream_Seek(s, 32); /* reserved1 (32 bytes) */
|
Stream_Seek(s, 32); /* reserved1 (32 bytes) */
|
||||||
@ -288,7 +288,7 @@ out:
|
|||||||
*
|
*
|
||||||
* @returns 0 on success, otherwise a Win32 error code.
|
* @returns 0 on success, otherwise a Win32 error code.
|
||||||
*/
|
*/
|
||||||
UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array,
|
UINT cliprdr_serialize_file_list(const FILEDESCRIPTORW* file_descriptor_array,
|
||||||
UINT32 file_descriptor_count, BYTE** format_data,
|
UINT32 file_descriptor_count, BYTE** format_data,
|
||||||
UINT32* format_data_length)
|
UINT32* format_data_length)
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array,
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
UINT64 lastWriteTime;
|
UINT64 lastWriteTime;
|
||||||
const FILEDESCRIPTOR* file = &file_descriptor_array[i];
|
const FILEDESCRIPTORW* file = &file_descriptor_array[i];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There is a known issue with Windows server getting stuck in
|
* There is a known issue with Windows server getting stuck in
|
||||||
|
@ -619,8 +619,8 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, BOOL hasDa
|
|||||||
(dstFormatId == ClipboardGetFormatId(clipboard->system, "FileGroupDescriptorW")))
|
(dstFormatId == ClipboardGetFormatId(clipboard->system, "FileGroupDescriptorW")))
|
||||||
{
|
{
|
||||||
UINT error = NO_ERROR;
|
UINT error = NO_ERROR;
|
||||||
FILEDESCRIPTOR* file_array = (FILEDESCRIPTOR*)pDstData;
|
FILEDESCRIPTORW* file_array = (FILEDESCRIPTORW*)pDstData;
|
||||||
UINT32 file_count = DstSize / sizeof(FILEDESCRIPTOR);
|
UINT32 file_count = DstSize / sizeof(FILEDESCRIPTORW);
|
||||||
pDstData = NULL;
|
pDstData = NULL;
|
||||||
DstSize = 0;
|
DstSize = 0;
|
||||||
error = cliprdr_serialize_file_list(file_array, file_count, &pDstData, &DstSize);
|
error = cliprdr_serialize_file_list(file_array, file_count, &pDstData, &DstSize);
|
||||||
|
@ -93,9 +93,9 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
FREERDP_API UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
|
FREERDP_API UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
|
||||||
FILEDESCRIPTOR** file_descriptor_array,
|
FILEDESCRIPTORW** file_descriptor_array,
|
||||||
UINT32* file_descriptor_count);
|
UINT32* file_descriptor_count);
|
||||||
FREERDP_API UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array,
|
FREERDP_API UINT cliprdr_serialize_file_list(const FILEDESCRIPTORW* file_descriptor_array,
|
||||||
UINT32 file_descriptor_count, BYTE** format_data,
|
UINT32 file_descriptor_count, BYTE** format_data,
|
||||||
UINT32* format_data_length);
|
UINT32* format_data_length);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
/* Shell clipboard formats */
|
/* Shell clipboard formats */
|
||||||
|
|
||||||
struct _FILEDESCRIPTOR
|
struct _FILEDESCRIPTORW
|
||||||
{
|
{
|
||||||
DWORD dwFlags;
|
DWORD dwFlags;
|
||||||
BYTE clsid[16];
|
BYTE clsid[16];
|
||||||
@ -50,7 +50,8 @@ struct _FILEDESCRIPTOR
|
|||||||
DWORD nFileSizeLow;
|
DWORD nFileSizeLow;
|
||||||
WCHAR cFileName[260];
|
WCHAR cFileName[260];
|
||||||
};
|
};
|
||||||
typedef struct _FILEDESCRIPTOR FILEDESCRIPTOR;
|
typedef struct _FILEDESCRIPTORW FILEDESCRIPTORW;
|
||||||
|
typedef struct _FILEDESCRIPTORW FILEDESCRIPTOR;
|
||||||
|
|
||||||
/* FILEDESCRIPTOR.dwFlags */
|
/* FILEDESCRIPTOR.dwFlags */
|
||||||
#define FD_ATTRIBUTES 0x00000004
|
#define FD_ATTRIBUTES 0x00000004
|
||||||
|
@ -496,7 +496,7 @@ static BOOL process_uri_list(const char* data, size_t length, wArrayList* files)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static BOOL convert_local_file_to_filedescriptor(const struct posix_file* file,
|
static BOOL convert_local_file_to_filedescriptor(const struct posix_file* file,
|
||||||
FILEDESCRIPTOR* descriptor)
|
FILEDESCRIPTORW* descriptor)
|
||||||
{
|
{
|
||||||
size_t remote_len = 0;
|
size_t remote_len = 0;
|
||||||
descriptor->dwFlags = FD_ATTRIBUTES | FD_FILESIZE | FD_SHOWPROGRESSUI;
|
descriptor->dwFlags = FD_ATTRIBUTES | FD_FILESIZE | FD_SHOWPROGRESSUI;
|
||||||
@ -526,11 +526,11 @@ static BOOL convert_local_file_to_filedescriptor(const struct posix_file* file,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FILEDESCRIPTOR* convert_local_file_list_to_filedescriptors(wArrayList* files)
|
static FILEDESCRIPTORW* convert_local_file_list_to_filedescriptors(wArrayList* files)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
FILEDESCRIPTOR* descriptors = NULL;
|
FILEDESCRIPTORW* descriptors = NULL;
|
||||||
count = ArrayList_Count(files);
|
count = ArrayList_Count(files);
|
||||||
descriptors = calloc(count, sizeof(descriptors[0]));
|
descriptors = calloc(count, sizeof(descriptors[0]));
|
||||||
|
|
||||||
@ -554,7 +554,7 @@ error:
|
|||||||
static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 formatId,
|
static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 formatId,
|
||||||
const void* data, UINT32* pSize)
|
const void* data, UINT32* pSize)
|
||||||
{
|
{
|
||||||
FILEDESCRIPTOR* descriptors = NULL;
|
FILEDESCRIPTORW* descriptors = NULL;
|
||||||
|
|
||||||
if (!clipboard || !data || !pSize)
|
if (!clipboard || !data || !pSize)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -570,7 +570,7 @@ static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 f
|
|||||||
if (!descriptors)
|
if (!descriptors)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
*pSize = ArrayList_Count(clipboard->localFiles) * sizeof(FILEDESCRIPTOR);
|
*pSize = ArrayList_Count(clipboard->localFiles) * sizeof(FILEDESCRIPTORW);
|
||||||
clipboard->fileListSequenceNumber = clipboard->sequenceNumber;
|
clipboard->fileListSequenceNumber = clipboard->sequenceNumber;
|
||||||
return descriptors;
|
return descriptors;
|
||||||
}
|
}
|
||||||
@ -578,7 +578,7 @@ static void* convert_uri_list_to_filedescriptors(wClipboard* clipboard, UINT32 f
|
|||||||
static void* convert_filedescriptors_to_uri_list(wClipboard* clipboard, UINT32 formatId,
|
static void* convert_filedescriptors_to_uri_list(wClipboard* clipboard, UINT32 formatId,
|
||||||
const void* data, UINT32* pSize)
|
const void* data, UINT32* pSize)
|
||||||
{
|
{
|
||||||
const FILEDESCRIPTOR* descriptors;
|
const FILEDESCRIPTORW* descriptors;
|
||||||
UINT32 nrDescriptors = 0;
|
UINT32 nrDescriptors = 0;
|
||||||
size_t count, x, alloc, pos, baseLength = 0;
|
size_t count, x, alloc, pos, baseLength = 0;
|
||||||
const char* src = (const char*)data;
|
const char* src = (const char*)data;
|
||||||
@ -600,12 +600,12 @@ static void* convert_filedescriptors_to_uri_list(wClipboard* clipboard, UINT32 f
|
|||||||
nrDescriptors = (UINT32)(src[3] << 24) | (UINT32)(src[2] << 16) | (UINT32)(src[1] << 8) |
|
nrDescriptors = (UINT32)(src[3] << 24) | (UINT32)(src[2] << 16) | (UINT32)(src[1] << 8) |
|
||||||
(src[0] & 0xFF);
|
(src[0] & 0xFF);
|
||||||
|
|
||||||
count = (*pSize - 4) / sizeof(FILEDESCRIPTOR);
|
count = (*pSize - 4) / sizeof(FILEDESCRIPTORW);
|
||||||
|
|
||||||
if ((count < 1) || (count != nrDescriptors))
|
if ((count < 1) || (count != nrDescriptors))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
descriptors = (const FILEDESCRIPTOR*)&src[4];
|
descriptors = (const FILEDESCRIPTORW*)&src[4];
|
||||||
|
|
||||||
if (formatId != ClipboardGetFormatId(clipboard, "FileGroupDescriptorW"))
|
if (formatId != ClipboardGetFormatId(clipboard, "FileGroupDescriptorW"))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -628,7 +628,7 @@ static void* convert_filedescriptors_to_uri_list(wClipboard* clipboard, UINT32 f
|
|||||||
for (x = 0; x < count; x++)
|
for (x = 0; x < count; x++)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
const FILEDESCRIPTOR* cur = &descriptors[x];
|
const FILEDESCRIPTORW* cur = &descriptors[x];
|
||||||
size_t curLen = _wcsnlen(cur->cFileName, ARRAYSIZE(cur->cFileName));
|
size_t curLen = _wcsnlen(cur->cFileName, ARRAYSIZE(cur->cFileName));
|
||||||
char* curName = NULL;
|
char* curName = NULL;
|
||||||
rc = ConvertFromUnicode(CP_UTF8, 0, cur->cFileName, (int)curLen, &curName, 0, NULL, NULL);
|
rc = ConvertFromUnicode(CP_UTF8, 0, cur->cFileName, (int)curLen, &curName, 0, NULL, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user