mirror of
https://github.com/thunderbrewhq/bc.git
synced 2025-12-12 01:52:30 +00:00
fix(file): added missing Read and ReadP calls on Windows
This commit is contained in:
parent
48d1a3c0b0
commit
d78609cceb
3 changed files with 16 additions and 4 deletions
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
#include "bc/system/file/Stacked.hpp"
|
||||
#include "bc/file/Filesystem.hpp"
|
||||
#include "bc/system/file/System_File.hpp"
|
||||
#include "bc/system/file/Stacked.hpp"
|
||||
#include "bc/String.hpp"
|
||||
#include "bc/Memory.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "bc/file/Types.hpp"
|
||||
#include "bc/file/Filesystem.hpp"
|
||||
#include "bc/system/file/System_File.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
|
|
|||
|
|
@ -308,12 +308,26 @@ bool write_init(Blizzard::File::StreamRecord* file, void* data, LPOVERLAPPED ove
|
|||
return write_func(file, data, overlapped, count);
|
||||
}
|
||||
|
||||
bool Read(Blizzard::File::Filesystem* fs, Stacked::FileParms* parms) {
|
||||
return read_func(parms->file, parms->data, nullptr, reinterpret_cast<LPDWORD>(&parms->count));
|
||||
}
|
||||
|
||||
bool ReadP(Blizzard::File::Filesystem* fs, Stacked::FileParms* parms) {
|
||||
OVERLAPPED overlapped;
|
||||
overlapped.Offset = static_cast<DWORD>(parms->offset & 0xFFFFFFFF);
|
||||
overlapped.OffsetHigh = static_cast<DWORD>((parms->offset >> 32) & 0xFFFFFFFF);
|
||||
overlapped.Internal = 0;
|
||||
overlapped.InternalHigh = 0;
|
||||
overlapped.hEvent = nullptr;
|
||||
return read_func(parms->file, parms->data, &overlapped, reinterpret_cast<LPDWORD>(&parms->count));
|
||||
}
|
||||
|
||||
bool Write(Blizzard::File::Filesystem* fs, Stacked::FileParms* parms) {
|
||||
return write_func(parms->file, parms->data, nullptr, reinterpret_cast<LPDWORD>(&parms->count));
|
||||
}
|
||||
|
||||
bool WriteP(Blizzard::File::Filesystem* fs, Stacked::FileParms* parms) {
|
||||
OVERLAPPED overlapped = {};
|
||||
OVERLAPPED overlapped;
|
||||
overlapped.Offset = static_cast<DWORD>(parms->offset & 0xFFFFFFFF);
|
||||
overlapped.OffsetHigh = static_cast<DWORD>((parms->offset >> 32) & 0xFFFFFFFF);
|
||||
overlapped.Internal = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue