STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
__abi_FTMWeakRefData Class Reference

#include <vccorlib.h>

Public Member Functions

 __declspec (non_user_code) __abi_FTMWeakRefData(
 
 __declspec (non_user_code) __abi_FTMWeakRefData(
 
 __declspec (non_user_code) void __abi_dtor()
 
unsigned long __stdcall Increment () volatile
 
unsigned long __stdcall Decrement () volatile
 
__abi_FTMWeakRefDataGetFreeThreadedMarshaler ()
 
inline::Platform::Details::IWeakReference GetWeakReference ()
 
long __stdcall Get () volatile
 
long __stdcall __abi_QueryInterface (::Platform::Guid &__guid, void **__pOut)
 
void ReleaseControlBlock ()
 

Private Attributes

::Platform::Details::ControlBlock * __weakRefSource
 
__abi_IUnknown *volatile __pUnkMarshal
 

Member Function Documentation

long __stdcall __abi_FTMWeakRefData::__abi_QueryInterface ( ::Platform::Guid &  __guid,
void **  __pOut 
)
inline
1773 {
1774  if (__pUnkMarshal == nullptr || __guid.Equals(__uuidof(__abi_IMarshal)) == false)
1775  {
1776  return 0x80004002;
1777  }
1778  if (__pUnkMarshal == reinterpret_cast<__abi_IUnknown*>(-1))
1779  {
1780  __abi_IUnknown* __pUnkMarshalLocal;
1781 
1782 #if !defined(VCWINRT_DLL)
1783  long __hr = ::__Platform_CoCreateFreeThreadedMarshaler(reinterpret_cast<::Platform::Object^>(__weakRefSource->__target), reinterpret_cast< ::Platform::Object^*>(&__pUnkMarshalLocal));
1784 #else
1785  long __hr = ::CoCreateFreeThreadedMarshaler(reinterpret_cast<IUnknown*>(__weakRefSource->__target), reinterpret_cast<IUnknown**>(&__pUnkMarshalLocal));
1786 #endif
1787  __abi_ThrowIfFailed(__hr);
1788 
1789  if (::_InterlockedCompareExchangePointer(reinterpret_cast<void* volatile*>(&__pUnkMarshal), __pUnkMarshalLocal, reinterpret_cast<void*>(-1)) != reinterpret_cast<void*>(-1))
1790  {
1791  __pUnkMarshalLocal->__abi_Release();
1792  }
1793  }
1794  return __pUnkMarshal->__abi_QueryInterface(__guid, __pOut);
1795 }
void __abi_ThrowIfFailed(long __hrArg)
Definition: vccorlib.h:96
long __stdcall __Platform_CoCreateFreeThreadedMarshaler(::Platform::Object^,::Platform::Object^*)
void * _InterlockedCompareExchangePointer(void *volatile *, void *, void *)
__abi_IUnknown *volatile __pUnkMarshal
Definition: vccorlib.h:707
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706
__abi_FTMWeakRefData::__declspec ( non_user_code  )
inline
711  {
712  __pUnkMarshal = reinterpret_cast<__abi_IUnknown*>(-1);
713 
714  if (__abi_module != nullptr)
715  {
716  __abi_module->__abi_IncrementObjectCount();
717  }
718  }
__abi_Module * __abi_module
__abi_IUnknown *volatile __pUnkMarshal
Definition: vccorlib.h:707
__abi_FTMWeakRefData::__declspec ( non_user_code  )
inline
721  {
722  if (__contextArg == ::Platform::CallbackContext::Any)
723  {
724  __pUnkMarshal = reinterpret_cast<__abi_IUnknown*>(-1);
725  }
726  else
727  {
728  __pUnkMarshal = nullptr;
729  }
730 
731  if (__abi_module != nullptr)
732  {
733  __abi_module->__abi_IncrementObjectCount();
734  }
735  }
__abi_Module * __abi_module
__abi_IUnknown *volatile __pUnkMarshal
Definition: vccorlib.h:707
__abi_FTMWeakRefData::__declspec ( non_user_code  )
inline
739  {
740  if (__pUnkMarshal && __pUnkMarshal != reinterpret_cast<__abi_IUnknown*>(-1))
741  {
742  __pUnkMarshal->__abi_Release();
743  __pUnkMarshal = nullptr;
744  }
745 
746  if (__abi_module != nullptr)
747  {
748  __abi_module->__abi_DecrementObjectCount();
749  }
750 
751  __weakRefSource->DecrementStrongReference();
753  }
__abi_Module * __abi_module
void ReleaseControlBlock()
Definition: vccorlib.h:817
__abi_IUnknown *volatile __pUnkMarshal
Definition: vccorlib.h:707
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706
unsigned long __stdcall __abi_FTMWeakRefData::Decrement ( ) volatile
inline
766  {
767  if (__weakRefSource == nullptr || __weakRefSource->GetRefcount() < 0)
768  {
769  return static_cast<unsigned long>(-1); // Called during destruction
770  }
771 
772  unsigned long __refCount = __weakRefSource->DecrementStrongReference();
773  if (__refCount == 0)
774  {
775  if (__pUnkMarshal && __pUnkMarshal != reinterpret_cast<__abi_IUnknown*>(-1))
776  {
777  __pUnkMarshal->__abi_Release();
778  __pUnkMarshal = nullptr;
779  }
780 
781  // When destructing objects at the end of the program, we might be freeing
782  // objects across dlls, and the dll this object is in might have already freed its module object.
783  if (__abi_module != nullptr)
784  {
785  __abi_module->__abi_DecrementObjectCount();
786  }
787  }
788 
789  return __refCount;
790  }
__abi_Module * __abi_module
__abi_IUnknown *volatile __pUnkMarshal
Definition: vccorlib.h:707
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706
long __stdcall __abi_FTMWeakRefData::Get ( ) volatile
inline
807  {
808  if (__weakRefSource == nullptr)
809  {
810  return static_cast<unsigned long>(-1); // Called during destruction
811  }
812  return __weakRefSource->GetRefcount();
813  }
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706
__abi_FTMWeakRefData* __abi_FTMWeakRefData::GetFreeThreadedMarshaler ( )
inline
793  {
794  if (__pUnkMarshal == nullptr)
795  {
796  return nullptr;
797  }
798  return this;
799  }
__abi_IUnknown *volatile __pUnkMarshal
Definition: vccorlib.h:707
inline ::Platform::Details::IWeakReference __abi_FTMWeakRefData::GetWeakReference ( )
inline
802  {
803  return reinterpret_cast< ::Platform::Details::IWeakReference^>(__weakRefSource);
804  }
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706
unsigned long __stdcall __abi_FTMWeakRefData::Increment ( ) volatile
inline
756  {
757  if (__weakRefSource == nullptr || __weakRefSource->GetRefcount() < 0)
758  {
759  return static_cast<unsigned long>(-1); // Called during destruction
760  }
761 
762  return __weakRefSource->IncrementStrongReference();
763  }
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706
void __abi_FTMWeakRefData::ReleaseControlBlock ( )
inline
818  {
819  auto __localWeakRefSource = __weakRefSource;
820  __localWeakRefSource->ReleaseTarget();
821  __localWeakRefSource->__abi_Release();
822  }
::Platform::Details::ControlBlock * __weakRefSource
Definition: vccorlib.h:706

Member Data Documentation

__abi_IUnknown* volatile __abi_FTMWeakRefData::__pUnkMarshal
private
::Platform::Details::ControlBlock* __abi_FTMWeakRefData::__weakRefSource
private

The documentation for this class was generated from the following file: