2015-10-18 15:25:48 +02:00
|
|
|
// OpenVPN -- An application to securely tunnel IP networks
|
|
|
|
// over a single port, with support for SSL/TLS-based
|
|
|
|
// session authentication and key exchange,
|
|
|
|
// packet encryption, packet authentication, and
|
|
|
|
// packet compression.
|
|
|
|
//
|
2022-09-29 11:41:13 +02:00
|
|
|
// Copyright (C) 2012-2022 OpenVPN Inc.
|
2015-10-18 15:25:48 +02:00
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
2017-12-21 21:42:20 +01:00
|
|
|
// it under the terms of the GNU Affero General Public License Version 3
|
2015-10-18 15:25:48 +02:00
|
|
|
// as published by the Free Software Foundation.
|
|
|
|
//
|
|
|
|
// This program 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
|
2017-12-21 21:42:20 +01:00
|
|
|
// GNU Affero General Public License for more details.
|
2015-10-18 15:25:48 +02:00
|
|
|
//
|
2017-12-21 21:42:20 +01:00
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
2015-10-18 15:25:48 +02:00
|
|
|
// along with this program in the COPYING file.
|
|
|
|
// If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
// Windows error utilities
|
|
|
|
|
|
|
|
#ifndef OPENVPN_WIN_WINERR_H
|
|
|
|
#define OPENVPN_WIN_WINERR_H
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
2017-03-30 23:10:56 +02:00
|
|
|
#include <openvpn/io/io.hpp>
|
2015-10-18 15:25:48 +02:00
|
|
|
|
2024-06-25 18:45:07 +02:00
|
|
|
namespace openvpn::Win {
|
2017-03-30 23:10:56 +02:00
|
|
|
struct Error : public openvpn_io::error_code
|
2023-01-11 20:43:22 +01:00
|
|
|
{
|
2015-10-18 15:25:48 +02:00
|
|
|
Error(const DWORD err)
|
2017-03-30 23:10:56 +02:00
|
|
|
: openvpn_io::error_code(err, openvpn_io::error::get_system_category())
|
2015-10-18 15:25:48 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LastError : public Error
|
2023-01-11 20:43:22 +01:00
|
|
|
{
|
2015-10-18 15:25:48 +02:00
|
|
|
LastError()
|
|
|
|
: Error(::GetLastError())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
2024-06-25 18:45:07 +02:00
|
|
|
} // namespace openvpn::Win
|
2015-10-18 15:25:48 +02:00
|
|
|
|
|
|
|
#endif
|