Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public int CompareTo_(int lFlags, IWbemClassObjectFreeThreaded pCompareTo)
if (pWbemClassObject == IntPtr.Zero)
throw new ObjectDisposedException(name);
int res = WmiNetUtilsHelper.CompareTo_f(16, pWbemClassObject, lFlags, pCompareTo.pWbemClassObject);
GC.KeepAlive(pCompareTo);
GC.KeepAlive(this);
return res;
}
Expand Down Expand Up @@ -270,6 +271,8 @@ public int PutMethod_(string wszName, int lFlags, IWbemClassObjectFreeThreaded p
if (pWbemClassObject == IntPtr.Zero)
throw new ObjectDisposedException(name);
int res = WmiNetUtilsHelper.PutMethod_f(20, pWbemClassObject, wszName, lFlags, pInSignature, pOutSignature);
Copy link
Member Author

@EgorBo EgorBo Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may look like we pass objects directly here, but it's just an overriden operator:

internal sealed class IWbemClassObjectFreeThreaded : IDisposable
{
    private IntPtr pWbemClassObject = IntPtr.Zero;

    public static implicit operator IntPtr(IWbemClassObjectFreeThreaded wbemClassObject)
    {
        if (null == wbemClassObject)
            return IntPtr.Zero;
        return wbemClassObject.pWbemClassObject;
    }

GC.KeepAlive(pInSignature);
GC.KeepAlive(pOutSignature);
GC.KeepAlive(this);
return res;
}
Expand Down
Loading