mirror of
https://github.com/holub/mame
synced 2025-06-28 15:14:21 +03:00
Implemented GetFileSize and and proper winrt file open (nw)
This commit is contained in:
parent
b73126e85a
commit
f999805738
@ -232,9 +232,7 @@ osd_file::error osd_file::open(std::string const &orig_path, uint32_t openflags,
|
||||
// get the file size
|
||||
FILE_STANDARD_INFO file_info;
|
||||
GetFileInformationByHandleEx(h, FileStandardInfo, &file_info, sizeof(file_info));
|
||||
auto lower = file_info.EndOfFile.QuadPart;
|
||||
|
||||
if (INVALID_FILE_SIZE == lower)
|
||||
if (INVALID_FILE_SIZE == file_info.EndOfFile.LowPart)
|
||||
{
|
||||
DWORD const err = GetLastError();
|
||||
if (NO_ERROR != err)
|
||||
@ -247,7 +245,7 @@ osd_file::error osd_file::open(std::string const &orig_path, uint32_t openflags,
|
||||
try
|
||||
{
|
||||
file = std::make_unique<win_osd_file>(h);
|
||||
filesize = lower;
|
||||
filesize = file_info.EndOfFile.QuadPart;
|
||||
return error::NONE;
|
||||
}
|
||||
catch (...)
|
||||
|
@ -93,6 +93,12 @@ extern "C" {
|
||||
_Out_opt_ LPDWORD lpFileSizeHigh
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
FILE_STANDARD_INFO file_info;
|
||||
GetFileInformationByHandleEx(hFile, FileStandardInfo, &file_info, sizeof(file_info));
|
||||
if(lpFileSizeHigh!=nullptr)
|
||||
{
|
||||
*lpFileSizeHigh = file_info.EndOfFile.HighPart;
|
||||
}
|
||||
return file_info.EndOfFile.LowPart;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user