kill3xx
June 5th, 2001, 10:28
Hi +Tsehp,
...quoting by hand (donno why u've locked the msg =)
1) using the undocumented VirtualAlloc 0x80000000 flag
#define MEM_SHARED_ARENA 0x80000000
PVOID pt = VirtualAlloc( 0, 0x1000, MEM_COMMIT + MEM_SHARED_ARENA,
PAGE_READWRITE );
2) using MMF - win9x MM map the pages for a MMF to the shared arena - side effect: a MMF lays _always_ at
the same linear address in _all_ memory contexts despite the process map it or not
HANDLE hFileMap = CreateFileMapping( INVALID_HANDLE_VALUE, 0,
PAGE_READWRITE, 0, 0x1000, 0 );
if ( hFileMapping )
{
PVOID pt = MapViewOfFile(hFileMapping, FILE_MAP_WRITE, 0, 0, 0x1000);
}
3) more esotic :
emulating kernel32 behaviour using (via K32!ORD_1) the VMM win32 vxd services
_PageReserve(PR_SHARED) and _PageCommit (PC_USER + PC_WRITEABLE)
Best Regards,
kill3xx
...quoting by hand (donno why u've locked the msg =)
Quote:
a big dilemna; I need to allocate some mem above the 0x7fffffff wall on win9x to write a global "fault" handler. I have two choices : 1-the vmm services way : _pageAllocate, etc... and I'm too lazy to take this a first choice 2-the api way, so here's my question : is there a way to allocate + have a handle to allocate such mem, even if I normally should use some ring0 code for those purposes. |
1) using the undocumented VirtualAlloc 0x80000000 flag
#define MEM_SHARED_ARENA 0x80000000
PVOID pt = VirtualAlloc( 0, 0x1000, MEM_COMMIT + MEM_SHARED_ARENA,
PAGE_READWRITE );
2) using MMF - win9x MM map the pages for a MMF to the shared arena - side effect: a MMF lays _always_ at
the same linear address in _all_ memory contexts despite the process map it or not
HANDLE hFileMap = CreateFileMapping( INVALID_HANDLE_VALUE, 0,
PAGE_READWRITE, 0, 0x1000, 0 );
if ( hFileMapping )
{
PVOID pt = MapViewOfFile(hFileMapping, FILE_MAP_WRITE, 0, 0, 0x1000);
}
3) more esotic :
emulating kernel32 behaviour using (via K32!ORD_1) the VMM win32 vxd services
_PageReserve(PR_SHARED) and _PageCommit (PC_USER + PC_WRITEABLE)
Best Regards,
kill3xx