Citar
Type COMMTIMEOUTS
ReadIntervalTimeout As Long
ReadTotalTimeoutMultiplier As Long
ReadTotalTimeoutConstant As Long
WriteTotalTimeoutMultiplier As Long
WriteTotalTimeoutConstant As Long
End Type
Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
' Global Memory Flags
Public Const GMEM_FIXED = &H0
Public Const GMEM_MOVEABLE = &H2
Public Const GMEM_NOCOMPACT = &H10
Public Const GMEM_NODISCARD = &H20
Public Const GMEM_ZEROINIT = &H40
Public Const GMEM_MODIFY = &H80
Public Const GMEM_DISCARDABLE = &H100
Public Const GMEM_NOT_BANKED = &H1000
Public Const GMEM_SHARE = &H2000
Public Const GMEM_DDESHARE = &H2000
Public Const GMEM_NOTIFY = &H4000
Public Const GMEM_LOWER = GMEM_NOT_BANKED
Public Const GMEM_VALID_FLAGS = &H7F72
Public Const GMEM_INVALID_HANDLE = &H8000
Public Const GHND = (GMEM_MOVEABLE Or GMEM_ZEROINIT)
Public Const GPTR = (GMEM_FIXED Or GMEM_ZEROINIT)
' Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE)
Public Const GMEM_DISCARDED = &H4000
Public Const GMEM_LOCKCOUNT = &HFF
Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
' Local Memory Flags
Public Const LMEM_FIXED = &H0
Public Const LMEM_MOVEABLE = &H2
Public Const LMEM_NOCOMPACT = &H10
Public Const LMEM_NODISCARD = &H20
Public Const LMEM_ZEROINIT = &H40
Public Const LMEM_MODIFY = &H80
Public Const LMEM_DISCARDABLE = &HF00
Public Const LMEM_VALID_FLAGS = &HF72
Public Const LMEM_INVALID_HANDLE = &H8000
Public Const LHND = (LMEM_MOVEABLE + LMEM_ZEROINIT)
Public Const LPTR = (LMEM_FIXED + LMEM_ZEROINIT)
Public Const NONZEROLHND = (LMEM_MOVEABLE)
Public Const NONZEROLPTR = (LMEM_FIXED)
' Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)
Public Const LMEM_DISCARDED = &H4000
Public Const LMEM_LOCKCOUNT = &HFF
' dwCreationFlag values
Public Const DEBUG_PROCESS = &H1
Public Const DEBUG_ONLY_THIS_PROCESS = &H2
Public Const CREATE_SUSPENDED = &H4
Public Const DETACHED_PROCESS = &H8
Public Const CREATE_NEW_CONSOLE = &H10
Public Const NORMAL_PRIORITY_CLASS = &H20
Public Const IDLE_PRIORITY_CLASS = &H40
Public Const HIGH_PRIORITY_CLASS = &H80
Public Const REALTIME_PRIORITY_CLASS = &H100
Public Const CREATE_NEW_PROCESS_GROUP = &H200
Public Const CREATE_NO_WINDOW = &H8000000
Public Const PROFILE_USER = &H10000000
Public Const PROFILE_KERNEL = &H20000000
Public Const PROFILE_SERVER = &H40000000
Public Const MAXLONG = &H7FFFFFFF
Public Const THREAD_BASE_PRIORITY_MIN = -2
Public Const THREAD_BASE_PRIORITY_MAX = 2
Public Const THREAD_BASE_PRIORITY_LOWRT = 15
Public Const THREAD_BASE_PRIORITY_IDLE = -15
Public Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
Public Const THREAD_PRIORITY_BELOW_NORMAL = (THREAD_PRIORITY_LOWEST + 1)
Public Const THREAD_PRIORITY_NORMAL = 0
Public Const THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
Public Const THREAD_PRIORITY_ABOVE_NORMAL = (THREAD_PRIORITY_HIGHEST - 1)
Public Const THREAD_PRIORITY_ERROR_RETURN = (MAXLONG)
Public Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
Public Const THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE
' ++ BUILD Version: 0093 Increment this if a change has global effects
' Copyright (c) 1990-1995 Microsoft Corporation
' Module Name:
' winnt.h
' Abstract:
' This module defines the 32-Bit Windows types and constants that are
' defined by NT, but exposed through the Win32 API.
' Revision History:
Public Const APPLICATION_ERROR_MASK = &H20000000
Public Const ERROR_SEVERITY_SUCCESS = &H0
Public Const ERROR_SEVERITY_INFORMATIONAL = &H40000000
Public Const ERROR_SEVERITY_WARNING = &H80000000
Public Const ERROR_SEVERITY_ERROR = &HC0000000
Public Const MINCHAR = &H80
Public Const MAXCHAR = &H7F
Public Const MINSHORT = &H8000
Public Const MAXSHORT = &H7FFF
Public Const MINLONG = &H80000000
Public Const MAXByte = &HFF
Public Const MAXWORD = &HFFFF
Public Const MAXDWORD = &HFFFF
'
' Calculate the byte offset of a field in a structure of type type.
' * Language IDs.
' *
' * The following two combinations of primary language ID and
' * sublanguage ID have special semantics:
' *
' * Primary Language ID Sublanguage ID Result
' * ------------------- --------------- ------------------------
' * LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral
' * LANG_NEUTRAL SUBLANG_DEFAULT User default language
' * LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language
' */
'
' * Primary language IDs.
' */
Public Const LANG_NEUTRAL = &H0
Public Const LANG_BULGARIAN = &H2
Public Const LANG_CHINESE = &H4
Public Const LANG_CROATIAN = &H1A
Public Const LANG_CZECH = &H5
Public Const LANG_DANISH = &H6
Public Const LANG_DUTCH = &H13
Public Const LANG_ENGLISH = &H9
Public Const LANG_FINNISH = &HB
Public Const LANG_FRENCH = &HC
Public Const LANG_GERMAN = &H7
Public Const LANG_GREEK = &H8
Public Const LANG_HUNGARIAN = &HE
Public Const LANG_ICELANDIC = &HF
Public Const LANG_ITALIAN = &H10
Public Const LANG_JAPANESE = &H11
Public Const LANG_KOREAN = &H12
Public Const LANG_NORWEGIAN = &H14
Public Const LANG_POLISH = &H15
Public Const LANG_PORTUGUESE = &H16
Public Const LANG_ROMANIAN = &H18
Public Const LANG_RUSSIAN = &H19
Public Const LANG_SLOVAK = &H1B
Public Const LANG_SLOVENIAN = &H24
Public Const LANG_SPANISH = &HA
Public Const LANG_SWEDISH = &H1D
Public Const LANG_TURKISH = &H1F
'
' * Sublanguage IDs.
' *
' * The name immediately following SUBLANG_ dictates which primary
' * language ID that sublanguage ID can be combined with to form a
' * valid language ID.
' */
Public Const SUBLANG_NEUTRAL = &H0 ' language neutral
Public Const SUBLANG_DEFAULT = &H1 ' user default
Public Const SUBLANG_SYS_DEFAULT = &H2 ' system default
Public Const SUBLANG_CHINESE_TRADITIONAL = &H1 ' Chinese (Taiwan)
Public Const SUBLANG_CHINESE_SIMPLIFIED = &H2 ' Chinese (PR China)
Public Const SUBLANG_CHINESE_HONGKONG = &H3 ' Chinese (Hong Kong)
Public Const SUBLANG_CHINESE_SINGAPORE = &H4 ' Chinese (Singapore)
Public Const SUBLANG_DUTCH = &H1 ' Dutch
Public Const SUBLANG_DUTCH_BELGIAN = &H2 ' Dutch (Belgian)
Public Const SUBLANG_ENGLISH_US = &H1 ' English (USA)
Public Const SUBLANG_ENGLISH_UK = &H2 ' English (UK)
Public Const SUBLANG_ENGLISH_AUS = &H3 ' English (Australian)
Public Const SUBLANG_ENGLISH_CAN = &H4 ' English (Canadian)
Public Const SUBLANG_ENGLISH_NZ = &H5 ' English (New Zealand)
Public Const SUBLANG_ENGLISH_EIRE = &H6 ' English (Irish)
Public Const SUBLANG_FRENCH = &H1 ' French
Public Const SUBLANG_FRENCH_BELGIAN = &H2 ' French (Belgian)
Public Const SUBLANG_FRENCH_CANADIAN = &H3 ' French (Canadian)
Public Const SUBLANG_FRENCH_SWISS = &H4 ' French (Swiss)
Public Const SUBLANG_GERMAN = &H1 ' German
Public Const SUBLANG_GERMAN_SWISS = &H2 ' German (Swiss)
Public Const SUBLANG_GERMAN_AUSTRIAN = &H3 ' German (Austrian)
Public Const SUBLANG_ITALIAN = &H1 ' Italian
Public Const SUBLANG_ITALIAN_SWISS = &H2 ' Italian (Swiss)
Public Const SUBLANG_NORWEGIAN_BOKMAL = &H1 ' Norwegian (Bokma
Public Const SUBLANG_NORWEGIAN_NYNORSK = &H2 ' Norwegian (Nynorsk)
Public Const SUBLANG_PORTUGUESE = &H2 ' Portuguese
Public Const SUBLANG_PORTUGUESE_BRAZILIAN = &H1 ' Portuguese (Brazilian)
Public Const SUBLANG_SPANISH = &H1 ' Spanish (Castilian)
Public Const SUBLANG_SPANISH_MEXICAN = &H2 ' Spanish (Mexican)
Public Const SUBLANG_SPANISH_MODERN = &H3 ' Spanish (Modern)
'
' * Sorting IDs.
' *
' */
Public Const SORT_DEFAULT = &H0 ' sorting default
Public Const SORT_JAPANESE_XJIS = &H0 ' Japanese0xJIS order
Public Const SORT_JAPANESE_UNICODE = &H1 ' Japanese Unicode order
Public Const SORT_CHINESE_BIG5 = &H0 ' Chinese BIG5 order
Public Const SORT_CHINESE_UNICODE = &H1 ' Chinese Unicode order
Public Const SORT_KOREAN_KSC = &H0 ' Korean KSC order
Public Const SORT_KOREAN_UNICODE = &H1 ' Korean Unicode order
' The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
' devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
' constants *MUST* always be in sync.
' The values are redefined in devioctl.h because they must be available to
' both DOS and NT.
'
Public Const FILE_READ_DATA = (&H1) ' file pipe
Public Const FILE_LIST_DIRECTORY = (&H1) ' directory
Public Const FILE_WRITE_DATA = (&H2) ' file pipe
Public Const FILE_ADD_FILE = (&H2) ' directory
Public Const FILE_APPEND_DATA = (&H4) ' file
Public Const FILE_ADD_SUBDIRECTORY = (&H4) ' directory
Public Const FILE_CREATE_PIPE_INSTANCE = (&H4) ' named pipe
Public Const FILE_READ_EA = (&H8) ' file directory
Public Const FILE_READ_PROPERTIES = FILE_READ_EA
Public Const FILE_WRITE_EA = (&H10) ' file directory
Public Const FILE_WRITE_PROPERTIES = FILE_WRITE_EA
Public Const FILE_EXECUTE = (&H20) ' file
Public Const FILE_TRAVERSE = (&H20) ' directory
Public Const FILE_DELETE_CHILD = (&H40) ' directory
Public Const FILE_READ_ATTRIBUTES = (&H80) ' all
Public Const FILE_WRITE_ATTRIBUTES = (&H100) ' all
Public Const FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H1FF)
Public Const FILE_GENERIC_READ = (STANDARD_RIGHTS_READ Or FILE_READ_DATA Or FILE_READ_ATTRIBUTES Or FILE_READ_EA Or SYNCHRONIZE)
Public Const FILE_GENERIC_WRITE = (STANDARD_RIGHTS_WRITE Or FILE_WRITE_DATA Or FILE_WRITE_ATTRIBUTES Or FILE_WRITE_EA Or FILE_APPEND_DATA Or SYNCHRONIZE)
Public Const FILE_GENERIC_EXECUTE = (STANDARD_RIGHTS_EXECUTE Or FILE_READ_ATTRIBUTES Or FILE_EXECUTE Or SYNCHRONIZE)
Public Const FILE_SHARE_READ = &H1
Public Const FILE_SHARE_WRITE = &H2
Public Const FILE_ATTRIBUTE_READONLY = &H1
Public Const FILE_ATTRIBUTE_HIDDEN = &H2
Public Const FILE_ATTRIBUTE_SYSTEM = &H4
Public Const FILE_ATTRIBUTE_DIRECTORY = &H10
Public Const FILE_ATTRIBUTE_ARCHIVE = &H20
Public Const FILE_ATTRIBUTE_NORMAL = &H80
Public Const FILE_ATTRIBUTE_TEMPORARY = &H100
Public Const FILE_ATTRIBUTE_COMPRESSED = &H800
Public Const FILE_NOTIFY_CHANGE_FILE_NAME = &H1
Public Const FILE_NOTIFY_CHANGE_DIR_NAME = &H2
Public Const FILE_NOTIFY_CHANGE_ATTRIBUTES = &H4
Public Const FILE_NOTIFY_CHANGE_SIZE = &H8
Public Const FILE_NOTIFY_CHANGE_LAST_WRITE = &H10
Public Const FILE_NOTIFY_CHANGE_SECURITY = &H100
Public Const MAILSLOT_NO_MESSAGE = (-1)
Public Const MAILSLOT_WAIT_FOREVER = (-1)
Public Const FILE_CASE_SENSITIVE_SEARCH = &H1
Public Const FILE_CASE_PRESERVED_NAMES = &H2
Public Const FILE_UNICODE_ON_DISK = &H4
Public Const FILE_PERSISTENT_ACLS = &H8
Public Const FILE_FILE_COMPRESSION = &H10
Public Const FILE_VOLUME_IS_COMPRESSED = &H8000
Public Const IO_COMPLETION_MODIFY_STATE = &H2
Public Const IO_COMPLETION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
Public Const DUPLICATE_CLOSE_SOURCE = &H1
Public Const DUPLICATE_SAME_ACCESS = &H2
' //////////////////////////////////////////////////////////////////////
' //
' ACCESS MASK //
' //
' //////////////////////////////////////////////////////////////////////
'
' Define the access mask as a longword sized structure divided up as
' follows:
' typedef struct _ACCESS_MASK {
' WORD SpecificRights;
' Byte StandardRights;
' Byte AccessSystemAcl : 1;
' Byte Reserved : 3;
' Byte GenericAll : 1;
' Byte GenericExecute : 1;
' Byte GenericWrite : 1;
' Byte GenericRead : 1;
' } ACCESS_MASK;
' typedef ACCESS_MASK *PACCESS_MASK;
'
' but to make life simple for programmer's we'll allow them to specify
' a desired access mask by simply OR'ing together mulitple single rights
' and treat an access mask as a DWORD. For example
'
' DesiredAccess = DELETE Or READ_CONTROL
'
' So we'll declare ACCESS_MASK as DWORD
'
' begin_ntddk begin_nthal begin_ntifs
' //////////////////////////////////////////////////////////////////////
' //
' ACCESS TYPES //
' //
' //////////////////////////////////////////////////////////////////////
' begin_ntddk begin_nthal begin_ntifs
'
' The following are masks for the predefined standard access types
' AccessSystemAcl access type
Public Const ACCESS_SYSTEM_SECURITY = &H1000000
' MaximumAllowed access type
Public Const MAXIMUM_ALLOWED = &H2000000
' These are the generic rights.
Public Const GENERIC_READ = &H80000000
Public Const GENERIC_WRITE = &H40000000
Public Const GENERIC_EXECUTE = &H20000000
Public Const GENERIC_ALL = &H10000000
' Define the generic mapping array. This is used to denote the
' mapping of each generic access right to a specific access mask.
Type GENERIC_MAPPING
GenericRead As Long
GenericWrite As Long
GenericExecute As Long
GenericAll As Long
End Type
' //////////////////////////////////////////////////////////////////////
' //
' LUID_AND_ATTRIBUTES //
' //
' //////////////////////////////////////////////////////////////////////
'
Type LUID
LowPart As Long
HighPart As Long
End Type
Type LUID_AND_ATTRIBUTES
pLuid As LUID
Attributes As Long
End Type
' //////////////////////////////////////////////////////////////////////
' //
' ACL and ACE //
' //
' //////////////////////////////////////////////////////////////////////
'
' Define an ACL and the ACE format. The structure of an ACL header
' followed by one or more ACEs. Pictorally the structure of an ACL header
' is as follows:
'
' The current AclRevision is defined to be ACL_REVISION.
'
' AclSize is the size, in bytes, allocated for the ACL. This includes
' the ACL header, ACES, and remaining free space in the buffer.
'
' AceCount is the number of ACES in the ACL.
'
' begin_ntddk begin_ntifs
' This is the *current* ACL revision
Public Const ACL_REVISION = (2)
' This is the history of ACL revisions. Add a new one whenever
' ACL_REVISION is updated
Public Const ACL_REVISION1 = (1)
Public Const ACL_REVISION2 = (2)
Type ACL
AclRevision As Byte
Sbz1 As Byte
AclSize As Integer
AceCount As Integer
Sbz2 As Integer
End Type
' typedef ACL *PACL;
' end_ntddk
' The structure of an ACE is a common ace header followed by ace type
' specific data. Pictorally the structure of the common ace header is
' as follows:
' AceType denotes the type of the ace, there are some predefined ace
' types
'
' AceSize is the size, in bytes, of ace.
'
' AceFlags are the Ace flags for audit and inheritance, defined Integerly.
Type ACE_HEADER
AceType As Byte
AceFlags As Byte
AceSize As Long
End Type
'
' The following are the predefined ace types that go into the AceType
' field of an Ace header.
Public Const ACCESS_ALLOWED_ACE_TYPE = &H0
Public Const ACCESS_DENIED_ACE_TYPE = &H1
Public Const SYSTEM_AUDIT_ACE_TYPE = &H2
Public Const SYSTEM_ALARM_ACE_TYPE = &H3
' The following are the inherit flags that go into the AceFlags field
' of an Ace header.
Public Const OBJECT_INHERIT_ACE = &H1
Public Const CONTAINER_INHERIT_ACE = &H2
Public Const NO_PROPAGATE_INHERIT_ACE = &H4
Public Const INHERIT_ONLY_ACE = &H8
Public Const VALID_INHERIT_FLAGS = &HF
' The following are the currently defined ACE flags that go into the
' AceFlags field of an ACE header. Each ACE type has its own set of
' AceFlags.
'
' SUCCESSFUL_ACCESS_ACE_FLAG - used only with system audit and alarm ACE
' types to indicate that a message is generated for successful accesses.
'
' FAILED_ACCESS_ACE_FLAG - used only with system audit and alarm ACE types
' to indicate that a message is generated for failed accesses.
' SYSTEM_AUDIT and SYSTEM_ALARM AceFlags
'
' These control the signaling of audit and alarms for success or failure.
Public Const SUCCESSFUL_ACCESS_ACE_FLAG = &H40
Public Const FAILED_ACCESS_ACE_FLAG = &H80
'
' We'll define the structure of the predefined ACE types. Pictorally
' the structure of the predefined ACE's is as follows:
' Mask is the access mask associated with the ACE. This is either the
' access allowed, access denied, audit, or alarm mask.
'
' Sid is the Sid associated with the ACE.
'
' The following are the four predefined ACE types.
' Examine the AceType field in the Header to determine
' which structure is appropriate to use for casting.