2 * reactos spinlock emulation of libcaptive
3 * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "reactos/ddk/iotypes.h" /* for PIRP */
23 #include <glib/gmessages.h>
24 #include <glib/gmem.h>
25 #include "captive/macros.h"
26 #include <glib/gmain.h>
27 #include "reactos/internal/io.h" /* for IoSecondStageCompletion() */
30 struct IofCompleteRequest_register_APC {
31 PFILE_OBJECT OriginalFileObject;
36 static gboolean IofCompleteRequest_register_APC_idle_func(struct IofCompleteRequest_register_APC *APC /*data*/)
38 g_return_val_if_fail(APC!=NULL,FALSE); /* remove-me */
40 g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: IoSecondStageCompletion(IRP=%p)...",G_STRLOC,APC->Irp);
41 IoSecondStageCompletion(NULL,NULL,(PVOID)&APC->OriginalFileObject,(PVOID)&APC->Irp,(PVOID)&APC->PriorityBoost);
42 g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: ...IoSecondStageCompletion(IRP=%p) done",G_STRLOC,APC->Irp);
46 return FALSE; /* remove-me */
50 void IofCompleteRequest_register_APC(PFILE_OBJECT OriginalFileObject,PIRP Irp,CCHAR PriorityBoost)
52 struct IofCompleteRequest_register_APC *APC;
54 g_return_if_fail(Irp!=NULL);
57 APC->OriginalFileObject=OriginalFileObject;
59 APC->PriorityBoost=PriorityBoost;
62 G_PRIORITY_DEFAULT_IDLE, /* priority */
63 (GSourceFunc)IofCompleteRequest_register_APC_idle_func, /* function */