// stddcls.h -- Precompiled headers for WDM drivers #ifdef __cplusplus extern "C" { #endif #include #include #ifdef __cplusplus } #endif #define PAGEDCODE code_seg("page") #define LOCKEDCODE code_seg() #define INITCODE code_seg("init") #define PAGEDDATA data_seg("page") #define LOCKEDDATA data_seg() #define INITDATA data_seg("init") #define arraysize(p) (sizeof(p)/sizeof((p)[0])) // Currently, the support routines for managing the device remove lock aren't // defined in the WDM.H or implemented in Windows 98. The following declarations // provide equivalent functionality on all WDM platforms by means of a private // implementation in RemoveLock.cpp typedef struct _REMOVE_LOCK { LONG usage; // reference count BOOLEAN removing; // true if removal is pending KEVENT evRemove; // event to wait on } REMOVE_LOCK, *PREMOVE_LOCK; VOID InitializeRemoveLock(PREMOVE_LOCK lock, ULONG tag, ULONG minutes, ULONG maxcount); NTSTATUS AcquireRemoveLock(PREMOVE_LOCK lock, PVOID tag); VOID ReleaseRemoveLock(PREMOVE_LOCK lock, PVOID tag); VOID ReleaseRemoveLockAndWait(PREMOVE_LOCK lock, PVOID tag); // Redefine macros in case the programmer changes the driver to include NTDDK.H // instead of WDM.H #undef IoInitializeRemoveLock #define IoInitializeRemoveLock InitializeRemoveLock #undef IoAcquireRemoveLock #define IoAcquireRemoveLock AcquireRemoveLock #undef IoReleaseRemoveLock #define IoReleaseRemoveLock ReleaseRemoveLock #undef IoReleaseRemoveLockAndWait #define IoReleaseRemoveLockAndWait ReleaseRemoveLockAndWait #define _IO_REMOVE_LOCK _REMOVE_LOCK #define IO_REMOVE_LOCK REMOVE_LOCK #define PIO_REMOVE_LOCK PREMOVE_LOCK