|
||||
|
KeePass 2.x
Installation / Portability
Translations
Plugins
Compatibility / SxS
Application Policy
Auto-Type Obfuscation
Synchronization
Triggers
User Interface
Database Settings
Entry
Interface Options
Load/Save From/To URL
License
Features
Auto-Type
Command Line Options
Composite Master Key
Configuration
Field References
Import / Export
Integration
Multi-User
Password Generator
Placeholders
Repair Databases
Secure Edit Controls
Security
TAN Support
URL Field
Using Stored Passwords
Development
Customization (1.x)
Customization (2.x)
Scripting (2.x)
Creating Plugins (1.x)
Creating Plugins (2.x)
Key Providers (1.x)
Key Providers (2.x)
Support KeePass
Donate
|
SysDefEx.hGo to the documentation of this file.00001 /* 00002 Copyright (c) 2008-2013, Dominik Reichl 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions 00007 are met: 00008 00009 * Redistributions of source code must retain the above copyright 00010 notice, this list of conditions and the following disclaimer. 00011 * Redistributions in binary form must reproduce the above copyright 00012 notice, this list of conditions and the following disclaimer in 00013 the documentation and/or other materials provided with the 00014 distribution. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00017 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00018 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00019 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00020 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00022 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00023 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00024 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00025 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00026 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00027 POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00030 #ifndef ___SYS_DEF_EX_H___ 00031 #define ___SYS_DEF_EX_H___ 00032 00033 #pragma once 00034 00035 // The following types and functions must be implemented for each 00036 // supported platform: 00037 00038 // Types: 00039 // UINT8 -- 8-bit unsigned integer. 00040 // UINT16 -- 16-bit unsigned integer. 00041 // UINT32 -- 32-bit unsigned integer. 00042 // UINT64 -- 64-bit unsigned integer. 00043 // INT8 -- 8-bit unsigned integer. 00044 // INT16 -- 16-bit unsigned integer. 00045 // INT32 -- 32-bit unsigned integer. 00046 // INT64 -- 64-bit unsigned integer. 00047 00048 // Defines: 00049 // CPP_CLASS_SHARE -- Define to a keyword that imports or exports a C++ class. 00050 // CPP_FN_SHARE -- Define to a keyword that imports or exports a function 00051 // that uses C++ types (class in parameters, STL type). 00052 // C_FN_SHARE -- Define to a keyword that imports or exports a function. 00053 // KP_EXP -- Define to the opposite of C_FN_SHARE. 00054 // KP_API -- Define to a function call type (STDCALL / CDECL). 00055 00056 // Include all system-specific definitions 00057 #include "SysSpec_Windows/SysSpecWin.h" 00058 // #include "SysSpec/SysSpecLinux.h" 00059 #if defined _WIN32_WCE 00060 #include "wce_wrap.h" 00061 #endif 00062 00063 // Implications, standard macros and other definitions follow. 00064 00065 #ifndef UNREFERENCED_PARAMETER 00066 #define UNREFERENCED_PARAMETER(p) (void)0 00067 #endif 00068 00069 #ifndef DWORD_MAX 00070 #define DWORD_MAX 0xFFFFFFFF 00071 #endif 00072 00073 #ifndef UINT32_MAX 00074 #define UINT32_MAX 0xFFFFFFFF 00075 #endif 00076 00077 #ifndef UINT64_MAX 00078 #define UINT64_MAX 0xFFFFFFFFFFFFFFFFui64 00079 #endif 00080 00081 #ifndef UTF8_BYTE 00082 #define UTF8_BYTE BYTE 00083 #endif 00084 00085 #ifndef ROTL32UE 00086 #define ROTL32UE(__uv,__nv) ((((__uv) << (__nv)) | ((__uv) >> (32 - (__nv)))) & 0xFFFFFFFF) 00087 #endif 00088 00089 // Safely delete pointers 00090 #ifndef SAFE_DELETE 00095 #define SAFE_DELETE(__kp_p) { if((__kp_p) != NULL) { delete (__kp_p); (__kp_p) = NULL; } } 00096 00101 #define SAFE_DELETE_ARRAY(__kp_p) { if((__kp_p) != NULL) { delete [](__kp_p); (__kp_p) = NULL; } } 00102 00106 #define SAFE_RELEASE(__kp_p) { if((__kp_p) != NULL) { (__kp_p)->Release(); (__kp_p) = NULL; } } 00107 #endif 00108 00109 #ifndef KP_DEFINE_GUID 00110 #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) \ 00111 EXTERN_C const GUID DECLSPEC_SELECTANY __kp_name \ 00112 = { __kp_l, __kp_w1, __kp_w2, { __kp_b1, __kp_b2, __kp_b3, __kp_b4, \ 00113 __kp_b5, __kp_b6, __kp_b7, __kp_b8 } } 00114 #endif 00115 00116 #ifndef KP_DECLSPEC_UUID 00117 #if ((_MSC_VER >= 1100) && defined(__cplusplus)) 00118 #define KP_DECLSPEC_UUID(__kp_uuid) __declspec(uuid(__kp_uuid)) 00119 #else 00120 #define KP_DECLSPEC_UUID(__kp_uuid) 00121 #endif 00122 #endif 00123 00124 #ifndef KP_DECLSPEC_NOVTABLE 00125 #if ((_MSC_VER >= 1100) && defined(__cplusplus)) 00126 #define KP_DECLSPEC_NOVTABLE __declspec(novtable) 00127 #else 00128 #define KP_DECLSPEC_NOVTABLE 00129 #endif 00130 #endif 00131 00132 #ifndef KP_DECL_INTERFACE 00133 #define KP_DECL_INTERFACE(__kp_if_uuid) KP_DECLSPEC_UUID(__kp_if_uuid) KP_DECLSPEC_NOVTABLE 00134 #endif 00135 00136 #ifndef KP_DECL_IUNKNOWN 00137 #define KP_DECL_IUNKNOWN STDMETHODIMP QueryInterface(REFIID riid, void** ppvObject); \ 00138 STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release() 00139 #endif 00140 00141 #ifndef KP_DECL_STDREFIMPL 00142 #define KP_DECL_STDREFIMPL ULONG __m_uInterfaceRefCount 00143 #endif 00144 00145 #ifndef KP_IMPL_STDREFIMPL 00146 #define KP_IMPL_STDREFIMPL(__kp_class_name) STDMETHODIMP_(ULONG) \ 00147 __kp_class_name##::AddRef() { return ++__m_uInterfaceRefCount; } \ 00148 STDMETHODIMP_(ULONG) __kp_class_name##::Release() { \ 00149 ULONG __kp_ref = __m_uInterfaceRefCount; \ 00150 if(__m_uInterfaceRefCount != 0) { __kp_ref = --__m_uInterfaceRefCount; \ 00151 if(__m_uInterfaceRefCount == 0) delete this; } \ 00152 else { assert(false); } return __kp_ref; } 00153 #endif 00154 00155 #ifndef KP_IMPL_STDREFIMPL_SUB 00156 #define KP_IMPL_STDREFIMPL_SUB(__kp_class_name,__kp_sub_name) STDMETHODIMP_(ULONG) \ 00157 __kp_class_name##::AddRef() { return ++__m_uInterfaceRefCount; } \ 00158 STDMETHODIMP_(ULONG) __kp_class_name##::Release() { \ 00159 ULONG __kp_ref = __m_uInterfaceRefCount; \ 00160 if(__m_uInterfaceRefCount != 0) { __kp_ref = --__m_uInterfaceRefCount; \ 00161 if(__m_uInterfaceRefCount == 0) { SAFE_DELETE(__kp_sub_name); delete this; } } \ 00162 else { assert(false); } return __kp_ref; } 00163 #endif 00164 00165 #ifndef KP_IMPL_STDREFIMPL_NODELETE 00166 #define KP_IMPL_STDREFIMPL_NODELETE(__kp_class_name) STDMETHODIMP_(ULONG) \ 00167 __kp_class_name##::AddRef() { return ++__m_uInterfaceRefCount; } \ 00168 STDMETHODIMP_(ULONG) __kp_class_name##::Release() { \ 00169 if(__m_uInterfaceRefCount != 0) --__m_uInterfaceRefCount; \ 00170 else { assert(false); } return __m_uInterfaceRefCount; } 00171 #endif 00172 00173 #ifndef KP_IMPL_CONSTRUCT 00174 #define KP_IMPL_CONSTRUCT { __m_uInterfaceRefCount = 1; } 00175 #endif 00176 00177 #ifndef KP_SUPPORT_INTERFACE 00178 #define KP_SUPPORT_INTERFACE(__kp_iid,__kp_int) { assert(__m_uInterfaceRefCount > 0); \ 00179 if(riid == __kp_iid) { __kp_int##* __kp_p = this; *ppvObject = __kp_p; \ 00180 this->AddRef(); return S_OK; } } 00181 #endif 00182 00183 /* #ifndef KP_IMPL_SUPPORT_INTERFACES2 00184 #define KP_IMPL_SUPPORT_INTERFACES2(__kp_class,__kp_iid1,__kp_int1,__kp_iid2,__kp_int2) \ 00185 STDMETHODIMP __kp_class##::QueryInterface(REFIID riid, void** ppvObject) { \ 00186 KP_SUPPORT_INTERFACE(__kp_iid1, __kp_int1); \ 00187 KP_SUPPORT_INTERFACE(__kp_iid2, __kp_int2); \ 00188 *ppvObject = NULL; return E_NOINTERFACE; } 00189 #endif */ 00190 00191 #ifndef KP_ASSERT_REFS 00192 #define KP_ASSERT_REFS(__kp_comobj,__kp_refcnt) ASSERT((__kp_comobj).AddRef() \ 00193 > 0); ASSERT((__kp_comobj).Release() == (__kp_refcnt)); 00194 #endif 00195 00196 #ifndef KP_REQ_OUT_PTR 00197 #define KP_REQ_OUT_PTR(__kp_ppv) { if((__kp_ppv) == NULL) { assert(false); \ 00198 return E_POINTER; } } 00199 #endif 00200 00201 #ifndef KP_REQ_OUT_PTR_INIT 00202 #define KP_REQ_OUT_PTR_INIT(__kp_ppvx) { KP_REQ_OUT_PTR(__kp_ppvx); \ 00203 *(__kp_ppvx) = NULL; } 00204 #endif 00205 00206 // For use in CreateInstanceEx: 00207 #ifndef KP_QUERY_INTERFACE_RELEASE_LOCAL_RET 00208 #define KP_QUERY_INTERFACE_RELEASE_LOCAL_RET(__kp_comobj,__kp_riid,__kp_ppvout) { \ 00209 void* __kp_ip = NULL; if((__kp_comobj)->QueryInterface((__kp_riid), &__kp_ip) == \ 00210 S_OK) { *(__kp_ppvout) = __kp_ip; VERIFY((__kp_comobj)->Release() == 1); \ 00211 return S_OK; } else { VERIFY((__kp_comobj)->Release() == 0); return E_NOINTERFACE; } } 00212 #endif 00213 00214 #endif // ___SYS_DEF_EX_H___ Documentation generated with
Doxygen.
|
![]()
|
||
KeePass is OSI Certified Open Source Software Copyright © 2003-2013 Dominik Reichl, [Legal Contact / Imprint] [Disclaimer] [Acknowledgements] [Donate], Downloads hosted at |
||||
KeePass Help Center
KeePass Home
Downloads
Translations
Plugins
Donate
Help Center Home
Forums
Awards
Links
Search
