File:  [WindowsNT SDKs] / mstools / samples / mcitest / gmem.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:22:16 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-oct-1992, ntsdk-nov-1993, ntsdk-jul-1993, HEAD
Microsoft Windows NT Build 328 10-12-1992

/*
    gmem.h

    This module supplies macros for fixed global memory
    allocation compatible with those used in the Multimedia
    extensions to Windows 3.x.  It is included to simplify
    porting of the Windows 3.x 16 bit code.

    Jul-16-91   NigelT

*/

#ifndef _GMEMMACROS_
#define _GMEMMACROS_

#define GAllocPtr(ul)       GlobalAlloc(GPTR,(ul))
#define GAllocPtrF(f,ul)    GlobalAlloc(GPTR,(ul))
#define GReAllocPtr(lp,ul)  GlobalReAlloc((HANDLE)(lp),(ul),GPTR)
#define GFreePtr(lp)        GlobalFree((HANDLE)(lp))

#define GlobalAllocPtrF(f,ul)    GlobalAlloc(GPTR,(ul))
//#define GlobalReAllocPtr(lp,ul,f)  GlobalReAlloc((HANDLE)(lp),(ul),GPTR)

#define GlobalPtrHandle(h)   (GlobalHandle(h))

/* the following are extracts from 3.1 WindowsX.h */
#define     GlobalUnlockPtr(lp) 	\
                GlobalUnlock(GlobalPtrHandle(lp))

#define     GlobalAllocPtr(flags, cb)	\
                (GlobalLock(GlobalAlloc((flags), (cb))))

#define     GlobalReAllocPtr(lp, cbNew, flags)	\
                (GlobalUnlockPtr(lp), GlobalLock(GlobalReAlloc(GlobalPtrHandle(lp) , (cbNew), (flags))))

#define     GlobalFreePtr(lp)		\
                (GlobalUnlockPtr(lp), (BOOL)GlobalFree(GlobalPtrHandle(lp)))

#endif // _GMEMMACROS_

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.