64 |
} |
} |
65 |
|
|
66 |
static NTSTATUS |
static NTSTATUS |
67 |
parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags, |
parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, |
68 |
char *filename, HANDLE * handle) |
uint32 flags, char *filename, HANDLE * handle) |
69 |
{ |
{ |
70 |
int parallel_fd; |
int parallel_fd; |
71 |
|
|
72 |
parallel_fd = open(g_rdpdr_device[device_id].local_path, O_RDWR); |
parallel_fd = open(g_rdpdr_device[device_id].local_path, O_RDWR); |
73 |
if (parallel_fd == -1) { |
if (parallel_fd == -1) |
74 |
|
{ |
75 |
perror("open"); |
perror("open"); |
76 |
return STATUS_ACCESS_DENIED; |
return STATUS_ACCESS_DENIED; |
77 |
} |
} |
79 |
g_rdpdr_device[device_id].handle = parallel_fd; |
g_rdpdr_device[device_id].handle = parallel_fd; |
80 |
|
|
81 |
*handle = parallel_fd; |
*handle = parallel_fd; |
82 |
|
|
83 |
|
/* all read and writes should be non blocking */ |
84 |
|
if (fcntl(*handle, F_SETFL, O_NONBLOCK) == -1) |
85 |
|
perror("fcntl"); |
86 |
|
|
87 |
return STATUS_SUCCESS; |
return STATUS_SUCCESS; |
88 |
} |
} |
89 |
|
|