-
Notifications
You must be signed in to change notification settings - Fork 507
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
ExecMethod in ISWbemObject returns always 0 #3199
Comments
Hey, glad you like windows-rs! Can you try the latest version? There are various improvements to both Here's an example: https://github.com/microsoft/windows-rs/tree/master/crates/samples/windows/wmi |
Win32_Process::Create returns a value of 0 (zero) if the process was successfully created, and any other number to indicate an error. (doc) It does not return the status code returned by logoff.exe. To verify things are working correctly, try executing |
Hi @kennykerr, hi @riverar, First off, thank you for your quick responses and the continuous improvements to this project! Feedback on Version Update (0.52 -> 0.58): I've recently attempted to upgrade from version 0.52 to 0.58 (noting that 0.59 isn't available on crates.io yet). The number of changes, particularly around the handling of ISWbemObject and VARIANT, has been a bit overwhelming. For instance, the following code that worked in 0.52 is no longer functional: if let Some(dispatch) = var.Anonymous.Anonymous.Anonymous.pdispVal.as_ref() {
let item: ISWbemObject = dispatch.cast()?;
let instance = T::from_wmi_object(&item)?;
results.push(instance);
} In the newer versions, this now returns a Given the scope of the changes, I found it difficult to update my code to work with versions beyond 0.52. I do see the value in the new PS.: Please note that the samples are using Success Code Always 0 Feedback: Regarding the Thanks again for all your hard work on this project. I look forward to integrating the new updates when I have the bandwidth to do so! Best regards |
Summary
Hi,
First of all, thanks for your hard work! I really enjoy using
windows-rs
so far.I am trying to access a remote machine. The execution of my wanted
logoff
with a given session ID (obtained throughquery session
) did work just fine. However if you look closely into my code below you will see, that I want to give some feedback if the commandlogoff
did fail. But no matter the session ID it will always proceed with "ok" or 0 in my case:Here is the loggin output:
This feels like a bug to me.
Crate manifest
Crate code
No response
The text was updated successfully, but these errors were encountered: