From 5519358291c813cdce57aa2ed16dc61d7abbf037 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 20 May 2016 16:09:33 +0200 Subject: [PATCH] - Code reorganized to move virtual methods and constructors to cpp - winstd::bstr and winstd::variant helpers introduced --- build/WinStd.vcxproj | 4 + build/WinStd.vcxproj.filters | 12 ++ include/WinStd/Base64.h | Bin 14624 -> 14548 bytes include/WinStd/COM.h | Bin 6132 -> 40676 bytes include/WinStd/Crypt.h | Bin 45408 -> 42802 bytes include/WinStd/EAP.h | Bin 3210 -> 2840 bytes include/WinStd/ETW.h | Bin 24884 -> 22130 bytes include/WinStd/Win.h | Bin 64326 -> 63806 bytes src/Base64.cpp | Bin 6266 -> 6478 bytes src/COM.cpp | 234 +++++++++++++++++++++++++++++++++++ src/Crypt.cpp | 149 ++++++++++++++++++++++ src/EAP.cpp | 40 ++++++ src/ETW.cpp | Bin 1992 -> 6054 bytes src/Win.cpp | 55 ++++++++ 14 files changed, 494 insertions(+) create mode 100644 src/COM.cpp create mode 100644 src/Crypt.cpp create mode 100644 src/EAP.cpp create mode 100644 src/Win.cpp diff --git a/build/WinStd.vcxproj b/build/WinStd.vcxproj index 56794eb2..06469be9 100644 --- a/build/WinStd.vcxproj +++ b/build/WinStd.vcxproj @@ -73,6 +73,9 @@ + + + Create @@ -80,6 +83,7 @@ Create Create + diff --git a/build/WinStd.vcxproj.filters b/build/WinStd.vcxproj.filters index 8b8ee4be..1509d93f 100644 --- a/build/WinStd.vcxproj.filters +++ b/build/WinStd.vcxproj.filters @@ -20,6 +20,18 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + diff --git a/include/WinStd/Base64.h b/include/WinStd/Base64.h index 8bfdb5b4dbc69e8c9f27f20e2ef85a65465a7153..2fc60edb86a5207f05b56d638f81d09e6f0c35ab 100644 GIT binary patch delta 33 pcmZ2bbfs`Z233k7nT)KdCEIb+GoaiKW#R&%#xH<$4S0l zzf{}zuv`JS!+|{Bk#}k}8k^D)2P}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1Cm_t Oa81sU{gZl%cqoNSY=xYKyc7%~}(7)lsQ84?+CCeP)TWVD_f%wrA! DJ17iv delta 275 zcmbOs)+MjP2CTFb!8zy&gU zasa2&^ zLWOJ?!74ZZ6X#=v3JFcNkd1)~r^(G?hBBWieUpbWdz=lJCo6ceO;!`J+T7zjk8$!H SIlj$G-d7lbhI{+J6a)Z@r!Ob~ delta 1082 zcmb_bO-~b16unKUDRgWdI$h;W7x5G0gP)y{0063W1>q|E?hR=H-3mb|9Dp7{W|wedcb3a@BHxF4lQ6me90*s zJ<{U_x-Cz_9~#Gp2|rrF6VN95VU|y!IiTQCNKp-j5fo|+bC(Q;ve~xrc|Z@O4lNqN z+0sexD%D^YB8M1}23472okltQEX`Aan^-e_^_kO>&wJVwG*rUTztDI{D-89&X)HSX z;h?WgqaO!@w}k9CT{eUQy@G9B$c*i4NqkIBI?p3pUiS(M=DR~nRK?9<6)#PNW%Hvi zsz6F<_@rCTa_n2Yjn?X}>uk@trv{bj z9^L0utZ*u3sDf9zp6L!@h95J{X|!qCRno;c*BwTIql-UP6YW$qS!JPu}3kHaWn7 zXENU>t;w^FX-pQ-T!DW5Qyl(}f2UXYg#}0RTv42Soq? diff --git a/src/COM.cpp b/src/COM.cpp new file mode 100644 index 00000000..47072d96 --- /dev/null +++ b/src/COM.cpp @@ -0,0 +1,234 @@ +/* + Copyright 1991-2016 Amebis + Copyright 2016 GÉANT + + This file is part of WinStd. + + Setup is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Setup is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Setup. If not, see . +*/ + +#include "StdAfx.h" + + +////////////////////////////////////////////////////////////////////// +// winstd::bstr +////////////////////////////////////////////////////////////////////// + +winstd::bstr::bstr() : handle() +{ +} + + +winstd::bstr::bstr(_In_ LPCOLESTR src) : handle(SysAllocString(src)) +{ +} + + +winstd::bstr::bstr(_In_ LPCOLESTR src, _In_ UINT len) : handle(SysAllocStringLen(src, len)) +{ +} + + +winstd::bstr::~bstr() +{ + if (m_h) + SysFreeString(m_h); +} + + +void winstd::bstr::free_internal() +{ + SysFreeString(m_h); +} + + +winstd::bstr::handle_type winstd::bstr::duplicate_internal(_In_ handle_type h) const +{ + return SysAllocStringLen(h, SysStringLen(h)); +} + + +////////////////////////////////////////////////////////////////////// +// winstd::variant +////////////////////////////////////////////////////////////////////// + +winstd::variant::variant() +{ + VariantInit(this); +} + + +winstd::variant::variant(_In_ const VARIANT& varSrc) +{ + vt = VT_EMPTY; + VariantCopy(this, &varSrc); +} + + +winstd::variant::variant(_In_ bool bSrc) +{ + vt = VT_BOOL; + boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE; +} + + +winstd::variant::variant(_In_ char cSrc) +{ + vt = VT_I1; + cVal = cSrc; +} + + +winstd::variant::variant(_In_ unsigned char nSrc) +{ + vt = VT_UI1; + bVal = nSrc; +} + + +winstd::variant::variant(_In_ short nSrc) +{ + vt = VT_I2; + iVal = nSrc; +} + + +winstd::variant::variant(_In_ unsigned short nSrc) +{ + vt = VT_UI2; + uiVal = nSrc; +} + + +winstd::variant::variant(_In_ int nSrc, _In_ VARTYPE vtSrc) +{ + assert(vtSrc == VT_I4 || vtSrc == VT_INT); + vt = vtSrc; + intVal = nSrc; +} + + +winstd::variant::variant(_In_ unsigned int nSrc, _In_ VARTYPE vtSrc) +{ + assert(vtSrc == VT_UI4 || vtSrc == VT_UINT); + vt = vtSrc; + uintVal= nSrc; +} + + +winstd::variant::variant(_In_ long nSrc, _In_ VARTYPE vtSrc) +{ + assert(vtSrc == VT_I4 || vtSrc == VT_ERROR); + vt = vtSrc; + lVal = nSrc; +} + + +winstd::variant::variant(_In_ unsigned long nSrc) +{ + vt = VT_UI4; + ulVal = nSrc; +} + + +winstd::variant::variant(_In_ float fltSrc) +{ + vt = VT_R4; + fltVal = fltSrc; +} + + +winstd::variant::variant(_In_ double dblSrc, _In_ VARTYPE vtSrc) +{ + assert(vtSrc == VT_R8 || vtSrc == VT_DATE); + vt = vtSrc; + dblVal = dblSrc; +} + + +winstd::variant::variant(_In_ long long nSrc) +{ + vt = VT_I8; + llVal = nSrc; +} + + +winstd::variant::variant(_In_ unsigned long long nSrc) +{ + vt = VT_UI8; + ullVal = nSrc; +} + + +winstd::variant::variant(_In_ CY cySrc) +{ + vt = VT_CY; + cyVal.Hi = cySrc.Hi; + cyVal.Lo = cySrc.Lo; +} + + +winstd::variant::variant(_In_z_ LPCOLESTR lpszSrc) +{ + vt = VT_EMPTY; + *this = lpszSrc; +} + + +winstd::variant::variant(_In_z_ BSTR bstr) +{ + vt = VT_EMPTY; + *this = bstr; +} + + +winstd::variant::variant(_In_opt_ IDispatch* pSrc) +{ + vt = VT_DISPATCH; + pdispVal = pSrc; + + if (pdispVal != NULL) + pdispVal->AddRef(); +} + + +winstd::variant::variant(_In_opt_ IUnknown* pSrc) +{ + vt = VT_UNKNOWN; + punkVal = pSrc; + + if (punkVal != NULL) + punkVal->AddRef(); +} + + +winstd::variant::variant(_In_ const SAFEARRAY *pSrc) +{ + assert(pSrc != NULL); + + LPSAFEARRAY pCopy; + HRESULT hRes = SafeArrayCopy((LPSAFEARRAY)pSrc, &pCopy); + if (SUCCEEDED(hRes)) { + SafeArrayGetVartype((LPSAFEARRAY)pSrc, &vt); + vt |= VT_ARRAY; + parray = pCopy; + } else + assert(0); +} + + +winstd::variant::~variant() +{ + VariantClear(this); +} diff --git a/src/Crypt.cpp b/src/Crypt.cpp new file mode 100644 index 00000000..fe1ecc20 --- /dev/null +++ b/src/Crypt.cpp @@ -0,0 +1,149 @@ +/* + Copyright 1991-2016 Amebis + Copyright 2016 GÉANT + + This file is part of WinStd. + + Setup is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Setup is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Setup. If not, see . +*/ + +#include "StdAfx.h" + + +////////////////////////////////////////////////////////////////////// +// winstd::cert_context +////////////////////////////////////////////////////////////////////// + +winstd::cert_context::~cert_context() +{ + if (m_h) + CertFreeCertificateContext(m_h); +} + + +void winstd::cert_context::free_internal() +{ + CertFreeCertificateContext(m_h); +} + + +winstd::cert_context::handle_type winstd::cert_context::duplicate_internal(_In_ handle_type h) const +{ + return CertDuplicateCertificateContext(h); +} + + +////////////////////////////////////////////////////////////////////// +// winstd::cert_chain_context +////////////////////////////////////////////////////////////////////// + +winstd::cert_chain_context::~cert_chain_context() +{ + if (m_h) + CertFreeCertificateChain(m_h); +} + + +void winstd::cert_chain_context::free_internal() +{ + CertFreeCertificateChain(m_h); +} + + +winstd::cert_chain_context::handle_type winstd::cert_chain_context::duplicate_internal(_In_ handle_type h) const +{ + return CertDuplicateCertificateChain(h); +} + + +////////////////////////////////////////////////////////////////////// +// winstd::cert_store +////////////////////////////////////////////////////////////////////// + +winstd::cert_store::~cert_store() +{ + if (m_h) + CertCloseStore(m_h, 0); +} + + +void winstd::cert_store::free_internal() +{ + CertCloseStore(m_h, 0); +} + + +////////////////////////////////////////////////////////////////////// +// winstd::crypt_prov +////////////////////////////////////////////////////////////////////// + +winstd::crypt_prov::~crypt_prov() +{ + if (m_h) + CryptReleaseContext(m_h, 0); +} + + +void winstd::crypt_prov::free_internal() +{ + CryptReleaseContext(m_h, 0); +} + + +////////////////////////////////////////////////////////////////////// +// winstd::crypt_hash +////////////////////////////////////////////////////////////////////// + +winstd::crypt_hash::~crypt_hash() +{ + if (m_h) + CryptDestroyHash(m_h); +} + + +void winstd::crypt_hash::free_internal() +{ + CryptDestroyHash(m_h); +} + + +winstd::crypt_hash::handle_type winstd::crypt_hash::duplicate_internal(_In_ handle_type h) const +{ + handle_type hNew = NULL; + return CryptDuplicateHash(h, NULL, 0, &hNew) ? hNew : NULL; +} + + +////////////////////////////////////////////////////////////////////// +// winstd::crypt_key +////////////////////////////////////////////////////////////////////// + +winstd::crypt_key::~crypt_key() +{ + if (m_h) + CryptDestroyKey(m_h); +} + + +void winstd::crypt_key::free_internal() +{ + CryptDestroyKey(m_h); +} + + +winstd::crypt_key::handle_type winstd::crypt_key::duplicate_internal(_In_ handle_type h) const +{ + handle_type hNew = NULL; + return CryptDuplicateKey(h, NULL, 0, &hNew) ? hNew : NULL; +} diff --git a/src/EAP.cpp b/src/EAP.cpp new file mode 100644 index 00000000..40a57333 --- /dev/null +++ b/src/EAP.cpp @@ -0,0 +1,40 @@ +/* + Copyright 1991-2016 Amebis + Copyright 2016 GÉANT + + This file is part of WinStd. + + Setup is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Setup is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Setup. If not, see . +*/ + +#include "StdAfx.h" + + +////////////////////////////////////////////////////////////////////// +// winstd::eap_attr +////////////////////////////////////////////////////////////////////// + +winstd::eap_attr::eap_attr() +{ + eaType = eatReserved; + dwLength = 0; + pValue = NULL; +} + + +winstd::eap_attr::~eap_attr() +{ + if (pValue) + delete pValue; +} diff --git a/src/ETW.cpp b/src/ETW.cpp index 424fa348c84353b76712bf57a7f130f3258d0f4e..8c915661b5904714e974b38e02d492e11f49ad61 100644 GIT binary patch literal 6054 zcmeI0TTdHD6vxkVrGAGMeKEA*(n^(@rmd*K1l0)$Ln59m8w|E;jAbt&v}(U!zf{}b z|ICheZEp;T(~5^^1T#B6b1wgLnae+aZ`hiBZl76_wW?j)(C%zxJ-f87rOa>HceE{g zVqe=P{kP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pp b/src/Win.cpp new file mode 100644 index 00000000..67b37b0c --- /dev/null +++ b/src/Win.cpp @@ -0,0 +1,55 @@ +/* + Copyright 1991-2016 Amebis + Copyright 2016 GÉANT + + This file is part of WinStd. + + Setup is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Setup is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Setup. If not, see . +*/ + +#include "StdAfx.h" + + +////////////////////////////////////////////////////////////////////// +// winstd::library +////////////////////////////////////////////////////////////////////// + +winstd::library::~library() +{ + if (m_h) + FreeLibrary(m_h); +} + + +void winstd::library::free_internal() +{ + FreeLibrary(m_h); +} + + +////////////////////////////////////////////////////////////////////// +// winstd::heap +////////////////////////////////////////////////////////////////////// + +winstd::heap::~heap() +{ + if (m_h) + HeapDestroy(m_h); +} + + +void winstd::heap::free_internal() +{ + HeapDestroy(m_h); +}