1 |
matthewc |
432 |
#include "rdesktop.h" |
2 |
|
|
|
3 |
|
|
FILE *printer_fp; |
4 |
|
|
|
5 |
|
|
static NTSTATUS |
6 |
astrand |
435 |
printer_create(HANDLE * handle) |
7 |
matthewc |
432 |
{ |
8 |
|
|
printer_fp = popen("lpr", "w"); |
9 |
|
|
*handle = 0; |
10 |
|
|
return STATUS_SUCCESS; |
11 |
|
|
} |
12 |
|
|
|
13 |
|
|
static NTSTATUS |
14 |
|
|
printer_close(HANDLE handle) |
15 |
|
|
{ |
16 |
|
|
pclose(printer_fp); |
17 |
|
|
return STATUS_SUCCESS; |
18 |
|
|
} |
19 |
|
|
|
20 |
|
|
static NTSTATUS |
21 |
astrand |
435 |
printer_write(HANDLE handle, uint8 * data, uint32 length, uint32 * result) |
22 |
matthewc |
432 |
{ |
23 |
|
|
*result = fwrite(data, 1, length, printer_fp); |
24 |
|
|
return STATUS_SUCCESS; |
25 |
|
|
} |
26 |
|
|
|
27 |
astrand |
435 |
DEVICE_FNS printer_fns = { |
28 |
matthewc |
432 |
printer_create, |
29 |
|
|
printer_close, |
30 |
astrand |
435 |
NULL, /* read */ |
31 |
matthewc |
432 |
printer_write, |
32 |
astrand |
435 |
NULL /* device_control */ |
33 |
matthewc |
432 |
}; |