source:
trunk /include /win /heap.h @
4
| Last change on this file since 4 was 4, checked in by ktk, 27 years ago | |
|---|---|
|
Import |
|
| File size: 1.6 KB | |
| Line | |
|---|---|
| 1 | /* $Id: heap.h,v 1.1 1999年05月24日 20:19:12 ktk Exp $ */ |
| 2 | |
| 3 | /* |
| 4 | * Win32 heap definitions |
| 5 | * |
| 6 | * Copyright 1996 Alexandre Julliard |
| 7 | */ |
| 8 | |
| 9 | #ifndef __WINE_HEAP_H |
| 10 | #define __WINE_HEAP_H |
| 11 | |
| 12 | #include"winbase.h" |
| 13 | |
| 14 | externHANDLESystemHeap; |
| 15 | externHANDLESegptrHeap; |
| 16 | |
| 17 | externintHEAP_IsInsideHeap(HANDLEheap,DWORDflags,LPCVOIDptr); |
| 18 | externSEGPTRHEAP_GetSegptr(HANDLEheap,DWORDflags,LPCVOIDptr); |
| 19 | externLPVOIDHEAP_xalloc(HANDLEheap,DWORDflags,DWORDsize); |
| 20 | externLPVOIDHEAP_xrealloc(HANDLEheap,DWORDflags,LPVOIDlpMem,DWORDsize); |
| 21 | externLPSTRHEAP_strdupA(HANDLEheap,DWORDflags,LPCSTRstr); |
| 22 | externLPWSTRHEAP_strdupW(HANDLEheap,DWORDflags,LPCWSTRstr); |
| 23 | externLPWSTRHEAP_strdupAtoW(HANDLEheap,DWORDflags,LPCSTRstr); |
| 24 | externLPSTRHEAP_strdupWtoA(HANDLEheap,DWORDflags,LPCWSTRstr); |
| 25 | |
| 26 | /* SEGPTR helper macros */ |
| 27 | |
| 28 | #define SEGPTR_ALLOC(size) \ |
| 29 | (HeapAlloc( SegptrHeap, 0, (size) )) |
| 30 | #define SEGPTR_NEW(type) \ |
| 31 | ((type *)HeapAlloc( SegptrHeap, 0, sizeof(type) )) |
| 32 | #define SEGPTR_STRDUP(str) \ |
| 33 | (HIWORD(str) ? HEAP_strdupA( SegptrHeap, 0, (str) ) : (LPSTR)(str)) |
| 34 | #define SEGPTR_STRDUP_WtoA(str) \ |
| 35 | (HIWORD(str) ? HEAP_strdupWtoA( SegptrHeap, 0, (str) ) : (LPSTR)(str)) |
| 36 | /* define an inline function, a macro won't do */ |
| 37 | static__inline__SEGPTRWINE_UNUSEDSEGPTR_Get(LPCVOIDptr){ |
| 38 | return(HIWORD(ptr)?HEAP_GetSegptr(SegptrHeap,0,ptr):(SEGPTR)ptr); |
| 39 | } |
| 40 | #define SEGPTR_GET(ptr) SEGPTR_Get(ptr) |
| 41 | #define SEGPTR_FREE(ptr) \ |
| 42 | (HIWORD(ptr) ? HeapFree( SegptrHeap, 0, (ptr) ) : 0) |
| 43 | |
| 44 | |
| 45 | #endif /* __WINE_HEAP_H */ |
Note:
See TracBrowser
for help on using the repository browser.