From c67055bad3cdfc93e2ac57d87f36c6e0993af690 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 17 May 2017 06:00:20 +0300 Subject: initial commit --- include/pdb/handle.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/pdb/handle.hpp (limited to 'include/pdb/handle.hpp') diff --git a/include/pdb/handle.hpp b/include/pdb/handle.hpp new file mode 100644 index 0000000..52fb805 --- /dev/null +++ b/include/pdb/handle.hpp @@ -0,0 +1,29 @@ +// Copyright (c) 2017 Egor Tensin +// This file is part of the "PDB repository" project. +// For details, see https://github.com/egor-tensin/pdb-repo. +// Distributed under the MIT License. + +#pragma once + +#include + +#include + +#include + +namespace pdb +{ + struct CloseHandle + { + void operator()(HANDLE raw) const + { + if (raw == NULL || raw == INVALID_HANDLE_VALUE) + return; + const auto ret = ::CloseHandle(raw); + assert(ret); + UNREFERENCED_PARAMETER(ret); + } + }; + + typedef std::unique_ptr Handle; +} -- cgit v1.2.3