Article ID: 141153
Article Last Modified on 12/2/2003
HKEY_LOCAL_MACHINE
Software
Microsoft
Windows NT
Current Version
Image File Execution Options
myapp.exe
Where 'myapp.exe' is the name of your application's .exe file.GlobalFlag = REG_SZ 0x70For a checked system, create the value:
GlobalFlag = REG_SZ 0x4f4470
GlobalFlag is a bitmask; here are the heap-related bits:
FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010 FLG_HEAP_ENABLE_FREE_CHECK 0x00000020 FLG_HEAP_VALIDATE_PARAMETERS 0x00000040 FLG_HEAP_VALIDATE_ALL 0x00000080VALIDATE_ALL is the flag that disables coalescing blocks.
/* Compile options needed: /Zi
*/
#include <windows.h>
void main()
{
int count;
char *achar[10];
while (TRUE)
{
for (count = 0; count <; 10; count++)
achar[count] = (char*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,10000);
for (count = 0; count < 10; count++)
HeapFree(GetProcessHeap(),0,achar[count]);
}
}
Additional query words: leak leaks GlobalAlloc malloc free new
Keywords: kbtshoot kbbug kbide kbenv kbdebug kbprb KB141153