private static int Release(IntPtr @this)
{
#if MAP_EX_TO_HR
try
{
#endif
ManagedToNativeWrapper thisObject = GetObject(@this);
lock (thisObject)
{
if ((thisObject.refCount != 0) && (--thisObject.refCount == 0))
thisObject.Dispose();
return thisObject.refCount;
}
#if MAP_EX_TO_HR
}
catch
{
return 0;
}
#endif
}