60 |
extern DEVICE_FNS printer_fns; |
extern DEVICE_FNS printer_fns; |
61 |
extern DEVICE_FNS parallel_fns; |
extern DEVICE_FNS parallel_fns; |
62 |
extern DEVICE_FNS disk_fns; |
extern DEVICE_FNS disk_fns; |
63 |
|
#ifdef WITH_SCARD |
64 |
|
extern DEVICE_FNS scard_fns; |
65 |
|
#endif |
66 |
extern FILEINFO g_fileinfo[]; |
extern FILEINFO g_fileinfo[]; |
67 |
extern BOOL g_notify_stamp; |
extern BOOL g_notify_stamp; |
68 |
|
|
312 |
channel_send(s, rdpdr_channel); |
channel_send(s, rdpdr_channel); |
313 |
} |
} |
314 |
|
|
315 |
static void |
void |
316 |
rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer, |
rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer, |
317 |
uint32 length) |
uint32 length) |
318 |
{ |
{ |
355 |
error_mode, |
error_mode, |
356 |
share_mode, disposition, total_timeout, interval_timeout, flags_and_attributes = 0; |
share_mode, disposition, total_timeout, interval_timeout, flags_and_attributes = 0; |
357 |
|
|
358 |
char filename[256]; |
char filename[PATH_MAX]; |
359 |
uint8 *buffer, *pst_buf; |
uint8 *buffer, *pst_buf; |
360 |
struct stream out; |
struct stream out; |
361 |
DEVICE_FNS *fns; |
DEVICE_FNS *fns; |
398 |
break; |
break; |
399 |
|
|
400 |
case DEVICE_TYPE_SCARD: |
case DEVICE_TYPE_SCARD: |
401 |
|
#ifdef WITH_SCARD |
402 |
|
fns = &scard_fns; |
403 |
|
rw_blocking = False; |
404 |
|
break; |
405 |
|
#endif |
406 |
default: |
default: |
407 |
|
|
408 |
error("IRP for bad device %ld\n", device); |
error("IRP for bad device %ld\n", device); |
679 |
|
|
680 |
out.data = out.p = buffer; |
out.data = out.p = buffer; |
681 |
out.size = sizeof(buffer); |
out.size = sizeof(buffer); |
682 |
|
|
683 |
|
DEBUG_SCARD(("[SMART-CARD TRACE]\n")); |
684 |
|
DEBUG_SCARD(("device 0x%.8x\n", device)); |
685 |
|
DEBUG_SCARD(("file 0x%.8x\n", file)); |
686 |
|
DEBUG_SCARD(("id 0x%.8x\n", id)); |
687 |
|
#ifdef WITH_SCARD |
688 |
|
scardSetInfo(device, id, bytes_out + 0x14); |
689 |
|
#endif |
690 |
status = fns->device_control(file, request, s, &out); |
status = fns->device_control(file, request, s, &out); |
691 |
result = buffer_len = out.p - out.data; |
result = buffer_len = out.p - out.data; |
692 |
|
|
693 |
|
DEBUG_SCARD(("[SMART-CARD TRACE] OUT 0x%.8x\n", status)); |
694 |
|
|
695 |
/* Serial SERIAL_WAIT_ON_MASK */ |
/* Serial SERIAL_WAIT_ON_MASK */ |
696 |
if (status == STATUS_PENDING) |
if (status == STATUS_PENDING) |
697 |
{ |
{ |
702 |
break; |
break; |
703 |
} |
} |
704 |
} |
} |
705 |
|
#ifdef WITH_SCARD |
706 |
|
else if (status == (STATUS_PENDING | 0xC0000000)) |
707 |
|
status = STATUS_PENDING; |
708 |
|
#endif |
709 |
break; |
break; |
710 |
|
|
711 |
|
|
951 |
} |
} |
952 |
|
|
953 |
/* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */ |
/* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */ |
954 |
void |
static void |
955 |
_rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out) |
_rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out) |
956 |
{ |
{ |
957 |
NTSTATUS status; |
NTSTATUS status; |
981 |
{ |
{ |
982 |
|
|
983 |
/* iv_timeout between 2 chars, send partial_len */ |
/* iv_timeout between 2 chars, send partial_len */ |
984 |
/*printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length);*/ |
/*printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length); */ |
985 |
rdpdr_send_completion(iorq->device, |
rdpdr_send_completion(iorq->device, |
986 |
iorq->id, STATUS_SUCCESS, |
iorq->id, STATUS_SUCCESS, |
987 |
iorq->partial_len, |
iorq->partial_len, |