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"; |
|
uint32 hostlen = (strlen(hostname) + 1) * 2; |
|
172 |
STREAM s; |
STREAM s; |
173 |
|
uint32 hostlen; |
174 |
|
|
175 |
|
if (NULL == g_rdpdr_clientname) { |
176 |
|
g_rdpdr_clientname = hostname; |
177 |
|
} |
178 |
|
hostlen = (strlen(g_rdpdr_clientname) + 1) * 2; |
179 |
|
|
180 |
s = channel_init(rdpdr_channel, 16 + hostlen); |
s = channel_init(rdpdr_channel, 16 + hostlen); |
181 |
out_uint8a(s, magic, 4); |
out_uint8a(s, magic, 4); |
183 |
out_uint16_le(s, 0x72); |
out_uint16_le(s, 0x72); |
184 |
out_uint32(s, 0); |
out_uint32(s, 0); |
185 |
out_uint32_le(s, hostlen); |
out_uint32_le(s, hostlen); |
186 |
rdp_out_unistr(s, hostname, hostlen - 2); |
rdp_out_unistr(s, g_rdpdr_clientname, hostlen - 2); |
187 |
s_mark_end(s); |
s_mark_end(s); |
188 |
channel_send(s, rdpdr_channel); |
channel_send(s, rdpdr_channel); |
189 |
} |
} |