Can't use Named Pipe created in Linux in my Windows program (under Wine)

Questions about Wine on Linux
Locked
cristian.craciun
Newbie
Newbie
Posts: 2
Joined: Tue Mar 02, 2021 1:38 pm

Can't use Named Pipe created in Linux in my Windows program (under Wine)

Post by cristian.craciun »

Hello!

I'm seeing an issue where I can't use named pipes created in a Linux program (Python3) in my Windows application that is running under Wine. The windows application is written in Python2.7.

I reproduced this same error in a basic Wine prefix, with the steps below. I'd appreciate any input if i'm doing anything wrong here, or how I can debug this issue further.

Setup: Ubuntu 20.04 server, Wine version: wine32=5.0-3ubuntu1
WINEARCH=win32 (needed by our application), WINEPREFIX=/home/user/.prefix

Wine prefix setup:
- install Python2.7.18 using msiexec
- install pywin32 in Python2.7.18 using pip.

Linux Python3 app:

Code: Select all

import os
import fcntl

path = "/home/user/.prefix/drive_c/pipe"
os.mkfifo(path)
writeHandler = open(path, 'w') # this operation will block, so the line below is never reached. 
fcntl.fcntl(writeHandler, fcntl.F_SETFL, os.O_NONBLOCK)
Wine Python2 app:

Code: Select all

import win32file, win32pipe
path="C:\\pipe"
handler=win32file.CreateFile(path, win32file.GENERIC_READ, 0, None, win32file.OPEN_EXISTING, 0, None)
buffer, bytesToRead, result = win32pipe.PeekNamedPipe(handler, 0)
if bytesToRead:
    returnValue, data = win32file.ReadFile(handler, bytesToRead, None)
The handler is created correctly, so the Python app under Wine sees the file created in Linux. However, the PeekNamedPipe method fails with the following error. One thing worth noting is that the same scenario was working for us using wine-1.9.20(Staging).

Code: Select all

pywintypes.error: (50, 'PeekNamedPipe', 'Request not supported.')
I'd appreciate any help with this issue :) Thanks!
madewokherd
Level 4
Level 4
Posts: 144
Joined: Mon Jun 02, 2008 5:03 pm

Re: Can't use Named Pipe created in Linux in my Windows program (under Wine)

Post by madewokherd »

I'm surprised this ever worked, as far as I know it's not a supported case.
fargodwe

Re: Can't use Named Pipe created in Linux in my Windows program (under Wine)

Post by fargodwe »

I'm just a novice here, but:

Code: Select all

the same scenario was working for us using wine-1.9.20(Staging)
I hope that's a mis-type, as wine is up in the 6 range now.
cristian.craciun
Newbie
Newbie
Posts: 2
Joined: Tue Mar 02, 2021 1:38 pm

Re: Can't use Named Pipe created in Linux in my Windows program (under Wine)

Post by cristian.craciun »

fargodwe wrote: Thu Mar 04, 2021 9:15 am I'm just a novice here, but:

Code: Select all

the same scenario was working for us using wine-1.9.20(Staging)
I hope that's a mis-type, as wine is up in the 6 range now.
Unfortunately this is not a mis-type :) I am now upgrading a very old setup that has not been touched since 2015 - so it remained on Wine 1.9.20
Locked