annotate loader/wine/heap.h @ 26963:8825552ee585

Fix the linking of TOOLS/netstream and TOOLS/vivodump.
author diego
date Fri, 06 Jun 2008 13:28:25 +0000
parents 0fdf04b07ecb
children 9e739bdb049c
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
26045
a8ea87c71d18 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 24422
diff changeset
7 #ifndef MPLAYER_HEAP_H
a8ea87c71d18 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 24422
diff changeset
8 #define MPLAYER_HEAP_H
1
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) {
26757
0fdf04b07ecb cosmetics: Remove pointless parentheses from return statements.
diego
parents: 26045
diff changeset
36 return HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, ptr ) : (SEGPTR)ptr;
1
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
26045
a8ea87c71d18 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 24422
diff changeset
56 #endif /* MPLAYER_HEAP_H */