rust_uds_windows icon indicating copy to clipboard operation
rust_uds_windows copied to clipboard

Wine compatibility; NTSTATUS ERROR_NO_SUCH_DEVICE

Open siltyy opened this issue 1 year ago • 3 comments

When trying to connect to a pathname UNIX domain socket with a program running on Wine, I receive the following error (ERROR_NO_SUCH_DEVICE):

called `Result::unwrap()` on an `Err` value: Os { code: 10047, kind: Uncategorized, message: "OS Error 10047 (FormatMessageW() returned error 317)" }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\core\src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\core\src/result.rs:1649:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\result.rs:1073:23
   4: win_uds_test::main
             at /home/silt/Documents/Programming/Rust/win-uds-test/src/main.rs:3:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\ops\function.rs:250:5

The test program I'm using is nothing fancy, just

use uds_windows::UnixStream;
fn main() {
    UnixStream::connect(r"Z:\tmp\socket").unwrap();
}

Looking at the output of strace, the path I provide is never even checked, and no socket-related operations are done excepting those from Wine itself.

Any idea what could be going wrong here, or tips on how to proceed with properly debugging this?

Environment info:
  • OS: Artix Linux Rolling
  • Wine: wine-ge-proton8-4 (reproduces on all other Wine versions I've tried)
  • uds_windows: 1.1.0
  • rustc: 1.76.0 (07dca489a 2024-02-04)
  • Build target: i686-pc-windows-gnu

siltyy avatar May 03 '24 06:05 siltyy

no clue.. we were testing with unix like file paths.. not windows drives

haraldh avatar May 03 '24 12:05 haraldh

UNIX-like file paths, on Windows? I'm a bit confused about what you mean, since I've also tried stuff like /tmp/socket, /z/tmp/socket, \\?\GlobalRoot\Global??\Z:\tmp\socket, \\?\Global\Z:\tmp\socket, and even just \socket and /socket with the socket being at C:\socket thinking maybe this only supported subdirectories of C:, and all of them had the same issue.

siltyy avatar May 04 '24 00:05 siltyy

https://github.com/haraldh/rust_uds_windows/blob/fb5e294a1c7430cfacc19e8fad6332a1abb33a95/src/stdnet/mod.rs#L55

Z:\tmp\socket, z:\tmp\socket, and (with the socket in C:'s root) \socket are all valid Win32 file paths as defined by https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file and should work assuming the comment is correct and the code is working correctly.

siltyy avatar May 26 '24 19:05 siltyy