Add stubs for file information set operations.

This commit is contained in:
Michael Jumper 2013-10-21 15:45:20 -07:00
parent f7acfbb1a0
commit 683e8c24c0
4 changed files with 124 additions and 5 deletions

View File

@ -223,7 +223,7 @@ void guac_rdpdr_fs_process_write(guac_rdpdr_device* device,
Stream_Read_UINT64(input_stream, offset);
Stream_Seek(input_stream, 20); /* Padding */
output_stream = Stream_New(NULL, 20);
output_stream = Stream_New(NULL, 21);
/* Write header */
Stream_Write_UINT16(output_stream, RDPDR_CTYP_CORE);
@ -239,6 +239,7 @@ void guac_rdpdr_fs_process_write(guac_rdpdr_device* device,
"Refusing to write directory as a file");
Stream_Write_UINT32(output_stream, STATUS_FILE_IS_A_DIRECTORY);
Stream_Write_UINT32(output_stream, 0); /* Length */
Stream_Write_UINT8(output_stream, 0); /* Padding */
}
/* Otherwise, perform write */
@ -257,12 +258,14 @@ void guac_rdpdr_fs_process_write(guac_rdpdr_device* device,
strerror(errno));
Stream_Write_UINT32(output_stream, STATUS_ACCESS_DENIED);
Stream_Write_UINT32(output_stream, 0); /* Length */
Stream_Write_UINT8(output_stream, 0); /* Padding */
}
/* Otherwise, send success */
else {
Stream_Write_UINT32(output_stream, STATUS_SUCCESS);
Stream_Write_UINT32(output_stream, bytes_written); /* Length */
Stream_Write_UINT8(output_stream, 0); /* Padding */
}
}
@ -373,10 +376,49 @@ void guac_rdpdr_fs_process_set_volume_info(guac_rdpdr_device* device, wStream* i
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__);
}
void guac_rdpdr_fs_process_set_file_info(guac_rdpdr_device* device, wStream* input_stream,
int file_id, int completion_id) {
/* STUB */
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__);
void guac_rdpdr_fs_process_set_file_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
int fs_information_class;
Stream_Read_UINT32(input_stream, fs_information_class);
Stream_Seek(input_stream, 4); /* Length */
Stream_Seek(input_stream, 24); /* Padding */
/* Dispatch to appropriate class-specific handler */
switch (fs_information_class) {
case FileBasicInformation:
guac_rdpdr_fs_process_set_basic_info(device, input_stream,
file_id, completion_id);
break;
case FileEndOfFileInformation:
guac_rdpdr_fs_process_set_end_of_file_info(device, input_stream,
file_id, completion_id);
break;
case FileDispositionInformation:
guac_rdpdr_fs_process_set_disposition_info(device, input_stream,
file_id, completion_id);
break;
case FileRenameInformation:
guac_rdpdr_fs_process_set_rename_info(device, input_stream,
file_id, completion_id);
break;
case FileAllocationInformation:
guac_rdpdr_fs_process_set_allocation_info(device, input_stream,
file_id, completion_id);
break;
default:
guac_client_log_info(device->rdpdr->client,
"Unknown file information class: 0x%x",
fs_information_class);
}
}
void guac_rdpdr_fs_process_device_control(guac_rdpdr_device* device, wStream* input_stream,

View File

@ -129,3 +129,39 @@ void guac_rdpdr_fs_process_query_attribute_tag_info(guac_rdpdr_device* device, w
"Unimplemented stub: guac_rdpdr_fs_query_attribute_tag_info");
}
void guac_rdpdr_fs_process_set_rename_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_error(device->rdpdr->client,
"Unimplemented stub: %s", __func__);
}
void guac_rdpdr_fs_process_set_allocation_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_error(device->rdpdr->client,
"Unimplemented stub: %s", __func__);
}
void guac_rdpdr_fs_process_set_disposition_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_error(device->rdpdr->client,
"Unimplemented stub: %s", __func__);
}
void guac_rdpdr_fs_process_set_end_of_file_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_error(device->rdpdr->client,
"Unimplemented stub: %s", __func__);
}
void guac_rdpdr_fs_process_set_basic_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_error(device->rdpdr->client,
"Unimplemented stub: %s", __func__);
}

View File

@ -76,4 +76,41 @@ void guac_rdpdr_fs_process_query_standard_info(guac_rdpdr_device* device, wStrea
void guac_rdpdr_fs_process_query_attribute_tag_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
/**
* Process a set operation for FileRenameInformation. From the documentation,
* this operation is used to rename a file.
*/
void guac_rdpdr_fs_process_set_rename_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
/**
* Process a set operation for FileAllocationInformation. From the
* documentation, this operation is used to set a file's allocation size.
*/
void guac_rdpdr_fs_process_set_allocation_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
/**
* Process a set operation for FileDispositionInformation. From the
* documentation, this operation is used to mark a file for deletion.
*/
void guac_rdpdr_fs_process_set_disposition_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
/**
* Process a set operation for FileEndOfFileInformation. From the
* documentation, this operation is used "to set end-of-file information for
* a file."
*/
void guac_rdpdr_fs_process_set_end_of_file_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
/**
* Process a set operation for FileBasicInformation. From the documentation,
* this is "used to set file information such as the times of creation, last
* access, last write, and change, in addition to file attributes."
*/
void guac_rdpdr_fs_process_set_basic_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
#endif

View File

@ -233,6 +233,10 @@
#define FileBasicInformation 0x00000004
#define FileStandardInformation 0x00000005
#define FileRenameInformation 0x0000000A
#define FileDispositionInformation 0x0000000D
#define FileAllocationInformation 0x00000013
#define FileEndOfFileInformation 0x00000014
#define FileAttributeTagInformation 0x00000023
/*