Refactored code

This commit is contained in:
a2x
2023-09-16 13:32:01 +10:00
parent a3a3427561
commit a8d3318d94
58 changed files with 787 additions and 635 deletions

View File

@@ -0,0 +1,22 @@
#pragma once
#define _AMD64_
#include <memory>
#include <handleapi.h>
namespace utility {
namespace detail {
struct HandleDisposer {
using pointer = HANDLE;
void operator()(const HANDLE handle) const noexcept {
if (handle != nullptr && handle != INVALID_HANDLE_VALUE)
CloseHandle(handle);
}
};
}
using SafeHandle = std::unique_ptr<HANDLE, detail::HandleDisposer>;
}