1
+ /*
2
+ * Helper routines for some of the common methods that people P/Invoke
3
+ * on their applications.
4
+ *
5
+ * Authors:
6
+ * Gonzalo Paniagua (gonzalo@ximian.com)
7
+ * Miguel de Icaza (miguel@novell.com)
8
+ *
9
+ * (C) 2005 Novell, Inc.
10
+ *
11
+ */
1
12
#include <glib.h>
2
13
#include <stdlib.h>
3
14
#include <string.h>
@@ -14,24 +25,24 @@ typedef struct {
14
25
void * fnptr ;
15
26
} FnPtr ;
16
27
17
- gpointer FindWindowExW (gpointer hwndParent , gpointer hwndChildAfter ,
18
- const char * classw , const char * window );
28
+ gpointer FindWindowExW (gpointer hwndParent , gpointer hwndChildAfter ,
29
+ const char * classw , const char * window );
19
30
20
- gpointer HeapAlloc (gpointer unused1 , gint32 unused2 , gint32 nbytes );
21
- gpointer HeapCreate (gint32 flags , gint32 initial_size , gint32 max_size );
22
- gboolean HeapSetInformation (gpointer handle , gpointer heap_info_class ,
23
- gpointer heap_info , gint32 head_info_length );
31
+ gpointer HeapAlloc (gpointer unused1 , gint32 unused2 , gint32 nbytes );
32
+ gpointer HeapCreate (gint32 flags , gint32 initial_size , gint32 max_size );
33
+ gboolean HeapSetInformation (gpointer handle , gpointer heap_info_class ,
34
+ gpointer heap_info , gint32 head_info_length );
24
35
25
36
gboolean HeapQueryInformation (gpointer handle , gpointer heap_info_class ,
26
- gpointer heap_info , gint32 head_info_length , gint32 * ret_length );
37
+ gpointer heap_info , gint32 head_info_length , gint32 * ret_length );
27
38
28
- gpointer HeapAlloc (gpointer handle , gint32 flags , gint32 nbytes );
29
- gpointer HeapReAlloc (gpointer handle , gint32 flags , gpointer mem , gint32 nbytes );
30
- gint32 HeapSize (gpointer handle , gint32 flags , gpointer mem );
31
- gboolean HeapFree (gpointer handle , gint32 flags , gpointer mem );
32
- gboolean HeapValidate (gpointer handle , gpointer mem );
33
- gboolean HeapDestroy (gpointer handle );
34
- gpointer GetProcessHeap (void );
39
+ gpointer HeapAlloc (gpointer handle , gint32 flags , gint32 nbytes );
40
+ gpointer HeapReAlloc (gpointer handle , gint32 flags , gpointer mem , gint32 nbytes );
41
+ gint32 HeapSize (gpointer handle , gint32 flags , gpointer mem );
42
+ gboolean HeapFree (gpointer handle , gint32 flags , gpointer mem );
43
+ gboolean HeapValidate (gpointer handle , gpointer mem );
44
+ gboolean HeapDestroy (gpointer handle );
45
+ gpointer GetProcessHeap (void );
35
46
36
47
static FnPtr functions [] = {
37
48
{ "FindWindowExW" , NULL }, /* user32 */
@@ -161,70 +172,4 @@ FindWindowExW (gpointer hwndParent, gpointer hwndChildAfter, const char *classw,
161
172
return func (hwndParent , hwndChildAfter , classw , window );
162
173
}
163
174
164
- /* begin Heap* functions */
165
- gpointer
166
- HeapCreate (gint32 flags , gint32 initial_size , gint32 max_size )
167
- {
168
- return (gpointer ) 0xDEADBEEF ;
169
- }
170
-
171
- gboolean
172
- HeapSetInformation (gpointer handle , gpointer heap_info_class , gpointer heap_info ,
173
- gint32 head_info_length )
174
- {
175
- return TRUE;
176
- }
177
-
178
- gboolean
179
- HeapQueryInformation (gpointer handle , gpointer heap_info_class , gpointer heap_info ,
180
- gint32 head_info_length , gint32 * ret_length )
181
- {
182
- * ret_length = 0 ;
183
- return TRUE;
184
- }
185
-
186
- gpointer
187
- HeapAlloc (gpointer handle , gint32 flags , gint32 nbytes )
188
- {
189
- return g_malloc0 (nbytes );
190
- }
191
-
192
- gpointer
193
- HeapReAlloc (gpointer handle , gint32 flags , gpointer mem , gint32 nbytes )
194
- {
195
- return g_realloc (mem , nbytes );
196
- }
197
-
198
- gint32
199
- HeapSize (gpointer handle , gint32 flags , gpointer mem )
200
- {
201
- return 0 ;
202
- }
203
-
204
- gboolean
205
- HeapFree (gpointer handle , gint32 flags , gpointer mem )
206
- {
207
- g_free (mem );
208
- return TRUE;
209
- }
210
-
211
- gboolean
212
- HeapValidate (gpointer handle , gpointer mem )
213
- {
214
- return TRUE;
215
- }
216
-
217
- gboolean
218
- HeapDestroy (gpointer handle )
219
- {
220
- return TRUE;
221
- }
222
-
223
-
224
- gpointer
225
- GetProcessHeap ()
226
- {
227
- return (gpointer ) 0xDEADBEEF ;
228
- }
229
- /* end Heap* functions */
230
175
0 commit comments