From 51b262b38223fbce3b9b43812ad0ff5ef88bdeb4 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 30 Mar 2021 11:59:18 +0200 Subject: [PATCH] Cleanup WINSTD_API and WINSTD_NOVTABLE WINSTD_API: the WinStd is never compiled as DLL any more. No public function or class needs __declspec(dllexport)/__declspec(dllimport) any more. WINSTD_NOVTABLE: inlined Signed-off-by: Simon Rozman --- include/WinStd/Base64.h | 8 ++--- include/WinStd/COM.h | 20 ++++++------- include/WinStd/Common.h | 34 ++++----------------- include/WinStd/Crypt.h | 28 +++++++++--------- include/WinStd/EAP.h | 44 +++++++++++++-------------- include/WinStd/ETW.h | 28 +++++++++--------- include/WinStd/Hex.h | 8 ++--- include/WinStd/Sec.h | 16 +++++----- include/WinStd/SetupAPI.h | 8 ++--- include/WinStd/WLAN.h | 4 +-- include/WinStd/Win.h | 62 +++++++++++++++++++-------------------- include/WinStd/WinSock2.h | 8 ++--- include/WinStd/WinTrust.h | 4 +-- src/Win.cpp | 4 +-- 14 files changed, 127 insertions(+), 149 deletions(-) diff --git a/include/WinStd/Base64.h b/include/WinStd/Base64.h index 64d92e8f..9728dcbf 100644 --- a/include/WinStd/Base64.h +++ b/include/WinStd/Base64.h @@ -30,8 +30,8 @@ namespace winstd { - class WINSTD_API base64_enc; - class WINSTD_API base64_dec; + class base64_enc; + class base64_dec; } #pragma once @@ -45,7 +45,7 @@ namespace winstd /// /// Base64 encoding session /// - class WINSTD_API base64_enc + class base64_enc { public: /// @@ -176,7 +176,7 @@ namespace winstd /// /// Base64 decoding session /// - class WINSTD_API base64_dec + class base64_dec { public: /// diff --git a/include/WinStd/COM.h b/include/WinStd/COM.h index 071b77ed..2f3423ab 100644 --- a/include/WinStd/COM.h +++ b/include/WinStd/COM.h @@ -29,12 +29,12 @@ namespace winstd { - class WINSTD_API com_runtime_error; - struct WINSTD_API CoTaskMemFree_delete; + class com_runtime_error; + struct CoTaskMemFree_delete; template class com_obj; - class WINSTD_API bstr; - class WINSTD_API variant; - class WINSTD_API com_initializer; + class bstr; + class variant; + class com_initializer; } #pragma once @@ -55,7 +55,7 @@ namespace winstd /// /// \note Must be defined as derived class from num_runtime_error<> to allow correct type info for dynamic typecasting and prevent folding with other derivates of num_runtime_error<>. /// - class WINSTD_API com_runtime_error : public num_runtime_error + class com_runtime_error : public num_runtime_error { public: /// @@ -87,7 +87,7 @@ namespace winstd /// /// Deleter for unique_ptr using CoTaskMemFree /// - struct WINSTD_API CoTaskMemFree_delete + struct CoTaskMemFree_delete { /// /// Default constructor @@ -238,7 +238,7 @@ namespace winstd /// /// BSTR string wrapper /// - class WINSTD_API bstr : public dplhandle + class bstr : public dplhandle { DPLHANDLE_IMPL(bstr, NULL) @@ -311,7 +311,7 @@ namespace winstd /// #pragma warning(push) #pragma warning(disable: 26432) // Copy constructor and assignment operator are also present, but not detected by code analysis as they are using base type source object reference. - class WINSTD_API variant : public VARIANT + class variant : public VARIANT { public: /// @@ -1062,7 +1062,7 @@ namespace winstd /// /// Context scope automatic COM (un)initialization /// - class WINSTD_API com_initializer + class com_initializer { WINSTD_NONCOPYABLE(com_initializer) WINSTD_NONMOVABLE(com_initializer) diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index 8e9cd5d1..75db96f0 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -54,28 +54,6 @@ /// \addtogroup WinStdGeneral /// @{ -/// -/// Public function calling convention -/// -#ifndef WINSTD_API -#if defined(WINSTD_DLL) -#define WINSTD_API __declspec(dllexport) -#elif defined(WINSTD_DLLIMP) -#define WINSTD_API __declspec(dllimport) -#else -#define WINSTD_API -#endif -#endif - -/// -/// Class/struct with no virtual table declaration -/// -/// Use for storing flat data. -/// -/// This macro bypasses Doxygen limitation to parse class/struct declarations with parentheses. -/// -#define WINSTD_NOVTABLE __declspec(novtable) - /// /// "L" stringizing macro /// @@ -222,7 +200,7 @@ namespace winstd template class dplhandle; template class vector_queue; template class num_runtime_error; - class WINSTD_API win_runtime_error; + class win_runtime_error; /// \addtogroup WinStdGeneral /// @{ @@ -296,8 +274,8 @@ namespace winstd template, class _Ax = std::allocator<_Elem> > class basic_string_guid; - class WINSTD_API string_guid; - class WINSTD_API wstring_guid; + class string_guid; + class wstring_guid; /// /// Multi-byte / Wide-character string GUID (according to _UNICODE) @@ -1561,7 +1539,7 @@ namespace winstd /// /// Windows runtime error /// - class WINSTD_API win_runtime_error : public num_runtime_error + class win_runtime_error : public num_runtime_error { public: /// @@ -1839,7 +1817,7 @@ namespace winstd /// /// Single-byte character implementation of a class to support converting GUID to string /// - class WINSTD_API string_guid : public basic_string_guid, std::allocator > + class string_guid : public basic_string_guid, std::allocator > { public: /// \name Initializing string using template in memory @@ -1862,7 +1840,7 @@ namespace winstd /// /// Wide character implementation of a class to support converting GUID to string /// - class WINSTD_API wstring_guid : public basic_string_guid, std::allocator > + class wstring_guid : public basic_string_guid, std::allocator > { public: /// \name Initializing string using template in memory diff --git a/include/WinStd/Crypt.h b/include/WinStd/Crypt.h index 20c05d5a..941d9773 100644 --- a/include/WinStd/Crypt.h +++ b/include/WinStd/Crypt.h @@ -32,13 +32,13 @@ namespace winstd { - class WINSTD_API cert_context; - class WINSTD_API cert_chain_context; - class WINSTD_API cert_store; - class WINSTD_API crypt_prov; - class WINSTD_API crypt_hash; - class WINSTD_API crypt_key; - class WINSTD_API data_blob; + class cert_context; + class cert_chain_context; + class cert_store; + class crypt_prov; + class crypt_hash; + class crypt_key; + class data_blob; } /// \addtogroup WinStdCryptoAPI @@ -120,7 +120,7 @@ namespace winstd /// /// PCCERT_CONTEXT wrapper class /// - class WINSTD_API cert_context : public dplhandle + class cert_context : public dplhandle { DPLHANDLE_IMPL(cert_context, NULL) @@ -260,7 +260,7 @@ namespace winstd /// /// PCCERT_CHAIN_CONTEXT wrapper class /// - class WINSTD_API cert_chain_context : public dplhandle + class cert_chain_context : public dplhandle { DPLHANDLE_IMPL(cert_chain_context, NULL) @@ -315,7 +315,7 @@ namespace winstd /// /// HCERTSTORE wrapper class /// - class WINSTD_API cert_store : public handle + class cert_store : public handle { HANDLE_IMPL(cert_store, NULL) @@ -378,7 +378,7 @@ namespace winstd /// /// HCRYPTPROV wrapper class /// - class WINSTD_API crypt_prov : public handle + class crypt_prov : public handle { HANDLE_IMPL(crypt_prov, NULL) @@ -422,7 +422,7 @@ namespace winstd /// /// HCRYPTHASH wrapper class /// - class WINSTD_API crypt_hash : public dplhandle + class crypt_hash : public dplhandle { DPLHANDLE_IMPL(crypt_hash, NULL) @@ -477,7 +477,7 @@ namespace winstd /// /// HCRYPTKEY wrapper class /// - class WINSTD_API crypt_key : public dplhandle + class crypt_key : public dplhandle { DPLHANDLE_IMPL(crypt_key, NULL) @@ -584,7 +584,7 @@ namespace winstd /// #pragma warning(push) #pragma warning(disable: 26432) // Copy constructor and assignment operator are also present, but not detected by code analysis as they are using base type source object reference. - class WINSTD_API data_blob : public DATA_BLOB + class data_blob : public DATA_BLOB { public: /// diff --git a/include/WinStd/EAP.h b/include/WinStd/EAP.h index 727d2c7e..e9eed9d3 100644 --- a/include/WinStd/EAP.h +++ b/include/WinStd/EAP.h @@ -34,15 +34,15 @@ namespace winstd { enum class eap_type_t : unsigned char; - struct WINSTD_API EapHostPeerFreeMemory_delete; - struct WINSTD_API EapHostPeerFreeRuntimeMemory_delete; - struct WINSTD_API EapHostPeerFreeErrorMemory_delete; - struct WINSTD_API EapHostPeerFreeEapError_delete; - class WINSTD_API WINSTD_NOVTABLE eap_attr; - class WINSTD_API WINSTD_NOVTABLE eap_method_prop; - class WINSTD_API eap_packet; - class WINSTD_API WINSTD_NOVTABLE eap_method_info_array; - class WINSTD_API eap_runtime_error; + struct EapHostPeerFreeMemory_delete; + struct EapHostPeerFreeRuntimeMemory_delete; + struct EapHostPeerFreeErrorMemory_delete; + struct EapHostPeerFreeEapError_delete; + class __declspec(novtable) eap_attr; + class __declspec(novtable) eap_method_prop; + class eap_packet; + class __declspec(novtable) eap_method_info_array; + class eap_runtime_error; /// \addtogroup WinStdEAPAPI /// @{ @@ -50,22 +50,22 @@ namespace winstd /// /// EapHost BLOB wrapper class /// - typedef std::unique_ptr WINSTD_API eap_blob; + typedef std::unique_ptr eap_blob; /// /// EapHost BLOB wrapper class /// - typedef std::unique_ptr WINSTD_API eap_blob_runtime; + typedef std::unique_ptr eap_blob_runtime; /// /// EAP_ERROR wrapper class /// - typedef std::unique_ptr WINSTD_API eap_error; + typedef std::unique_ptr eap_error; /// /// EAP_ERROR wrapper class /// - typedef std::unique_ptr WINSTD_API eap_error_runtime; + typedef std::unique_ptr eap_error_runtime; /// @} } @@ -150,7 +150,7 @@ namespace winstd /// /// Deleter for unique_ptr using EapHostPeerFreeMemory /// - struct WINSTD_API EapHostPeerFreeMemory_delete + struct EapHostPeerFreeMemory_delete { /// /// Default constructor @@ -173,7 +173,7 @@ namespace winstd /// /// Deleter for unique_ptr using EapHostPeerFreeRuntimeMemory /// - struct WINSTD_API EapHostPeerFreeRuntimeMemory_delete + struct EapHostPeerFreeRuntimeMemory_delete { /// /// Default constructor @@ -194,7 +194,7 @@ namespace winstd /// /// Deleter for unique_ptr to EAP_ERROR using EapHostPeerFreeErrorMemory /// - struct WINSTD_API EapHostPeerFreeErrorMemory_delete + struct EapHostPeerFreeErrorMemory_delete { /// /// Default constructor @@ -216,7 +216,7 @@ namespace winstd /// /// Deleter for unique_ptr to EAP_ERROR using EapHostPeerFreeEapError /// - struct WINSTD_API EapHostPeerFreeEapError_delete + struct EapHostPeerFreeEapError_delete { /// /// Default constructor @@ -240,7 +240,7 @@ namespace winstd /// #pragma warning(push) #pragma warning(disable: 26432) // Copy constructor and assignment operator are also present, but not detected by code analysis as they are using base type source object reference. - class WINSTD_API WINSTD_NOVTABLE eap_attr : public EAP_ATTRIBUTE + class __declspec(novtable) eap_attr : public EAP_ATTRIBUTE { public: /// @@ -349,7 +349,7 @@ namespace winstd /// /// EAP_METHOD_PROPERTY wrapper class /// - class WINSTD_API WINSTD_NOVTABLE eap_method_prop : public EAP_METHOD_PROPERTY + class __declspec(novtable) eap_method_prop : public EAP_METHOD_PROPERTY { public: /// @@ -401,7 +401,7 @@ namespace winstd /// /// EapPacket wrapper class /// - class WINSTD_API eap_packet : public dplhandle + class eap_packet : public dplhandle { DPLHANDLE_IMPL(eap_packet, NULL) @@ -469,7 +469,7 @@ namespace winstd /// /// EAP_METHOD_INFO_ARRAY wrapper class /// - class WINSTD_API WINSTD_NOVTABLE eap_method_info_array : public EAP_METHOD_INFO_ARRAY + class __declspec(novtable) eap_method_info_array : public EAP_METHOD_INFO_ARRAY { WINSTD_NONCOPYABLE(eap_method_info_array) @@ -539,7 +539,7 @@ namespace winstd /// /// \sa [EAP_ERROR structure](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363699.aspx) /// - class WINSTD_API eap_runtime_error : public win_runtime_error + class eap_runtime_error : public win_runtime_error { public: /// diff --git a/include/WinStd/ETW.h b/include/WinStd/ETW.h index d6bd3e47..2950729f 100644 --- a/include/WinStd/ETW.h +++ b/include/WinStd/ETW.h @@ -37,13 +37,13 @@ namespace winstd { - class WINSTD_API WINSTD_NOVTABLE event_data; - class WINSTD_API WINSTD_NOVTABLE event_rec; - class WINSTD_API event_provider; - class WINSTD_API event_session; - class WINSTD_API event_trace; - class WINSTD_API event_trace_enabler; - class WINSTD_API event_fn_auto; + class __declspec(novtable) event_data; + class __declspec(novtable) event_rec; + class event_provider; + class event_session; + class event_trace; + class event_trace_enabler; + class event_fn_auto; template class event_fn_auto_ret; } @@ -84,7 +84,7 @@ namespace winstd /// /// EVENT_DATA_DESCRIPTOR wrapper /// - class WINSTD_API WINSTD_NOVTABLE event_data : public EVENT_DATA_DESCRIPTOR + class __declspec(novtable) event_data : public EVENT_DATA_DESCRIPTOR { public: /// @@ -276,7 +276,7 @@ namespace winstd /// /// EVENT_RECORD wrapper /// - class WINSTD_API WINSTD_NOVTABLE event_rec : public EVENT_RECORD + class __declspec(novtable) event_rec : public EVENT_RECORD { public: /// @@ -418,7 +418,7 @@ namespace winstd /// /// ETW event provider /// - class WINSTD_API event_provider : public handle + class event_provider : public handle { HANDLE_IMPL(event_provider, NULL) @@ -636,7 +636,7 @@ namespace winstd /// /// ETW session /// - class WINSTD_API event_session : public handle + class event_session : public handle { WINSTD_NONCOPYABLE(event_session) @@ -823,7 +823,7 @@ namespace winstd /// /// ETW trace /// - class WINSTD_API event_trace : public handle + class event_trace : public handle { HANDLE_IMPL(event_trace, INVALID_PROCESSTRACE_HANDLE) @@ -868,7 +868,7 @@ namespace winstd /// /// Helper class to enable event provider in constructor and disables it in destructor /// - class WINSTD_API event_trace_enabler + class event_trace_enabler { public: /// @@ -978,7 +978,7 @@ namespace winstd /// /// It writes one string event at creation and another at destruction. /// - class WINSTD_API event_fn_auto + class event_fn_auto { public: /// diff --git a/include/WinStd/Hex.h b/include/WinStd/Hex.h index 8367d884..f6a8e7e4 100644 --- a/include/WinStd/Hex.h +++ b/include/WinStd/Hex.h @@ -30,8 +30,8 @@ namespace winstd { - class WINSTD_API hex_enc; - class WINSTD_API hex_dec; + class hex_enc; + class hex_dec; } #pragma once @@ -45,7 +45,7 @@ namespace winstd /// /// Hexadecimal encoding session /// - class WINSTD_API hex_enc + class hex_enc { public: /// @@ -101,7 +101,7 @@ namespace winstd /// /// Hexadecimal decoding session /// - class WINSTD_API hex_dec + class hex_dec { public: /// diff --git a/include/WinStd/Sec.h b/include/WinStd/Sec.h index 368f99bb..e18e4529 100644 --- a/include/WinStd/Sec.h +++ b/include/WinStd/Sec.h @@ -31,10 +31,10 @@ namespace winstd { - class WINSTD_API sec_credentials; - class WINSTD_API sec_context; - class WINSTD_API sec_buffer_desc; - class WINSTD_API sec_runtime_error; + class sec_credentials; + class sec_context; + class sec_buffer_desc; + class sec_runtime_error; } /// \addtogroup WinStdSecurityAPI @@ -63,7 +63,7 @@ namespace winstd /// /// PCredHandle wrapper class /// - class WINSTD_API sec_credentials : public handle + class sec_credentials : public handle { WINSTD_NONCOPYABLE(sec_credentials) @@ -165,7 +165,7 @@ namespace winstd /// /// PCtxtHandle wrapper class /// - class WINSTD_API sec_context : public handle + class sec_context : public handle { public: /// @@ -281,7 +281,7 @@ namespace winstd /// /// SecBufferDesc wrapper class /// - class WINSTD_API sec_buffer_desc : public SecBufferDesc + class sec_buffer_desc : public SecBufferDesc { public: /// @@ -315,7 +315,7 @@ namespace winstd /// /// \note Must be defined as derived class from num_runtime_error<> to allow correct type info for dynamic typecasting and prevent folding with other derivates of num_runtime_error<>. /// - class WINSTD_API sec_runtime_error : public num_runtime_error + class sec_runtime_error : public num_runtime_error { public: /// diff --git a/include/WinStd/SetupAPI.h b/include/WinStd/SetupAPI.h index 53334a4a..ad7ad50f 100644 --- a/include/WinStd/SetupAPI.h +++ b/include/WinStd/SetupAPI.h @@ -27,8 +27,8 @@ namespace winstd { - class WINSTD_API setup_device_info_list; - class WINSTD_API setup_driver_info_list_builder; + class setup_device_info_list; + class setup_driver_info_list_builder; } @@ -45,7 +45,7 @@ namespace winstd /// /// HDEVINFO wrapper class /// - class WINSTD_API setup_device_info_list : public handle + class setup_device_info_list : public handle { HANDLE_IMPL(setup_device_info_list, INVALID_HANDLE_VALUE) @@ -119,7 +119,7 @@ namespace winstd /// /// Builds a list of drivers in constructor and deletes it in destructor /// - class WINSTD_API setup_driver_info_list_builder + class setup_driver_info_list_builder { WINSTD_NONCOPYABLE(setup_driver_info_list_builder) WINSTD_NONMOVABLE(setup_driver_info_list_builder) diff --git a/include/WinStd/WLAN.h b/include/WinStd/WLAN.h index c7e7dd9c..69d393a1 100644 --- a/include/WinStd/WLAN.h +++ b/include/WinStd/WLAN.h @@ -36,7 +36,7 @@ extern DWORD (WINAPI *pfnWlanReasonCodeToString)(__in DWORD dwReasonCode, __in D namespace winstd { template struct WlanFreeMemory_delete; template struct WlanFreeMemory_delete<_Ty[]>; - class WINSTD_API wlan_handle; + class wlan_handle; } /// \addtogroup WinStdWLANAPI @@ -124,7 +124,7 @@ namespace winstd /// /// WLAN handle wrapper /// - class WINSTD_API wlan_handle : public handle + class wlan_handle : public handle { HANDLE_IMPL(wlan_handle, NULL) diff --git a/include/WinStd/Win.h b/include/WinStd/Win.h index 5d8a4ed5..285b5cba 100644 --- a/include/WinStd/Win.h +++ b/include/WinStd/Win.h @@ -32,21 +32,21 @@ namespace winstd { - template class WINSTD_API win_handle; - class WINSTD_API library; - class WINSTD_API process; - class WINSTD_API file; - class WINSTD_API event; - class WINSTD_API critical_section; - class WINSTD_API heap; + template class win_handle; + class library; + class process; + class file; + class event; + class critical_section; + class heap; template class heap_allocator; - class WINSTD_API actctx_activator; - class WINSTD_API user_impersonator; - class WINSTD_API console_ctrl_handler; - class WINSTD_API vmemory; - class WINSTD_API reg_key; - class WINSTD_API security_id; - class WINSTD_API process_information; + class actctx_activator; + class user_impersonator; + class console_ctrl_handler; + class vmemory; + class reg_key; + class security_id; + class process_information; } @@ -111,7 +111,7 @@ template inline VOID GuidToStringW(_In_ L #endif /// @copydoc StringToGuidW() -_Success_(return) BOOL WINSTD_API StringToGuidA(_In_z_ LPCSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCSTR *lpszGuidEnd = NULL) noexcept; +_Success_(return) BOOL StringToGuidA(_In_z_ LPCSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCSTR *lpszGuidEnd = NULL) noexcept; /// /// Parses string with GUID and stores it to GUID @@ -124,7 +124,7 @@ _Success_(return) BOOL WINSTD_API StringToGuidA(_In_z_ LPCSTR lpszGuid, _Out_ LP /// - `TRUE` if GUID successfuly parsed; /// - `FALSE` otherwise. /// -_Success_(return) BOOL WINSTD_API StringToGuidW(_In_z_ LPCWSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCWSTR *lpszGuidEnd = NULL) noexcept; +_Success_(return) BOOL StringToGuidW(_In_z_ LPCWSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCWSTR *lpszGuidEnd = NULL) noexcept; /// @copydoc StringToGuidW() #ifdef _UNICODE #define StringToGuid StringToGuidW @@ -387,7 +387,7 @@ namespace winstd /// Windows HANDLE wrapper class /// template - class WINSTD_API win_handle : public handle + class win_handle : public handle { HANDLE_IMPL(win_handle, INVALID) @@ -419,7 +419,7 @@ namespace winstd /// /// Module handle wrapper /// - class WINSTD_API library : public handle + class library : public handle { HANDLE_IMPL(library, NULL) @@ -463,7 +463,7 @@ namespace winstd /// /// Process handle wrapper /// - class WINSTD_API process : public win_handle + class process : public win_handle { public: /// @@ -490,7 +490,7 @@ namespace winstd /// /// File handle wrapper /// - class WINSTD_API file : public win_handle + class file : public win_handle { public: /// @@ -517,7 +517,7 @@ namespace winstd /// /// Event handle wrapper /// - class WINSTD_API event : public win_handle + class event : public win_handle { public: /// @@ -563,7 +563,7 @@ namespace winstd /// /// Critical section wrapper /// - class WINSTD_API critical_section + class critical_section { WINSTD_NONCOPYABLE(critical_section) WINSTD_NONMOVABLE(critical_section) @@ -601,7 +601,7 @@ namespace winstd /// /// Find-file handle wrapper /// - class WINSTD_API find_file : public handle + class find_file : public handle { HANDLE_IMPL(find_file, INVALID_HANDLE_VALUE) @@ -645,7 +645,7 @@ namespace winstd /// /// Heap handle wrapper /// - class WINSTD_API heap : public handle + class heap : public handle { HANDLE_IMPL(heap, NULL) @@ -815,7 +815,7 @@ namespace winstd /// /// Activates given activation context in constructor and deactivates it in destructor /// - class WINSTD_API actctx_activator + class actctx_activator { WINSTD_NONCOPYABLE(actctx_activator) WINSTD_NONMOVABLE(actctx_activator) @@ -845,7 +845,7 @@ namespace winstd /// /// Lets the calling thread impersonate the security context of a logged-on user /// - class WINSTD_API user_impersonator + class user_impersonator { WINSTD_NONCOPYABLE(user_impersonator) WINSTD_NONMOVABLE(user_impersonator) @@ -875,7 +875,7 @@ namespace winstd /// /// Console control handler stack management /// - class WINSTD_API console_ctrl_handler + class console_ctrl_handler { WINSTD_NONCOPYABLE(console_ctrl_handler) WINSTD_NONMOVABLE(console_ctrl_handler) @@ -906,7 +906,7 @@ namespace winstd /// /// Memory in virtual address space of a process handle wrapper /// - class WINSTD_API vmemory : public handle + class vmemory : public handle { WINSTD_NONCOPYABLE(vmemory) @@ -1018,7 +1018,7 @@ namespace winstd /// /// Registry wrapper class /// - class WINSTD_API reg_key : public handle + class reg_key : public handle { HANDLE_IMPL(reg_key, NULL) @@ -1109,7 +1109,7 @@ namespace winstd /// /// SID wrapper class /// - class WINSTD_API security_id : public handle + class security_id : public handle { HANDLE_IMPL(security_id, NULL) @@ -1134,7 +1134,7 @@ namespace winstd /// /// PROCESS_INFORMATION struct wrapper /// - class WINSTD_API process_information : public PROCESS_INFORMATION + class process_information : public PROCESS_INFORMATION { WINSTD_NONCOPYABLE(process_information) WINSTD_NONMOVABLE(process_information) diff --git a/include/WinStd/WinSock2.h b/include/WinStd/WinSock2.h index ffc21ce9..f77059ec 100644 --- a/include/WinStd/WinSock2.h +++ b/include/WinStd/WinSock2.h @@ -27,9 +27,9 @@ namespace winstd { - class WINSTD_API ws2_runtime_error; + class ws2_runtime_error; #if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502) - class WINSTD_API addrinfo; + class addrinfo; #endif } @@ -48,7 +48,7 @@ namespace winstd /// /// WinSock2 runtime error /// - class WINSTD_API ws2_runtime_error : public num_runtime_error + class ws2_runtime_error : public num_runtime_error { public: /// @@ -121,7 +121,7 @@ namespace winstd /// /// SID wrapper class /// - class WINSTD_API addrinfo : public handle + class addrinfo : public handle { HANDLE_IMPL(addrinfo, NULL) diff --git a/include/WinStd/WinTrust.h b/include/WinStd/WinTrust.h index 2acb4b9f..f6d9f3d5 100644 --- a/include/WinStd/WinTrust.h +++ b/include/WinStd/WinTrust.h @@ -31,7 +31,7 @@ namespace winstd { - class WINSTD_API wintrust; + class wintrust; } #pragma once @@ -45,7 +45,7 @@ namespace winstd /// /// WinTrust engine wrapper class /// - class WINSTD_API wintrust + class wintrust { WINSTD_NONCOPYABLE(wintrust) WINSTD_NONMOVABLE(wintrust) diff --git a/src/Win.cpp b/src/Win.cpp index db6456dd..0307b77e 100644 --- a/src/Win.cpp +++ b/src/Win.cpp @@ -25,7 +25,7 @@ // StringToGuidA ////////////////////////////////////////////////////////////////////// -_Success_(return) BOOL WINSTD_API StringToGuidA(_In_z_ LPCSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCSTR *lpszGuidEnd) noexcept +_Success_(return) BOOL StringToGuidA(_In_z_ LPCSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCSTR *lpszGuidEnd) noexcept { GUID g; LPSTR lpszEnd; @@ -88,7 +88,7 @@ _Success_(return) BOOL WINSTD_API StringToGuidA(_In_z_ LPCSTR lpszGuid, _Out_ LP } -_Success_(return) BOOL WINSTD_API StringToGuidW(_In_z_ LPCWSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCWSTR *lpszGuidEnd) noexcept +_Success_(return) BOOL StringToGuidW(_In_z_ LPCWSTR lpszGuid, _Out_ LPGUID lpGuid, _Out_opt_ LPCWSTR *lpszGuidEnd) noexcept { GUID g; LPWSTR lpszEnd;