📄 ntdef.inc
字号:
ELSE
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! ObjectName improperly specified.
ENDIF
and [ecx].SecurityQualityOfService, 0 ;; NULL
assume ecx:nothing
POPCONTEXT ASSUMES
ENDM
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; Constants
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
FALSE equ 0
TRUE equ 1
NULL equ 0
NULL64 equ 0
MINCHAR equ 080h
MAXCHAR equ 07fh
MINSHORT equ 08000h
MAXSHORT equ 07fffh
MINLONG equ 080000000h
MAXLONG equ 07fffffffh
MAXUCHAR equ 0ffh
MAXUSHORT equ 0ffffh
MAXULONG equ 0ffffffffh
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; Useful Helper Macros
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; CONTAINING_RECORD calculates the address of the base of the structure given its type,
; and an address of a field within the structure.
CONTAINING_RECORD MACRO Address:REQ, _Type:REQ, Field:REQ
local adr, line
IF $IsAddr2(Address)
adr SUBSTR <Address>, 6
IF (OPATTR (adr)) AND 01000000y
;; relative to SS
lea eax, adr
ELSE
mov eax, offset adr
ENDIF
ELSEIF (OPATTR (Address)) AND 00010000y
;; is a register value
IFDIFI <Address>, <eax> ;; not eax
mov eax, Address
ENDIF
ELSEIF (OPATTR (Address)) AND 00000010y
;; is a memory variable or has a relocatable data label (offset)
mov eax, Address
ELSEIF (OPATTR (Address)) AND 01000000y
;; relative to SS
mov eax, Address
ELSE
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! Pointer to a field in an instance of a structure of type _Type is improperly specified.
ENDIF
IFE (OPATTR (_Type)) AND 00000100y
;; Is not an immediate value.
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! The second parameter of CONTAINING_RECORD macro must be a structure name whose base address is to be returned.
ENDIF
IF (OPATTR (Field))
;; OPATTR doesn't recognizes structure members. So if it returns something
;; Field is not a name of structure member.
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! The third parameter of CONTAINING_RECORD macro must be a name of the member pointed to by Address and which is contained in a structure of type _Type.
ENDIF
lea eax, (_Type PTR [eax-_Type.Field])
ENDM
$CONTAINING_RECORD MACRO Address:REQ, _Type:REQ, Field:REQ
local adr, line
IF $IsAddr2(Address)
adr SUBSTR <Address>, 6
IF (OPATTR (adr)) AND 01000000y
;; relative to SS
lea eax, adr
ELSE
mov eax, offset adr
ENDIF
ELSEIF (OPATTR (Address)) AND 00010000y
;; is a register value
IFDIFI <Address>, <eax> ;; not eax
mov eax, Address
ENDIF
ELSEIF (OPATTR (Address)) AND 00000010y
;; is a memory variable or has a relocatable data label (offset)
mov eax, Address
ELSEIF (OPATTR (Address)) AND 01000000y
;; relative to SS
mov eax, Address
ELSE
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! Pointer to a field in an instance of a structure of type _Type is improperly specified.
ENDIF
IFE (OPATTR (_Type)) AND 00000100y
;; Is not an immediate value.
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! The second parameter of CONTAINING_RECORD macro must be a structure name whose base address is to be returned.
ENDIF
IF (OPATTR (Field))
;; OPATTR doesn't recognizes structure members. So if it returns something
;; Field is not a name of structure member.
line TEXTEQU %@Line
.ERR
% ECHO @FileCur(line) : ERROR! The third parameter of CONTAINING_RECORD macro must be a name of the member pointed to by Address and which is contained in a structure of type _Type.
ENDIF
lea eax, (_Type PTR [eax-_Type.Field])
EXITM <eax>
ENDM
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; Interrupt Request Level (IRQL)
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
KIRQL typedef BYTE
PKIRQL typedef PTR BYTE
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; Product types
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;typedef enum _NT_PRODUCT_TYPE {
NtProductWinNt equ 1
NtProductLanManNt equ 2
NtProductServer equ 3
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; the bit mask, SharedUserData->SuiteMask, is a ULONG
; so there can be a maximum of 32 entries in this enum.
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;typedef enum _SUITE_TYPE {
SmallBusiness equ 0
Enterprise equ 1
BackOffice equ 2
CommunicationServer equ 3
TerminalServer equ 4
SmallBusinessRestricted equ 5
EmbeddedNT equ 6
DataCenter equ 7
SingleUserTS equ 8
Personal equ 9
ServerAppliance equ 10
MaxSuiteType equ 11
VER_SERVER_NT equ 80000000h
VER_WORKSTATION_NT equ 40000000h
VER_SUITE_SMALLBUSINESS equ 00000001h
VER_SUITE_ENTERPRISE equ 00000002h
VER_SUITE_BACKOFFICE equ 00000004h
VER_SUITE_COMMUNICATIONS equ 00000008h
VER_SUITE_TERMINAL equ 00000010h
VER_SUITE_SMALLBUSINESS_RESTRICTED equ 00000020h
VER_SUITE_EMBEDDEDNT equ 00000040h
VER_SUITE_DATACENTER equ 00000080h
VER_SUITE_SINGLEUSERTS equ 00000100h
VER_SUITE_PERSONAL equ 00000200h
VER_SUITE_SERVERAPPLIANCE equ 00000400h
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; 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.
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
LANG_NEUTRAL equ 00
LANG_AFRIKAANS equ 36h
LANG_ALBANIAN equ 1ch
LANG_ARABIC equ 01h
LANG_ARMENIAN equ 2bh
LANG_ASSAMESE equ 4dh
LANG_AZERI equ 2ch
LANG_BASQUE equ 2dh
LANG_BELARUSIAN equ 23h
LANG_BENGALI equ 45h
LANG_BULGARIAN equ 02h
LANG_CATALAN equ 03h
LANG_CHINESE equ 04h
LANG_CROATIAN equ 1ah
LANG_CZECH equ 05h
LANG_DANISH equ 06h
LANG_DUTCH equ 13h
LANG_ENGLISH equ 09h
LANG_ESTONIAN equ 25h
LANG_FAEROESE equ 38h
LANG_FARSI equ 29h
LANG_FINNISH equ 0bh
LANG_FRENCH equ 0ch
LANG_GEORGIAN equ 37h
LANG_GERMAN equ 07h
LANG_GREEK equ 08h
LANG_GUJARATI equ 47h
LANG_HEBREW equ 0dh
LANG_HINDI equ 39h
LANG_HUNGARIAN equ 0eh
LANG_ICELANDIC equ 0fh
LANG_INDONESIAN equ 21h
LANG_ITALIAN equ 10h
LANG_JAPANESE equ 11h
LANG_KANNADA equ 4bh
LANG_KASHMIRI equ 60h
LANG_KAZAK equ 3fh
LANG_KONKANI equ 57h
LANG_KOREAN equ 12h
LANG_LATVIAN equ 26h
LANG_LITHUANIAN equ 27h
LANG_MACEDONIAN equ 2fh ; the Former Yugoslav Republic of Macedonia
LANG_MALAY equ 3eh
LANG_MALAYALAM equ 4ch
LANG_MANIPURI equ 58h
LANG_MARATHI equ 4eh
LANG_NEPALI equ 61h
LANG_NORWEGIAN equ 14h
LANG_ORIYA equ 48h
LANG_POLISH equ 15h
LANG_PORTUGUESE equ 16h
LANG_PUNJABI equ 46h
LANG_ROMANIAN equ 18h
LANG_RUSSIAN equ 19h
LANG_SANSKRIT equ 4fh
LANG_SERBIAN equ 1ah
LANG_SINDHI equ 59h
LANG_SLOVAK equ 1bh
LANG_SLOVENIAN equ 24h
LANG_SPANISH equ 0ah
LANG_SWAHILI equ 41h
LANG_SWEDISH equ 1dh
LANG_TAMIL equ 49h
LANG_TATAR equ 44h
LANG_TELUGU equ 4ah
LANG_THAI equ 1eh
LANG_TURKISH equ 1fh
LANG_UKRAINIAN equ 22h
LANG_URDU equ 20h
LANG_UZBEK equ 43h
LANG_VIETNAMESE equ 2ah
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; 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.
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SUBLANG_NEUTRAL equ 00 ; language neutral
SUBLANG_DEFAULT equ 01 ; user default
SUBLANG_SYS_DEFAULT equ 02 ; system default
SUBLANG_ARABIC_SAUDI_ARABIA equ 01 ; Arabic (Saudi Arabia)
SUBLANG_ARABIC_IRAQ equ 02 ; Arabic (Iraq)
SUBLANG_ARABIC_EGYPT equ 03 ; Arabic (Egypt)
SUBLANG_ARABIC_LIBYA equ 04 ; Arabic (Libya)
SUBLANG_ARABIC_ALGERIA equ 05 ; Arabic (Algeria)
SUBLANG_ARABIC_MOROCCO equ 06 ; Arabic (Morocco)
SUBLANG_ARABIC_TUNISIA equ 07 ; Arabic (Tunisia)
SUBLANG_ARABIC_OMAN equ 08 ; Arabic (Oman)
SUBLANG_ARABIC_YEMEN equ 09 ; Arabic (Yemen)
SUBLANG_ARABIC_SYRIA equ 0ah ; Arabic (Syria)
SUBLANG_ARABIC_JORDAN equ 0bh ; Arabic (Jordan)
SUBLANG_ARABIC_LEBANON equ 0ch ; Arabic (Lebanon)
SUBLANG_ARABIC_KUWAIT equ 0dh ; Arabic (Kuwait)
SUBLANG_ARABIC_UAE equ 0eh ; Arabic (U.A.E)
SUBLANG_ARABIC_BAHRAIN equ 0fh ; Arabic (Bahrain)
SUBLANG_ARABIC_QATAR equ 10h ; Arabic (Qatar)
SUBLANG_AZERI_LATIN equ 01 ; Azeri (Latin)
SUBLANG_AZERI_CYRILLIC equ 02 ; Azeri (Cyrillic)
SUBLANG_CHINESE_TRADITIONAL equ 01 ; Chinese (Taiwan)
SUBLANG_CHINESE_SIMPLIFIED equ 02 ; Chinese (PR China)
SUBLANG_CHINESE_HONGKONG equ 03 ; Chinese (Hong Kong S.A.R., P.R.C.)
SUBLANG_CHINESE_SINGAPORE equ 04 ; Chinese (Singapore)
SUBLANG_CHINESE_MACAU equ 05 ; Chinese (Macau)
SUBLANG_DUTCH equ 01 ; Dutch
SUBLANG_DUTCH_BELGIAN equ 02 ; Dutch (Belgian)
SUBLANG_ENGLISH_US equ 01 ; English (USA)
SUBLANG_ENGLISH_UK equ 02 ; English (UK)
SUBLANG_ENGLISH_AUS equ 03 ; English (Australian)
SUBLANG_ENGLISH_CAN equ 04 ; English (Canadian)
SUBLANG_ENGLISH_NZ equ 05 ; English (New Zealand)
SUBLANG_ENGLISH_EIRE equ 06 ; English (Irish)
SUBLANG_ENGLISH_SOUTH_AFRICA equ 07 ; English (South Africa)
SUBLANG_ENGLISH_JAMAICA equ 08 ; English (Jamaica)
SUBLANG_ENGLISH_CARIBBEAN equ 09 ; English (Caribbean)
SUBLANG_ENGLISH_BELIZE equ 0ah ; English (Belize)
SUBLANG_ENGLISH_TRINIDAD equ 0bh ; English (Trinidad)
SUBLANG_ENGLISH_ZIMBABWE equ 0ch ; English (Zimbabwe)
SUBLANG_ENGLISH_PHILIPPINES equ 0dh ; English (Philippines)
SUBLANG_FRENCH equ 01 ; French
SUBLANG_FRENCH_BELGIAN equ 02 ; French (Belgian)
SUBLANG_FRENCH_CANADIAN equ 03 ; French (Canadian)
SUBLANG_FRENCH_SWISS equ 04 ; French (Swiss)
SUBLANG_FRENCH_LUXEMBOURG equ 05 ; French (Luxembourg)
SUBLANG_FRENCH_MONACO equ 06 ; French (Monaco)
SUBLANG_GERMAN equ 01 ; German
SUBLANG_GERMAN_SWISS equ 02 ; German (Swiss)
SUBLANG_GERMAN_AUSTRIAN equ 03 ; German (Austrian)
SUBLANG_GERMAN_LUXEMBOURG equ 04 ; German (Luxembourg)
SUBLANG_GERMAN_LIECHTENSTEIN equ 05 ; German (Liechtenstein)
SUBLANG_ITALIAN equ 01 ; Italian
SUBLANG_ITALIAN_SWISS equ 02 ; Italian (Swiss)
SUBLANG_KASHMIRI_INDIA equ 02 ; Kashmiri (India)
SUBLANG_KOREAN equ 01 ; Korean (Extended Wansung)
SUBLANG_LITHUANIAN equ 01 ; Lithuanian
SUBLANG_MALAY_MALAYSIA equ 01 ; Malay (Malaysia)
SUBLANG_MALAY_BRUNEI_DARUSSALAM equ 02 ; Malay (Brunei Darussalam)
SUBLANG_NEPALI_INDIA equ 02 ; Nepali (India)
SUBLANG_NORWEGIAN_BOKMAL equ 01 ; Norwegian (Bokmal)
SUBLANG_NORWEGIAN_NYNORSK equ 02 ; Norwegian (Nynorsk)
SUBLANG_PORTUGUESE equ 02 ; Portuguese
SUBLANG_PORTUGUESE_BRAZILIAN equ 01 ; Portuguese (Brazilian)
SUBLANG_SERBIAN_LATIN equ 02 ; Serbian (Latin)
SUBLANG_SERBIAN_CYRILLIC equ 03 ; Serbian (Cyrillic)
SUBLANG_SPANISH equ 01 ; Spanish (Castilian)
SUBLANG_SPANISH_MEXICAN equ 02 ; Spanish (Mexican)
SUBLANG_SPANISH_MODERN equ 03 ; Spanish (Modern)
SUBLANG_SPANISH_GUATEMALA equ 04 ; Spanish (Guatemala)
SUBLANG_SPANISH_COSTA_RICA equ 05 ; Spanish (Costa Rica)
SUBLANG_SPANISH_PANAMA equ 06 ; Spanish (Panama)
SUBLANG_SPANISH_DOMINICAN_REPUBLIC equ 07 ; Spanish (Dominican Republic)
SUBLANG_SPANISH_VENEZUELA equ 08 ; Spanish (Venezuela)
SUBLANG_SPANISH_COLOMBIA equ 09 ; Spanish (Colombia)
SUBLANG_SPANISH_PERU equ 0ah ; Spanish (Peru)
SUBLANG_SPANISH_ARGENTINA equ 0bh ; Spanish (Argentina)
SUBLANG_SPANISH_ECUADOR equ 0ch ; Spanish (Ecuador)
SUBLANG_SPANISH_CHILE equ 0dh ; Spanish (Chile)
SUBLANG_SPANISH_URUGUAY equ 0eh ; Spanish (Uruguay)
SUBLANG_SPANISH_PARAGUAY equ 0fh ; Spanish (Paraguay)
SUBLANG_SPANISH_BOLIVIA equ 10h ; Spanish (Bolivia)
SUBLANG_SPANISH_EL_SALVADOR equ 11h ; Spanish (El Salvador)
SUBLANG_SPANISH_HONDURAS equ 12h ; Spanish (Honduras)
SUBLANG_SPANISH_NICARAGUA equ 13h ; Spanish (Nicaragua)
SUBLANG_SPANISH_PUERTO_RICO equ 14h ; Spanish (Puerto Rico)
SUBLANG_SWEDISH equ 01 ; Swedish
SUBLANG_SWEDISH_FINLAND equ 02 ; Swedish (Finland)
SUBLANG_URDU_PAKISTAN equ 01 ; Urdu (Pakistan)
SUBLANG_URDU_INDIA equ 02 ; Urdu (India)
SUBLANG_UZBEK_LATIN equ 01 ; Uzbek (Latin)
SUBLANG_UZBEK_CYRILLIC equ 02 ; Uzbek (Cyrillic)
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; Sorting IDs.
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SORT_DEFAULT equ 0 ; sorting default
SORT_JAPANESE_XJIS equ 0 ; Japanese XJIS order
SORT_JAPANESE_UNICODE equ 1 ; Japanese Unicode order
SORT_CHINESE_BIG5 equ 0 ; Chinese BIG5 order
SORT_CHINESE_PRCP equ 0 ; PRC Chinese Phonetic order
SORT_CHINESE_UNICODE equ 1 ; Chinese Unicode order
SORT_CHINESE_PRC equ 2 ; PRC Chinese Stroke Count order
SORT_CHINESE_BOPOMOFO equ 3 ; Traditional Chinese Bopomofo order
SORT_KOREAN_KSC equ 0 ; Korean KSC order
SORT_KOREAN_UNICODE equ 1 ; Korean Unicode order
SORT_GERMAN_PHONE_BOOK equ 1 ; German Phone Book order
SORT_HUNGARIAN_DEFAULT equ 0 ; Hungarian Default order
SORT_HUNGARIAN_TECHNICAL equ 1 ; Hungarian Technical order
SORT_GEORGIAN_TRADITIONAL equ 0 ; Georgian Traditional order
SORT_GEORGIAN_MODERN equ 1 ; Georgian Modern order
ENDIF ; _NTDEF_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -