annotate loader/wine/heap.h @ 8394:cf1ac6d3d4f2

sync
author zdar
date Sat, 07 Dec 2002 20:08:51 +0000
parents 3b5f5d1c5041
children c98c9e7f3bd0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * Win32 heap definitions
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 * Copyright 1996 Alexandre Julliard
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 #ifndef __WINE_HEAP_H
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 #define __WINE_HEAP_H
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 #include "config.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 #include "winbase.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 extern HANDLE SystemHeap;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 extern HANDLE SegptrHeap;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 extern int HEAP_IsInsideHeap( HANDLE heap, DWORD flags, LPCVOID ptr );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 extern SEGPTR HEAP_GetSegptr( HANDLE heap, DWORD flags, LPCVOID ptr );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 extern LPSTR HEAP_strdupA( HANDLE heap, DWORD flags, LPCSTR str );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 extern LPWSTR HEAP_strdupW( HANDLE heap, DWORD flags, LPCWSTR str );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 extern LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 extern LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 /* SEGPTR helper macros */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 #define SEGPTR_ALLOC(size) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 (HeapAlloc( SegptrHeap, 0, (size) ))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #define SEGPTR_NEW(type) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 ((type *)HeapAlloc( SegptrHeap, 0, sizeof(type) ))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 #define SEGPTR_STRDUP(str) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 (HIWORD(str) ? HEAP_strdupA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #define SEGPTR_STRDUP_WtoA(str) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 (HIWORD(str) ? HEAP_strdupWtoA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 /* define an inline function, a macro won't do */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 static inline SEGPTR WINE_UNUSED SEGPTR_Get(LPCVOID ptr) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 return (HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, ptr ) : (SEGPTR)ptr);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 #define SEGPTR_GET(ptr) SEGPTR_Get(ptr)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #define SEGPTR_FREE(ptr) \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 (HIWORD(ptr) ? HeapFree( SegptrHeap, 0, (ptr) ) : 0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 /* system heap private data */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 /* you must lock the system heap before using this structure */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 typedef struct
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 void *gdi; /* GDI heap */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 void *user; /* USER handle table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 void *cursor; /* cursor information */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 void *queue; /* message queues descriptor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 void *win; /* windows descriptor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 void *root; /* X11 root window */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 } SYSTEM_HEAP_DESCR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 extern SYSTEM_HEAP_DESCR *SystemHeapDescr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 #endif /* __WINE_HEAP_H */