Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Defcronyke
@defcronyke
Hi, I am on Windows and trying to run cargo doc --open on a project which uses rand (which pulls in winapi), but when I try the command, it tries to document winapi, and building it fails with thousands of errors about unused variables and such. What am I doing wrong?
it is just the guessing game project from the rust book
I am using rust-nightly
endeav0r
@endeav0r
I’m just getting started with winapi-rs. Any idea why I can’t use winapi::um::minwinbase::SECURITY_ATTRIBUTES:
error[E0432]: unresolved import `winapi::um::minwinbase`                                                                        
 --> src/main.rs:4:17                                                                                                           
  |                                                                                                                             
4 | use winapi::um::minwinbase::SECURITY_ATTRIBUTES;                                                                            
  |                 ^^^^^^^^^^ Could not find `minwinbase` in `um`
endeav0r
@endeav0r
well, ok, figured that out
endeav0r
@endeav0r
Now I’m trying to pass a DEBUG_EVENT to WaitForDebugEvent .
In order to do this, I need to create a DEBUG_EVENT, but because DEBUG_EVENT.DEBUG_EVENT_u doesn’t have anyway to create it, I can’t create a DEBUG_EVENT, and so I can’t create an empty argument to pass to WaitForDebugEvent.
I’m a little stuck on this one
Mykhailo Osypov
@mosyp
Hello guys, how one would create an instance of winapi::um::synchapi::OVERLAPPED_u?
this one is not working:
50 |         let u = OVERLAPPED_u([0, 0]);
   |                 ^^^^^^^^^^^^ constructor is not visible here due to private fields
Mykhailo Osypov
@mosyp
ah, union macro does not include pub in ints constuctor, prepared a pr retep998/winapi-rs#672
@retep998 Is there any chance it will bve merged and released? The workaround is only to provide custom fn/strcut externs for the whole call tree
Daniel Hines
@d4hines
Hello all. I'm a JS dev looking to do some deeper Win32 integration from NodeJS, so I'm evaluating options. How active/widely used is winapi-rs?
Peter Atashian
@retep998
@d4hines winapi is very widely used, and is generally the only option anyways
basically anything in the rust ecosystem that needs to talk to windows api uses winapi
@woodgear
hi guys,we need your help
we currently use rust write windows driver and has deploy it to product env.
we add some km binding of winapi
is a brief example how we do.
cargo xbuild + custom target + km binding of winapi.
i afraid of request a PR cause we juse use it in our company. but of couse we want to make it merge into winapi.
@woodgear
we use rust-bindgen to transform ddk header file to rust and edit it manual to pick up function or struct what we used.
how you guys think?
@retep998
Peter Atashian
@retep998
@woodgear I do want to have bindings to kernel mode stuff, however actually linking to kernel mode specific stuff is a very hairy problem right now
types and constants can be provided just fine though
@woodgear
why? what the difference?
@woodgear
what the problem is? maybe be we could fix that
Peter Atashian
@retep998
@woodgear I'd need Rust to officially bless certain targets for windows kernel mode, so I can detect them and link to different things for them.
@woodgear
en,maybe a branch like feature/km? we could not do nothing but just wait for rust officially .
i will open a pr to push rust add windows kernel mode target (by the way where should i go? rust/rustup?)
@woodgear
for now, we could temporary assume that the target name is i686-kernel-windows-msvc for x86 and x86_64-kernel-windows-msvc for x64
there are some people who want to km binding of winapi like retep998/winapi-rs#605
Peter Atashian
@retep998
I'll try to work on some stuff in a branch
@woodgear
cool,please make that branch be public, we are gratefully to contribute our code.
hopefully be helpful
@woodgear
i will open a pr(could not be merge) to show what we have done.
Peter Atashian
@retep998
locating the km libraries should be the job of rust, not winapi
or rather, the cc crate
@woodgear
locating the km libraries? you mean find the path of those lib?
Peter Atashian
@retep998
most of the stuff in that build.rs you linked is supposed to be handled automatically by rust through the cc crate
Peter Atashian
@retep998
anyway, I kicked things off by filing an issue in Rust rust-lang/rust#59994
@woodgear
seems great
FXTi
@FXTi
Hey guys, I'm new to rust on Windows. I wonder how to use NtDeviceIoControlFile in nt.dll in rust way.
I see it in ntdll.def. But seems there's no rust source code about it in winapi-rs crate. And I think it may concerns bindgen.
anyway, is there a way to call that function? It's quite complicated for me...
Peter Atashian
@retep998
@FXTi that function is in the Windows SDK, so it's just a matter of someone submitting a pull request to winapi adding the bindings for it correctly.