home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / common / pvalloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-11  |  893 b   |  50 lines

  1. /*
  2.  -  P V A L L O C . H
  3.  -
  4.  *  Purpose:
  5.  *      Header file for sample memory manager.  Provides chained
  6.  *      memory data structures.
  7.  *
  8.  */
  9.  
  10. #ifndef __PVALLOC_H__
  11. #define __PVALLOC_H__
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. #define pvNull NULL
  18.  
  19. typedef unsigned long CB;
  20. typedef void FAR * PV;
  21. typedef char FAR * SZ;
  22. typedef BYTE FAR * PB;
  23.  
  24. /* Memory allocation node */
  25.  
  26. typedef struct
  27. {
  28.     HANDLE  hMem;
  29.     CB      cbSize;
  30.     PV      lpvNext;
  31.     PV      lpvBuf;
  32.     CB      ulBlockNum;
  33.     unsigned long   ulAlignPad;
  34. } PVINFO, * PPVINFO;
  35.  
  36. #define cbPvMax (65520L-sizeof(PVINFO))
  37. #define cbPvMin (1024L-sizeof(PVINFO))
  38.  
  39. /* Memory manager function prototypes */
  40.  
  41. PV   PvAlloc(CB cbSize);
  42. PV   PvAllocMore(CB cbSize, PV lpvParent);
  43. BOOL PvFree(PV lpv);
  44.  
  45. #ifdef __cplusplus
  46. }       /* extern "C" */
  47. #endif
  48.  
  49. #endif  /* __PVALLOC_H__ */
  50.