Fix call to CreateFileMappingW.

The call shouldn't rely on the `size` variable, since it is available only
conditionally, based on preprocessor macros.

The `dwMaximumSize{High,Low}` arguments are actually optional, so omitting
them.

https://github.com/yhirose/cpp-httplib/issues/1901
This commit is contained in:
mol123 2024-08-27 13:23:17 +02:00
parent 52a18c78a5
commit 71c3d1fd86

View File

@ -2859,8 +2859,7 @@ inline bool mmap::open(const char *path) {
hMapping_ =
::CreateFileMappingFromApp(hFile_, NULL, PAGE_READONLY, size_, NULL);
#else
hMapping_ = ::CreateFileMappingW(hFile_, NULL, PAGE_READONLY, size.HighPart,
size.LowPart, NULL);
hMapping_ = ::CreateFileMappingW(hFile_, NULL, PAGE_READONLY, 0, 0, NULL);
#endif
if (hMapping_ == NULL) {