Merge pull request #74 from neutrinolabs/master

neutrinordp
ulab-next
jsorg71 12 years ago
commit d3fb328d0f

@ -90,7 +90,7 @@ struct xrdp_client_info
char orders[32];
int order_flags_ex;
int use_bulk_comp;
int pointer_flags; /* 0 color, 1 new */
int pointer_flags; /* 0 color, 1 new, 2 no new */
};
#endif

@ -437,7 +437,8 @@ libxrdp_send_pointer(struct xrdp_session *session, int cache_idx,
{
if (bpp != 24)
{
g_writeln("libxrdp_send_pointer: error");
g_writeln("libxrdp_send_pointer: error client does not support "
"new cursors and bpp is %d", bpp);
return 1;
}
}

@ -131,6 +131,10 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
{
client_info->max_bpp = g_atoi(value);
}
else if (g_strcasecmp(item, "new_cursors") == 0)
{
client_info->pointer_flags = text2bool(value) == 0 ? 2 : 0;
}
}
list_delete(items);
@ -964,7 +968,9 @@ xrdp_process_capset_pointercache(struct xrdp_rdp *self, struct stream *s,
{
int i;
int colorPointerFlag;
int no_new_cursor;
no_new_cursor = self->client_info.pointer_flags & 2;
in_uint16_le(s, colorPointerFlag);
self->client_info.pointer_flags = colorPointerFlag;
in_uint16_le(s, i);
@ -983,6 +989,12 @@ xrdp_process_capset_pointercache(struct xrdp_rdp *self, struct stream *s,
g_writeln("xrdp_process_capset_pointercache: client does not support "
"new(color) cursor");
}
if (no_new_cursor)
{
g_writeln("xrdp_process_capset_pointercache: new(color) cursor is "
"disabled by config");
self->client_info.pointer_flags = 0;
}
return 0;
}

@ -259,7 +259,7 @@ int dev_redir_get_dir_listing(void *fusep, tui32 device_id, char *path);
int dev_redir_file_open(void *fusep, tui32 device_id, char *path,
int mode, int type, char *gen_buf);
int dev_redir_file_read(void *fusep, tui32 device_id, tui32 FileId,
int devredir_file_read(void *fusep, tui32 device_id, tui32 FileId,
tui32 Length, tui64 Offset);
int dev_redir_file_write(void *fusep, tui32 device_id, tui32 FileId,
@ -2865,7 +2865,7 @@ static void xfuse_cb_read(fuse_req_t req, fuse_ino_t ino, size_t size,
fusep->device_id = fh->DeviceId;
fusep->fi = fi;
dev_redir_file_read(fusep, fh->DeviceId, fh->FileId, size, off);
devredir_file_read(fusep, fh->DeviceId, fh->FileId, size, off);
}
/**

@ -775,16 +775,24 @@ void dev_redir_proc_device_iocompletion(struct stream *s)
log_debug("got CID_READ");
xstream_rd_u32_le(s, Length);
fuse_data = devredir_fuse_data_dequeue(irp);
if (fuse_data == NULL)
log_error("fuse_data is NULL");
xfuse_devredir_cb_read_file(fuse_data->data_ptr, s->p, Length);
devredir_irp_delete(irp);
break;
case CID_WRITE:
log_debug("got CID_WRITE");
xstream_rd_u32_le(s, Length);
fuse_data = devredir_fuse_data_dequeue(irp);
if (fuse_data == NULL)
log_error("fuse_data is NULL");
xfuse_devredir_cb_write_file(fuse_data->data_ptr, s->p, Length);
devredir_irp_delete(irp);
break;
case CID_CLOSE:
@ -1172,11 +1180,12 @@ int devredir_rmdir_or_file(void *fusep, tui32 device_id, char *path, int mode)
* @return 0 on success, -1 on failure
*****************************************************************************/
int dev_redir_file_read(void *fusep, tui32 DeviceId, tui32 FileId,
int devredir_file_read(void *fusep, tui32 DeviceId, tui32 FileId,
tui32 Length, tui64 Offset)
{
struct stream *s;
IRP *irp;
IRP *new_irp;
int bytes;
xstream_new(s, 1024);
@ -1188,12 +1197,22 @@ int dev_redir_file_read(void *fusep, tui32 DeviceId, tui32 FileId,
return -1;
}
irp->completion_type = CID_READ;
devredir_fuse_data_enqueue(irp, fusep);
/* create a new IRP for this request */
if ((new_irp = devredir_irp_clone(irp)) == NULL)
{
/* system out of memory */
xfuse_devredir_cb_read_file(fusep, NULL, 0);
return -1;
}
new_irp->FileId = 0;
new_irp->completion_type = CID_READ;
new_irp->CompletionId = g_completion_id++;
devredir_fuse_data_enqueue(new_irp, fusep);
devredir_insert_DeviceIoRequest(s,
DeviceId,
FileId,
irp->CompletionId,
new_irp->CompletionId,
IRP_MJ_READ,
0);
@ -1214,6 +1233,7 @@ int dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId,
{
struct stream *s;
IRP *irp;
IRP *new_irp;
int bytes;
log_debug("DeviceId=%d FileId=%d Length=%d Offset=%lld",
@ -1228,12 +1248,22 @@ int dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId,
return -1;
}
irp->completion_type = CID_WRITE;
devredir_fuse_data_enqueue(irp, fusep);
/* create a new IRP for this request */
if ((new_irp = devredir_irp_clone(irp)) == NULL)
{
/* system out of memory */
xfuse_devredir_cb_write_file(fusep, NULL, 0);
return -1;
}
new_irp->FileId = 0;
new_irp->completion_type = CID_WRITE;
new_irp->CompletionId = g_completion_id++;
devredir_fuse_data_enqueue(new_irp, fusep);
devredir_insert_DeviceIoRequest(s,
DeviceId,
FileId,
irp->CompletionId,
new_irp->CompletionId,
IRP_MJ_WRITE,
0);

@ -101,7 +101,7 @@ int dev_redir_file_open(void *fusep, tui32 device_id, char *path,
int devredir_file_close(void *fusep, tui32 device_id, tui32 file_id);
int dev_redir_file_read(void *fusep, tui32 device_id, tui32 FileId,
int devredir_file_read(void *fusep, tui32 device_id, tui32 FileId,
tui32 Length, tui64 Offset);
int send_channel_data(int chan_id, char *data, int size);

@ -99,6 +99,35 @@ IRP * devredir_irp_new()
return irp;
}
/**
* Clone specified IRP
*
* @return new IRP or NULL on error
*****************************************************************************/
IRP * devredir_irp_clone(IRP *irp)
{
IRP *new_irp;
IRP *prev;
IRP *next;
if ((new_irp = devredir_irp_new()) == NULL)
return NULL;
/* save link pointers */
prev = new_irp->prev;
next = new_irp->next;
/* copy all members */
memcpy(new_irp, irp, sizeof(IRP));
/* restore link pointers */
new_irp->prev = prev;
new_irp->next = next;
return new_irp;
}
/**
* Delete specified IRP from linked list
*

@ -55,6 +55,7 @@ struct irp
};
IRP * devredir_irp_new();
IRP * devredir_irp_clone(IRP *irp);
int devredir_irp_delete(IRP *irp);
IRP * devredir_irp_find(tui32 completion_id);
IRP * devredir_irp_find_by_fileid(tui32 FileId);

@ -772,6 +772,14 @@ rdpup_process_msg(struct stream *s)
LLOGLN(0, (" client can not do offscreen to offscreen blits"));
g_can_do_pix_to_pix = 0;
}
if (g_rdpScreen.client_info.pointer_flags & 1)
{
LLOGLN(0, (" client can do new(color) cursor"));
}
else
{
LLOGLN(0, (" client can not do new(color) cursor"));
}
}
else
{

@ -27,6 +27,7 @@ tcp_keepalive=yes
#bulk_compression=yes
# You can set the PAM error text in a gateway setup (MAX 256 chars)
#pamerrortxt=change your password according to policy at http://url
#new_cursors=no
[Logging]
LogFile=xrdp.log

Loading…
Cancel
Save