Closed ibigbug closed 1 month ago
This sounds more like an API question. Might I suggest https://stackoverflow.com/search?q=windows-rs as I'm not personally familiar with this API.
thanks @kennykerr I posted on so https://stackoverflow.com/questions/78929446/rtmregisterentity-access-violation
however regarding the union
mapping, is the _0_0
suffix somehow by design, is this how people should pass unions to winapi, do you have examples demonstrating APIs using a union?
tysm!
You can have a look at the overlapped sample:
The challenge is that C, unlike Rust, supports nested structs. So this is a workaround to express that in Rust.
i see isee .thanks for the explanation!
Summary
I try to impl this example https://learn.microsoft.com/en-us/windows/win32/rras/register-with-the-routing-table-manager
and I get
I also get a bit confused about
windows::Win32::NetworkManagement::Rras::RTM_ENTITY_ID
https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/NetworkManagement/Rras/struct.RTM_ENTITY_ID.html
and the embedded
Anonymous
,RTM_ENTITY_ID_0_0
stuff.is that due to the def is a union https://learn.microsoft.com/en-us/windows/win32/api/rtmv2/ns-rtmv2-rtm_entity_id
and that is how it looks like mapping to Rust?
I'm not sure if it's related to the pointer issue
Crate manifest
Crate code