3 #ifndef _INCLUDE_DDK_MMTYPES_H
4 #define _INCLUDE_DDK_MMTYPES_H
6 #include <ddk/i386/pagesize.h>
11 * FUNCTION: Determines if the given virtual address is page aligned
13 #define IS_PAGE_ALIGNED(Va) (((ULONG)Va)&0xfff)
16 * PURPOSE: Returns the byte offset of a field within a structure
19 #define FIELD_OFFSET(Type,Field) (LONG)(&(((Type *)(0))->Field))
23 * PURPOSE: Returns the base address structure if the caller knows the
24 * address of a field within the structure
26 * Address = address of the field
27 * Type = Type of the whole structure
28 * Field = Name of the field whose address is none
30 #ifndef CONTAINING_RECORD
31 #define CONTAINING_RECORD(Address,Type,Field) (Type *)(((LONG)Address) - FIELD_OFFSET(Type,Field))
35 #define MDL_MAPPED_TO_SYSTEM_VA (0x1)
36 #define MDL_PAGES_LOCKED (0x2)
37 #define MDL_SOURCE_IS_NONPAGED_POOL (0x4)
38 #define MDL_ALLOCATED_FIXED_SIZE (0x8)
39 #define MDL_PARTIAL (0x10)
40 #define MDL_PARTIAL_HAS_BEEN_MAPPED (0x20)
41 #define MDL_IO_PAGE_READ (0x40)
42 #define MDL_WRITE_OPERATION (0x80)
43 #define MDL_PARENT_MAPPED_SYSTEM_VA (0x100)
44 #define MDL_LOCK_HELD (0x200)
45 #define MDL_SCATTER_GATHER_VA (0x400)
46 #define MDL_IO_SPACE (0x800)
47 #define MDL_NETWORK_HEADER (0x1000)
48 #define MDL_MAPPING_CAN_FAIL (0x2000)
49 #define MDL_ALLOCATED_MUST_SUCCEED (0x4000)
50 #define MDL_64_BIT_VA (0x8000)
55 * PURPOSE: Describes a user buffer passed to a system API
61 struct _EPROCESS* Process;
68 #define MmSmallSystem (0)
69 #define MmMediumSystem (1)
70 #define MmLargeSystem (2)
72 /* Used in MmFlushImageSection */
73 typedef enum _MMFLUSH_TYPE
79 typedef enum _MEMORY_CACHING_TYPE
84 MmHardwareCoherentCached,
86 } MEMORY_CACHING_TYPE;