From 7be3d976a223220e8e48896a401ac7e56e40ce62 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 27 Apr 2017 22:35:21 +0300 Subject: um: reorganize projects * libservice -> service * libsimple -> wrappers/simple * libnt_path_converter -> wrappers/special/nt_path_converter --- um/service/include/libservice/windows_error.hpp | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 um/service/include/libservice/windows_error.hpp (limited to 'um/service/include/libservice/windows_error.hpp') diff --git a/um/service/include/libservice/windows_error.hpp b/um/service/include/libservice/windows_error.hpp new file mode 100644 index 0000000..f7ac90e --- /dev/null +++ b/um/service/include/libservice/windows_error.hpp @@ -0,0 +1,31 @@ +// Copyright (c) 2015 Egor Tensin +// This file is part of the "Windows 7 drivers" project. +// For details, see https://github.com/egor-tensin/windows7-drivers. +// Distributed under the MIT License. + +#pragma once + +#include "common.hpp" +#include "singleton.hpp" + +#include +#include + +namespace libservice +{ + class WindowsErrorCategory + : public std::error_category + , public Singleton + { + public: + const char* name() const LIBSERVICE_NOEXCEPT { return "Windows"; } + + std::string message(int) const; + + private: + friend class Singleton; + }; +} + +#define LIBSERVICE_ERROR_PREFIX \ + "Error in function '" LIBSERVICE_FUNCTION_NAME "' at file '" LIBSERVICE_FILE_PATH "', line " LIBSERVICE_LINE_NUMBER_STRING -- cgit v1.2.3