mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Fix CfAPI wrapper build in Win32 mode
For some reason MSVC manages to deduce the right constructor in Win64 mode but not in Win32 mode. So let's be more explicit about what we return. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
a0facaf36d
commit
3b3864296a
1 changed files with 2 additions and 2 deletions
|
@ -346,13 +346,13 @@ OCC::CfApiWrapper::FileHandle OCC::CfApiWrapper::handleForPath(const QString &pa
|
|||
HANDLE handle = nullptr;
|
||||
const qint64 openResult = CfOpenFileWithOplock(path.toStdWString().data(), CF_OPEN_FILE_FLAG_NONE, &handle);
|
||||
if (openResult == S_OK) {
|
||||
return {handle, CfCloseHandle};
|
||||
return FileHandle(handle, CfCloseHandle);
|
||||
}
|
||||
} else {
|
||||
const auto handle = CreateFile(path.toStdWString().data(), 0, 0, nullptr,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (handle != INVALID_HANDLE_VALUE) {
|
||||
return {handle, [](HANDLE h) { CloseHandle(h); }};
|
||||
return FileHandle(handle, [](HANDLE h) { CloseHandle(h); });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue