-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WMI (MI_xxx) functions - where are they? #1572
Comments
Hey @vpopescu. Those functions are unfortunately header-only functions, found in MI_INLINE MI_Result MI_Application_NewSession(
_In_ MI_Application *application,
...)
{
if (application && application->ft)
{
return application->ft->NewSession(application, protocol, destination, options, callbacks, extendedError, session);
}
// ... Going to close this for now as it's not a crate issue, but feel free to continue the discussion or re-open if needed. |
Depends on what the goal of the crate is. If someone is doing Rust only and had no exposure to doing this in C, how are they supposed to create WMI applications? |
One of the goals of the crate is to give you access to Windows APIs. MI_* APIs are not Windows APIs but rather belong to Windows Management Infrastructure (MI). Use of these APIs also requires the Windows Management Framework redistributable to be installed. That said, I did try to write a quick sample for you but had to stop abruptly due to the unfortunate way the |
Thanks for looking into it. I kinda got stuck around the same place you got stuck as well. Yes, I think it needs a little TLC, it's either unusable, or beyond my Rust skills at the moment. I think MI has been included in the OS since Win8 (?) -- of course, with available downloadable updates. There is a third party WMI crate (https://crates.io/crates/wmi) but I don't think it supports executing methods. However it doesn't depend on MI. It's pretty good if all you need is to read WMI. |
@riverar Could you link the WIn32 metadata issue here, so we can track an open issue? |
@vpopescu Will do momentarily. |
Hope you guys can add the functions to some crate, if not this one. Currently I have to handcraft my own function signature, then transmute the
|
It looks like the crate wraps the MI library for WMI, in namespace windows::Win32::System:Wmi. This is great, however I only see one function defined, MI_Application_InitializeV1.
At least from my exposure to this MI library via C, I would need additional functions, such as:
Is this an omission, or is the usage model different than C, and I'm missing something obvious? How would I create a MI_Session?
Ref: https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/System/Wmi/index.html#functions
The text was updated successfully, but these errors were encountered: