Skip to content

Commit 2d82776

Browse files
committed
fix: Disk provider still using old open() api on windows
1 parent fdee0ac commit 2d82776

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugins/builtin/source/content/providers/disk_provider.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ namespace hex::plugin::builtin {
171171
m_writable = false;
172172

173173
if (m_diskHandle == INVALID_HANDLE_VALUE) {
174-
this->setErrorMessage(hex::formatSystemError(::GetLastError()));
175-
return false;
174+
return OpenResult::failure(hex::formatSystemError(::GetLastError()));
176175
}
177176
}
178177

@@ -194,12 +193,12 @@ namespace hex::plugin::builtin {
194193
}
195194

196195
if (m_diskHandle == nullptr || m_diskHandle == INVALID_HANDLE_VALUE) {
197-
this->setErrorMessage(hex::formatSystemError(::GetLastError()));
196+
auto error = ::GetLastError();
198197
m_readable = false;
199198
m_diskHandle = nullptr;
200199
CloseHandle(m_diskHandle);
201200

202-
return false;
201+
return OpenResult::failure(hex::formatSystemError(error));
203202
}
204203

205204
#else

0 commit comments

Comments
 (0)