Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
1003 B

/*++
Copyright (c) 2000-2002 Microsoft Corporation
Module Name:
largemem.h
Abstract:
The public definition of large memory allocator interfaces.
Author:
George V. Reilly (GeorgeRe) 10-Nov-2000
Revision History:
--*/
#ifndef _LARGEMEM_H_
#define _LARGEMEM_H_
NTSTATUS
UlLargeMemInitialize(
);
VOID
UlLargeMemTerminate(
VOID
);
ULONG
UlLargeMemUsagePercentage(
VOID
);
PMDL
UlLargeMemAllocate(
IN ULONG Length
);
VOID
UlLargeMemFree(
IN PMDL pMdl
);
BOOLEAN
UlLargeMemSetData(
IN PMDL pMdl,
IN PUCHAR pBuffer,
IN ULONG Length,
IN ULONG Offset
);
// 2^20 = 1MB
#define MEGABYTE_SHIFT 20
C_ASSERT(PAGE_SHIFT < MEGABYTE_SHIFT);
#define PAGES_TO_MEGABYTES(P) ((P) >> (MEGABYTE_SHIFT - PAGE_SHIFT))
#define MEGABYTES_TO_PAGES(M) ((M) << (MEGABYTE_SHIFT - PAGE_SHIFT))
#define MEGABYTES_TO_BYTES(M) ((M) << (MEGABYTE_SHIFT))
#endif // _LARGEMEM_H_