X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=support%2Fsupportw.c;h=49ed549c5d2f546ffeffd31a2e3b8289fa32af1a;hb=2f11972da5a0697144887a38fd7fb008c783533d;hp=512d21732f0d0926d8336130197948e010833acb;hpb=05381e2173ba106ef1b85c444dd8956c7a2b7dbe;p=mono.git diff --git a/support/supportw.c b/support/supportw.c index 512d21732f0..49ed549c5d2 100644 --- a/support/supportw.c +++ b/support/supportw.c @@ -1,3 +1,14 @@ +/* + * Helper routines for some of the common methods that people P/Invoke + * on their applications. + * + * Authors: + * Gonzalo Paniagua (gonzalo@ximian.com) + * Miguel de Icaza (miguel@novell.com) + * + * (C) 2005 Novell, Inc. + * + */ #include #include #include @@ -14,23 +25,10 @@ typedef struct { void *fnptr; } FnPtr; -gpointer FindWindowExW (gpointer hwndParent, gpointer hwndChildAfter, - const char *classw, const char *window); +gpointer FindWindowExW (gpointer hwndParent, gpointer hwndChildAfter, + const char *classw, const char *window); -gpointer HeapAlloc (gpointer unused1, gint32 unused2, gint32 nbytes); -gpointer HeapCreate (gint32 flags, gint32 initial_size, gint32 max_size); -gboolean HeapSetInformation (gpointer handle, gpointer heap_info_class, - gpointer heap_info, gint32 head_info_length); - -gboolean HeapQueryInformation (gpointer handle, gpointer heap_info_class, - gpointer heap_info, gint32 head_info_length, gint32 *ret_length); - -gpointer HeapAlloc (gpointer handle, gint32 flags, gint32 nbytes); -gpointer HeapReAlloc (gpointer handle, gint32 flags, gpointer mem, gint32 nbytes); -gint32 HeapSize (gpointer handle, gint32 flags, gpointer mem); -gboolean HeapFree (gpointer handle, gint32 flags, gpointer mem); -gboolean HeapValidate (gpointer handle, gpointer mem); -gpointer GetProcessHeap (void); +gpointer GetProcessHeap (void); static FnPtr functions [] = { { "FindWindowExW", NULL }, /* user32 */ @@ -85,6 +83,8 @@ supportw_register_delegate (const char *function_name, void *fnptr) static gboolean register_assembly (const char *name, int *registered) { +/* we can't use mono or wapi funcions in a support lib */ +#if 0 MonoAssembly *assembly; MonoImageOpenStatus status; MonoImage *image; @@ -126,6 +126,9 @@ register_assembly (const char *name, int *registered) *registered = 1; mono_assembly_close (assembly); return TRUE; +#else + return FALSE; +#endif } void @@ -150,66 +153,27 @@ FindWindowExW (gpointer hwndParent, gpointer hwndChildAfter, const char *classw, g_return_val_if_fail (register_assembly ("System.Windows.Forms", &swf_registered), NULL); if (func == NULL) - func = (func_type) get_function ("FindwindowExW"); + func = (func_type) get_function ("FindWindowExW"); return func (hwndParent, hwndChildAfter, classw, window); } -gpointer -HeapCreate (gint32 flags, gint32 initial_size, gint32 max_size) +int +SetWindowPos (gpointer hwnd, gpointer hwndInsertAfter, int x, int y, int cx, int cy, unsigned int flags) { - return (gpointer) 0xDEADBEEF; + fprintf (stderr, "SetWindowPos %p %p to [%d,%dx%d,%d] %d\n", hwnd, hwndInsertAfter, x, y, cx, cy, flags); + return 1; } -gboolean -HeapSetInformation (gpointer handle, gpointer heap_info_class, gpointer heap_info, - gint32 head_info_length) -{ - return TRUE; -} - -gboolean -HeapQueryInformation (gpointer handle, gpointer heap_info_class, gpointer heap_info, - gint32 head_info_length, gint32 *ret_length) -{ - *ret_length = 0; - return TRUE; -} - -gpointer -HeapAlloc (gpointer handle, gint32 flags, gint32 nbytes) -{ - return g_malloc0 (nbytes); -} - -gpointer -HeapReAlloc (gpointer handle, gint32 flags, gpointer mem, gint32 nbytes) -{ - return g_realloc (mem, nbytes); -} - -gint32 -HeapSize (gpointer handle, gint32 flags, gpointer mem) +int +SendMessageA (gpointer hwnd, unsigned int msg, gpointer wparam, gpointer lparam) { + fprintf (stderr, "SendMessage (%d, 0x%x, %p, %p)\n", (int) GPOINTER_TO_INT (hwnd), msg, wparam, lparam); return 0; } -gboolean -HeapFree (gpointer handle, gint32 flags, gpointer mem) -{ - g_free (mem); - return TRUE; -} - -gboolean -HeapValidate (gpointer handle, gpointer mem) -{ - return TRUE; -} - -gpointer -GetProcessHeap () +int +GetWindowLongA (gpointer hwnd, int a) { - return (gpointer) 0xDEADBEEF; + return 0; } -