Index: trunk/include/helpers/except.h
===================================================================
--- trunk/include/helpers/except.h	(revision 161)
+++ trunk/include/helpers/except.h	(revision 164)
@@ -79,5 +79,5 @@
         PFN             pfnHandler;         // as in EXCEPTIONREGISTRATIONRECORD
         jmp_buf         jmpThread;          // additional buffer for setjmp
-        // PFNEXCONKILL    pfnOnKill;          // subroutine to call upon process/thread termination
+        EXCEPTIONREPORTRECORD err;          // exception handlers copy the report rec here
         PVOID           pvUser;             // user ptr
     } EXCEPTIONREGISTRATIONRECORD2;
Index: trunk/include/helpers/gpih.h
===================================================================
--- trunk/include/helpers/gpih.h	(revision 161)
+++ trunk/include/helpers/gpih.h	(revision 164)
@@ -175,4 +175,48 @@
                                               PCH pchString);
     typedef GPIHCHARSTRINGPOSAT *PGPIHCHARSTRINGPOSAT;
+
+    /*
+     *@@ BKGNDINFO:
+     *      background information passed into
+     *      gpihFillBackground.
+     *
+     *      The color flags apply always. The
+     *      bitmap flags apply only if hbm is
+     *      not NULLHANDLE.
+     *
+     *@@added V0.9.19 (2002-05-07) [umoeller]
+     */
+
+    typedef struct _BKGNDINFO
+    {
+        ULONG       flPaintMode;
+                // a combination of one of the color
+                // flags and one of the bitmap flags:
+                // a) color flags
+                #define PMOD_COLORMASK      0x000F
+                #define PMOD_SOLID          0x0000  // solid color, use lcol1
+                #define PMOD_TOPBOTTOM      0x0001  // spectrum, lcol1 = top, lcol2 = bottom
+                #define PMOD_LEFTRIGHT      0x0002  // spectrum, lcol1 = left, lcol2 = right
+                // b) bitmap flags
+                #define PMOD_BMPMASK        0x00F0
+                #define PMOD_BMP_CENTER     0x0000  // center the bitmap
+                #define PMOD_BMP_SCALE_X    0x0002  // scale the bitmap to size in prcl,
+                                                    // respect lScale
+                #define PMOD_BMP_TILE       0x0004  // tile the bitmap
+
+        LONG        lcol1,              // color 1 (RGB)
+                    lcol2;              // color 2 (RGB)
+
+        HBITMAP     hbm;                // bitmap or NULLHANDLE if none
+        ULONG       lScale;             // only with PMOD_BMP_SCALE_X: how many times
+                                        // the bmp should be scaled (as with WPS
+                                        // folder "Background" page); this cannot
+                                        // be zero then
+
+    } BKGNDINFO, *PBKGNDINFO;
+
+    VOID gpihFillBackground(HPS hps,
+                            PRECTL prcl,
+                            PBKGNDINFO pInfo);
 
     /* ******************************************************************
Index: trunk/include/helpers/memdebug.h
===================================================================
--- trunk/include/helpers/memdebug.h	(revision 161)
+++ trunk/include/helpers/memdebug.h	(revision 164)
@@ -43,5 +43,14 @@
 
     #ifndef __stdlib_h           // <stdlib.h>
-        #error stdlib.h must be included before memdebug.h.
+        // #error stdlib.h must be included before memdebug.h.
+        typedef unsigned int size_t;
+    #endif
+
+    #ifndef NULL
+       #if (defined(__EXTENDED__)  || defined( __cplusplus ))
+          #define NULL 0
+       #else
+          #define NULL ((void *)0)
+       #endif
     #endif
 
@@ -146,7 +155,23 @@
 
         #ifndef DONT_REPLACE_MALLOC
+
+            #ifdef malloc
+                #undef malloc
+            #endif
             #define malloc(ul) memdMalloc(ul, __FILE__, __LINE__, __FUNCTION__)
+
+            #ifdef calloc
+                #undef calloc
+            #endif
             #define calloc(n, size) memdCalloc(n, size, __FILE__, __LINE__, __FUNCTION__)
+
+            #ifdef realloc
+                #undef realloc
+            #endif
             #define realloc(p, ul) memdRealloc(p, ul, __FILE__, __LINE__, __FUNCTION__)
+
+            #ifdef free
+                #undef free
+            #endif
             #define free(p) memdFree(p, __FILE__, __LINE__, __FUNCTION__)
 
@@ -159,4 +184,5 @@
             #endif
 
+            // tell other headers that these have been replaced
             #define __DEBUG_MALLOC_ENABLED__
 
