]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/inspircd_win32wrapper.cpp
m_ident Invalidate cache after changing User::ident
[user/henk/code/inspircd.git] / win / inspircd_win32wrapper.cpp
index a451dd0df362908f2c8f607ec60a218ef53fd9b1..ebc49852934409eb55d04c2e4303effa0c6fa201 100644 (file)
@@ -180,6 +180,28 @@ int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, cons
        return 1;
 }
 
+CWin32Exception::CWin32Exception() : exception()
+{
+       dwErrorCode = GetLastError();
+       if( FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)szErrorString, _countof(szErrorString), NULL) == 0 )
+               sprintf_s(szErrorString, _countof(szErrorString), "Error code: %u", dwErrorCode);
+}
+
+CWin32Exception::CWin32Exception(const CWin32Exception& other)
+{
+       strcpy_s(szErrorString, _countof(szErrorString), other.szErrorString);
+}
+
+const char* CWin32Exception::what() const throw()
+{
+       return szErrorString;
+}
+
+DWORD CWin32Exception::GetErrorCode()
+{
+       return dwErrorCode;
+}
+
 #include "../src/modules/m_spanningtree/link.h"
 #include "../src/modules/ssl.h"
 template class reference<Link>;