
--proc/system/winnt: don't know the scope of this yet.
--Written by Cosmin Apreutesei. Public Domain.

setfenv(1, require'winapi')

STANDARD_RIGHTS_REQUIRED = 0x000F0000
STANDARD_RIGHTS_ALL      = 0x001F0000

SECTION_QUERY                = 0x0001
SECTION_MAP_WRITE            = 0x0002
SECTION_MAP_READ             = 0x0004
SECTION_MAP_EXECUTE          = 0x0008
SECTION_EXTEND_SIZE          = 0x0010
SECTION_MAP_EXECUTE_EXPLICIT = 0x0020
SECTION_ALL_ACCESS           = bit.bor(STANDARD_RIGHTS_REQUIRED,
	SECTION_QUERY, SECTION_MAP_WRITE, SECTION_MAP_READ, SECTION_MAP_EXECUTE,
	SECTION_EXTEND_SIZE)

PAGE_NOACCESS          = 0x01
PAGE_READONLY          = 0x02
PAGE_READWRITE         = 0x04
PAGE_WRITECOPY         = 0x08
PAGE_EXECUTE           = 0x10
PAGE_EXECUTE_READ      = 0x20 --XP SP2+
PAGE_EXECUTE_READWRITE = 0x40 --XP SP2+
PAGE_EXECUTE_WRITECOPY = 0x80 --Vista SP1+
PAGE_GUARD            = 0x100
PAGE_NOCACHE          = 0x200
PAGE_WRITECOMBINE     = 0x400

SEC_FILE            = 0x00800000
SEC_IMAGE           = 0x01000000
SEC_PROTECTED_IMAGE = 0x02000000
SEC_RESERVE         = 0x04000000
SEC_COMMIT          = 0x08000000
SEC_NOCACHE         = 0x10000000
SEC_WRITECOMBINE    = 0x40000000
SEC_LARGE_PAGES     = 0x80000000

GENERIC_READ    = 0x80000000
GENERIC_WRITE   = 0x40000000
GENERIC_EXECUTE = 0x20000000
GENERIC_ALL     = 0x10000000

FILE_SHARE_READ        = 0x00000001
FILE_SHARE_WRITE       = 0x00000002
FILE_SHARE_DELETE      = 0x00000004
FILE_SHARE_VALID_FLAGS = 0x00000007

FILE_ATTRIBUTE_READONLY             = 0x00000001
FILE_ATTRIBUTE_HIDDEN               = 0x00000002
FILE_ATTRIBUTE_SYSTEM               = 0x00000004
FILE_ATTRIBUTE_DIRECTORY            = 0x00000010
FILE_ATTRIBUTE_ARCHIVE              = 0x00000020
FILE_ATTRIBUTE_DEVICE               = 0x00000040
FILE_ATTRIBUTE_NORMAL               = 0x00000080
FILE_ATTRIBUTE_TEMPORARY            = 0x00000100
FILE_ATTRIBUTE_SPARSE_FILE          = 0x00000200
FILE_ATTRIBUTE_REPARSE_POINT        = 0x00000400
FILE_ATTRIBUTE_COMPRESSED           = 0x00000800
FILE_ATTRIBUTE_OFFLINE              = 0x00001000
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  = 0x00002000
FILE_ATTRIBUTE_ENCRYPTED            = 0x00004000
FILE_ATTRIBUTE_VIRTUAL              = 0x00010000
