diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-29 23:33:48 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-29 23:33:48 +0200 |
commit | b9d7ec228b03e2978b0e1d9f21dadd56b2f405e3 (patch) | |
tree | b909da04cba0bcaada3c5fa16c474c49c684ef12 /c/data.h | |
parent | aabdb17f29216e03b9821fb99b57e9287ee46d6d (diff) | |
download | EpisodeBrowser-b9d7ec228b03e2978b0e1d9f21dadd56b2f405e3.tar.gz |
Small improvments.
Diffstat (limited to 'c/data.h')
-rw-r--r-- | c/data.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -120,11 +120,11 @@ struct FileView { hf = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); - if (!hf.Not(INVALID_HANDLE_VALUE)) { + if (!hf.Bad(INVALID_HANDLE_VALUE)) { if (GetLastError() == ERROR_FILE_NOT_FOUND) { hf = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); - if (!hf.Not(INVALID_HANDLE_VALUE)) + if (!hf.Bad(INVALID_HANDLE_VALUE)) throw Win32Error(); } else throw Win32Error(); @@ -134,11 +134,11 @@ struct FileView cbMap.QuadPart = c*sizeof(T); hm = CreateFileMapping(hf.v, nullptr, PAGE_READWRITE, cbMap.HighPart, cbMap.LowPart, nullptr); - if (!hm.Not(0)) + if (!hm.Bad(0)) throw Win32Error(); view = reinterpret_cast<T*>(MapViewOfFile(hm.v, FILE_MAP_ALL_ACCESS, 0, 0, 0)); - if (!view.Not(0)) + if (!view.Bad(0)) throw Win32Error(); } |