mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 16:36:11 +00:00
Fix IoInitializeTimer()
svn path=/trunk/; revision=6537
This commit is contained in:
parent
49f2b1905a
commit
8eb8bd42c6
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: iotypes.h,v 1.56 2003/09/28 07:37:11 navaraf Exp $
|
/* $Id: iotypes.h,v 1.57 2003/11/05 22:49:06 gvg Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ struct _DEVICE_OBJECT;
|
||||||
struct _IRP;
|
struct _IRP;
|
||||||
struct _IO_STATUS_BLOCK;
|
struct _IO_STATUS_BLOCK;
|
||||||
struct _SCSI_REQUEST_BLOCK;
|
struct _SCSI_REQUEST_BLOCK;
|
||||||
|
struct _IO_TIMER;
|
||||||
|
|
||||||
/* SIMPLE TYPES *************************************************************/
|
/* SIMPLE TYPES *************************************************************/
|
||||||
|
|
||||||
|
@ -102,16 +103,6 @@ typedef VOID STDCALL_FUNC
|
||||||
|
|
||||||
typedef struct _ADAPTER_OBJECT ADAPTER_OBJECT, *PADAPTER_OBJECT;
|
typedef struct _ADAPTER_OBJECT ADAPTER_OBJECT, *PADAPTER_OBJECT;
|
||||||
|
|
||||||
/*
|
|
||||||
* PURPOSE: Special timer associated with each device
|
|
||||||
* NOTES: This is a guess
|
|
||||||
*/
|
|
||||||
typedef struct _IO_TIMER
|
|
||||||
{
|
|
||||||
KTIMER timer;
|
|
||||||
KDPC dpc;
|
|
||||||
} IO_TIMER, *PIO_TIMER;
|
|
||||||
|
|
||||||
typedef struct _IO_SECURITY_CONTEXT
|
typedef struct _IO_SECURITY_CONTEXT
|
||||||
{
|
{
|
||||||
PSECURITY_QUALITY_OF_SERVICE SecurityQos;
|
PSECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||||
|
@ -917,7 +908,7 @@ typedef struct _DEVICE_OBJECT
|
||||||
struct _DEVICE_OBJECT* NextDevice;
|
struct _DEVICE_OBJECT* NextDevice;
|
||||||
struct _DEVICE_OBJECT* AttachedDevice;
|
struct _DEVICE_OBJECT* AttachedDevice;
|
||||||
struct _IRP* CurrentIrp;
|
struct _IRP* CurrentIrp;
|
||||||
PIO_TIMER Timer;
|
struct _IO_TIMER *Timer;
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
ULONG Characteristics;
|
ULONG Characteristics;
|
||||||
PVPB Vpb;
|
PVPB Vpb;
|
||||||
|
@ -1081,6 +1072,19 @@ typedef VOID STDCALL_FUNC
|
||||||
(*PIO_TIMER_ROUTINE)(PDEVICE_OBJECT DeviceObject,
|
(*PIO_TIMER_ROUTINE)(PDEVICE_OBJECT DeviceObject,
|
||||||
PVOID Context);
|
PVOID Context);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PURPOSE: Special timer associated with each device
|
||||||
|
* NOTES: This is a guess
|
||||||
|
*/
|
||||||
|
typedef struct _IO_TIMER
|
||||||
|
{
|
||||||
|
KTIMER timer;
|
||||||
|
KDPC dpc;
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
PIO_TIMER_ROUTINE TimerRoutine;
|
||||||
|
PVOID Context;
|
||||||
|
} IO_TIMER, *PIO_TIMER;
|
||||||
|
|
||||||
typedef struct _IO_WORKITEM *PIO_WORKITEM;
|
typedef struct _IO_WORKITEM *PIO_WORKITEM;
|
||||||
typedef VOID (*PIO_WORKITEM_ROUTINE)(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context);
|
typedef VOID (*PIO_WORKITEM_ROUTINE)(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: timer.c,v 1.9 2003/07/10 15:47:00 royce Exp $
|
/* $Id: timer.c,v 1.10 2003/11/05 22:49:06 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -23,6 +23,17 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
static VOID STDCALL
|
||||||
|
IoTimerCallback(IN PKDPC Dpc,
|
||||||
|
IN PVOID DeferredContext,
|
||||||
|
IN PVOID SystemArgument1,
|
||||||
|
IN PVOID SystemArgument2)
|
||||||
|
{
|
||||||
|
PIO_TIMER Timer = (PIO_TIMER) DeferredContext;
|
||||||
|
|
||||||
|
Timer->TimerRoutine(Timer->DeviceObject, Timer->Context);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -44,9 +55,12 @@ IoInitializeTimer(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
DeviceObject->Timer = ExAllocatePoolWithTag(NonPagedPool, sizeof(IO_TIMER),
|
DeviceObject->Timer = ExAllocatePoolWithTag(NonPagedPool, sizeof(IO_TIMER),
|
||||||
TAG_IO_TIMER);
|
TAG_IO_TIMER);
|
||||||
|
DeviceObject->Timer->DeviceObject = DeviceObject;
|
||||||
|
DeviceObject->Timer->TimerRoutine = TimerRoutine;
|
||||||
|
DeviceObject->Timer->Context = Context;
|
||||||
KeInitializeTimer(&(DeviceObject->Timer->timer));
|
KeInitializeTimer(&(DeviceObject->Timer->timer));
|
||||||
KeInitializeDpc(&(DeviceObject->Timer->dpc),
|
KeInitializeDpc(&(DeviceObject->Timer->dpc),
|
||||||
(PKDEFERRED_ROUTINE)TimerRoutine,Context);
|
IoTimerCallback, DeviceObject->Timer);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue