internal static ComInteropProxy GetProxy (IntPtr pItf, Type t)
{
IntPtr ppv;
Guid iid = __ComObject.IID_IUnknown;
int hr = Marshal.QueryInterface (pItf, ref iid, out ppv);
Marshal.ThrowExceptionForHR (hr);
ComInteropProxy obj = FindProxy (ppv);
if (obj == null) {
Marshal.Release (pItf);
return new ComInteropProxy (ppv);
}
else {
Marshal.Release (pItf);
System.Threading.Interlocked.Increment (ref obj.ref_count);
return obj;
}
}