I have adjusted the guacd code.
Now I answer the read request with a dummy string and it works. :-)
Windows doesn't seem to care what is returned there.
The code is definitely not perfect.
It may make sense to insert something a little nicer into the official
source code.
src/protocols/rdp/channels/rdpdr/rdpdr-printer.c
.....
void guac_rdpdr_process_print_job_read(guac_rdp_common_svc* svc,
guac_rdpdr_device* device, guac_rdpdr_iorequest* iorequest,
wStream* input_stream) {
UINT32 length;
UINT64 offset;
char* buffer;
int bytes_read;
wStream* output_stream;
/* Read packet */
Stream_Read_UINT32(input_stream, length);
Stream_Read_UINT64(input_stream, offset);
guac_client_log(svc->client, GUAC_LOG_INFO,
"%s: [file_id=%i] length=%i, offset=%" PRIu64,
__func__, iorequest->file_id, length, (uint64_t) offset);
/* Ensure buffer size does not exceed a safe maximum */
if (length > GUAC_RDP_MAX_READ_BUFFER)
length = GUAC_RDP_MAX_READ_BUFFER;
/* Allocate buffer */
buffer = malloc(length);
char str[] = "helloworld";
strcpy(buffer, str);
/* Attempt read */
/* bytes_read = guac_rdp_fs_read((guac_rdp_fs*) device->data,
iorequest->file_id, offset, buffer, length); */
/* If error, return invalid parameter */
bytes_read = sizeof(buffer);
output_stream = guac_rdpdr_new_io_completion(device,
iorequest->completion_id,
guac_rdp_fs_get_status(bytes_read), 4);
Stream_Write_UINT32(output_stream, 0); /* Length */
/* Otherwise, send bytes read */
output_stream = guac_rdpdr_new_io_completion(device,
iorequest->completion_id, STATUS_SUCCESS, 4+bytes_read);
Stream_Write_UINT32(output_stream, bytes_read); /* Length */
Stream_Write(output_stream, buffer, bytes_read); /* ReadData */
guac_rdp_common_svc_write(svc, output_stream);
free(buffer);
}
.........
case IRP_MJ_READ:
guac_client_log(svc->client, GUAC_LOG_INFO, "printer read");
guac_rdpdr_process_print_job_read(svc, device, iorequest,
input_stream);
break;
/* Log unknown */
default:
guac_client_log(svc->client, GUAC_LOG_ERROR, "Unknown printer "
"I/O request function: 0x%x/0x%x",
iorequest->major_func,
iorequest->minor_func);
--
Sent from:
http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]