www.pudn.com > Microsoft Windows驱动程序模型设计 源代码.zip > Driver.h
// Declarations for wmi42 driver // Copyright (C) 1999 by Walter Oney // All rights reserved #ifndef DRIVER_H #define DRIVER_H #include#define DRIVERNAME "WMI42" // for use in messages #define LDRIVERNAME L"WMI42" // for use in UNICODE strings /////////////////////////////////////////////////////////////////////////////// // Device extension structure typedef struct tagDEVICE_EXTENSION { PDEVICE_OBJECT DeviceObject; // device object this extension belongs to PDEVICE_OBJECT LowerDeviceObject; // next lower driver in same stack PDEVICE_OBJECT Pdo; // the PDO IO_REMOVE_LOCK RemoveLock; // removal control locking structure UNICODE_STRING devname; // name of device PGENERIC_EXTENSION pgx; // device extension for GENERIC.SYS ULONG TheAnswer; // WMI property value } DEVICE_EXTENSION, *PDEVICE_EXTENSION; /////////////////////////////////////////////////////////////////////////////// // Global functions VOID RemoveDevice(IN PDEVICE_OBJECT fdo); NTSTATUS CompleteRequest(IN PIRP Irp, IN NTSTATUS status, IN ULONG_PTR info); NTSTATUS StartDevice(PDEVICE_OBJECT fdo, PCM_PARTIAL_RESOURCE_LIST raw, PCM_PARTIAL_RESOURCE_LIST translated); VOID StopDevice(PDEVICE_OBJECT fdo, BOOLEAN oktouch = FALSE); VOID WmiInitialize(IN PDEVICE_OBJECT fdo); VOID WmiTerminate(IN PDEVICE_OBJECT fdo); // I/O request handlers NTSTATUS DispatchPower(PDEVICE_OBJECT fdo, PIRP Irp); NTSTATUS DispatchWmi(PDEVICE_OBJECT fdo, PIRP Irp); NTSTATUS DispatchPnp(PDEVICE_OBJECT fdo, PIRP Irp); extern BOOLEAN win98; extern UNICODE_STRING servkey; #endif // DRIVER_H