aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/file.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/utils/file.cpp b/src/utils/file.cpp
index af1de6e..fdc695f 100644
--- a/src/utils/file.cpp
+++ b/src/utils/file.cpp
@@ -5,6 +5,7 @@
#include <pdb/all.hpp>
+#include <winapi/error.hpp>
#include <winapi/utf8.hpp>
#include <windows.h>
@@ -27,12 +28,12 @@ std::size_t get_size(const std::string& path) {
NULL)};
if (handle.get() == INVALID_HANDLE_VALUE)
- throw error::windows(GetLastError(), "CreateFileW");
+ throw winapi::error::windows(GetLastError(), "CreateFileW");
LARGE_INTEGER size;
if (!GetFileSizeEx(handle.get(), &size))
- throw error::windows(GetLastError(), "GetFileSizeEx");
+ throw winapi::error::windows(GetLastError(), "GetFileSizeEx");
if (size.QuadPart < 0 || size.QuadPart > SIZE_MAX)
throw std::runtime_error{"invalid file size"};
@@ -49,12 +50,12 @@ ID query_id(const std::string& path) {
NULL)};
if (handle.get() == INVALID_HANDLE_VALUE)
- throw error::windows(GetLastError(), "CreateFileW");
+ throw winapi::error::windows(GetLastError(), "CreateFileW");
FILE_ID_INFO id;
if (!GetFileInformationByHandleEx(handle.get(), FileIdInfo, &id, sizeof(id)))
- throw error::windows(GetLastError(), "GetFileInformationByHandleEx");
+ throw winapi::error::windows(GetLastError(), "GetFileInformationByHandleEx");
return {id};
}