From c8f330566954563ef5624a8be314b5eb5a068505 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Tue, 17 Oct 2023 03:08:29 +0100 Subject: [PATCH] [*] Address a number of NT/x86_32 build regressions --- Source/AuProcAddresses.NT.hpp | 4 ++-- Source/Compression/StreamCompression.cpp | 4 ++-- Source/IO/FS/FileStream.NT.cpp | 8 ++++---- Source/IO/Net/AuNetStream.NT.cpp | 8 ++++---- Source/IO/Protocol/AuProtocolStack.cpp | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/AuProcAddresses.NT.hpp b/Source/AuProcAddresses.NT.hpp index e857e265..0e2158c9 100644 --- a/Source/AuProcAddresses.NT.hpp +++ b/Source/AuProcAddresses.NT.hpp @@ -771,11 +771,11 @@ namespace Aurora DWORD dwAttributes = 0 ); - inline HMODULE (*pLoadLibraryW)( + inline HMODULE(__stdcall *pLoadLibraryW)( LPCWSTR lpLibFileName ); - inline FARPROC (*pGetProcAddress)( + inline FARPROC(__stdcall*pGetProcAddress)( HMODULE hModule, LPCSTR lpProcName ); diff --git a/Source/Compression/StreamCompression.cpp b/Source/Compression/StreamCompression.cpp index 00d413c3..c4af7d45 100644 --- a/Source/Compression/StreamCompression.cpp +++ b/Source/Compression/StreamCompression.cpp @@ -846,7 +846,7 @@ namespace Aurora::Compression do { auto view = buffer.GetNextLinearRead(); - view.length = AuMin(view.length, kChunkSize / 2); + view.length = AuMin(view.length, kChunkSize / 2); auto pair = pCompressor->ReadEx(AuMemory::MemoryViewWrite(buffer), true); while (pair.first || pair.second) @@ -968,7 +968,7 @@ namespace Aurora::Compression } auto view = buffer.GetNextLinearRead(); - view.length = AuMin(view.length, kChunkSize / 2); + view.length = AuMin(view.length, kChunkSize / 2); auto pair = pCompressor->ReadEx(AuMemory::MemoryViewWrite(buffer), false); while (pair.first || pair.second) diff --git a/Source/IO/FS/FileStream.NT.cpp b/Source/IO/FS/FileStream.NT.cpp index 779e58ce..1228664c 100644 --- a/Source/IO/FS/FileStream.NT.cpp +++ b/Source/IO/FS/FileStream.NT.cpp @@ -179,7 +179,7 @@ namespace Aurora::IO::FS { DWORD read {}; - auto blockSize = AuMin(AuUInt(kFileCopyBlock), uLength); + auto blockSize = AuMin(AuUInt(kFileCopyBlock), uLength); if (this->pHandle_->IsAsync()) { @@ -187,7 +187,7 @@ namespace Aurora::IO::FS if (!::ReadFile(hHandle, reinterpret_cast(parameters.ptr) + uOffset, - blockSize, + AuUInt32(blockSize), NULL, &overlapped)) { @@ -282,7 +282,7 @@ namespace Aurora::IO::FS { DWORD written {}; - auto uBlockSize = AuMin(AuUInt(kFileCopyBlock), uLength); + auto uBlockSize = AuMin(AuUInt(kFileCopyBlock), uLength); if (bIsAsync) { @@ -290,7 +290,7 @@ namespace Aurora::IO::FS if (!::WriteFile(hHandle, reinterpret_cast(parameters.ptr) + uOffset, - uBlockSize, + AuUInt32(uBlockSize), NULL, &overlapped)) { diff --git a/Source/IO/Net/AuNetStream.NT.cpp b/Source/IO/Net/AuNetStream.NT.cpp index a18f5db3..9788b0b7 100644 --- a/Source/IO/Net/AuNetStream.NT.cpp +++ b/Source/IO/Net/AuNetStream.NT.cpp @@ -28,10 +28,10 @@ namespace Aurora::IO::Net Reset(); } - static void WsaOverlappedCompletionRoutine(DWORD dwErrorCode, - DWORD cbTransferred, - LPWSAOVERLAPPED lpOverlapped, - DWORD dwFlags + static void __stdcall WsaOverlappedCompletionRoutine(DWORD dwErrorCode, + DWORD cbTransferred, + LPWSAOVERLAPPED lpOverlapped, + DWORD dwFlags ) { auto transaction = reinterpret_cast(reinterpret_cast(lpOverlapped) - offsetof(NtAsyncNetworkTransaction, overlap)); diff --git a/Source/IO/Protocol/AuProtocolStack.cpp b/Source/IO/Protocol/AuProtocolStack.cpp index be7dced8..2fee9913 100644 --- a/Source/IO/Protocol/AuProtocolStack.cpp +++ b/Source/IO/Protocol/AuProtocolStack.cpp @@ -689,7 +689,7 @@ namespace Aurora::IO::Protocol } auto target = AuMin(AuPageRound(bytesRem + ((bytesRem / 4) * 3), 128), maxVal); - target = AuMax(target, pCurrent->uStartingSize); + target = AuMax(target, pCurrent->uStartingSize); if (target >= pCurrent->outputBuffer.allocSize || ((pCurrent->outputBuffer.length > target) && (bytesRem < pCurrent->uStartingSize)))