Mono.Interop.ComInteropProxy.GetProxy C# (CSharp) Method

GetProxy() static private method

static private GetProxy ( IntPtr pItf, Type t ) : ComInteropProxy
pItf System.IntPtr
t System.Type
return ComInteropProxy
		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;
			}
		}