239 |
{ |
{ |
240 |
case 4: /* rename item */ |
case 4: /* rename item */ |
241 |
in_uint8(s, printer_length); |
in_uint8(s, printer_length); |
242 |
in_uint8s(s, 0x3); // padding |
in_uint8s(s, 0x3); /* padding */ |
243 |
in_uint8(s, driver_length); |
in_uint8(s, driver_length); |
244 |
in_uint8s(s, 0x3); // padding |
in_uint8s(s, 0x3); /* padding */ |
245 |
|
|
246 |
/* NOTE - 'driver' doesn't contain driver, it contains the new printer name */ |
/* NOTE - 'driver' doesn't contain driver, it contains the new printer name */ |
247 |
|
|
253 |
|
|
254 |
case 3: /* delete item */ |
case 3: /* delete item */ |
255 |
in_uint8(s, printer_unicode_length); |
in_uint8(s, printer_unicode_length); |
256 |
in_uint8s(s, 0x3); // padding |
in_uint8s(s, 0x3); /* padding */ |
257 |
printer_length = rdp_in_unistr(s, printer, printer_unicode_length); |
printer_length = rdp_in_unistr(s, printer, printer_unicode_length); |
258 |
printercache_unlink_blob(printer); |
printercache_unlink_blob(printer); |
259 |
break; |
break; |
270 |
break; |
break; |
271 |
|
|
272 |
case 1: /* save device data */ |
case 1: /* save device data */ |
273 |
in_uint8a(s, device_name, 5); // get LPTx/COMx name |
in_uint8a(s, device_name, 5); /* get LPTx/COMx name */ |
274 |
|
|
275 |
// need to fetch this data so that we can get the length of the packet to store. |
/* need to fetch this data so that we can get the length of the packet to store. */ |
276 |
in_uint8s(s, 0x2); // ??? |
in_uint8s(s, 0x2); /* ??? */ |
277 |
in_uint8s(s, 0x2) // pad?? |
in_uint8s(s, 0x2) /* pad?? */ |
278 |
in_uint32_be(s, driver_length); |
in_uint32_be(s, driver_length); |
279 |
in_uint32_be(s, printer_length); |
in_uint32_be(s, printer_length); |
280 |
in_uint8s(s, 0x7) // pad?? |
in_uint8s(s, 0x7) /* pad?? */ |
281 |
// next is driver in unicode |
/* next is driver in unicode */ |
282 |
// next is printer in unicode |
/* next is printer in unicode */ |
283 |
/* TODO: figure out how to use this information when reconnecting */ |
/* TODO: figure out how to use this information when reconnecting */ |
284 |
/* actually - all we need to store is the driver and printer */ |
/* actually - all we need to store is the driver and printer */ |
285 |
/* and figure out what the first word is. */ |
/* and figure out what the first word is. */ |
286 |
/* rewind stream so that we can save this blob */ |
/* rewind stream so that we can save this blob */ |
287 |
/* length is driver_length + printer_length + 19 */ |
/* length is driver_length + printer_length + 19 */ |
288 |
// rewind stream |
/* rewind stream */ |
289 |
s->p = s->p - 19; |
s->p = s->p - 19; |
290 |
|
|
291 |
printercache_save_blob(device_name, s->p, |
printercache_save_blob(device_name, s->p, |