System.Drawing.ComIStreamMarshaler.ManagedToNativeWrapper.ReleaseInterface C# (CSharp) Method

ReleaseInterface() static private method

static private ReleaseInterface ( IntPtr comInterface ) : void
comInterface System.IntPtr
return void
			internal static void ReleaseInterface(IntPtr comInterface)
			{
				if (comInterface != IntPtr.Zero)
				{
					IntPtr vtable = Marshal.ReadIntPtr(comInterface);

					if (vtable == comVtable)
						Release(comInterface);
					else
					{
						ReleaseSlot releaseSlot = (ReleaseSlot)Marshal.PtrToStructure((IntPtr)((long)vtable + (long)(IntPtr.Size * 2)), typeof(ReleaseSlot));
						releaseSlot.Release(comInterface);
					}
				}
			}