39 |
|
|
40 |
/* Table with information about rdpdr devices */ |
/* Table with information about rdpdr devices */ |
41 |
RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES]; |
RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES]; |
42 |
|
char * g_rdpdr_clientname = NULL; |
43 |
|
|
44 |
/* Used to store incoming io request, until they are ready to be completed */ |
/* Used to store incoming io request, until they are ready to be completed */ |
45 |
/* using a linked list ensures that they are processed in the right order, */ |
/* using a linked list ensures that they are processed in the right order, */ |
169 |
rdpdr_send_name(void) |
rdpdr_send_name(void) |
170 |
{ |
{ |
171 |
uint8 magic[4] = "rDNC"; |
uint8 magic[4] = "rDNC"; |
172 |
uint32 hostlen = (strlen(hostname) + 1) * 2; |
if (NULL == g_rdpdr_clientname) { |
173 |
|
g_rdpdr_clientname = hostname; |
174 |
|
} |
175 |
|
uint32 hostlen = (strlen(g_rdpdr_clientname) + 1) * 2; |
176 |
STREAM s; |
STREAM s; |
177 |
|
|
178 |
s = channel_init(rdpdr_channel, 16 + hostlen); |
s = channel_init(rdpdr_channel, 16 + hostlen); |
181 |
out_uint16_le(s, 0x72); |
out_uint16_le(s, 0x72); |
182 |
out_uint32(s, 0); |
out_uint32(s, 0); |
183 |
out_uint32_le(s, hostlen); |
out_uint32_le(s, hostlen); |
184 |
rdp_out_unistr(s, hostname, hostlen - 2); |
rdp_out_unistr(s, g_rdpdr_clientname, hostlen - 2); |
185 |
s_mark_end(s); |
s_mark_end(s); |
186 |
channel_send(s, rdpdr_channel); |
channel_send(s, rdpdr_channel); |
187 |
} |
} |