PurifyAssertIsWritable example

#include <windows.h>

#include "pure.h"

 

void main()

{

   char    *chunk;

   HANDLE  hHeap;

   hHeap = GetProcessHeap();

   chunk = (char *)HeapAlloc(hHeap, HEAP_GENERATE_EXCEPTIONS, 15);

 

   PurifyAssertIsWritable(0, 1);       /* Will generate an NPW */

   PurifyAssertIsWritable(chunk, 1);   /* No Error */

   PurifyAssertIsWritable(chunk, 16);  /* Will generate an ABW */

}

(C) Copyright IBM Corporation 1992, 2010.