🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages Started by tinyabs Tue, 12 Dec 2006 01:07
Memory guard, how to do it?
#2859
Author: tinyabs
Date: Tue, 12 Dec 2006 01:07
16 lines
1474 bytes
The scenario is like this:

I have allocated memory buffer and like to mark none read/write/execute at 
the beginning and end of the buffer.

0x00600000-4K size [None-read/write/execute]
0x00601000-256K size [valid memory buffer]
0x00641000-4K size [none read/write/execute]

I'm doing this because I have a graphics engine that uses assembly language 
to read and write to the buffer. I want an access violation exception when I 
access memory outside of buffer.

My idea is to use VirtualAlloc to allocate the memory and then use 
VirtualProtect to change the attributes. Is this a viable way to do it or is 
there a shortcut?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads