I can create a named pipe in Windows via CreateNamedPipe
.
p = win32pipe.CreateNamedPipe(r'\\.\pipe\test_pipe',
win32pipe.PIPE_ACCESS_DUPLEX,
win32pipe.PIPE_TYPE_MESSAGE | win32pipe.PIPE_WAIT,
1, 65536, 65536,300,None)
This is a file-like object, and in contrast to Linux FIFOs it does not live in the main filesystem, but in a special kernel namespace (that's what the \\.\pipe
is for). Now, I have a device that lives at //./xillybus_read_32
, and would like to mock it out for tests, i.e. create a fake that behaves like it. According to MSDN, this is the Win32 device namespace. If possible, how can I create a pipe-like object there? Would it be neccessary to write a driver, or is there a userspace API?
(Of course, I can just change the consuming code to use my pipe, or solve it in a dozen other ways. But I'm really curious about this Win32 device namespace.)