[RDBSS]
[reactos.git] / reactos / sdk / include / ddk / ntrxdef.h
1 #ifndef _RX_NTDEFS_DEFINED_
2 #define _RX_NTDEFS_DEFINED_
3
4 #define INLINE __inline
5 #ifndef INVALID_HANDLE_VALUE
6 #define INVALID_HANDLE_VALUE ((HANDLE)-1)
7 #endif
8
9 #define RxAllocatePoolWithTag ExAllocatePoolWithTag
10 #define RxFreePool ExFreePool
11
12 #define RxMdlIsLocked(Mdl) ((Mdl)->MdlFlags & MDL_PAGES_LOCKED)
13 #define RxMdlSourceIsNonPaged(Mdl) ((Mdl)->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL)
14
15 #define RxAdjustAllocationSizeforCC(Fcb) \
16 { \
17 if ((Fcb)->Header.FileSize.QuadPart > (Fcb)->Header.AllocationSize.QuadPart) \
18 { \
19 PMRX_NET_ROOT NetRoot = (Fcb)->pNetRoot; \
20 ULONGLONG ClusterSize = NetRoot->DiskParameters.ClusterSize; \
21 ULONGLONG FileSize = (Fcb)->Header.FileSize.QuadPart; \
22 ASSERT(ClusterSize != 0); \
23 (Fcb)->Header.AllocationSize.QuadPart = (FileSize + ClusterSize) &~ (ClusterSize - 1); \
24 } \
25 ASSERT ((Fcb)->Header.ValidDataLength.QuadPart <= (Fcb)->Header.FileSize.QuadPart); \
26 }
27
28 #endif