You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the _NewEnum method on an instance of INetFwAuthorizedApplications fails with the following exception:
Unhandled exception. System.Runtime.InteropServices.InvalidOleVariantTypeException: Specified OLE variant is invalid.
at System.StubHelpers.ObjectMarshaler.ConvertToManaged(IntPtr pSrcVariant)
at Windows.Win32.NetworkManagement.WindowsFirewall.INetFwAuthorizedApplications.get__NewEnum()
at Fires.Program.Main() in C:\Users\Fots\source\Firewallcs\Program.cs:line 12
The source generated also suggests it returns an object when I think it should either be IUnknown (which can be cast to IEnumVARIANT) or IEnumVARIANT directly.
This all works perfectly in windows-rs (see below for equivalent code).
Expected behavior
I expect to be able to retrieve the _NewEnum so I can iterate through the collection.
Actual behavior
Calling the
_NewEnum
method on an instance ofINetFwAuthorizedApplications
fails with the following exception:The source generated also suggests it returns an
object
when I think it should either beIUnknown
(which can be cast toIEnumVARIANT
) orIEnumVARIANT
directly.This all works perfectly in windows-rs (see below for equivalent code).
Expected behavior
I expect to be able to retrieve the
_NewEnum
so I can iterate through the collection.Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):N/A
Here's the equivalent in Rust...
Cargo.toml
main.rs
Context
0.4.422-beta
]: 0.3.106netstandard2.0
]: net8.0-windowsLangVersion
(if explicitly set by project): [e.g.9
]: N/AThanks a lot in advance!
Fotis
The text was updated successfully, but these errors were encountered: