Add some log for the GetFileLength function (#5330)

This commit is contained in:
Changming Sun 2020-09-30 10:39:42 -07:00 committed by GitHub
parent cb57c100e6
commit 8d4740b39c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,6 +195,10 @@ class WindowsEnv : public Env {
wil::unique_hfile file_handle{
CreateFileW(file_path, FILE_READ_ATTRIBUTES, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)};
#endif
if (file_handle.get() == INVALID_HANDLE_VALUE) {
const int err = GetLastError();
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "open file ", ToMBString(file_path), " fail, errcode = ", err);
}
LARGE_INTEGER filesize;
if (!GetFileSizeEx(file_handle.get(), &filesize)) {
const int err = GetLastError();