Modify output to match rdesktop packets more closely. Still doesn't work.

This commit is contained in:
Michael Jumper 2013-09-13 16:53:50 -07:00
parent aec6c167e3
commit 98a1a494cd
4 changed files with 18 additions and 12 deletions

View File

@ -140,7 +140,7 @@ void guac_rdpdr_fs_process_write(guac_rdpdr_device* device,
void guac_rdpdr_fs_process_close(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
wStream* output_stream = Stream_New(NULL, 21);
wStream* output_stream = Stream_New(NULL, 20);
/* Close file */
guac_client_log_info(device->rdpdr->client, "Closing file id=%i", file_id);
@ -154,7 +154,7 @@ void guac_rdpdr_fs_process_close(guac_rdpdr_device* device,
Stream_Write_UINT32(output_stream, device->device_id);
Stream_Write_UINT32(output_stream, completion_id);
Stream_Write_UINT32(output_stream, STATUS_SUCCESS);
Stream_Write(output_stream, "\0\0\0\0\0", 5); /* Padding */
Stream_Write(output_stream, "\0\0\0\0", 4); /* Padding */
svc_plugin_send((rdpSvcPlugin*) device->rdpdr, output_stream);
@ -272,7 +272,7 @@ void guac_rdpdr_fs_process_device_control(guac_rdpdr_device* device, wStream* in
/* Write content */
Stream_Write_UINT32(output_stream, device->device_id);
Stream_Write_UINT32(output_stream, completion_id);
Stream_Write_UINT32(output_stream, STATUS_SUCCESS);
Stream_Write_UINT32(output_stream, STATUS_INVALID_PARAMETER);
/* No content for now */
Stream_Write_UINT32(output_stream, 0);

View File

@ -83,7 +83,7 @@ void guac_rdpdr_fs_process_query_both_directory_info(guac_rdpdr_device* device,
Stream_Write_UINT32(output_stream, STATUS_SUCCESS);
Stream_Write_UINT32(output_stream,
69 + 24 + utf16_length); /* Length */
69 + 24 + utf16_length + 2); /* Length */
Stream_Write_UINT32(output_stream, 0); /* NextEntryOffset */
Stream_Write_UINT32(output_stream, 0); /* FileIndex */
@ -94,7 +94,7 @@ void guac_rdpdr_fs_process_query_both_directory_info(guac_rdpdr_device* device,
Stream_Write_UINT64(output_stream, file->size); /* EndOfFile */
Stream_Write_UINT64(output_stream, file->size); /* AllocationSize */
Stream_Write_UINT32(output_stream, file->attributes); /* FileAttributes */
Stream_Write_UINT32(output_stream, utf16_length); /* FileNameLength*/
Stream_Write_UINT32(output_stream, utf16_length+2); /* FileNameLength*/
Stream_Write_UINT32(output_stream, 0); /* EaSize */
Stream_Write_UINT8(output_stream, 0); /* ShortNameLength */
@ -102,6 +102,7 @@ void guac_rdpdr_fs_process_query_both_directory_info(guac_rdpdr_device* device,
Stream_Zero(output_stream, 24); /* FileName */
Stream_Write(output_stream, utf16_entry_name, utf16_length); /* FileName */
Stream_Write(output_stream, "\0\0", 2);
svc_plugin_send((rdpSvcPlugin*) device->rdpdr, output_stream);
guac_client_log_info(device->rdpdr->client, "Sent directory entry: \"%s\"",

View File

@ -55,8 +55,6 @@ void guac_rdpdr_fs_process_query_volume_info(guac_rdpdr_device* device, wStream*
int file_id, int completion_id) {
wStream* output_stream = Stream_New(NULL, 38 + GUAC_FILESYSTEM_NAME_LENGTH);
guac_rdpdr_fs_data* data = (guac_rdpdr_fs_data*) device->data;
guac_rdpdr_fs_file* file = &(data->files[file_id]);
/* Write header */
Stream_Write_UINT16(output_stream, RDPDR_CTYP_CORE);
@ -67,13 +65,13 @@ void guac_rdpdr_fs_process_query_volume_info(guac_rdpdr_device* device, wStream*
Stream_Write_UINT32(output_stream, completion_id);
Stream_Write_UINT32(output_stream, STATUS_SUCCESS);
Stream_Write_UINT32(output_stream, 17 + GUAC_FILESYSTEM_NAME_LENGTH);
Stream_Write_UINT64(output_stream, file->ctime); /* VolumeCreationTime */
Stream_Write(output_stream, "GUAC", 4); /* VolumeSerialNumber */
Stream_Write_UINT32(output_stream, GUAC_FILESYSTEM_NAME_LENGTH);
Stream_Write_UINT32(output_stream, 17 + GUAC_FILESYSTEM_LABEL_LENGTH);
Stream_Write_UINT64(output_stream, 0); /* VolumeCreationTime */
Stream_Write_UINT32(output_stream, 0); /* VolumeSerialNumber */
Stream_Write_UINT32(output_stream, GUAC_FILESYSTEM_LABEL_LENGTH);
Stream_Write_UINT8(output_stream, FALSE); /* SupportsObjects */
/* Reserved field must not be sent */
Stream_Write(output_stream, GUAC_FILESYSTEM_NAME, GUAC_FILESYSTEM_NAME_LENGTH);
Stream_Write(output_stream, GUAC_FILESYSTEM_LABEL, GUAC_FILESYSTEM_LABEL_LENGTH);
svc_plugin_send((rdpSvcPlugin*) device->rdpdr, output_stream);

View File

@ -101,6 +101,12 @@
#define GUAC_FILESYSTEM_NAME "G\0u\0a\0c\0a\0m\0o\0l\0e\0\0\0"
#define GUAC_FILESYSTEM_NAME_LENGTH 20
/**
* Label of the filesystem.
*/
#define GUAC_FILESYSTEM_LABEL "G\0U\0A\0C\0F\0I\0L\0E\0"
#define GUAC_FILESYSTEM_LABEL_LENGTH 16
/*
* Capability types
*/
@ -198,6 +204,7 @@
#define STATUS_SUCCESS 0x00000000
#define STATUS_NO_MORE_FILES 0x80000006
#define STATUS_DEVICE_OFF_LINE 0x80000010
#define STATUS_INVALID_PARAMETER 0xC000000D
#define STATUS_NO_SUCH_FILE 0xC000000F
#define STATUS_END_OF_FILE 0xC0000011
#define STATUS_FILE_INVALID 0xC0000098