Skip to main content

write to and read from parallel port RRS feed

  • Question

  • i use the WRITE_PORT_UCHAR to write a char to the parallel port and the function READ_PORT_UCHAR to read the same character written, so a part of my code in kernel is:

    ULONG p = 120;
    WRITE_PORT_UCHAR(&p, (UCHAR) 'e'); // or another character , r will be the same

    UCHAR r = READ_PORT_UCHAR(&p); // reading from the same port

    r = 255 , why?

    i think that there is no synchronisation between the two calls (read & write), i mean, for example, that the write function ends before the read function catch the information & return it.

    Wednesday, January 30, 2019 2:07 PM


  • In windows you can’t assume ownership of hardware resources, you must work with the parallel port driver to gain access to the parallel port resources. Once you have done that, it is up to you to synchronize access across threads. Within a single thread, the io operations will complete when the call returns

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, January 30, 2019 3:26 PM