PurifyAssertIsReadable example

#include <windows.h>

#include "pure.h"

 

void main()

{

   char    *chunk;

   HANDLE  hHeap;

   hHeap = GetProcessHeap();

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

 

   PurifyAssertIsReadable(0, 1);       /* Will generate an NPR */

   PurifyAssertIsReadable(chunk, 1);   /* Will generate a UMR */

   PurifyAssertIsReadable(chunk, 16);  /* Will generate an ABR */

}

(C) Copyright IBM Corporation 1992, 2010.