Jaa


Reading and Writing a Parallel Device

A client reads and writes a parallel device by using IRP_MJ_READ and IRP_MJ_WRITE requests. A kernel-mode driver can also use the system-supplied PPARALLEL_READ and PPARALLEL_WRITE callback routines. To obtain pointers to the system-supplied read and write callbacks, a kernel-mode driver uses an IOCTL_INTERNAL_PARCLASS_CONNECT request, which returns a PARCLASS_INFORMATION structure. The ParallelRead and ParallelWrite members of the PARCLASS_INFORMATION structure are pointers to the callbacks.

If a client uses read and write I/O requests, the parallel port bus driver queues the requests on the work queue of the parallel device. A client of a parallel device does not have to lock a parallel port before reading and writing a device because the system-supplied bus driver for parallel ports automatically locks and unlocks the port for the client.