winpr: define file attribute flags
The flags are defined by MS-RDPECLIP 2.2.5.2.3.1 File Descriptor (CLIPRDR_FILEDESCRIPTOR) as well as by 'File Attribute Constants' in WinAPI reference [1]. The idea is to delegate FILEDESCRIPTOR format processing to WinPR instead of cliprdr channel, so move the struct definition there. The definition used by cliprdr protocol is identical but with some fields treated as reserved. The defintions are placed into <winpr/shell.h> as FileGroupDescriptorW is a shell clipboard format. Also remove the definition of CLIPRDR_FILELIST. The clients would be using WinPR to handle the file clipping, so CLIPRDR_FILELIST does not have to be handled explicitly. The clients will have serialization and deserialization functions to handle CLIPRDR_FILELIST. [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx
This commit is contained in:
parent
9fd3974817
commit
6ad05d5ea3
@ -23,6 +23,8 @@
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
#include <winpr/shell.h>
|
||||
|
||||
#define CLIPRDR_SVC_CHANNEL_NAME "cliprdr"
|
||||
|
||||
/**
|
||||
@ -84,33 +86,6 @@ struct _CLIPRDR_MFPICT
|
||||
};
|
||||
typedef struct _CLIPRDR_MFPICT CLIPRDR_MFPICT;
|
||||
|
||||
struct _CLIPRDR_FILEDESCRIPTOR
|
||||
{
|
||||
DWORD dwFlags;
|
||||
BYTE clsid[16];
|
||||
BYTE sizel[8];
|
||||
BYTE pointl[8];
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
union
|
||||
{
|
||||
WCHAR w[260];
|
||||
CHAR c[520];
|
||||
} cFileName;
|
||||
};
|
||||
typedef struct _CLIPRDR_FILEDESCRIPTOR CLIPRDR_FILEDESCRIPTOR;
|
||||
|
||||
struct _CLIPRDR_FILELIST
|
||||
{
|
||||
UINT32 cItems;
|
||||
CLIPRDR_FILEDESCRIPTOR* fileDescriptorArray;
|
||||
};
|
||||
typedef struct _CLIPRDR_FILELIST CLIPRDR_FILELIST;
|
||||
|
||||
/* Clipboard Messages */
|
||||
|
||||
#define DEFINE_CLIPRDR_HEADER_COMMON() \
|
||||
|
@ -29,6 +29,37 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
/* Shell clipboard formats */
|
||||
|
||||
struct _FILEDESCRIPTOR {
|
||||
DWORD dwFlags;
|
||||
BYTE clsid[16];
|
||||
BYTE sizel[8];
|
||||
BYTE pointl[8];
|
||||
DWORD dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
DWORD nFileSizeHigh;
|
||||
DWORD nFileSizeLow;
|
||||
WCHAR fileName[260];
|
||||
};
|
||||
typedef struct _FILEDESCRIPTOR FILEDESCRIPTOR;
|
||||
|
||||
/* FILEDESCRIPTOR.dwFlags */
|
||||
#define FD_ATTRIBUTES 0x00000004
|
||||
#define FD_FILESIZE 0x00000040
|
||||
#define FD_WRITESTIME 0x00000020
|
||||
#define FD_SHOWPROGRESSUI 0x00004000
|
||||
|
||||
/* FILEDESCRIPTOR.dwFileAttributes */
|
||||
#define FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user