Add options for file attributes and create options to open. Fix create disposition of files in directory list.

This commit is contained in:
Michael Jumper 2013-10-22 10:56:47 -07:00
parent 67c461be40
commit 911746ae24
3 changed files with 8 additions and 16 deletions

View File

@ -111,8 +111,9 @@ static void __guac_rdpdr_fs_translate_path(guac_rdpdr_device* device,
} }
int guac_rdpdr_fs_open(guac_rdpdr_device* device, int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path,
const char* path, int access, int create_disposition) { int access, int file_attributes, int create_disposition,
int create_options) {
guac_rdpdr_fs_data* data = (guac_rdpdr_fs_data*) device->data; guac_rdpdr_fs_data* data = (guac_rdpdr_fs_data*) device->data;
char real_path[GUAC_RDPDR_FS_MAX_PATH]; char real_path[GUAC_RDPDR_FS_MAX_PATH];

View File

@ -239,7 +239,8 @@ int guac_rdpdr_fs_convert_path(const char* parent, const char* rel_path, char* a
* if an error occurs. * if an error occurs.
*/ */
int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path, int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path,
int access, int create_disposition); int access, int file_attributes, int create_disposition,
int create_options);
/** /**
* Frees the given file ID, allowing future open operations to reuse it. * Frees the given file ID, allowing future open operations to reuse it.

View File

@ -78,23 +78,13 @@ void guac_rdpdr_fs_process_create(guac_rdpdr_device* device,
/* FIXME: Validate path length */ /* FIXME: Validate path length */
/* STUB: create_options */
guac_client_log_info(device->rdpdr->client,
"%s: STUB: Unused variable: create_options (%i)", __func__,
create_options);
/* STUB: file_attributes */
guac_client_log_info(device->rdpdr->client,
"%s: STUB: Unused variable: file_attributes (%i)", __func__,
file_attributes);
/* Convert path to UTF-8 */ /* Convert path to UTF-8 */
guac_rdp_utf16_to_utf8(Stream_Pointer(input_stream), guac_rdp_utf16_to_utf8(Stream_Pointer(input_stream),
path, path_length/2 - 1); path, path_length/2 - 1);
/* Open file */ /* Open file */
file_id = guac_rdpdr_fs_open(device, path, desired_access, file_id = guac_rdpdr_fs_open(device, path, desired_access, file_attributes,
create_disposition); create_disposition, create_options);
/* Write header */ /* Write header */
Stream_Write_UINT16(output_stream, RDPDR_CTYP_CORE); Stream_Write_UINT16(output_stream, RDPDR_CTYP_CORE);
@ -499,7 +489,7 @@ void guac_rdpdr_fs_process_query_directory(guac_rdpdr_device* device, wStream* i
/* Open directory entry */ /* Open directory entry */
entry_file_id = guac_rdpdr_fs_open(device, entry_path, entry_file_id = guac_rdpdr_fs_open(device, entry_path,
ACCESS_FILE_READ_DATA, DISP_FILE_OVERWRITE); ACCESS_FILE_READ_DATA, 0, DISP_FILE_OPEN, 0);
if (entry_file_id >= 0) { if (entry_file_id >= 0) {