77 if (
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0,
m_num, dwLanguageId, str, NULL)) {
79 str.erase(str.find_last_not_of(_T(
" \t\n\r\f\v")) + 1);
91#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
177#pragma warning(disable: 4505)
181 _In_opt_ PCSTR pNodeName,
182 _In_opt_ PCSTR pServiceName,
183 _In_opt_
const ADDRINFOA *pHints,
187 INT iResult =
GetAddrInfoA(pNodeName, pServiceName, pHints, &h);
199 _In_opt_ PCWSTR pNodeName,
200 _In_opt_ PCWSTR pServiceName,
201 _In_opt_
const ADDRINFOW *pHints,
205 INT iResult =
GetAddrInfoW(pNodeName, pServiceName, pHints, &h);
Integrates WinStd classes with Microsoft WinSock2 API.
SID wrapper class.
Definition: WinSock2.h:99
void free_internal() noexcept override
Frees address information.
Definition: WinSock2.h:120
virtual ~addrinfo()
Frees address information.
Definition: WinSock2.h:108
Base abstract template class to support generic object handle keeping.
Definition: Common.h:615
handle_type m_h
Object handle.
Definition: Common.h:866
Numerical runtime error.
Definition: Common.h:1011
int error_type
Error number type.
Definition: Common.h:1013
error_type m_num
Numeric error code.
Definition: Common.h:1049
SID wrapper class.
Definition: WinSock2.h:132
virtual ~waddrinfo()
Frees address information.
Definition: WinSock2.h:141
void free_internal() noexcept override
Frees address information.
Definition: WinSock2.h:153
WinSock2 runtime error.
Definition: WinSock2.h:29
ws2_runtime_error(error_type num, const char *msg=nullptr)
Constructs an exception.
Definition: WinSock2.h:47
ws2_runtime_error(const char *msg=nullptr)
Constructs an exception using WSAGetLastError()
Definition: WinSock2.h:65
ws2_runtime_error(error_type num, const std::string &msg)
Constructs an exception.
Definition: WinSock2.h:37
ws2_runtime_error(const std::string &msg)
Constructs an exception using WSAGetLastError()
Definition: WinSock2.h:56
tstring msg(DWORD dwLanguageId=0) const
Returns a user-readable Windows error message.
Definition: WinSock2.h:74
addrinfo taddrinfo
Multi-byte / Wide-character SID wrapper class (according to _UNICODE)
Definition: WinSock2.h:165
static INT GetAddrInfoW(PCWSTR pNodeName, PCWSTR pServiceName, const ADDRINFOW *pHints, winstd::waddrinfo &result)
Provides protocol-independent translation from a host name to an address.
Definition: WinSock2.h:198
static INT GetAddrInfoA(PCSTR pNodeName, PCSTR pServiceName, const ADDRINFOA *pHints, winstd::addrinfo &result)
Provides protocol-independent translation from a host name to an address.
Definition: WinSock2.h:180
std::string tstring
Multi-byte / Wide-character string (according to _UNICODE)
Definition: Common.h:346
#define WINSTD_HANDLE_IMPL(C, INVAL)
Implements default constructors and operators to prevent their auto-generation by compiler.
Definition: Common.h:171
static const PADDRINFOA invalid
Invalid handle value.
Definition: Common.h:625