34 #define WDF_EXTERN_C extern "C"
35 #define WDF_EXTERN_C_START extern "C" {
36 #define WDF_EXTERN_C_END }
39 #define WDF_EXTERN_C_START
40 #define WDF_EXTERN_C_END
48#if (NTDDI_VERSION >= NTDDI_WIN2K)
57#define WDF_TIMEOUT_TO_SEC ((LONGLONG) 1 * 10 * 1000 * 1000)
58#define WDF_TIMEOUT_TO_MS ((LONGLONG) 1 * 10 * 1000)
59#define WDF_TIMEOUT_TO_US ((LONGLONG) 1 * 10)
124 return Length & ~(AlignTo - 1);
141#define WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, _type) \
142 ((_type) (((PUCHAR) (_ptr)) + (_offset)))
144#define WDF_PTR_ADD_OFFSET(_ptr, _offset) \
145 WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, PVOID)
147#define WDF_PTR_GET_OFFSET(_base, _addr) \
148 (size_t) (((PUCHAR) _addr) - ((PUCHAR) _base))
150#if (OSVER(NTDDI_VERSION) == NTDDI_WIN2K)
154#ifndef DECLARE_UNICODE_STRING_SIZE
155#define DECLARE_UNICODE_STRING_SIZE(_var, _size) \
156WCHAR _var ## _buffer[_size]; \
157UNICODE_STRING _var = { 0, _size * sizeof(WCHAR) , _var ## _buffer }
160#undef DECLARE_CONST_UNICODE_STRING
161#define DECLARE_CONST_UNICODE_STRING(_variablename, _string) \
162const WCHAR _variablename ## _buffer[] = _string; \
163__pragma(warning(suppress:4204)) __pragma(warning(suppress:4221)) \
164const UNICODE_STRING _variablename = { sizeof(_string) - sizeof(WCHAR), sizeof(_string), (PWSTR) _variablename ## _buffer }
static PLARGE_INTEGER Time
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define WDF_TIMEOUT_TO_MS
#define WDF_TIMEOUT_TO_SEC
FORCEINLINE LONGLONG WDF_ABS_TIMEOUT_IN_SEC(_In_ ULONGLONG Time)
FORCEINLINE LONGLONG WDF_REL_TIMEOUT_IN_SEC(_In_ ULONGLONG Time)
#define WDF_TIMEOUT_TO_US
FORCEINLINE LONGLONG WDF_ABS_TIMEOUT_IN_US(_In_ ULONGLONG Time)
#define WDF_EXTERN_C_START
FORCEINLINE LONGLONG WDF_REL_TIMEOUT_IN_US(_In_ ULONGLONG Time)
FORCEINLINE LONGLONG WDF_ABS_TIMEOUT_IN_MS(_In_ ULONGLONG Time)
FORCEINLINE LONGLONG WDF_REL_TIMEOUT_IN_MS(_In_ ULONGLONG Time)
FORCEINLINE size_t WDF_ALIGN_SIZE_UP(_In_ size_t Length, _In_ size_t AlignTo)
FORCEINLINE size_t WDF_ALIGN_SIZE_DOWN(_In_ size_t Length, _In_ size_t AlignTo)