Fix handle closed twice

This commit is contained in:
2024-07-20 16:44:29 +08:00
parent b1016b029e
commit aabe935933

View File

@@ -91,9 +91,9 @@ def hydrate_file(s: str):
CfHydratePlaceholder(h, 0, -1, 0, LPVOID())
except OSError as e:
if GetLastError() != ERROR_INVALID_FUNCTION:
CfCloseHandle(h)
# File is not cloud file
if e.winerror != -2147024520:
CfCloseHandle(h)
raise e
CfCloseHandle(h)