KeePass   KeePass Help Center Home KeePass Home | Package Downloads | Flag Translations | Blocks Plugins | Donate Donate  
Home Help Center Home | People Forums | Award Awards | Link Links | Search Search  







SysDefEx.h File Reference
#include "SysSpec_Windows/SysSpecWin.h"

Go to the source code of this file.

Macros

#define UNREFERENCED_PARAMETER(p)   (void)0
 
#define DWORD_MAX   0xFFFFFFFF
 
#define UINT32_MAX   0xFFFFFFFF
 
#define UINT64_MAX   0xFFFFFFFFFFFFFFFFui64
 
#define UTF8_BYTE   BYTE
 
#define ROTL32UE(__uv, __nv)   ((((__uv) << (__nv)) | ((__uv) >> (32 - (__nv)))) & 0xFFFFFFFF)
 
#define SAFE_DELETE(__kp_p)   { if((__kp_p) != NULL) { delete (__kp_p); (__kp_p) = NULL; } }
 Delete the given object in the CRT of the caller. More...
 
#define SAFE_DELETE_ARRAY(__kp_p)   { if((__kp_p) != NULL) { delete [](__kp_p); (__kp_p) = NULL; } }
 Delete the given array/string in the CRT of the caller. More...
 
#define SAFE_RELEASE(__kp_p)   { if((__kp_p) != NULL) { (__kp_p)->Release(); (__kp_p) = NULL; } }
 Safely release a COM interface. More...
 
#define KP_DEFINE_GUID(__kp_name, __kp_l, __kp_w1, __kp_w2, __kp_b1, __kp_b2, __kp_b3, __kp_b4, __kp_b5, __kp_b6, __kp_b7, __kp_b8)
 
#define KP_DECLSPEC_UUID(__kp_uuid)
 
#define KP_DECLSPEC_NOVTABLE
 
#define KP_DECL_IUNKNOWN
 
#define KP_DECL_STDREFIMPL   ULONG __m_uInterfaceRefCount
 
#define KP_IMPL_STDREFIMPL(__kp_class_name)
 
#define KP_IMPL_STDREFIMPL_SUB(__kp_class_name, __kp_sub_name)
 
#define KP_IMPL_STDREFIMPL_NODELETE(__kp_class_name)
 
#define KP_IMPL_CONSTRUCT   { __m_uInterfaceRefCount = 1; }
 
#define KP_SUPPORT_INTERFACE(__kp_iid, __kp_int)
 
#define KP_ASSERT_REFS(__kp_comobj, __kp_refcnt)
 
#define KP_REQ_OUT_PTR(__kp_ppv)
 
#define KP_REQ_OUT_PTR_INIT(__kp_ppvx)
 
#define KP_QUERY_INTERFACE_RELEASE_LOCAL_RET(__kp_comobj, __kp_riid, __kp_ppvout)
 

Macro Definition Documentation

#define DWORD_MAX   0xFFFFFFFF
#define KP_ASSERT_REFS (   __kp_comobj,
  __kp_refcnt 
)
Value:
ASSERT((__kp_comobj).AddRef() \
> 0); ASSERT((__kp_comobj).Release() == (__kp_refcnt));
#define KP_DECL_IUNKNOWN
Value:
STDMETHODIMP QueryInterface(REFIID riid, void** ppvObject); \
STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release()
#define KP_DECL_STDREFIMPL   ULONG __m_uInterfaceRefCount
#define KP_DECLSPEC_NOVTABLE
#define KP_DECLSPEC_UUID (   __kp_uuid)
#define KP_DEFINE_GUID (   __kp_name,
  __kp_l,
  __kp_w1,
  __kp_w2,
  __kp_b1,
  __kp_b2,
  __kp_b3,
  __kp_b4,
  __kp_b5,
  __kp_b6,
  __kp_b7,
  __kp_b8 
)
Value:
EXTERN_C const GUID DECLSPEC_SELECTANY __kp_name \
= { __kp_l, __kp_w1, __kp_w2, { __kp_b1, __kp_b2, __kp_b3, __kp_b4, \
__kp_b5, __kp_b6, __kp_b7, __kp_b8 } }
#define KP_IMPL_CONSTRUCT   { __m_uInterfaceRefCount = 1; }
#define KP_IMPL_STDREFIMPL (   __kp_class_name)
Value:
STDMETHODIMP_(ULONG) \
__kp_class_name##::AddRef() { return ++__m_uInterfaceRefCount; } \
STDMETHODIMP_(ULONG) __kp_class_name##::Release() { \
ULONG __kp_ref = __m_uInterfaceRefCount; \
if(__m_uInterfaceRefCount != 0) { __kp_ref = --__m_uInterfaceRefCount; \
if(__m_uInterfaceRefCount == 0) delete this; } \
else { assert(false); } return __kp_ref; }
#define KP_IMPL_STDREFIMPL_NODELETE (   __kp_class_name)
Value:
STDMETHODIMP_(ULONG) \
__kp_class_name##::AddRef() { return ++__m_uInterfaceRefCount; } \
STDMETHODIMP_(ULONG) __kp_class_name##::Release() { \
if(__m_uInterfaceRefCount != 0) --__m_uInterfaceRefCount; \
else { assert(false); } return __m_uInterfaceRefCount; }
#define KP_IMPL_STDREFIMPL_SUB (   __kp_class_name,
  __kp_sub_name 
)
Value:
STDMETHODIMP_(ULONG) \
__kp_class_name##::AddRef() { return ++__m_uInterfaceRefCount; } \
STDMETHODIMP_(ULONG) __kp_class_name##::Release() { \
ULONG __kp_ref = __m_uInterfaceRefCount; \
if(__m_uInterfaceRefCount != 0) { __kp_ref = --__m_uInterfaceRefCount; \
if(__m_uInterfaceRefCount == 0) { SAFE_DELETE(__kp_sub_name); delete this; } } \
else { assert(false); } return __kp_ref; }
#define KP_QUERY_INTERFACE_RELEASE_LOCAL_RET (   __kp_comobj,
  __kp_riid,
  __kp_ppvout 
)
Value:
{ \
void* __kp_ip = NULL; if((__kp_comobj)->QueryInterface((__kp_riid), &__kp_ip) == \
S_OK) { *(__kp_ppvout) = __kp_ip; VERIFY((__kp_comobj)->Release() == 1); \
return S_OK; } else { VERIFY((__kp_comobj)->Release() == 0); return E_NOINTERFACE; } }
#define KP_REQ_OUT_PTR (   __kp_ppv)
Value:
{ if((__kp_ppv) == NULL) { assert(false); \
return E_POINTER; } }
#define KP_REQ_OUT_PTR_INIT (   __kp_ppvx)
Value:
{ KP_REQ_OUT_PTR(__kp_ppvx); \
*(__kp_ppvx) = NULL; }
#define KP_REQ_OUT_PTR(__kp_ppv)
Definition: SysDefEx.h:197
#define KP_SUPPORT_INTERFACE (   __kp_iid,
  __kp_int 
)
Value:
{ assert(__m_uInterfaceRefCount > 0); \
if(riid == __kp_iid) { __kp_int##* __kp_p = this; *ppvObject = __kp_p; \
this->AddRef(); return S_OK; } }
#define ROTL32UE (   __uv,
  __nv 
)    ((((__uv) << (__nv)) | ((__uv) >> (32 - (__nv)))) & 0xFFFFFFFF)
#define SAFE_DELETE (   __kp_p)    { if((__kp_p) != NULL) { delete (__kp_p); (__kp_p) = NULL; } }

Delete the given object in the CRT of the caller.

Plugins: you can use this macro to safely delete objects that you allocated with 'new', however do not use it to delete objects returned by KeePass interface methods! For this, use IKpAPI::DeleteObject instead.

#define SAFE_DELETE_ARRAY (   __kp_p)    { if((__kp_p) != NULL) { delete [](__kp_p); (__kp_p) = NULL; } }

Delete the given array/string in the CRT of the caller.

Plugins: you can use this macro to safely delete arrays/strings that you allocated with 'new', however do not use it to delete arrays/strings returned by KeePass interface methods! For this, use IKpAPI::DeleteArray instead.

#define SAFE_RELEASE (   __kp_p)    { if((__kp_p) != NULL) { (__kp_p)->Release(); (__kp_p) = NULL; } }

Safely release a COM interface.

If the given interface pointer is valid (i.e. non-NULL), the macro will call the COM Release method of the object and set the interface pointer to NULL.

#define UINT32_MAX   0xFFFFFFFF
#define UINT64_MAX   0xFFFFFFFFFFFFFFFFui64
#define UNREFERENCED_PARAMETER (   p)    (void)0
#define UTF8_BYTE   BYTE



Documentation generated with Doxygen.




Valid XHTML 1.0 Transitional Document

Get KeePass

Flattr this


KeePass is OSI Certified Open Source Software
Copyright © 2003-2014
Dominik Reichl, [Legal Contact / Imprint] [Disclaimer] [Acknowledgements] [Donate], Downloads hosted at

Get KeePass Password Safe at
SourceForge.net. Fast, secure and Free Open Source software downloads