g_return_if_fail(page->dirty);
if (page->lsn_newest) {
-LARGE_INTEGER lsn_newest_LargeInteger;
-
/* sanity check */
g_assert(!lsn_last || lsn_last<=page->lsn_newest);
lsn_last=page->lsn_newest;
- lsn_newest_LargeInteger.QuadPart=page->lsn_newest;
- (*captive_FlushToLsnRoutine)(captive_LogHandle,lsn_newest_LargeInteger);
+ captive_stdcall_call_12((CaptiveStdCallFunc12)captive_FlushToLsnRoutine,
+ captive_LogHandle,
+ (gpointer)(guint32)(page->lsn_newest>> 0U), /* 'LARGE_INTEGER' argument */
+ (gpointer)(guint32)(page->lsn_newest>>32U));
}
offset_LargeInteger.QuadPart=offset;
captive_utf8_to_UnicodeString_alloca("\\captive\\filesystem")); /* DriverEntry_RegistryPath */
g_return_val_if_fail(NT_SUCCESS(err),FALSE);
if (captive_DriverObject_ReinitRoutine) {
- (*captive_DriverObject_ReinitRoutine)(
+ captive_stdcall_call_12((CaptiveStdCallFunc12)captive_DriverObject_ReinitRoutine,
&captive_DriverObject, /* DriverObject */
captive_DriverObject_ReinitRoutine_Context, /* Context */
- 1); /* Count: # of calls of ReinitRoutine incl. the current one */
+ (gpointer)1); /* Count: # of calls of ReinitRoutine incl. the current one */
}
return TRUE;
/* typedef VOID STDCALL_FUNC (*PWORKER_THREAD_ROUTINE)(PVOID Parameter); */
- (*WorkItem_copy->WorkerRoutine)(WorkItem_copy->Parameter);
+ captive_stdcall_call_4((CaptiveStdCallFunc4)WorkItem_copy->WorkerRoutine,
+ WorkItem_copy->Parameter); /* Parameter */
g_free(WorkItem_copy);
return FALSE; /* remove-me */
#include <glib/gmacros.h>
+#include <glib/gtypes.h>
/* captive/?*_reactos.h include files have forbidden any reactos/?* inclusions
* as they are being included by reactos/compat.h.
*/
*/
#undef CAPTIVE_FASTCALL
+
+typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc4 )(gpointer arg0);
+typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc8 )(gpointer arg0,gpointer arg1);
+typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc12)(gpointer arg0,gpointer arg1,gpointer arg2);
+
+gpointer captive_stdcall_call_4 (CaptiveStdCallFunc4 func,gpointer arg0);
+gpointer captive_stdcall_call_8 (CaptiveStdCallFunc8 func,gpointer arg0,gpointer arg1);
+gpointer captive_stdcall_call_12(CaptiveStdCallFunc12 func,gpointer arg0,gpointer arg1,gpointer arg2);
+
G_END_DECLS
/* initialize the module */
DriverEntry=(PDRIVER_INITIALIZE)(*ModuleObjectp)->EntryPoint;
- err=(*DriverEntry)(DriverEntry_DriverObject,DriverEntry_RegistryPath);
+ err=(NTSTATUS)captive_stdcall_call_8((CaptiveStdCallFunc8)DriverEntry,
+ DriverEntry_DriverObject,
+ DriverEntry_RegistryPath);
if (!NT_SUCCESS(err))
goto err_LdrUnloadModule;
{
g_return_if_fail(captive_work_queue_item!=NULL);
- (*captive_work_queue_item->WorkerRoutine)(captive_work_queue_item->Parameter);
+ /* typedef VOID CAPTIVE_STDCALL (*PWORKER_THREAD_ROUTINE)(IN PVOID Context); */
+
+ captive_stdcall_call_4((CaptiveStdCallFunc4)captive_work_queue_item->WorkerRoutine,
+ captive_work_queue_item->Parameter); /* Context */
g_free(captive_work_queue_item);
}
/* FIXME: Should we check for func/data dupes? Are they permitted by W32? */
- /* typedef VOID (*PWORKER_THREAD_ROUTINE)(IN PVOID Context); */
-
ghook=g_hook_alloc(&captive_PoQueueShutdownWorkItem_hooklist);
ghook->func=PoQueueShutdownWorkItem_func;
ghook->data=captive_work_queue_item;
noinst_LTLIBRARIES=libps.la
libps_la_SOURCES= \
+ calltype.S \
create.c \
math.c \
ps_reactos.c \
--- /dev/null
+/* $Id$
+ * CAPTIVE_STDCALL calling by hand as GCC has it broken
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/*
+ * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc4 )(gpointer arg0);
+ * gpointer captive_stdcall_call_4 (CaptiveStdCallFunc4 func,gpointer arg0);
+ */
+ .globl captive_stdcall_call_4
+captive_stdcall_call_4:
+ pushl %ebp /* std stack frame */
+ movl %esp,%ebp /* std stack frame */
+ pushl 12(%ebp) /* arg0 */
+ movl 8(%ebp),%eax /* func */
+ call *%eax
+ /* keep '%eax' return value */
+ leave
+ ret
+
+/*
+ * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc8 )(gpointer arg0,gpointer arg1);
+ * gpointer captive_stdcall_call_8 (CaptiveStdCallFunc8 func,gpointer arg0,gpointer arg1);
+ */
+ .globl captive_stdcall_call_8
+captive_stdcall_call_8:
+ pushl %ebp /* std stack frame */
+ movl %esp,%ebp /* std stack frame */
+ pushl 16(%ebp) /* arg1 */
+ pushl 12(%ebp) /* arg0 */
+ movl 8(%ebp),%eax /* func */
+ call *%eax
+ /* keep '%eax' return value */
+ leave
+ ret
+
+/*
+ * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc12)(gpointer arg0,gpointer arg1,gpointer arg2);
+ * gpointer captive_stdcall_call_12(CaptiveStdCallFunc12 func,gpointer arg0,gpointer arg1,gpointer arg2);
+ */
+ .globl captive_stdcall_call_12
+captive_stdcall_call_12:
+ pushl %ebp /* std stack frame */
+ movl %esp,%ebp /* std stack frame */
+ pushl 20(%ebp) /* arg2 */
+ pushl 16(%ebp) /* arg1 */
+ pushl 12(%ebp) /* arg0 */
+ movl 8(%ebp),%eax /* func */
+ call *%eax
+ /* keep '%eax' return value */
+ leave
+ ret