0

I am trying to use the NetGetJoinInformation function and I cannot resolve it from the winapi-rs crate.

Here is the code and the compiler output.

use winapi::um::lmjoin::NetGetJoinInformation;
use winapi::um::PNETSETUP_JOIN_STATUS;
use winapi::um::winnt::LPWSTR;
use winapi::um::winnt::LPCWSTR;

fn foo() {
    let mut lpServer: LPCWSTR = 0 as *mut u16;
    let mut DomainName: LPWSTR = 0 as *mut u16;
    let mut pNetJoinStatus: PNETSETUP_JOIN_STATUS = 0;
    NetGetJoinInformation(0, &DomainName, &pNetJoinStatus);
}

Compiler output:

error[E0432]: unresolved import `winapi::um::lmjoin`                                                                                                                                                               
 --> src/foo.rs:2:17                                                                                                                                                                                      
  |
2 | use winapi::um::lmjoin::NetGetJoinInformation;
  |                 ^^^^^^ could not find `lmjoin` in `um`

error[E0432]: unresolved import `winapi::um::PNETSETUP_JOIN_STATUS`
 --> src/foo.rs:3:5
  |
3 | use winapi::um::PNETSETUP_JOIN_STATUS;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `PNETSETUP_JOIN_STATUS` in `um`

I am of course compiling for windows.

I have no idea why it happens. I tried to trick with features but nothing seemed to work. I think it might be a problem with the crate. I already posted an issue on the github repository in case it was really a problem with the library and not a problem between the chair and the keyboard. Any clues ? Thanks a lot !

EDIT: Here is the Cargo.toml

[package]
name = "foo"
version = "0.1.0"
edition = "2021"

[dependencies]
winapi = {version="0.3.9", features=["winuser"]}
W00dy
  • 51
  • 6

0 Answers0