Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

heap.h

00001 /*
00002  * Win32 heap definitions
00003  *
00004  * Copyright 1996 Alexandre Julliard
00005  */
00006 
00007 #ifndef __WINE_HEAP_H
00008 #define __WINE_HEAP_H
00009 
00010 #include "config.h"
00011 
00012 #include "winbase.h"
00013 
00014 extern HANDLE SystemHeap;
00015 extern HANDLE SegptrHeap;
00016 
00017 extern int HEAP_IsInsideHeap( HANDLE heap, DWORD flags, LPCVOID ptr );
00018 extern SEGPTR HEAP_GetSegptr( HANDLE heap, DWORD flags, LPCVOID ptr );
00019 extern LPSTR HEAP_strdupA( HANDLE heap, DWORD flags, LPCSTR str );
00020 extern LPWSTR HEAP_strdupW( HANDLE heap, DWORD flags, LPCWSTR str );
00021 extern LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str );
00022 extern LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str );
00023 
00024 /* SEGPTR helper macros */
00025 
00026 #define SEGPTR_ALLOC(size) \
00027          (HeapAlloc( SegptrHeap, 0, (size) ))
00028 #define SEGPTR_NEW(type) \
00029          ((type *)HeapAlloc( SegptrHeap, 0, sizeof(type) ))
00030 #define SEGPTR_STRDUP(str) \
00031          (HIWORD(str) ? HEAP_strdupA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
00032 #define SEGPTR_STRDUP_WtoA(str) \
00033          (HIWORD(str) ? HEAP_strdupWtoA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
00034         /* define an inline function, a macro won't do */
00035 static inline SEGPTR WINE_UNUSED SEGPTR_Get(LPCVOID ptr) {
00036          return (HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, ptr ) : (SEGPTR)ptr);
00037 }
00038 #define SEGPTR_GET(ptr) SEGPTR_Get(ptr)
00039 #define SEGPTR_FREE(ptr) \
00040          (HIWORD(ptr) ? HeapFree( SegptrHeap, 0, (ptr) ) : 0)
00041 
00042 /* system heap private data */
00043 /* you must lock the system heap before using this structure */
00044 typedef struct
00045 {
00046     void     *gdi;        /* GDI heap */
00047     void     *user;       /* USER handle table */
00048     void     *cursor;     /* cursor information */
00049     void     *queue;      /* message queues descriptor */
00050     void     *win;        /* windows descriptor */
00051     void     *root;       /* X11 root window */
00052 } SYSTEM_HEAP_DESCR;
00053 
00054 extern SYSTEM_HEAP_DESCR *SystemHeapDescr;
00055 
00056 #endif  /* __WINE_HEAP_H */

Generated on Tue Dec 20 10:14:22 2005 for vlc-0.8.4a by  doxygen 1.4.2