winpr: fix field names of FILEDESCRIPTOR struct

The file name field is actually called cFileName on Windows. Use this
name in WinPR's struct definition as well for compatibility.
This commit is contained in:
ilammy 2017-04-21 14:13:52 +03:00
parent d341973247
commit 843ab1c234
3 changed files with 7 additions and 7 deletions

View File

@ -425,8 +425,8 @@ UINT cliprdr_parse_file_list(const BYTE* format_data, UINT32 format_data_length,
file->ftLastWriteTime = uint64_to_filetime(lastWriteTime);
Stream_Read_UINT32(s, file->nFileSizeHigh); /* fileSizeHigh (4 bytes) */
Stream_Read_UINT32(s, file->nFileSizeLow); /* fileSizeLow (4 bytes) */
for (c = 0; c < 260; c++) /* fileName (520 bytes) */
Stream_Read_UINT16(s, file->fileName[c]);
for (c = 0; c < 260; c++) /* cFileName (520 bytes) */
Stream_Read_UINT16(s, file->cFileName[c]);
}
if (Stream_GetRemainingLength(s) > 0)
@ -496,8 +496,8 @@ UINT cliprdr_serialize_file_list(const FILEDESCRIPTOR* file_descriptor_array,
Stream_Write_UINT64(s, lastWriteTime); /* lastWriteTime (8 bytes) */
Stream_Write_UINT32(s, file->nFileSizeHigh); /* fileSizeHigh (4 bytes) */
Stream_Write_UINT32(s, file->nFileSizeLow); /* fileSizeLow (4 bytes) */
for (c = 0; c < 260; c++) /* fileName (520 bytes) */
Stream_Write_UINT16(s, file->fileName[c]);
for (c = 0; c < 260; c++) /* cFileName (520 bytes) */
Stream_Write_UINT16(s, file->cFileName[c]);
}
Stream_SealLength(s);

View File

@ -47,7 +47,7 @@ struct _FILEDESCRIPTOR {
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
WCHAR fileName[260];
WCHAR cFileName[260];
};
typedef struct _FILEDESCRIPTOR FILEDESCRIPTOR;

View File

@ -540,13 +540,13 @@ static BOOL convert_local_file_to_filedescriptor(const struct posix_file* file,
}
remote_len = _wcslen(file->remote_name);
if (remote_len + 1 > ARRAYSIZE(descriptor->fileName))
if (remote_len + 1 > ARRAYSIZE(descriptor->cFileName))
{
WLog_ERR(TAG, "file name too long (%"PRIuz" characters)", remote_len);
return FALSE;
}
memcpy(descriptor->fileName, file->remote_name, remote_len * sizeof(WCHAR));
memcpy(descriptor->cFileName, file->remote_name, remote_len * sizeof(WCHAR));
return TRUE;
}