Header file nt_code.hpp

#include "win32_code.hpp"

namespace system_error2
{
    using nt_code = status_code<system_error2::_nt_code_domain>;

    using nt_error = status_error<system_error2::_nt_code_domain>;

    class _nt_code_domain;

    constexpr system_error2::_nt_code_domain const nt_code_domain;

    static constexpr system_error2::_nt_code_domain const& _nt_code_domain::get();
}

Type alias system_error2::nt_code

using nt_code = status_code<system_error2::_nt_code_domain>;

(Windows only) A NT error code, those returned by NT kernel functions.


Type alias system_error2::nt_error

using nt_error = status_error<system_error2::_nt_code_domain>;

(Windows only) A specialisation of status_error for the NT error code domain.


Class system_error2::_nt_code_domain

class _nt_code_domain
: public status_code_domain
{
public:
    using value_type = 'hidden';

    constexpr _nt_code_domain(typename _base::unique_id_type id = 0x93f3b4487e4af25b) noexcept;

    _nt_code_domain(system_error2::_nt_code_domain const&) = default;

    _nt_code_domain(system_error2::_nt_code_domain&&) = default;

    system_error2::_nt_code_domain& operator=(system_error2::_nt_code_domain const&) = default;

    system_error2::_nt_code_domain& operator=(system_error2::_nt_code_domain&&) = default;

    ~_nt_code_domain() = default;

    static constexpr system_error2::_nt_code_domain const& get();

    virtual system_error2::status_code_domain::string_ref name() const noexcept;

protected:
    virtual bool _do_failure(status_code<void> const& code) const noexcept;

    virtual bool _do_equivalent(status_code<void> const& code1, status_code<void> const& code2) const noexcept;

    virtual system_error2::generic_code _generic_code(status_code<void> const& code) const noexcept;

    virtual system_error2::status_code_domain::string_ref _do_message(status_code<void> const& code) const noexcept;

    virtual void _do_throw_exception(status_code<void> const& code) const;
};

(Windows only) The implementation of the domain for NT error codes, those returned by NT kernel functions.

Type alias system_error2::_nt_code_domain::value_type

using value_type = 'hidden';

The value type of the NT code, which is a win32::NTSTATUS


Constructor system_error2::_nt_code_domain::_nt_code_domain

constexpr _nt_code_domain(typename _base::unique_id_type id = 0x93f3b4487e4af25b) noexcept;

Default constructor


Function system_error2::_nt_code_domain::get

static constexpr system_error2::_nt_code_domain const& get();

Constexpr singleton getter. Returns the constexpr nt_code_domain variable.



Variable system_error2::nt_code_domain

constexpr system_error2::_nt_code_domain const nt_code_domain;

(Windows only) A constexpr source variable for the NT code domain, which is that of NT kernel functions. Returned by _nt_code_domain::get().