HX fails at anonymous memory mapping (DOSX)
Dear HX users,
HX 2.17 runs into an infinite loop or hangs with the following code. I did not bother to find out where it stops though. I am running on Freedos in VirtualBox. It works fine in Wine.
Mappings to actual files work.
#include <windows.h>
#include <iostream>
#include <cstdlib>
int main( int, char *[] )
{
// Note: hardcoded size.
HANDLE map = CreateFileMapping( 0, NULL, PAGE_READWRITE, 0, 6, NULL );
void *buffer = MapViewOfFile( map, FILE_MAP_WRITE, 0, 0, 0 );
std::memcpy( buffer, "hello", 6 );
std::cout << static_cast< char * >( buffer ) << std::endl;
return 0;
}
This is currently my showstopper at supporting DOS (though I don't think anyone will want to use my application, much less in DOS).
This is a practice/demonstration at using memory mappings so "just using new[]" isn't going to "help." In practice I'd probably use something else, honest!
If there is a memory mapper in some other DOS extender I may play with it as well.
Johann
Complete thread:
- HX fails at anonymous memory mapping - myrkraverk, 25.11.2010, 00:44
- HX fails at anonymous memory mapping - Japheth, 25.11.2010, 08:30
- HX fails at anonymous memory mapping - myrkraverk, 25.11.2010, 10:07
- HX fails at anonymous memory mapping - Japheth, 25.11.2010, 08:30