JwaWinNT.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:336k
源码类别:
Windows编程
开发平台:
Delphi
- {******************************************************************************}
- { }
- { Windows Types API interface Unit for Object Pascal }
- { }
- { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
- { Corporation. All Rights Reserved. }
- { }
- { The original file is: winnt.h, released August 2001. The original Pascal }
- { code is: WinNT.pas, released December 2000. The initial developer of the }
- { Pascal code is Marcel van Brakel (brakelm@chello.nl). }
- { }
- { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
- { Marcel van Brakel. All Rights Reserved. }
- { }
- { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
- { }
- { You may retrieve the latest version of this file at the Project JEDI home }
- { page, located at http://delphi-jedi.org or my personal homepage located at }
- { http://members.chello.nl/m.vanbrakel2 }
- { }
- { The contents of this file are used with permission, subject to the Mozilla }
- { Public License Version 1.1 (the "License"); you may not use this file except }
- { in compliance with the License. You may obtain a copy of the License at }
- { http://www.mozilla.org/MPL/MPL-1.1.html }
- { }
- { Software distributed under the License is distributed on an "AS IS" basis, }
- { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
- { the specific language governing rights and limitations under the License. }
- { }
- { Alternatively, the contents of this file may be used under the terms of the }
- { GNU Lesser General Public License (the "LGPL License"), in which case the }
- { provisions of the LGPL License are applicable instead of those above. }
- { If you wish to allow use of your version of this file only under the terms }
- { of the LGPL License and not to allow others to use your version of this file }
- { under the MPL, indicate your decision by deleting the provisions above and }
- { replace them with the notice and other provisions required by the LGPL }
- { License. If you do not delete the provisions above, a recipient may use }
- { your version of this file under either the MPL or the LGPL License. }
- { }
- { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
- { }
- {******************************************************************************}
- unit JwaWinNT;
- {$WEAKPACKAGEUNIT}
- {$HPPEMIT ''}
- {$HPPEMIT '#include "winnt.h"'}
- {$HPPEMIT ''}
- {$HPPEMIT 'typedef PACL *PPACL'}
- {$HPPEMIT 'typedef PSID *PPSID'}
- {$HPPEMIT 'typedef PSECURITY_DESCRIPTOR *PPSECURITY_DESCRIPTOR'}
- {$HPPEMIT ''}
- {$I WINDEFINES.INC}
- interface
- uses
- JwaWinType;
- const
- MAXBYTE = BYTE($ff);
- {$EXTERNALSYM MAXBYTE}
- MAXWORD = WORD($ffff);
- {$EXTERNALSYM MAXWORD}
- MAXDWORD = DWORD($ffffffff);
- {$EXTERNALSYM MAXDWORD}
- const
- VER_SERVER_NT = DWORD($80000000);
- {$EXTERNALSYM VER_SERVER_NT}
- VER_WORKSTATION_NT = $40000000;
- {$EXTERNALSYM VER_WORKSTATION_NT}
- VER_SUITE_SMALLBUSINESS = $00000001;
- {$EXTERNALSYM VER_SUITE_SMALLBUSINESS}
- VER_SUITE_ENTERPRISE = $00000002;
- {$EXTERNALSYM VER_SUITE_ENTERPRISE}
- VER_SUITE_BACKOFFICE = $00000004;
- {$EXTERNALSYM VER_SUITE_BACKOFFICE}
- VER_SUITE_COMMUNICATIONS = $00000008;
- {$EXTERNALSYM VER_SUITE_COMMUNICATIONS}
- VER_SUITE_TERMINAL = $00000010;
- {$EXTERNALSYM VER_SUITE_TERMINAL}
- VER_SUITE_SMALLBUSINESS_RESTRICTED = $00000020;
- {$EXTERNALSYM VER_SUITE_SMALLBUSINESS_RESTRICTED}
- VER_SUITE_EMBEDDEDNT = $00000040;
- {$EXTERNALSYM VER_SUITE_EMBEDDEDNT}
- VER_SUITE_DATACENTER = $00000080;
- {$EXTERNALSYM VER_SUITE_DATACENTER}
- VER_SUITE_SINGLEUSERTS = $00000100;
- {$EXTERNALSYM VER_SUITE_SINGLEUSERTS}
- VER_SUITE_PERSONAL = $00000200;
- {$EXTERNALSYM VER_SUITE_PERSONAL}
- VER_SUITE_BLADE = $00000400;
- {$EXTERNALSYM VER_SUITE_BLADE}
- VER_SUITE_EMBEDDED_RESTRICTED = $00000800;
- {$EXTERNALSYM VER_SUITE_EMBEDDED_RESTRICTED}
- //
- // 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
- // LANG_INVARIANT SUBLANG_NEUTRAL Invariant locale
- //
- //
- // Primary language IDs.
- //
- const
- LANG_NEUTRAL = $00;
- {$EXTERNALSYM LANG_NEUTRAL}
- LANG_INVARIANT = $7f;
- {$EXTERNALSYM LANG_INVARIANT}
- LANG_AFRIKAANS = $36;
- {$EXTERNALSYM LANG_AFRIKAANS}
- LANG_ALBANIAN = $1c;
- {$EXTERNALSYM LANG_ALBANIAN}
- LANG_ARABIC = $01;
- {$EXTERNALSYM LANG_ARABIC}
- LANG_ARMENIAN = $2b;
- {$EXTERNALSYM LANG_ARMENIAN}
- LANG_ASSAMESE = $4d;
- {$EXTERNALSYM LANG_ASSAMESE}
- LANG_AZERI = $2c;
- {$EXTERNALSYM LANG_AZERI}
- LANG_BASQUE = $2d;
- {$EXTERNALSYM LANG_BASQUE}
- LANG_BELARUSIAN = $23;
- {$EXTERNALSYM LANG_BELARUSIAN}
- LANG_BENGALI = $45;
- {$EXTERNALSYM LANG_BENGALI}
- LANG_BULGARIAN = $02;
- {$EXTERNALSYM LANG_BULGARIAN}
- LANG_CATALAN = $03;
- {$EXTERNALSYM LANG_CATALAN}
- LANG_CHINESE = $04;
- {$EXTERNALSYM LANG_CHINESE}
- LANG_CROATIAN = $1a;
- {$EXTERNALSYM LANG_CROATIAN}
- LANG_CZECH = $05;
- {$EXTERNALSYM LANG_CZECH}
- LANG_DANISH = $06;
- {$EXTERNALSYM LANG_DANISH}
- LANG_DIVEHI = $65;
- {$EXTERNALSYM LANG_DIVEHI}
- LANG_DUTCH = $13;
- {$EXTERNALSYM LANG_DUTCH}
- LANG_ENGLISH = $09;
- {$EXTERNALSYM LANG_ENGLISH}
- LANG_ESTONIAN = $25;
- {$EXTERNALSYM LANG_ESTONIAN}
- LANG_FAEROESE = $38;
- {$EXTERNALSYM LANG_FAEROESE}
- LANG_FARSI = $29;
- {$EXTERNALSYM LANG_FARSI}
- LANG_FINNISH = $0b;
- {$EXTERNALSYM LANG_FINNISH}
- LANG_FRENCH = $0c;
- {$EXTERNALSYM LANG_FRENCH}
- LANG_GALICIAN = $56;
- {$EXTERNALSYM LANG_GALICIAN}
- LANG_GEORGIAN = $37;
- {$EXTERNALSYM LANG_GEORGIAN}
- LANG_GERMAN = $07;
- {$EXTERNALSYM LANG_GERMAN}
- LANG_GREEK = $08;
- {$EXTERNALSYM LANG_GREEK}
- LANG_GUJARATI = $47;
- {$EXTERNALSYM LANG_GUJARATI}
- LANG_HEBREW = $0d;
- {$EXTERNALSYM LANG_HEBREW}
- LANG_HINDI = $39;
- {$EXTERNALSYM LANG_HINDI}
- LANG_HUNGARIAN = $0e;
- {$EXTERNALSYM LANG_HUNGARIAN}
- LANG_ICELANDIC = $0f;
- {$EXTERNALSYM LANG_ICELANDIC}
- LANG_INDONESIAN = $21;
- {$EXTERNALSYM LANG_INDONESIAN}
- LANG_ITALIAN = $10;
- {$EXTERNALSYM LANG_ITALIAN}
- LANG_JAPANESE = $11;
- {$EXTERNALSYM LANG_JAPANESE}
- LANG_KANNADA = $4b;
- {$EXTERNALSYM LANG_KANNADA}
- LANG_KASHMIRI = $60;
- {$EXTERNALSYM LANG_KASHMIRI}
- LANG_KAZAK = $3f;
- {$EXTERNALSYM LANG_KAZAK}
- LANG_KONKANI = $57;
- {$EXTERNALSYM LANG_KONKANI}
- LANG_KOREAN = $12;
- {$EXTERNALSYM LANG_KOREAN}
- LANG_KYRGYZ = $40;
- {$EXTERNALSYM LANG_KYRGYZ}
- LANG_LATVIAN = $26;
- {$EXTERNALSYM LANG_LATVIAN}
- LANG_LITHUANIAN = $27;
- {$EXTERNALSYM LANG_LITHUANIAN}
- LANG_MACEDONIAN = $2f; // the Former Yugoslav Republic of Macedonia
- {$EXTERNALSYM LANG_MACEDONIAN}
- LANG_MALAY = $3e;
- {$EXTERNALSYM LANG_MALAY}
- LANG_MALAYALAM = $4c;
- {$EXTERNALSYM LANG_MALAYALAM}
- LANG_MANIPURI = $58;
- {$EXTERNALSYM LANG_MANIPURI}
- LANG_MARATHI = $4e;
- {$EXTERNALSYM LANG_MARATHI}
- LANG_MONGOLIAN = $50;
- {$EXTERNALSYM LANG_MONGOLIAN}
- LANG_NEPALI = $61;
- {$EXTERNALSYM LANG_NEPALI}
- LANG_NORWEGIAN = $14;
- {$EXTERNALSYM LANG_NORWEGIAN}
- LANG_ORIYA = $48;
- {$EXTERNALSYM LANG_ORIYA}
- LANG_POLISH = $15;
- {$EXTERNALSYM LANG_POLISH}
- LANG_PORTUGUESE = $16;
- {$EXTERNALSYM LANG_PORTUGUESE}
- LANG_PUNJABI = $46;
- {$EXTERNALSYM LANG_PUNJABI}
- LANG_ROMANIAN = $18;
- {$EXTERNALSYM LANG_ROMANIAN}
- LANG_RUSSIAN = $19;
- {$EXTERNALSYM LANG_RUSSIAN}
- LANG_SANSKRIT = $4f;
- {$EXTERNALSYM LANG_SANSKRIT}
- LANG_SERBIAN = $1a;
- {$EXTERNALSYM LANG_SERBIAN}
- LANG_SINDHI = $59;
- {$EXTERNALSYM LANG_SINDHI}
- LANG_SLOVAK = $1b;
- {$EXTERNALSYM LANG_SLOVAK}
- LANG_SLOVENIAN = $24;
- {$EXTERNALSYM LANG_SLOVENIAN}
- LANG_SPANISH = $0a;
- {$EXTERNALSYM LANG_SPANISH}
- LANG_SWAHILI = $41;
- {$EXTERNALSYM LANG_SWAHILI}
- LANG_SWEDISH = $1d;
- {$EXTERNALSYM LANG_SWEDISH}
- LANG_SYRIAC = $5a;
- {$EXTERNALSYM LANG_SYRIAC}
- LANG_TAMIL = $49;
- {$EXTERNALSYM LANG_TAMIL}
- LANG_TATAR = $44;
- {$EXTERNALSYM LANG_TATAR}
- LANG_TELUGU = $4a;
- {$EXTERNALSYM LANG_TELUGU}
- LANG_THAI = $1e;
- {$EXTERNALSYM LANG_THAI}
- LANG_TURKISH = $1f;
- {$EXTERNALSYM LANG_TURKISH}
- LANG_UKRAINIAN = $22;
- {$EXTERNALSYM LANG_UKRAINIAN}
- LANG_URDU = $20;
- {$EXTERNALSYM LANG_URDU}
- LANG_UZBEK = $43;
- {$EXTERNALSYM LANG_UZBEK}
- LANG_VIETNAMESE = $2a;
- {$EXTERNALSYM LANG_VIETNAMESE}
- //
- // 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 = $00; // language neutral
- {$EXTERNALSYM SUBLANG_NEUTRAL}
- SUBLANG_DEFAULT = $01; // user default
- {$EXTERNALSYM SUBLANG_DEFAULT}
- SUBLANG_SYS_DEFAULT = $02; // system default
- {$EXTERNALSYM SUBLANG_SYS_DEFAULT}
- SUBLANG_ARABIC_SAUDI_ARABIA = $01; // Arabic (Saudi Arabia)
- {$EXTERNALSYM SUBLANG_ARABIC_SAUDI_ARABIA}
- SUBLANG_ARABIC_IRAQ = $02; // Arabic (Iraq)
- {$EXTERNALSYM SUBLANG_ARABIC_IRAQ}
- SUBLANG_ARABIC_EGYPT = $03; // Arabic (Egypt)
- {$EXTERNALSYM SUBLANG_ARABIC_EGYPT}
- SUBLANG_ARABIC_LIBYA = $04; // Arabic (Libya)
- {$EXTERNALSYM SUBLANG_ARABIC_LIBYA}
- SUBLANG_ARABIC_ALGERIA = $05; // Arabic (Algeria)
- {$EXTERNALSYM SUBLANG_ARABIC_ALGERIA}
- SUBLANG_ARABIC_MOROCCO = $06; // Arabic (Morocco)
- {$EXTERNALSYM SUBLANG_ARABIC_MOROCCO}
- SUBLANG_ARABIC_TUNISIA = $07; // Arabic (Tunisia)
- {$EXTERNALSYM SUBLANG_ARABIC_TUNISIA}
- SUBLANG_ARABIC_OMAN = $08; // Arabic (Oman)
- {$EXTERNALSYM SUBLANG_ARABIC_OMAN}
- SUBLANG_ARABIC_YEMEN = $09; // Arabic (Yemen)
- {$EXTERNALSYM SUBLANG_ARABIC_YEMEN}
- SUBLANG_ARABIC_SYRIA = $0a; // Arabic (Syria)
- {$EXTERNALSYM SUBLANG_ARABIC_SYRIA}
- SUBLANG_ARABIC_JORDAN = $0b; // Arabic (Jordan)
- {$EXTERNALSYM SUBLANG_ARABIC_JORDAN}
- SUBLANG_ARABIC_LEBANON = $0c; // Arabic (Lebanon)
- {$EXTERNALSYM SUBLANG_ARABIC_LEBANON}
- SUBLANG_ARABIC_KUWAIT = $0d; // Arabic (Kuwait)
- {$EXTERNALSYM SUBLANG_ARABIC_KUWAIT}
- SUBLANG_ARABIC_UAE = $0e; // Arabic (U.A.E)
- {$EXTERNALSYM SUBLANG_ARABIC_UAE}
- SUBLANG_ARABIC_BAHRAIN = $0f; // Arabic (Bahrain)
- {$EXTERNALSYM SUBLANG_ARABIC_BAHRAIN}
- SUBLANG_ARABIC_QATAR = $10; // Arabic (Qatar)
- {$EXTERNALSYM SUBLANG_ARABIC_QATAR}
- SUBLANG_AZERI_LATIN = $01; // Azeri (Latin)
- {$EXTERNALSYM SUBLANG_AZERI_LATIN}
- SUBLANG_AZERI_CYRILLIC = $02; // Azeri (Cyrillic)
- {$EXTERNALSYM SUBLANG_AZERI_CYRILLIC}
- SUBLANG_CHINESE_TRADITIONAL = $01; // Chinese (Taiwan)
- {$EXTERNALSYM SUBLANG_CHINESE_TRADITIONAL}
- SUBLANG_CHINESE_SIMPLIFIED = $02; // Chinese (PR China)
- {$EXTERNALSYM SUBLANG_CHINESE_SIMPLIFIED}
- SUBLANG_CHINESE_HONGKONG = $03; // Chinese (Hong Kong S.A.R., P.R.C.)
- {$EXTERNALSYM SUBLANG_CHINESE_HONGKONG}
- SUBLANG_CHINESE_SINGAPORE = $04; // Chinese (Singapore)
- {$EXTERNALSYM SUBLANG_CHINESE_SINGAPORE}
- SUBLANG_CHINESE_MACAU = $05; // Chinese (Macau S.A.R.)
- {$EXTERNALSYM SUBLANG_CHINESE_MACAU}
- SUBLANG_DUTCH = $01; // Dutch
- {$EXTERNALSYM SUBLANG_DUTCH}
- SUBLANG_DUTCH_BELGIAN = $02; // Dutch (Belgian)
- {$EXTERNALSYM SUBLANG_DUTCH_BELGIAN}
- SUBLANG_ENGLISH_US = $01; // English (USA)
- {$EXTERNALSYM SUBLANG_ENGLISH_US}
- SUBLANG_ENGLISH_UK = $02; // English (UK)
- {$EXTERNALSYM SUBLANG_ENGLISH_UK}
- SUBLANG_ENGLISH_AUS = $03; // English (Australian)
- {$EXTERNALSYM SUBLANG_ENGLISH_AUS}
- SUBLANG_ENGLISH_CAN = $04; // English (Canadian)
- {$EXTERNALSYM SUBLANG_ENGLISH_CAN}
- SUBLANG_ENGLISH_NZ = $05; // English (New Zealand)
- {$EXTERNALSYM SUBLANG_ENGLISH_NZ}
- SUBLANG_ENGLISH_EIRE = $06; // English (Irish)
- {$EXTERNALSYM SUBLANG_ENGLISH_EIRE}
- SUBLANG_ENGLISH_SOUTH_AFRICA = $07; // English (South Africa)
- {$EXTERNALSYM SUBLANG_ENGLISH_SOUTH_AFRICA}
- SUBLANG_ENGLISH_JAMAICA = $08; // English (Jamaica)
- {$EXTERNALSYM SUBLANG_ENGLISH_JAMAICA}
- SUBLANG_ENGLISH_CARIBBEAN = $09; // English (Caribbean)
- {$EXTERNALSYM SUBLANG_ENGLISH_CARIBBEAN}
- SUBLANG_ENGLISH_BELIZE = $0a; // English (Belize)
- {$EXTERNALSYM SUBLANG_ENGLISH_BELIZE}
- SUBLANG_ENGLISH_TRINIDAD = $0b; // English (Trinidad)
- {$EXTERNALSYM SUBLANG_ENGLISH_TRINIDAD}
- SUBLANG_ENGLISH_ZIMBABWE = $0c; // English (Zimbabwe)
- {$EXTERNALSYM SUBLANG_ENGLISH_ZIMBABWE}
- SUBLANG_ENGLISH_PHILIPPINES = $0d; // English (Philippines)
- {$EXTERNALSYM SUBLANG_ENGLISH_PHILIPPINES}
- SUBLANG_FRENCH = $01; // French
- {$EXTERNALSYM SUBLANG_FRENCH}
- SUBLANG_FRENCH_BELGIAN = $02; // French (Belgian)
- {$EXTERNALSYM SUBLANG_FRENCH_BELGIAN}
- SUBLANG_FRENCH_CANADIAN = $03; // French (Canadian)
- {$EXTERNALSYM SUBLANG_FRENCH_CANADIAN}
- SUBLANG_FRENCH_SWISS = $04; // French (Swiss)
- {$EXTERNALSYM SUBLANG_FRENCH_SWISS}
- SUBLANG_FRENCH_LUXEMBOURG = $05; // French (Luxembourg)
- {$EXTERNALSYM SUBLANG_FRENCH_LUXEMBOURG}
- SUBLANG_FRENCH_MONACO = $06; // French (Monaco)
- {$EXTERNALSYM SUBLANG_FRENCH_MONACO}
- SUBLANG_GERMAN = $01; // German
- {$EXTERNALSYM SUBLANG_GERMAN}
- SUBLANG_GERMAN_SWISS = $02; // German (Swiss)
- {$EXTERNALSYM SUBLANG_GERMAN_SWISS}
- SUBLANG_GERMAN_AUSTRIAN = $03; // German (Austrian)
- {$EXTERNALSYM SUBLANG_GERMAN_AUSTRIAN}
- SUBLANG_GERMAN_LUXEMBOURG = $04; // German (Luxembourg)
- {$EXTERNALSYM SUBLANG_GERMAN_LUXEMBOURG}
- SUBLANG_GERMAN_LIECHTENSTEIN = $05; // German (Liechtenstein)
- {$EXTERNALSYM SUBLANG_GERMAN_LIECHTENSTEIN}
- SUBLANG_ITALIAN = $01; // Italian
- {$EXTERNALSYM SUBLANG_ITALIAN}
- SUBLANG_ITALIAN_SWISS = $02; // Italian (Swiss)
- {$EXTERNALSYM SUBLANG_ITALIAN_SWISS}
- SUBLANG_KASHMIRI_SASIA = $02; // Kashmiri (South Asia)
- {$EXTERNALSYM SUBLANG_KASHMIRI_SASIA}
- SUBLANG_KASHMIRI_INDIA = $02; // For app compatibility only
- {$EXTERNALSYM SUBLANG_KASHMIRI_INDIA}
- SUBLANG_KOREAN = $01; // Korean (Extended Wansung)
- {$EXTERNALSYM SUBLANG_KOREAN}
- SUBLANG_LITHUANIAN = $01; // Lithuanian
- {$EXTERNALSYM SUBLANG_LITHUANIAN}
- SUBLANG_MALAY_MALAYSIA = $01; // Malay (Malaysia)
- {$EXTERNALSYM SUBLANG_MALAY_MALAYSIA}
- SUBLANG_MALAY_BRUNEI_DARUSSALAM = $02; // Malay (Brunei Darussalam)
- {$EXTERNALSYM SUBLANG_MALAY_BRUNEI_DARUSSALAM}
- SUBLANG_NEPALI_INDIA = $02; // Nepali (India)
- {$EXTERNALSYM SUBLANG_NEPALI_INDIA}
- SUBLANG_NORWEGIAN_BOKMAL = $01; // Norwegian (Bokmal)
- {$EXTERNALSYM SUBLANG_NORWEGIAN_BOKMAL}
- SUBLANG_NORWEGIAN_NYNORSK = $02; // Norwegian (Nynorsk)
- {$EXTERNALSYM SUBLANG_NORWEGIAN_NYNORSK}
- SUBLANG_PORTUGUESE = $02; // Portuguese
- {$EXTERNALSYM SUBLANG_PORTUGUESE}
- SUBLANG_PORTUGUESE_BRAZILIAN = $01; // Portuguese (Brazilian)
- {$EXTERNALSYM SUBLANG_PORTUGUESE_BRAZILIAN}
- SUBLANG_SERBIAN_LATIN = $02; // Serbian (Latin)
- {$EXTERNALSYM SUBLANG_SERBIAN_LATIN}
- SUBLANG_SERBIAN_CYRILLIC = $03; // Serbian (Cyrillic)
- {$EXTERNALSYM SUBLANG_SERBIAN_CYRILLIC}
- SUBLANG_SPANISH = $01; // Spanish (Castilian)
- {$EXTERNALSYM SUBLANG_SPANISH}
- SUBLANG_SPANISH_MEXICAN = $02; // Spanish (Mexican)
- {$EXTERNALSYM SUBLANG_SPANISH_MEXICAN}
- SUBLANG_SPANISH_MODERN = $03; // Spanish (Spain)
- {$EXTERNALSYM SUBLANG_SPANISH_MODERN}
- SUBLANG_SPANISH_GUATEMALA = $04; // Spanish (Guatemala)
- {$EXTERNALSYM SUBLANG_SPANISH_GUATEMALA}
- SUBLANG_SPANISH_COSTA_RICA = $05; // Spanish (Costa Rica)
- {$EXTERNALSYM SUBLANG_SPANISH_COSTA_RICA}
- SUBLANG_SPANISH_PANAMA = $06; // Spanish (Panama)
- {$EXTERNALSYM SUBLANG_SPANISH_PANAMA}
- SUBLANG_SPANISH_DOMINICAN_REPUBLIC = $07; // Spanish (Dominican Republic)
- {$EXTERNALSYM SUBLANG_SPANISH_DOMINICAN_REPUBLIC}
- SUBLANG_SPANISH_VENEZUELA = $08; // Spanish (Venezuela)
- {$EXTERNALSYM SUBLANG_SPANISH_VENEZUELA}
- SUBLANG_SPANISH_COLOMBIA = $09; // Spanish (Colombia)
- {$EXTERNALSYM SUBLANG_SPANISH_COLOMBIA}
- SUBLANG_SPANISH_PERU = $0a; // Spanish (Peru)
- {$EXTERNALSYM SUBLANG_SPANISH_PERU}
- SUBLANG_SPANISH_ARGENTINA = $0b; // Spanish (Argentina)
- {$EXTERNALSYM SUBLANG_SPANISH_ARGENTINA}
- SUBLANG_SPANISH_ECUADOR = $0c; // Spanish (Ecuador)
- {$EXTERNALSYM SUBLANG_SPANISH_ECUADOR}
- SUBLANG_SPANISH_CHILE = $0d; // Spanish (Chile)
- {$EXTERNALSYM SUBLANG_SPANISH_CHILE}
- SUBLANG_SPANISH_URUGUAY = $0e; // Spanish (Uruguay)
- {$EXTERNALSYM SUBLANG_SPANISH_URUGUAY}
- SUBLANG_SPANISH_PARAGUAY = $0f; // Spanish (Paraguay)
- {$EXTERNALSYM SUBLANG_SPANISH_PARAGUAY}
- SUBLANG_SPANISH_BOLIVIA = $10; // Spanish (Bolivia)
- {$EXTERNALSYM SUBLANG_SPANISH_BOLIVIA}
- SUBLANG_SPANISH_EL_SALVADOR = $11; // Spanish (El Salvador)
- {$EXTERNALSYM SUBLANG_SPANISH_EL_SALVADOR}
- SUBLANG_SPANISH_HONDURAS = $12; // Spanish (Honduras)
- {$EXTERNALSYM SUBLANG_SPANISH_HONDURAS}
- SUBLANG_SPANISH_NICARAGUA = $13; // Spanish (Nicaragua)
- {$EXTERNALSYM SUBLANG_SPANISH_NICARAGUA}
- SUBLANG_SPANISH_PUERTO_RICO = $14; // Spanish (Puerto Rico)
- {$EXTERNALSYM SUBLANG_SPANISH_PUERTO_RICO}
- SUBLANG_SWEDISH = $01; // Swedish
- {$EXTERNALSYM SUBLANG_SWEDISH}
- SUBLANG_SWEDISH_FINLAND = $02; // Swedish (Finland)
- {$EXTERNALSYM SUBLANG_SWEDISH_FINLAND}
- SUBLANG_URDU_PAKISTAN = $01; // Urdu (Pakistan)
- {$EXTERNALSYM SUBLANG_URDU_PAKISTAN}
- SUBLANG_URDU_INDIA = $02; // Urdu (India)
- {$EXTERNALSYM SUBLANG_URDU_INDIA}
- SUBLANG_UZBEK_LATIN = $01; // Uzbek (Latin)
- {$EXTERNALSYM SUBLANG_UZBEK_LATIN}
- SUBLANG_UZBEK_CYRILLIC = $02; // Uzbek (Cyrillic)
- {$EXTERNALSYM SUBLANG_UZBEK_CYRILLIC}
- //
- // Sorting IDs.
- //
- SORT_DEFAULT = $0; // sorting default
- {$EXTERNALSYM SORT_DEFAULT}
- SORT_JAPANESE_XJIS = $0; // Japanese XJIS order
- {$EXTERNALSYM SORT_JAPANESE_XJIS}
- SORT_JAPANESE_UNICODE = $1; // Japanese Unicode order
- {$EXTERNALSYM SORT_JAPANESE_UNICODE}
- SORT_CHINESE_BIG5 = $0; // Chinese BIG5 order
- {$EXTERNALSYM SORT_CHINESE_BIG5}
- SORT_CHINESE_PRCP = $0; // PRC Chinese Phonetic order
- {$EXTERNALSYM SORT_CHINESE_PRCP}
- SORT_CHINESE_UNICODE = $1; // Chinese Unicode order
- {$EXTERNALSYM SORT_CHINESE_UNICODE}
- SORT_CHINESE_PRC = $2; // PRC Chinese Stroke Count order
- {$EXTERNALSYM SORT_CHINESE_PRC}
- SORT_CHINESE_BOPOMOFO = $3; // Traditional Chinese Bopomofo order
- {$EXTERNALSYM SORT_CHINESE_BOPOMOFO}
- SORT_KOREAN_KSC = $0; // Korean KSC order
- {$EXTERNALSYM SORT_KOREAN_KSC}
- SORT_KOREAN_UNICODE = $1; // Korean Unicode order
- {$EXTERNALSYM SORT_KOREAN_UNICODE}
- SORT_GERMAN_PHONE_BOOK = $1; // German Phone Book order
- {$EXTERNALSYM SORT_GERMAN_PHONE_BOOK}
- SORT_HUNGARIAN_DEFAULT = $0; // Hungarian Default order
- {$EXTERNALSYM SORT_HUNGARIAN_DEFAULT}
- SORT_HUNGARIAN_TECHNICAL = $1; // Hungarian Technical order
- {$EXTERNALSYM SORT_HUNGARIAN_TECHNICAL}
- SORT_GEORGIAN_TRADITIONAL = $0; // Georgian Traditional order
- {$EXTERNALSYM SORT_GEORGIAN_TRADITIONAL}
- SORT_GEORGIAN_MODERN = $1; // Georgian Modern order
- {$EXTERNALSYM SORT_GEORGIAN_MODERN}
- //
- // A language ID is a 16 bit value which is the combination of a
- // primary language ID and a secondary language ID. The bits are
- // allocated as follows:
- //
- // +-----------------------+-------------------------+
- // | Sublanguage ID | Primary Language ID |
- // +-----------------------+-------------------------+
- // 15 10 9 0 bit
- //
- //
- // Language ID creation/extraction macros:
- //
- // MAKELANGID - construct language id from a primary language id and
- // a sublanguage id.
- // PRIMARYLANGID - extract primary language id from a language id.
- // SUBLANGID - extract sublanguage id from a language id.
- //
- function MAKELANGID(PrimaryLang, SubLang: USHORT): WORD;
- {$EXTERNALSYM MAKELANGID}
- function PRIMARYLANGID(LangId: WORD): WORD;
- {$EXTERNALSYM PRIMARYLANGID}
- function SUBLANGID(LangId: WORD): WORD;
- {$EXTERNALSYM SUBLANGID}
- //
- // A locale ID is a 32 bit value which is the combination of a
- // language ID, a sort ID, and a reserved area. The bits are
- // allocated as follows:
- //
- // +-------------+---------+-------------------------+
- // | Reserved | Sort ID | Language ID |
- // +-------------+---------+-------------------------+
- // 31 20 19 16 15 0 bit
- //
- //
- // Locale ID creation/extraction macros:
- //
- // MAKELCID - construct the locale id from a language id and a sort id.
- // MAKESORTLCID - construct the locale id from a language id, sort id, and sort version.
- // LANGIDFROMLCID - extract the language id from a locale id.
- // SORTIDFROMLCID - extract the sort id from a locale id.
- // SORTVERSIONFROMLCID - extract the sort version from a locale id.
- //
- const
- NLS_VALID_LOCALE_MASK = $000fffff;
- {$EXTERNALSYM NLS_VALID_LOCALE_MASK}
- function MAKELCID(LangId, SortId: WORD): DWORD;
- {$EXTERNALSYM MAKELCID}
- function MAKESORTLCID(LangId, SortId, SortVersion: WORD): DWORD;
- {$EXTERNALSYM MAKESORTLCID}
- function LANGIDFROMLCID(LocaleId: LCID): WORD;
- {$EXTERNALSYM LANGIDFROMLCID}
- function SORTIDFROMLCID(LocaleId: LCID): WORD;
- {$EXTERNALSYM SORTIDFROMLCID}
- function SORTVERSIONFROMLCID(LocaleId: LCID): WORD;
- {$EXTERNALSYM SORTVERSIONFROMLCID}
- //
- // Default System and User IDs for language and locale.
- //
- function LANG_SYSTEM_DEFAULT: WORD;
- {$EXTERNALSYM LANG_SYSTEM_DEFAULT}
- function LANG_USER_DEFAULT: WORD;
- {$EXTERNALSYM LANG_USER_DEFAULT}
- function LOCALE_SYSTEM_DEFAULT: DWORD;
- {$EXTERNALSYM LOCALE_SYSTEM_DEFAULT}
- function LOCALE_USER_DEFAULT: DWORD;
- {$EXTERNALSYM LOCALE_USER_DEFAULT}
- function LOCALE_NEUTRAL: DWORD;
- {$EXTERNALSYM LOCALE_NEUTRAL}
- function LOCALE_INVARIANT: DWORD;
- {$EXTERNALSYM LOCALE_NEUTRAL}
- {$IFNDEF WIN32_NO_STATUS}
- const
- STATUS_WAIT_0 = DWORD($00000000);
- {$EXTERNALSYM STATUS_WAIT_0}
- STATUS_ABANDONED_WAIT_0 = DWORD($00000080);
- {$EXTERNALSYM STATUS_ABANDONED_WAIT_0}
- STATUS_USER_APC = DWORD($000000C0);
- {$EXTERNALSYM STATUS_USER_APC}
- STATUS_TIMEOUT = DWORD($00000102);
- {$EXTERNALSYM STATUS_TIMEOUT}
- STATUS_PENDING = DWORD($00000103);
- {$EXTERNALSYM STATUS_PENDING}
- DBG_EXCEPTION_HANDLED = DWORD($00010001);
- {$EXTERNALSYM DBG_EXCEPTION_HANDLED}
- DBG_CONTINUE = DWORD($00010002);
- {$EXTERNALSYM DBG_CONTINUE}
- STATUS_SEGMENT_NOTIFICATION = DWORD($40000005);
- {$EXTERNALSYM STATUS_SEGMENT_NOTIFICATION}
- DBG_TERMINATE_THREAD = DWORD($40010003);
- {$EXTERNALSYM DBG_TERMINATE_THREAD}
- DBG_TERMINATE_PROCESS = DWORD($40010004);
- {$EXTERNALSYM DBG_TERMINATE_PROCESS}
- DBG_CONTROL_C = DWORD($40010005);
- {$EXTERNALSYM DBG_CONTROL_C}
- DBG_CONTROL_BREAK = DWORD($40010008);
- {$EXTERNALSYM DBG_CONTROL_BREAK}
- DBG_COMMAND_EXCEPTION = DWORD($40010009);
- {$EXTERNALSYM DBG_COMMAND_EXCEPTION}
- STATUS_GUARD_PAGE_VIOLATION = DWORD($80000001);
- {$EXTERNALSYM STATUS_GUARD_PAGE_VIOLATION}
- STATUS_DATATYPE_MISALIGNMENT = DWORD($80000002);
- {$EXTERNALSYM STATUS_DATATYPE_MISALIGNMENT}
- STATUS_BREAKPOINT = DWORD($80000003);
- {$EXTERNALSYM STATUS_BREAKPOINT}
- STATUS_SINGLE_STEP = DWORD($80000004);
- {$EXTERNALSYM STATUS_SINGLE_STEP}
- DBG_EXCEPTION_NOT_HANDLED = DWORD($80010001);
- {$EXTERNALSYM DBG_EXCEPTION_NOT_HANDLED}
- STATUS_ACCESS_VIOLATION = DWORD($C0000005);
- {$EXTERNALSYM STATUS_ACCESS_VIOLATION}
- STATUS_IN_PAGE_ERROR = DWORD($C0000006);
- {$EXTERNALSYM STATUS_IN_PAGE_ERROR}
- STATUS_INVALID_HANDLE = DWORD($C0000008);
- {$EXTERNALSYM STATUS_INVALID_HANDLE}
- STATUS_NO_MEMORY = DWORD($C0000017);
- {$EXTERNALSYM STATUS_NO_MEMORY}
- STATUS_ILLEGAL_INSTRUCTION = DWORD($C000001D);
- {$EXTERNALSYM STATUS_ILLEGAL_INSTRUCTION}
- STATUS_NONCONTINUABLE_EXCEPTION = DWORD($C0000025);
- {$EXTERNALSYM STATUS_NONCONTINUABLE_EXCEPTION}
- STATUS_INVALID_DISPOSITION = DWORD($C0000026);
- {$EXTERNALSYM STATUS_INVALID_DISPOSITION}
- STATUS_ARRAY_BOUNDS_EXCEEDED = DWORD($C000008C);
- {$EXTERNALSYM STATUS_ARRAY_BOUNDS_EXCEEDED}
- STATUS_FLOAT_DENORMAL_OPERAND = DWORD($C000008D);
- {$EXTERNALSYM STATUS_FLOAT_DENORMAL_OPERAND}
- STATUS_FLOAT_DIVIDE_BY_ZERO = DWORD($C000008E);
- {$EXTERNALSYM STATUS_FLOAT_DIVIDE_BY_ZERO}
- STATUS_FLOAT_INEXACT_RESULT = DWORD($C000008F);
- {$EXTERNALSYM STATUS_FLOAT_INEXACT_RESULT}
- STATUS_FLOAT_INVALID_OPERATION = DWORD($C0000090);
- {$EXTERNALSYM STATUS_FLOAT_INVALID_OPERATION}
- STATUS_FLOAT_OVERFLOW = DWORD($C0000091);
- {$EXTERNALSYM STATUS_FLOAT_OVERFLOW}
- STATUS_FLOAT_STACK_CHECK = DWORD($C0000092);
- {$EXTERNALSYM STATUS_FLOAT_STACK_CHECK}
- STATUS_FLOAT_UNDERFLOW = DWORD($C0000093);
- {$EXTERNALSYM STATUS_FLOAT_UNDERFLOW}
- STATUS_INTEGER_DIVIDE_BY_ZERO = DWORD($C0000094);
- {$EXTERNALSYM STATUS_INTEGER_DIVIDE_BY_ZERO}
- STATUS_INTEGER_OVERFLOW = DWORD($C0000095);
- {$EXTERNALSYM STATUS_INTEGER_OVERFLOW}
- STATUS_PRIVILEGED_INSTRUCTION = DWORD($C0000096);
- {$EXTERNALSYM STATUS_PRIVILEGED_INSTRUCTION}
- STATUS_STACK_OVERFLOW = DWORD($C00000FD);
- {$EXTERNALSYM STATUS_STACK_OVERFLOW}
- STATUS_CONTROL_C_EXIT = DWORD($C000013A);
- {$EXTERNALSYM STATUS_CONTROL_C_EXIT}
- STATUS_FLOAT_MULTIPLE_FAULTS = DWORD($C00002B4);
- {$EXTERNALSYM STATUS_FLOAT_MULTIPLE_FAULTS}
- STATUS_FLOAT_MULTIPLE_TRAPS = DWORD($C00002B5);
- {$EXTERNALSYM STATUS_FLOAT_MULTIPLE_TRAPS}
- STATUS_REG_NAT_CONSUMPTION = DWORD($C00002C9);
- {$EXTERNALSYM STATUS_REG_NAT_CONSUMPTION}
- STATUS_SXS_EARLY_DEACTIVATION = DWORD($C015000F);
- {$EXTERNALSYM STATUS_SXS_EARLY_DEACTIVATION}
- STATUS_SXS_INVALID_DEACTIVATION = DWORD($C0150010);
- {$EXTERNALSYM STATUS_SXS_INVALID_DEACTIVATION}
- {$ENDIF}
- const
- MAXIMUM_WAIT_OBJECTS = 64; // Maximum number of wait objects
- {$EXTERNALSYM MAXIMUM_WAIT_OBJECTS}
- MAXIMUM_SUSPEND_COUNT = MAXCHAR; // Maximum times thread can be suspended
- {$EXTERNALSYM MAXIMUM_SUSPEND_COUNT}
- type
- KSPIN_LOCK = ULONG_PTR;
- {$EXTERNALSYM KSPIN_LOCK}
- PKSPIN_LOCK = ^KSPIN_LOCK;
- {$EXTERNALSYM PKSPIN_LOCK}
- //
- // Define functions to get the address of the current fiber and the
- // current fiber data.
- //
- //
- // Disable these two pramas that evaluate to "sti" "cli" on x86 so that driver
- // writers to not leave them inadvertantly in their code.
- //
- function GetFiberData: PVOID;
- {$EXTERNALSYM GetFiberData}
- function GetCurrentFiber: PVOID;
- {$EXTERNALSYM GetCurrentFiber}
- //
- // Define the size of the 80387 save area, which is in the context frame.
- //
- const
- SIZE_OF_80387_REGISTERS = 80;
- {$EXTERNALSYM SIZE_OF_80387_REGISTERS}
- //
- // The following flags control the contents of the CONTEXT structure.
- //
- const
- CONTEXT_i386 = $00010000; // this assumes that i386 and
- {$EXTERNALSYM CONTEXT_i386}
- CONTEXT_i486 = $00010000; // i486 have identical context records
- {$EXTERNALSYM CONTEXT_i486}
- const
- CONTEXT_CONTROL = (CONTEXT_i386 or $00000001); // SS:SP, CS:IP, FLAGS, BP
- {$EXTERNALSYM CONTEXT_CONTROL}
- CONTEXT_INTEGER = (CONTEXT_i386 or $00000002); // AX, BX, CX, DX, SI, DI
- {$EXTERNALSYM CONTEXT_INTEGER}
- CONTEXT_SEGMENTS = (CONTEXT_i386 or $00000004); // DS, ES, FS, GS
- {$EXTERNALSYM CONTEXT_SEGMENTS}
- CONTEXT_FLOATING_POINT = (CONTEXT_i386 or $00000008); // 387 state
- {$EXTERNALSYM CONTEXT_FLOATING_POINT}
- CONTEXT_DEBUG_REGISTERS = (CONTEXT_i386 or $00000010); // DB 0-3,6,7
- {$EXTERNALSYM CONTEXT_DEBUG_REGISTERS}
- CONTEXT_EXTENDED_REGISTERS = (CONTEXT_i386 or $00000020); // cpu specific extensions
- {$EXTERNALSYM CONTEXT_EXTENDED_REGISTERS}
- CONTEXT_FULL = (CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS);
- {$EXTERNALSYM CONTEXT_FULL}
- CONTEXT_ALL = (CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS or CONTEXT_FLOATING_POINT or CONTEXT_DEBUG_REGISTERS);
- {$EXTERNALSYM CONTEXT_ALL}
- //
- // Define initial MxCsr control.
- //
- INITIAL_MXCSR = $1f80; // initial MXCSR value
- {$EXTERNALSYM INITIAL_MXCSR}
- MAXIMUM_SUPPORTED_EXTENSION = 512;
- {$EXTERNALSYM MAXIMUM_SUPPORTED_EXTENSION}
- type
- PFLOATING_SAVE_AREA = ^FLOATING_SAVE_AREA;
- {$EXTERNALSYM PFLOATING_SAVE_AREA}
- _FLOATING_SAVE_AREA = record
- ControlWord: DWORD;
- StatusWord: DWORD;
- TagWord: DWORD;
- ErrorOffset: DWORD;
- ErrorSelector: DWORD;
- DataOffset: DWORD;
- DataSelector: DWORD;
- RegisterArea: array [0..SIZE_OF_80387_REGISTERS - 1] of BYTE;
- Cr0NpxState: DWORD;
- end;
- {$EXTERNALSYM _FLOATING_SAVE_AREA}
- FLOATING_SAVE_AREA = _FLOATING_SAVE_AREA;
- {$EXTERNALSYM FLOATING_SAVE_AREA}
- TFloatingSaveArea = FLOATING_SAVE_AREA;
- PFloatingSaveArea = PFLOATING_SAVE_AREA;
- //
- // Context Frame
- //
- // This frame has a several purposes: 1) it is used as an argument to
- // NtContinue, 2) is is used to constuct a call frame for APC delivery,
- // and 3) it is used in the user level thread creation routines.
- //
- // The layout of the record conforms to a standard call frame.
- //
- type
- PContext = ^CONTEXT;
- _CONTEXT = record
- //
- // The flags values within this flag control the contents of
- // a CONTEXT record.
- //
- // If the context record is used as an input parameter, then
- // for each portion of the context record controlled by a flag
- // whose value is set, it is assumed that that portion of the
- // context record contains valid context. If the context record
- // is being used to modify a threads context, then only that
- // portion of the threads context will be modified.
- //
- // If the context record is used as an IN OUT parameter to capture
- // the context of a thread, then only those portions of the thread's
- // context corresponding to set flags will be returned.
- //
- // The context record is never used as an OUT only parameter.
- //
- ContextFlags: DWORD;
- //
- // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
- // set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT
- // included in CONTEXT_FULL.
- //
- Dr0: DWORD;
- Dr1: DWORD;
- Dr2: DWORD;
- Dr3: DWORD;
- Dr6: DWORD;
- Dr7: DWORD;
- //
- // This section is specified/returned if the
- // ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
- //
- FloatSave: FLOATING_SAVE_AREA;
- //
- // This section is specified/returned if the
- // ContextFlags word contians the flag CONTEXT_SEGMENTS.
- //
- SegGs: DWORD;
- SegFs: DWORD;
- SegEs: DWORD;
- SegDs: DWORD;
- //
- // This section is specified/returned if the
- // ContextFlags word contians the flag CONTEXT_INTEGER.
- //
- Edi: DWORD;
- Esi: DWORD;
- Ebx: DWORD;
- Edx: DWORD;
- Ecx: DWORD;
- Eax: DWORD;
- //
- // This section is specified/returned if the
- // ContextFlags word contians the flag CONTEXT_CONTROL.
- //
- Ebp: DWORD;
- Eip: DWORD;
- SegCs: DWORD; // MUST BE SANITIZED
- EFlags: DWORD; // MUST BE SANITIZED
- Esp: DWORD;
- SegSs: DWORD;
- //
- // This section is specified/returned if the ContextFlags word
- // contains the flag CONTEXT_EXTENDED_REGISTERS.
- // The format and contexts are processor specific
- //
- ExtendedRegisters: array [0..MAXIMUM_SUPPORTED_EXTENSION - 1] of BYTE;
- end;
- {$EXTERNALSYM _CONTEXT}
- CONTEXT = _CONTEXT;
- {$EXTERNALSYM CONTEXT}
- TContext = CONTEXT;
- const
- LDTENTRY_FLAGS1_TYPE = $1F;
- LDTENTRY_FLAGS1_DPL = $60;
- LDTENTRY_FLAGS1_PRES = $80;
- LDTENTRY_FLAGS2_LIMITHI = $0F;
- LDTENTRY_FLAGS2_SYS = $10;
- LDTENTRY_FLAGS2_RESERVED_0 = $20;
- LDTENTRY_FLAGS2_DEFAULT_BIG = $40;
- LDTENTRY_FLAGS2_GRANULARITY = $80;
- type
- PLDT_ENTRY = ^LDT_ENTRY;
- {$EXTERNALSYM PLDT_ENTRY}
- _LDT_ENTRY = record
- LimitLow: WORD;
- BaseLow: WORD;
- BaseMid: BYTE;
- Flags1: BYTE; // Declare as bytes to avoid alignment
- Flags2: BYTE; // Problems.
- BaseHi: BYTE;
- end;
- {$EXTERNALSYM _LDT_ENTRY}
- LDT_ENTRY = _LDT_ENTRY;
- {$EXTERNALSYM LDT_ENTRY}
- TLdtEntry = LDT_ENTRY;
- PLdtEntry = PLDT_ENTRY;
- // Please contact INTEL to get IA64-specific information
- const
- EXCEPTION_NONCONTINUABLE = $1; // Noncontinuable exception
- {$EXTERNALSYM EXCEPTION_NONCONTINUABLE}
- EXCEPTION_MAXIMUM_PARAMETERS = 15; // maximum number of exception parameters
- {$EXTERNALSYM EXCEPTION_MAXIMUM_PARAMETERS}
- //
- // Exception record definition.
- //
- type
- PEXCEPTION_RECORD = ^EXCEPTION_RECORD;
- {$EXTERNALSYM PEXCEPTION_RECORD}
- _EXCEPTION_RECORD = record
- ExceptionCode: DWORD;
- ExceptionFlags: DWORD;
- ExceptionRecord: PEXCEPTION_RECORD;
- ExceptionAddress: Pointer;
- NumberParameters: DWORD;
- ExceptionInformation: array [0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of ULONG_PTR;
- end;
- {$EXTERNALSYM _EXCEPTION_RECORD}
- EXCEPTION_RECORD = _EXCEPTION_RECORD;
- {$EXTERNALSYM EXCEPTION_RECORD}
- TExceptionRecord = EXCEPTION_RECORD;
- PExceptionRecord = PEXCEPTION_RECORD;
- PEXCEPTION_RECORD32 = ^EXCEPTION_RECORD32;
- {$EXTERNALSYM PEXCEPTION_RECORD32}
- _EXCEPTION_RECORD32 = record
- ExceptionCode: DWORD;
- ExceptionFlags: DWORD;
- ExceptionRecord: DWORD;
- ExceptionAddress: DWORD;
- NumberParameters: DWORD;
- ExceptionInformation: array [0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of DWORD;
- end;
- {$EXTERNALSYM _EXCEPTION_RECORD32}
- EXCEPTION_RECORD32 = _EXCEPTION_RECORD32;
- {$EXTERNALSYM EXCEPTION_RECORD32}
- TExceptionRecord32 = EXCEPTION_RECORD32;
- PExceptionRecord32 = PEXCEPTION_RECORD32;
- PEXCEPTION_RECORD64 = ^EXCEPTION_RECORD64;
- {$EXTERNALSYM PEXCEPTION_RECORD64}
- _EXCEPTION_RECORD64 = record
- ExceptionCode: DWORD;
- ExceptionFlags: DWORD;
- ExceptionRecord: DWORD64;
- ExceptionAddress: DWORD64;
- NumberParameters: DWORD;
- __unusedAlignment: DWORD;
- ExceptionInformation: array [0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of DWORD64;
- end;
- {$EXTERNALSYM _EXCEPTION_RECORD64}
- EXCEPTION_RECORD64 = _EXCEPTION_RECORD64;
- {$EXTERNALSYM EXCEPTION_RECORD64}
- TExceptionRecord64 = EXCEPTION_RECORD64;
- PExceptionRecord64 = PEXCEPTION_RECORD64;
- //
- // Typedef for pointer returned by exception_info()
- //
- PEXCEPTION_POINTERS = ^EXCEPTION_POINTERS;
- {$EXTERNALSYM PEXCEPTION_POINTERS}
- _EXCEPTION_POINTERS = record
- ExceptionRecord: PEXCEPTION_RECORD;
- ContextRecord: PCONTEXT;
- end;
- {$EXTERNALSYM _EXCEPTION_POINTERS}
- EXCEPTION_POINTERS = _EXCEPTION_POINTERS;
- {$EXTERNALSYM EXCEPTION_POINTERS}
- TExceptionPointers = EXCEPTION_POINTERS;
- PExceptionPointers = ^TExceptionPointers;
- PACCESS_TOKEN = Pointer;
- {$EXTERNALSYM PACCESS_TOKEN}
- ////////////////////////////////////////////////////////////////////////
- // //
- // ACCESS MASK //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- // Define the access mask as a longword sized structure divided up as
- // follows:
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +---------------+---------------+-------------------------------+
- // |G|G|G|G|Res'd|A| StandardRights| SpecificRights |
- // |R|W|E|A| |S| | |
- // +-+-------------+---------------+-------------------------------+
- //
- // 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 | READ_CONTROL
- //
- // So we'll declare ACCESS_MASK as DWORD
- //
- type
- ACCESS_MASK = DWORD;
- {$EXTERNALSYM ACCESS_MASK}
- PACCESS_MASK = ^ACCESS_MASK;
- {$EXTERNALSYM PACCESS_MASK}
- TAccessMask = ACCESS_MASK;
- PAccessMask = PACCESS_MASK;
- ////////////////////////////////////////////////////////////////////////
- // //
- // ACCESS TYPES //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- // The following are masks for the predefined standard access types
- //
- const
- DELETE = ($00010000);
- {$EXTERNALSYM DELETE}
- READ_CONTROL = ($00020000);
- {$EXTERNALSYM READ_CONTROL}
- WRITE_DAC = ($00040000);
- {$EXTERNALSYM WRITE_DAC}
- WRITE_OWNER = ($00080000);
- {$EXTERNALSYM WRITE_OWNER}
- SYNCHRONIZE = ($00100000);
- {$EXTERNALSYM SYNCHRONIZE}
- STANDARD_RIGHTS_REQUIRED = ($000F0000);
- {$EXTERNALSYM STANDARD_RIGHTS_REQUIRED}
- STANDARD_RIGHTS_READ = (READ_CONTROL);
- {$EXTERNALSYM STANDARD_RIGHTS_READ}
- STANDARD_RIGHTS_WRITE = (READ_CONTROL);
- {$EXTERNALSYM STANDARD_RIGHTS_WRITE}
- STANDARD_RIGHTS_EXECUTE = (READ_CONTROL);
- {$EXTERNALSYM STANDARD_RIGHTS_EXECUTE}
- STANDARD_RIGHTS_ALL = ($001F0000);
- {$EXTERNALSYM STANDARD_RIGHTS_ALL}
- SPECIFIC_RIGHTS_ALL = ($0000FFFF);
- {$EXTERNALSYM SPECIFIC_RIGHTS_ALL}
- //
- // AccessSystemAcl access type
- //
- ACCESS_SYSTEM_SECURITY = ($01000000);
- {$EXTERNALSYM ACCESS_SYSTEM_SECURITY}
- //
- // MaximumAllowed access type
- //
- MAXIMUM_ALLOWED = ($02000000);
- {$EXTERNALSYM MAXIMUM_ALLOWED}
- //
- // These are the generic rights.
- //
- GENERIC_READ = DWORD($80000000);
- {$EXTERNALSYM GENERIC_READ}
- GENERIC_WRITE = ($40000000);
- {$EXTERNALSYM GENERIC_WRITE}
- GENERIC_EXECUTE = ($20000000);
- {$EXTERNALSYM GENERIC_EXECUTE}
- GENERIC_ALL = ($10000000);
- {$EXTERNALSYM GENERIC_ALL}
- //
- // Define the generic mapping array. This is used to denote the
- // mapping of each generic access right to a specific access mask.
- //
- type
- PGENERIC_MAPPING = ^GENERIC_MAPPING;
- {$EXTERNALSYM PGENERIC_MAPPING}
- _GENERIC_MAPPING = record
- GenericRead: ACCESS_MASK;
- GenericWrite: ACCESS_MASK;
- GenericExecute: ACCESS_MASK;
- GenericAll: ACCESS_MASK;
- end;
- {$EXTERNALSYM _GENERIC_MAPPING}
- GENERIC_MAPPING = _GENERIC_MAPPING;
- {$EXTERNALSYM GENERIC_MAPPING}
- TGenericMapping = GENERIC_MAPPING;
- PGenericMapping = PGENERIC_MAPPING;
- ////////////////////////////////////////////////////////////////////////
- // //
- // LUID_AND_ATTRIBUTES //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- //
- //#include <pshpack4.h>
- PLUID_AND_ATTRIBUTES = ^LUID_AND_ATTRIBUTES;
- {$EXTERNALSYM PLUID_AND_ATTRIBUTES}
- _LUID_AND_ATTRIBUTES = record
- Luid: LUID;
- Attributes: DWORD;
- end;
- {$EXTERNALSYM _LUID_AND_ATTRIBUTES}
- LUID_AND_ATTRIBUTES = _LUID_AND_ATTRIBUTES;
- {$EXTERNALSYM LUID_AND_ATTRIBUTES}
- TLuidAndAttributes = LUID_AND_ATTRIBUTES;
- PLuidAndAttributes = PLUID_AND_ATTRIBUTES;
- LUID_AND_ATTRIBUTES_ARRAY = array [0..ANYSIZE_ARRAY - 1] of LUID_AND_ATTRIBUTES;
- {$EXTERNALSYM LUID_AND_ATTRIBUTES_ARRAY}
- PLUID_AND_ATTRIBUTES_ARRAY = ^LUID_AND_ATTRIBUTES_ARRAY;
- {$EXTERNALSYM PLUID_AND_ATTRIBUTES_ARRAY}
- TLuidAndAttributesArray = LUID_AND_ATTRIBUTES_ARRAY;
- PLuidAndAttributesArray = ^TLuidAndAttributesArray;
- //#include <poppack.h>
- ////////////////////////////////////////////////////////////////////////
- // //
- // Security Id (SID) //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- //
- // Pictorially the structure of an SID is as follows:
- //
- // 1 1 1 1 1 1
- // 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +---------------------------------------------------------------+
- // | SubAuthorityCount |Reserved1 (SBZ)| Revision |
- // +---------------------------------------------------------------+
- // | IdentifierAuthority[0] |
- // +---------------------------------------------------------------+
- // | IdentifierAuthority[1] |
- // +---------------------------------------------------------------+
- // | IdentifierAuthority[2] |
- // +---------------------------------------------------------------+
- // | |
- // +- - - - - - - - SubAuthority[] - - - - - - - - -+
- // | |
- // +---------------------------------------------------------------+
- //
- //
- type
- PSID_IDENTIFIER_AUTHORITY = ^SID_IDENTIFIER_AUTHORITY;
- {$EXTERNALSYM PSID_IDENTIFIER_AUTHORITY}
- _SID_IDENTIFIER_AUTHORITY = record
- Value: array [0..5] of Byte;
- end;
- {$EXTERNALSYM _SID_IDENTIFIER_AUTHORITY}
- SID_IDENTIFIER_AUTHORITY = _SID_IDENTIFIER_AUTHORITY;
- {$EXTERNALSYM SID_IDENTIFIER_AUTHORITY}
- TSidIdentifierAuthority = SID_IDENTIFIER_AUTHORITY;
- PSidIdentifierAuthority = PSID_IDENTIFIER_AUTHORITY;
- PSid = ^SID;
- _SID = record
- Revision: Byte;
- SubAuthorityCount: Byte;
- IdentifierAuthority: SID_IDENTIFIER_AUTHORITY;
- SubAuthority: array [0..ANYSIZE_ARRAY - 1] of DWORD;
- end;
- {$EXTERNALSYM _SID}
- SID = _SID;
- {$EXTERNALSYM SID}
- PPSID = ^PSID;
- {$NODEFINE PPSID}
- TSid = SID;
- const
- SID_REVISION = (1); // Current revision level
- {$EXTERNALSYM SID_REVISION}
- SID_MAX_SUB_AUTHORITIES = (15);
- {$EXTERNALSYM SID_MAX_SUB_AUTHORITIES}
- SID_RECOMMENDED_SUB_AUTHORITIES = (1); // Will change to around 6 in a future release.
- {$EXTERNALSYM SID_RECOMMENDED_SUB_AUTHORITIES}
- SECURITY_MAX_SID_SIZE = SizeOf(SID) - SizeOf(DWORD) + (SID_MAX_SUB_AUTHORITIES * SizeOf(DWORD));
- {$EXTERNALSYM SECURITY_MAX_SID_SIZE}
- SidTypeUser = 1;
- {$EXTERNALSYM SidTypeUser}
- SidTypeGroup = 2;
- {$EXTERNALSYM SidTypeGroup}
- SidTypeDomain = 3;
- {$EXTERNALSYM SidTypeDomain}
- SidTypeAlias = 4;
- {$EXTERNALSYM SidTypeAlias}
- SidTypeWellKnownGroup = 5;
- {$EXTERNALSYM SidTypeWellKnownGroup}
- SidTypeDeletedAccount = 6;
- {$EXTERNALSYM SidTypeDeletedAccount}
- SidTypeInvalid = 7;
- {$EXTERNALSYM SidTypeInvalid}
- SidTypeUnknown = 8;
- {$EXTERNALSYM SidTypeUnknown}
- SidTypeComputer = 9;
- {$EXTERNALSYM SidTypeComputer}
- type
- _SID_NAME_USE = DWORD;
- {$EXTERNALSYM _SID_NAME_USE}
- SID_NAME_USE = _SID_NAME_USE;
- {$EXTERNALSYM SID_NAME_USE}
- PSID_NAME_USE = ^SID_NAME_USE;
- {$EXTERNALSYM PSID_NAME_USE}
- TSidNameUse = SID_NAME_USE;
- PSidNameUSe = PSID_NAME_USE;
- PSID_AND_ATTRIBUTES = ^SID_AND_ATTRIBUTES;
- {$EXTERNALSYM PSID_AND_ATTRIBUTES}
- _SID_AND_ATTRIBUTES = record
- Sid: PSID;
- Attributes: DWORD;
- end;
- {$EXTERNALSYM _SID_AND_ATTRIBUTES}
- SID_AND_ATTRIBUTES = _SID_AND_ATTRIBUTES;
- {$EXTERNALSYM SID_AND_ATTRIBUTES}
- TSidAndAttributes = SID_AND_ATTRIBUTES;
- PSidAndAttributes = PSID_AND_ATTRIBUTES;
- SID_AND_ATTRIBUTES_ARRAY = array [0..ANYSIZE_ARRAY - 1] of SID_AND_ATTRIBUTES;
- {$EXTERNALSYM SID_AND_ATTRIBUTES_ARRAY}
- PSID_AND_ATTRIBUTES_ARRAY = ^SID_AND_ATTRIBUTES_ARRAY;
- {$EXTERNALSYM PSID_AND_ATTRIBUTES_ARRAY}
- PSidAndAttributesArray = ^TSidAndAttributesArray;
- TSidAndAttributesArray = SID_AND_ATTRIBUTES_ARRAY;
- /////////////////////////////////////////////////////////////////////////////
- // //
- // Universal well-known SIDs //
- // //
- // Null SID S-1-0-0 //
- // World S-1-1-0 //
- // Local S-1-2-0 //
- // Creator Owner ID S-1-3-0 //
- // Creator Group ID S-1-3-1 //
- // Creator Owner Server ID S-1-3-2 //
- // Creator Group Server ID S-1-3-3 //
- // //
- // (Non-unique IDs) S-1-4 //
- // //
- /////////////////////////////////////////////////////////////////////////////
- const
- SECURITY_NULL_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 0));
- {$EXTERNALSYM SECURITY_NULL_SID_AUTHORITY}
- SECURITY_WORLD_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 1));
- {$EXTERNALSYM SECURITY_WORLD_SID_AUTHORITY}
- SECURITY_LOCAL_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 2));
- {$EXTERNALSYM SECURITY_LOCAL_SID_AUTHORITY}
- SECURITY_CREATOR_SID_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 3));
- {$EXTERNALSYM SECURITY_CREATOR_SID_AUTHORITY}
- SECURITY_NON_UNIQUE_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 4));
- {$EXTERNALSYM SECURITY_NON_UNIQUE_AUTHORITY}
- SECURITY_RESOURCE_MANAGER_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 9));
- {$EXTERNALSYM SECURITY_RESOURCE_MANAGER_AUTHORITY}
- SECURITY_NULL_RID = ($00000000);
- {$EXTERNALSYM SECURITY_NULL_RID}
- SECURITY_WORLD_RID = ($00000000);
- {$EXTERNALSYM SECURITY_WORLD_RID}
- SECURITY_LOCAL_RID = ($00000000);
- {$EXTERNALSYM SECURITY_LOCAL_RID}
- SECURITY_CREATOR_OWNER_RID = ($00000000);
- {$EXTERNALSYM SECURITY_CREATOR_OWNER_RID}
- SECURITY_CREATOR_GROUP_RID = ($00000001);
- {$EXTERNALSYM SECURITY_CREATOR_GROUP_RID}
- SECURITY_CREATOR_OWNER_SERVER_RID = ($00000002);
- {$EXTERNALSYM SECURITY_CREATOR_OWNER_SERVER_RID}
- SECURITY_CREATOR_GROUP_SERVER_RID = ($00000003);
- {$EXTERNALSYM SECURITY_CREATOR_GROUP_SERVER_RID}
- /////////////////////////////////////////////////////////////////////////////
- // //
- // NT well-known SIDs //
- // //
- // NT Authority S-1-5 //
- // Dialup S-1-5-1 //
- // //
- // Network S-1-5-2 //
- // Batch S-1-5-3 //
- // Interactive S-1-5-4 //
- // (Logon IDs) S-1-5-5-X-Y //
- // Service S-1-5-6 //
- // AnonymousLogon S-1-5-7 (aka null logon session) //
- // Proxy S-1-5-8 //
- // Enterprise DC (EDC) S-1-5-9 (aka domain controller account) //
- // Self S-1-5-10 (self RID) //
- // Authenticated User S-1-5-11 (Authenticated user somewhere) //
- // Restricted Code S-1-5-12 (Running restricted code) //
- // Terminal Server S-1-5-13 (Running on Terminal Server) //
- // Remote Logon S-1-5-14 (Remote Interactive Logon) //
- // This Organization S-1-5-15 //
- // //
- // Local System S-1-5-18 //
- // Local Service S-1-5-19 //
- // Network Service S-1-5-20 //
- // //
- // (NT non-unique IDs) S-1-5-0x15-... (NT Domain Sids) //
- // //
- // (Built-in domain) S-1-5-0x20 //
- // //
- // (Security Package IDs) S-1-5-0x40 //
- // NTLM Authentication S-1-5-0x40-10 //
- // SChannel Authentication S-1-5-0x40-14 //
- // Digest Authentication S-1-5-0x40-21 //
- // //
- // Other Organization S-1-5-1000 (>=1000 can not be filtered) //
- // //
- // //
- // NOTE: the relative identifier values (RIDs) determine which security //
- // boundaries the SID is allowed to cross. Before adding new RIDs, //
- // a determination needs to be made regarding which range they should //
- // be added to in order to ensure proper "SID filtering" //
- // //
- /////////////////////////////////////////////////////////////////////////////
- const
- SECURITY_NT_AUTHORITY: TSidIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5));
- {$EXTERNALSYM SECURITY_NT_AUTHORITY}
- SECURITY_DIALUP_RID = ($00000001);
- {$EXTERNALSYM SECURITY_DIALUP_RID}
- SECURITY_NETWORK_RID = ($00000002);
- {$EXTERNALSYM SECURITY_NETWORK_RID}
- SECURITY_BATCH_RID = ($00000003);
- {$EXTERNALSYM SECURITY_BATCH_RID}
- SECURITY_INTERACTIVE_RID = ($00000004);
- {$EXTERNALSYM SECURITY_INTERACTIVE_RID}
- SECURITY_LOGON_IDS_RID = ($00000005);
- {$EXTERNALSYM SECURITY_LOGON_IDS_RID}
- SECURITY_LOGON_IDS_RID_COUNT = (3);
- {$EXTERNALSYM SECURITY_LOGON_IDS_RID_COUNT}
- SECURITY_SERVICE_RID = ($00000006);
- {$EXTERNALSYM SECURITY_SERVICE_RID}
- SECURITY_ANONYMOUS_LOGON_RID = ($00000007);
- {$EXTERNALSYM SECURITY_ANONYMOUS_LOGON_RID}
- SECURITY_PROXY_RID = ($00000008);
- {$EXTERNALSYM SECURITY_PROXY_RID}
- SECURITY_ENTERPRISE_CONTROLLERS_RID = ($00000009);
- {$EXTERNALSYM SECURITY_ENTERPRISE_CONTROLLERS_RID}
- SECURITY_SERVER_LOGON_RID = SECURITY_ENTERPRISE_CONTROLLERS_RID;
- {$EXTERNALSYM SECURITY_SERVER_LOGON_RID}
- SECURITY_PRINCIPAL_SELF_RID = ($0000000A);
- {$EXTERNALSYM SECURITY_PRINCIPAL_SELF_RID}
- SECURITY_AUTHENTICATED_USER_RID = ($0000000B);
- {$EXTERNALSYM SECURITY_AUTHENTICATED_USER_RID}
- SECURITY_RESTRICTED_CODE_RID = ($0000000C);
- {$EXTERNALSYM SECURITY_RESTRICTED_CODE_RID}
- SECURITY_TERMINAL_SERVER_RID = ($0000000D);
- {$EXTERNALSYM SECURITY_TERMINAL_SERVER_RID}
- SECURITY_REMOTE_LOGON_RID = ($0000000E);
- {$EXTERNALSYM SECURITY_REMOTE_LOGON_RID}
- SECURITY_THIS_ORGANIZATION_RID = ($0000000F);
- {$EXTERNALSYM SECURITY_THIS_ORGANIZATION_RID}
- SECURITY_LOCAL_SYSTEM_RID = ($00000012);
- {$EXTERNALSYM SECURITY_LOCAL_SYSTEM_RID}
- SECURITY_LOCAL_SERVICE_RID = ($00000013);
- {$EXTERNALSYM SECURITY_LOCAL_SERVICE_RID}
- SECURITY_NETWORK_SERVICE_RID = ($00000014);
- {$EXTERNALSYM SECURITY_NETWORK_SERVICE_RID}
- SECURITY_NT_NON_UNIQUE = ($00000015);
- {$EXTERNALSYM SECURITY_NT_NON_UNIQUE}
- SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT = (3);
- {$EXTERNALSYM SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT}
- SECURITY_BUILTIN_DOMAIN_RID = ($00000020);
- {$EXTERNALSYM SECURITY_BUILTIN_DOMAIN_RID}
- SECURITY_PACKAGE_BASE_RID = ($00000040);
- {$EXTERNALSYM SECURITY_PACKAGE_BASE_RID}
- SECURITY_PACKAGE_RID_COUNT = (2);
- {$EXTERNALSYM SECURITY_PACKAGE_RID_COUNT}
- SECURITY_PACKAGE_NTLM_RID = ($0000000A);
- {$EXTERNALSYM SECURITY_PACKAGE_NTLM_RID}
- SECURITY_PACKAGE_SCHANNEL_RID = ($0000000E);
- {$EXTERNALSYM SECURITY_PACKAGE_SCHANNEL_RID}
- SECURITY_PACKAGE_DIGEST_RID = ($00000015);
- {$EXTERNALSYM SECURITY_PACKAGE_DIGEST_RID}
- SECURITY_MAX_ALWAYS_FILTERED = ($000003E7);
- {$EXTERNALSYM SECURITY_MAX_ALWAYS_FILTERED}
- SECURITY_MIN_NEVER_FILTERED = ($000003E8);
- {$EXTERNALSYM SECURITY_MIN_NEVER_FILTERED}
- SECURITY_OTHER_ORGANIZATION_RID = ($000003E8);
- {$EXTERNALSYM SECURITY_OTHER_ORGANIZATION_RID}
- /////////////////////////////////////////////////////////////////////////////
- // //
- // well-known domain relative sub-authority values (RIDs)... //
- // //
- /////////////////////////////////////////////////////////////////////////////
- // Well-known users ...
- FOREST_USER_RID_MAX = ($000001F3);
- {$EXTERNALSYM FOREST_USER_RID_MAX}
- DOMAIN_USER_RID_ADMIN = ($000001F4);
- {$EXTERNALSYM DOMAIN_USER_RID_ADMIN}
- DOMAIN_USER_RID_GUEST = ($000001F5);
- {$EXTERNALSYM DOMAIN_USER_RID_GUEST}
- DOMAIN_USER_RID_KRBTGT = ($000001F6);
- {$EXTERNALSYM DOMAIN_USER_RID_KRBTGT}
- DOMAIN_USER_RID_MAX = ($000003E7);
- {$EXTERNALSYM DOMAIN_USER_RID_MAX}
- // well-known groups ...
- DOMAIN_GROUP_RID_ADMINS = ($00000200);
- {$EXTERNALSYM DOMAIN_GROUP_RID_ADMINS}
- DOMAIN_GROUP_RID_USERS = ($00000201);
- {$EXTERNALSYM DOMAIN_GROUP_RID_USERS}
- DOMAIN_GROUP_RID_GUESTS = ($00000202);
- {$EXTERNALSYM DOMAIN_GROUP_RID_GUESTS}
- DOMAIN_GROUP_RID_COMPUTERS = ($00000203);
- {$EXTERNALSYM DOMAIN_GROUP_RID_COMPUTERS}
- DOMAIN_GROUP_RID_CONTROLLERS = ($00000204);
- {$EXTERNALSYM DOMAIN_GROUP_RID_CONTROLLERS}
- DOMAIN_GROUP_RID_CERT_ADMINS = ($00000205);
- {$EXTERNALSYM DOMAIN_GROUP_RID_CERT_ADMINS}
- DOMAIN_GROUP_RID_SCHEMA_ADMINS = ($00000206);
- {$EXTERNALSYM DOMAIN_GROUP_RID_SCHEMA_ADMINS}
- DOMAIN_GROUP_RID_ENTERPRISE_ADMINS = ($00000207);
- {$EXTERNALSYM DOMAIN_GROUP_RID_ENTERPRISE_ADMINS}
- DOMAIN_GROUP_RID_POLICY_ADMINS = ($00000208);
- {$EXTERNALSYM DOMAIN_GROUP_RID_POLICY_ADMINS}
- // well-known aliases ...
- DOMAIN_ALIAS_RID_ADMINS = ($00000220);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_ADMINS}
- DOMAIN_ALIAS_RID_USERS = ($00000221);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_USERS}
- DOMAIN_ALIAS_RID_GUESTS = ($00000222);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_GUESTS}
- DOMAIN_ALIAS_RID_POWER_USERS = ($00000223);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_POWER_USERS}
- DOMAIN_ALIAS_RID_ACCOUNT_OPS = ($00000224);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_ACCOUNT_OPS}
- DOMAIN_ALIAS_RID_SYSTEM_OPS = ($00000225);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_SYSTEM_OPS}
- DOMAIN_ALIAS_RID_PRINT_OPS = ($00000226);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_PRINT_OPS}
- DOMAIN_ALIAS_RID_BACKUP_OPS = ($00000227);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_BACKUP_OPS}
- DOMAIN_ALIAS_RID_REPLICATOR = ($00000228);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_REPLICATOR}
- DOMAIN_ALIAS_RID_RAS_SERVERS = ($00000229);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_RAS_SERVERS}
- DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = ($0000022A);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_PREW2KCOMPACCESS}
- DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = ($0000022B);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS}
- DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = ($0000022C);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS}
- DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = ($0000022D);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS}
- DOMAIN_ALIAS_RID_MONITORING_USERS = ($0000022E);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_MONITORING_USERS}
- DOMAIN_ALIAS_RID_LOGGING_USERS = ($0000022F);
- {$EXTERNALSYM DOMAIN_ALIAS_RID_LOGGING_USERS}
- type
- WELL_KNOWN_SID_TYPE = (
- WinNullSid,
- WinWorldSid,
- WinLocalSid,
- WinCreatorOwnerSid,
- WinCreatorGroupSid,
- WinCreatorOwnerServerSid,
- WinCreatorGroupServerSid,
- WinNtAuthoritySid,
- WinDialupSid,
- WinNetworkSid,
- WinBatchSid,
- WinInteractiveSid,
- WinServiceSid,
- WinAnonymousSid,
- WinProxySid,
- WinEnterpriseControllersSid,
- WinSelfSid,
- WinAuthenticatedUserSid,
- WinRestrictedCodeSid,
- WinTerminalServerSid,
- WinRemoteLogonIdSid,
- WinLogonIdsSid,
- WinLocalSystemSid,
- WinLocalServiceSid,
- WinNetworkServiceSid,
- WinBuiltinDomainSid,
- WinBuiltinAdministratorsSid,
- WinBuiltinUsersSid,
- WinBuiltinGuestsSid,
- WinBuiltinPowerUsersSid,
- WinBuiltinAccountOperatorsSid,
- WinBuiltinSystemOperatorsSid,
- WinBuiltinPrintOperatorsSid,
- WinBuiltinBackupOperatorsSid,
- WinBuiltinReplicatorSid,
- WinBuiltinPreWindows2000CompatibleAccessSid,
- WinBuiltinRemoteDesktopUsersSid,
- WinBuiltinNetworkConfigurationOperatorsSid,
- WinAccountAdministratorSid,
- WinAccountGuestSid,
- WinAccountKrbtgtSid,
- WinAccountDomainAdminsSid,
- WinAccountDomainUsersSid,
- WinAccountDomainGuestsSid,
- WinAccountComputersSid,
- WinAccountControllersSid,
- WinAccountCertAdminsSid,
- WinAccountSchemaAdminsSid,
- WinAccountEnterpriseAdminsSid,
- WinAccountPolicyAdminsSid,
- WinAccountRasAndIasServersSid,
- WinNTLMAuthenticationSid,
- WinDigestAuthenticationSid,
- WinSChannelAuthenticationSid,
- WinThisOrganizationSid,
- WinOtherOrganizationSid,
- WinBuiltinIncomingForestTrustBuildersSid,
- WinBuiltinPerfMonitoringUsersSid,
- WinBuiltinPerfLoggingUsersSid);
- {$EXTERNALSYM WELL_KNOWN_SID_TYPE}
- TWellKnownSidType = WELL_KNOWN_SID_TYPE;
- //
- // Allocate the System Luid. The first 1000 LUIDs are reserved.
- // Use #999 here (0x3E7 = 999)
- //
- const
- SYSTEM_LUID: LUID = (LowPart: $3E7; HighPart: $0);
- {$EXTERNALSYM SYSTEM_LUID}
- ANONYMOUS_LOGON_LUID: LUID = (LowPart: $3E6; HighPart: $0);
- {$EXTERNALSYM ANONYMOUS_LOGON_LUID}
- LOCALSERVICE_LUID: LUID = (LowPart: $3E5; HighPart: $0);
- {$EXTERNALSYM LOCALSERVICE_LUID}
- NETWORKSERVICE_LUID: LUID = (LowPart: $3E4; HighPart: $0);
- {$EXTERNALSYM NETWORKSERVICE_LUID}
- ////////////////////////////////////////////////////////////////////////
- // //
- // User and Group related SID attributes //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- // Group attributes
- //
- SE_GROUP_MANDATORY = ($00000001);
- {$EXTERNALSYM SE_GROUP_MANDATORY}
- SE_GROUP_ENABLED_BY_DEFAULT = ($00000002);
- {$EXTERNALSYM SE_GROUP_ENABLED_BY_DEFAULT}
- SE_GROUP_ENABLED = ($00000004);
- {$EXTERNALSYM SE_GROUP_ENABLED}
- SE_GROUP_OWNER = ($00000008);
- {$EXTERNALSYM SE_GROUP_OWNER}
- SE_GROUP_USE_FOR_DENY_ONLY = ($00000010);
- {$EXTERNALSYM SE_GROUP_USE_FOR_DENY_ONLY}
- SE_GROUP_LOGON_ID = ($C0000000);
- {$EXTERNALSYM SE_GROUP_LOGON_ID}
- SE_GROUP_RESOURCE = ($20000000);
- {$EXTERNALSYM SE_GROUP_RESOURCE}
- //
- // User attributes
- //
- // (None yet defined.)
- ////////////////////////////////////////////////////////////////////////
- // //
- // 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:
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +-------------------------------+---------------+---------------+
- // | AclSize | Sbz1 | AclRevision |
- // +-------------------------------+---------------+---------------+
- // | Sbz2 | AceCount |
- // +-------------------------------+-------------------------------+
- //
- // 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.
- //
- // This is the *current* ACL revision
- ACL_REVISION = (2);
- {$EXTERNALSYM ACL_REVISION}
- ACL_REVISION_DS = (4);
- {$EXTERNALSYM ACL_REVISION_DS}
- // This is the history of ACL revisions. Add a new one whenever
- // ACL_REVISION is updated
- ACL_REVISION1 = (1);
- {$EXTERNALSYM ACL_REVISION1}
- ACL_REVISION2 = (2);
- {$EXTERNALSYM ACL_REVISION2}
- MIN_ACL_REVISION = ACL_REVISION2;
- {$EXTERNALSYM MIN_ACL_REVISION}
- ACL_REVISION3 = (3);
- {$EXTERNALSYM ACL_REVISION3}
- ACL_REVISION4 = (4);
- {$EXTERNALSYM ACL_REVISION4}
- MAX_ACL_REVISION = ACL_REVISION4;
- {$EXTERNALSYM MAX_ACL_REVISION}
- type
- PACL = ^ACL;
- {$EXTERNALSYM PACL}
- _ACL = record
- AclRevision: Byte;
- Sbz1: Byte;
- AclSize: Word;
- AceCount: Word;
- Sbz2: Word;
- end;
- {$EXTERNALSYM _ACL}
- ACL = _ACL;
- {$EXTERNALSYM ACL}
- TAcl = ACL;
- PPACL = ^PAcl;
- {$NODEFINE PPACL}
- //
- // 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:
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +---------------+-------+-------+---------------+---------------+
- // | AceSize | AceFlags | AceType |
- // +---------------+-------+-------+---------------+---------------+
- //
- // 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 shortly.
- type
- PACE_HEADER = ^ACE_HEADER;
- {$EXTERNALSYM PACE_HEADER}
- _ACE_HEADER = record
- AceType: Byte;
- AceFlags: Byte;
- AceSize: Word;
- end;
- {$EXTERNALSYM _ACE_HEADER}
- ACE_HEADER = _ACE_HEADER;
- {$EXTERNALSYM ACE_HEADER}
- TAceHeader = ACE_HEADER;
- PAceHeader = PACE_HEADER;
- //
- // The following are the predefined ace types that go into the AceType
- // field of an Ace header.
- //
- const
- ACCESS_MIN_MS_ACE_TYPE = ($0);
- {$EXTERNALSYM ACCESS_MIN_MS_ACE_TYPE}
- ACCESS_ALLOWED_ACE_TYPE = ($0);
- {$EXTERNALSYM ACCESS_ALLOWED_ACE_TYPE}
- ACCESS_DENIED_ACE_TYPE = ($1);
- {$EXTERNALSYM ACCESS_DENIED_ACE_TYPE}
- SYSTEM_AUDIT_ACE_TYPE = ($2);
- {$EXTERNALSYM SYSTEM_AUDIT_ACE_TYPE}
- SYSTEM_ALARM_ACE_TYPE = ($3);
- {$EXTERNALSYM SYSTEM_ALARM_ACE_TYPE}
- ACCESS_MAX_MS_V2_ACE_TYPE = ($3);
- {$EXTERNALSYM ACCESS_MAX_MS_V2_ACE_TYPE}
- ACCESS_ALLOWED_COMPOUND_ACE_TYPE = ($4);
- {$EXTERNALSYM ACCESS_ALLOWED_COMPOUND_ACE_TYPE}
- ACCESS_MAX_MS_V3_ACE_TYPE = ($4);
- {$EXTERNALSYM ACCESS_MAX_MS_V3_ACE_TYPE}
- ACCESS_MIN_MS_OBJECT_ACE_TYPE = ($5);
- {$EXTERNALSYM ACCESS_MIN_MS_OBJECT_ACE_TYPE}
- ACCESS_ALLOWED_OBJECT_ACE_TYPE = ($5);
- {$EXTERNALSYM ACCESS_ALLOWED_OBJECT_ACE_TYPE}
- ACCESS_DENIED_OBJECT_ACE_TYPE = ($6);
- {$EXTERNALSYM ACCESS_DENIED_OBJECT_ACE_TYPE}
- SYSTEM_AUDIT_OBJECT_ACE_TYPE = ($7);
- {$EXTERNALSYM SYSTEM_AUDIT_OBJECT_ACE_TYPE}
- SYSTEM_ALARM_OBJECT_ACE_TYPE = ($8);
- {$EXTERNALSYM SYSTEM_ALARM_OBJECT_ACE_TYPE}
- ACCESS_MAX_MS_OBJECT_ACE_TYPE = ($8);
- {$EXTERNALSYM ACCESS_MAX_MS_OBJECT_ACE_TYPE}
- ACCESS_MAX_MS_V4_ACE_TYPE = ($8);
- {$EXTERNALSYM ACCESS_MAX_MS_V4_ACE_TYPE}
- ACCESS_MAX_MS_ACE_TYPE = ($8);
- {$EXTERNALSYM ACCESS_MAX_MS_ACE_TYPE}
- ACCESS_ALLOWED_CALLBACK_ACE_TYPE = $9;
- {$EXTERNALSYM ACCESS_ALLOWED_CALLBACK_ACE_TYPE}
- ACCESS_DENIED_CALLBACK_ACE_TYPE = $A;
- {$EXTERNALSYM ACCESS_DENIED_CALLBACK_ACE_TYPE}
- ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE = $B;
- {$EXTERNALSYM ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE}
- ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE = $C;
- {$EXTERNALSYM ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE}
- SYSTEM_AUDIT_CALLBACK_ACE_TYPE = $D;
- {$EXTERNALSYM SYSTEM_AUDIT_CALLBACK_ACE_TYPE}
- SYSTEM_ALARM_CALLBACK_ACE_TYPE = $E;
- {$EXTERNALSYM SYSTEM_ALARM_CALLBACK_ACE_TYPE}
- SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE = $F;
- {$EXTERNALSYM SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE}
- SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE = $10;
- {$EXTERNALSYM SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE}
- ACCESS_MAX_MS_V5_ACE_TYPE = $10;
- {$EXTERNALSYM ACCESS_MAX_MS_V5_ACE_TYPE}
- //
- // The following are the inherit flags that go into the AceFlags field
- // of an Ace header.
- //
- OBJECT_INHERIT_ACE = ($1);
- {$EXTERNALSYM OBJECT_INHERIT_ACE}
- CONTAINER_INHERIT_ACE = ($2);
- {$EXTERNALSYM CONTAINER_INHERIT_ACE}
- NO_PROPAGATE_INHERIT_ACE = ($4);
- {$EXTERNALSYM NO_PROPAGATE_INHERIT_ACE}
- INHERIT_ONLY_ACE = ($8);
- {$EXTERNALSYM INHERIT_ONLY_ACE}
- INHERITED_ACE = ($10);
- {$EXTERNALSYM INHERITED_ACE}
- VALID_INHERIT_FLAGS = ($1F);
- {$EXTERNALSYM VALID_INHERIT_FLAGS}
- // 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.
- //
- SUCCESSFUL_ACCESS_ACE_FLAG = ($40);
- {$EXTERNALSYM SUCCESSFUL_ACCESS_ACE_FLAG}
- FAILED_ACCESS_ACE_FLAG = ($80);
- {$EXTERNALSYM FAILED_ACCESS_ACE_FLAG}
- //
- // We'll define the structure of the predefined ACE types. Pictorally
- // the structure of the predefined ACE's is as follows:
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +---------------+-------+-------+---------------+---------------+
- // | AceFlags | Resd |Inherit| AceSize | AceType |
- // +---------------+-------+-------+---------------+---------------+
- // | Mask |
- // +---------------------------------------------------------------+
- // | |
- // + +
- // | |
- // + Sid +
- // | |
- // + +
- // | |
- // +---------------------------------------------------------------+
- //
- // 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.
- type
- PACCESS_ALLOWED_ACE = ^ACCESS_ALLOWED_ACE;
- {$EXTERNALSYM PACCESS_ALLOWED_ACE}
- _ACCESS_ALLOWED_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _ACCESS_ALLOWED_ACE}
- ACCESS_ALLOWED_ACE = _ACCESS_ALLOWED_ACE;
- {$EXTERNALSYM ACCESS_ALLOWED_ACE}
- TAccessAllowedAce = ACCESS_ALLOWED_ACE;
- PAccessAllowedAce = PACCESS_ALLOWED_ACE;
- PACCESS_DENIED_ACE = ^ACCESS_DENIED_ACE;
- {$EXTERNALSYM PACCESS_DENIED_ACE}
- _ACCESS_DENIED_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _ACCESS_DENIED_ACE}
- ACCESS_DENIED_ACE = _ACCESS_DENIED_ACE;
- {$EXTERNALSYM ACCESS_DENIED_ACE}
- TAccessDeniedAce = ACCESS_DENIED_ACE;
- PAccessDeniedAce = PACCESS_DENIED_ACE;
- PSYSTEM_AUDIT_ACE = ^SYSTEM_AUDIT_ACE;
- {$EXTERNALSYM PSYSTEM_AUDIT_ACE}
- _SYSTEM_AUDIT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _SYSTEM_AUDIT_ACE}
- SYSTEM_AUDIT_ACE = _SYSTEM_AUDIT_ACE;
- {$EXTERNALSYM SYSTEM_AUDIT_ACE}
- TSystemAuditAce = SYSTEM_AUDIT_ACE;
- PSystemAuditAce = PSYSTEM_AUDIT_ACE;
- PSYSTEM_ALARM_ACE = ^SYSTEM_ALARM_ACE;
- {$EXTERNALSYM PSYSTEM_ALARM_ACE}
- _SYSTEM_ALARM_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _SYSTEM_ALARM_ACE}
- SYSTEM_ALARM_ACE = _SYSTEM_ALARM_ACE;
- {$EXTERNALSYM SYSTEM_ALARM_ACE}
- TSystemAlarmAce = SYSTEM_ALARM_ACE;
- PSystemAlarmAce = PSYSTEM_ALARM_ACE;
- PACCESS_ALLOWED_OBJECT_ACE = ^ACCESS_ALLOWED_OBJECT_ACE;
- {$EXTERNALSYM PACCESS_ALLOWED_OBJECT_ACE}
- _ACCESS_ALLOWED_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _ACCESS_ALLOWED_OBJECT_ACE}
- ACCESS_ALLOWED_OBJECT_ACE = _ACCESS_ALLOWED_OBJECT_ACE;
- {$EXTERNALSYM ACCESS_ALLOWED_OBJECT_ACE}
- TAccessAllowedObjectAce = ACCESS_ALLOWED_OBJECT_ACE;
- PAccessAllowedObjectAce = PACCESS_ALLOWED_OBJECT_ACE;
- PACCESS_DENIED_OBJECT_ACE = ^ACCESS_DENIED_OBJECT_ACE;
- {$EXTERNALSYM PACCESS_DENIED_OBJECT_ACE}
- _ACCESS_DENIED_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _ACCESS_DENIED_OBJECT_ACE}
- ACCESS_DENIED_OBJECT_ACE = _ACCESS_DENIED_OBJECT_ACE;
- {$EXTERNALSYM ACCESS_DENIED_OBJECT_ACE}
- TAccessDeniedObjectAce = ACCESS_DENIED_OBJECT_ACE;
- PAccessDeniedObjectAce = PACCESS_DENIED_OBJECT_ACE;
- PSYSTEM_AUDIT_OBJECT_ACE = ^SYSTEM_AUDIT_OBJECT_ACE;
- {$EXTERNALSYM PSYSTEM_AUDIT_OBJECT_ACE}
- _SYSTEM_AUDIT_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _SYSTEM_AUDIT_OBJECT_ACE}
- SYSTEM_AUDIT_OBJECT_ACE = _SYSTEM_AUDIT_OBJECT_ACE;
- {$EXTERNALSYM SYSTEM_AUDIT_OBJECT_ACE}
- TSystemAuditObjectAce = SYSTEM_AUDIT_OBJECT_ACE;
- PSystemAuditObjectAce = PSYSTEM_AUDIT_OBJECT_ACE;
- PSYSTEM_ALARM_OBJECT_ACE = ^SYSTEM_ALARM_OBJECT_ACE;
- {$EXTERNALSYM PSYSTEM_ALARM_OBJECT_ACE}
- _SYSTEM_ALARM_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- end;
- {$EXTERNALSYM _SYSTEM_ALARM_OBJECT_ACE}
- SYSTEM_ALARM_OBJECT_ACE = _SYSTEM_ALARM_OBJECT_ACE;
- {$EXTERNALSYM SYSTEM_ALARM_OBJECT_ACE}
- TSystemAlarmObjectAce = SYSTEM_ALARM_OBJECT_ACE;
- PSystemAlarmObjectAce = PSYSTEM_ALARM_OBJECT_ACE;
- //
- // Callback ace support in post Win2000.
- // Resource managers can put their own data after Sidstart + Length of the sid
- //
- _ACCESS_ALLOWED_CALLBACK_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _ACCESS_ALLOWED_CALLBACK_ACE}
- ACCESS_ALLOWED_CALLBACK_ACE = _ACCESS_ALLOWED_CALLBACK_ACE;
- {$EXTERNALSYM ACCESS_ALLOWED_CALLBACK_ACE}
- PACCESS_ALLOWED_CALLBACK_ACE = ^ACCESS_ALLOWED_CALLBACK_ACE;
- {$EXTERNALSYM PACCESS_ALLOWED_CALLBACK_ACE}
- TAccessAllowedCallBackAce = ACCESS_ALLOWED_CALLBACK_ACE;
- PAccessAllowedCallBackAce = PACCESS_ALLOWED_CALLBACK_ACE;
- _ACCESS_DENIED_CALLBACK_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _ACCESS_DENIED_CALLBACK_ACE}
- ACCESS_DENIED_CALLBACK_ACE = _ACCESS_DENIED_CALLBACK_ACE;
- {$EXTERNALSYM ACCESS_DENIED_CALLBACK_ACE}
- PACCESS_DENIED_CALLBACK_ACE = ^ACCESS_DENIED_CALLBACK_ACE;
- {$EXTERNALSYM PACCESS_DENIED_CALLBACK_ACE}
- TAccessDeniedCallBackAce = ACCESS_DENIED_CALLBACK_ACE;
- PAccessDeniedCallBackAce = PACCESS_DENIED_CALLBACK_ACE;
- _SYSTEM_AUDIT_CALLBACK_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _SYSTEM_AUDIT_CALLBACK_ACE}
- SYSTEM_AUDIT_CALLBACK_ACE = _SYSTEM_AUDIT_CALLBACK_ACE;
- {$EXTERNALSYM SYSTEM_AUDIT_CALLBACK_ACE}
- PSYSTEM_AUDIT_CALLBACK_ACE = ^SYSTEM_AUDIT_CALLBACK_ACE;
- {$EXTERNALSYM PSYSTEM_AUDIT_CALLBACK_ACE}
- TSystemAuditCallBackAce = SYSTEM_AUDIT_CALLBACK_ACE;
- PSystemAuditCallBackAce = PSYSTEM_AUDIT_CALLBACK_ACE;
- _SYSTEM_ALARM_CALLBACK_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _SYSTEM_ALARM_CALLBACK_ACE}
- SYSTEM_ALARM_CALLBACK_ACE = _SYSTEM_ALARM_CALLBACK_ACE;
- {$EXTERNALSYM SYSTEM_ALARM_CALLBACK_ACE}
- PSYSTEM_ALARM_CALLBACK_ACE = ^SYSTEM_ALARM_CALLBACK_ACE;
- {$EXTERNALSYM PSYSTEM_ALARM_CALLBACK_ACE}
- TSystemAlarmCallBackAce = SYSTEM_ALARM_CALLBACK_ACE;
- PSystemAlarmCallBackAce = PSYSTEM_ALARM_CALLBACK_ACE;
- _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE}
- ACCESS_ALLOWED_CALLBACK_OBJECT_ACE = _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM ACCESS_ALLOWED_CALLBACK_OBJECT_ACE}
- PACCESS_ALLOWED_CALLBACK_OBJECT_ACE = ^ACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM PACCESS_ALLOWED_CALLBACK_OBJECT_ACE}
- TAccessAllowedCallBackObjectAce = ACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
- PAccessAllowedCallBackObjectAce = PACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
- _ACCESS_DENIED_CALLBACK_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _ACCESS_DENIED_CALLBACK_OBJECT_ACE}
- ACCESS_DENIED_CALLBACK_OBJECT_ACE = _ACCESS_DENIED_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM ACCESS_DENIED_CALLBACK_OBJECT_ACE}
- PACCESS_DENIED_CALLBACK_OBJECT_ACE = ^ACCESS_DENIED_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM PACCESS_DENIED_CALLBACK_OBJECT_ACE}
- TAccessDeniedCallBackObjectAce = ACCESS_DENIED_CALLBACK_OBJECT_ACE;
- PAccessDeniedCallBackObjectAce = PACCESS_DENIED_CALLBACK_OBJECT_ACE;
- _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE}
- SYSTEM_AUDIT_CALLBACK_OBJECT_ACE = _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM SYSTEM_AUDIT_CALLBACK_OBJECT_ACE}
- PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE = ^SYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE}
- TSystemAuditCallBackObjectAce = SYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
- PSystemAuditCallBackObjectAce = PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
- _SYSTEM_ALARM_CALLBACK_OBJECT_ACE = record
- Header: ACE_HEADER;
- Mask: ACCESS_MASK;
- Flags: DWORD;
- ObjectType: GUID;
- InheritedObjectType: GUID;
- SidStart: DWORD;
- // Opaque resouce manager specific data
- end;
- {$EXTERNALSYM _SYSTEM_ALARM_CALLBACK_OBJECT_ACE}
- SYSTEM_ALARM_CALLBACK_OBJECT_ACE = _SYSTEM_ALARM_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM SYSTEM_ALARM_CALLBACK_OBJECT_ACE}
- PSYSTEM_ALARM_CALLBACK_OBJECT_ACE = ^SYSTEM_ALARM_CALLBACK_OBJECT_ACE;
- {$EXTERNALSYM PSYSTEM_ALARM_CALLBACK_OBJECT_ACE}
- TSystemAlarmCallBackObjectAce = SYSTEM_ALARM_CALLBACK_OBJECT_ACE;
- PSystemAlarmCallBackObjectAce = PSYSTEM_ALARM_CALLBACK_OBJECT_ACE;
- //
- // Currently define Flags for "OBJECT" ACE types.
- //
- const
- ACE_OBJECT_TYPE_PRESENT = $1;
- {$EXTERNALSYM ACE_OBJECT_TYPE_PRESENT}
- ACE_INHERITED_OBJECT_TYPE_PRESENT = $2;
- {$EXTERNALSYM ACE_INHERITED_OBJECT_TYPE_PRESENT}
- //
- // The following declarations are used for setting and querying information
- // about and ACL. First are the various information classes available to
- // the user.
- //
- AclRevisionInformation = 1;
- {$EXTERNALSYM AclRevisionInformation}
- AclSizeInformation = 2;
- {$EXTERNALSYM AclSizeInformation}
- type
- _ACL_INFORMATION_CLASS = DWORD;
- {$EXTERNALSYM _ACL_INFORMATION_CLASS}
- ACL_INFORMATION_CLASS = _ACL_INFORMATION_CLASS;
- {$EXTERNALSYM ACL_INFORMATION_CLASS}
- TAclInformationClass = ACL_INFORMATION_CLASS;
- //
- // This record is returned/sent if the user is requesting/setting the
- // AclRevisionInformation
- //
- PACL_REVISION_INFORMATION = ^ACL_REVISION_INFORMATION;
- {$EXTERNALSYM PACL_REVISION_INFORMATION}
- _ACL_REVISION_INFORMATION = record
- AclRevision: DWORD;
- end;
- {$EXTERNALSYM _ACL_REVISION_INFORMATION}
- ACL_REVISION_INFORMATION = _ACL_REVISION_INFORMATION;
- {$EXTERNALSYM ACL_REVISION_INFORMATION}
- TAclRevisionInformation = ACL_REVISION_INFORMATION;
- PAclRevisionInformation = PACL_REVISION_INFORMATION;
- //
- // This record is returned if the user is requesting AclSizeInformation
- //
- PACL_SIZE_INFORMATION = ^ACL_SIZE_INFORMATION;
- {$EXTERNALSYM PACL_SIZE_INFORMATION}
- _ACL_SIZE_INFORMATION = record
- AceCount: DWORD;
- AclBytesInUse: DWORD;
- AclBytesFree: DWORD;
- end;
- {$EXTERNALSYM _ACL_SIZE_INFORMATION}
- ACL_SIZE_INFORMATION = _ACL_SIZE_INFORMATION;
- {$EXTERNALSYM ACL_SIZE_INFORMATION}
- TAclSizeInformation = ACL_SIZE_INFORMATION;
- PAclSizeInformation = PACL_SIZE_INFORMATION;
- ////////////////////////////////////////////////////////////////////////
- // //
- // SECURITY_DESCRIPTOR //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- // Define the Security Descriptor and related data types.
- // This is an opaque data structure.
- //
- //
- // Current security descriptor revision value
- //
- const
- SECURITY_DESCRIPTOR_REVISION = (1);
- {$EXTERNALSYM SECURITY_DESCRIPTOR_REVISION}
- SECURITY_DESCRIPTOR_REVISION1 = (1);
- {$EXTERNALSYM SECURITY_DESCRIPTOR_REVISION1}
- type
- SECURITY_DESCRIPTOR_CONTROL = WORD;
- {$EXTERNALSYM SECURITY_DESCRIPTOR_CONTROL}
- PSECURITY_DESCRIPTOR_CONTROL = ^SECURITY_DESCRIPTOR_CONTROL;
- {$EXTERNALSYM PSECURITY_DESCRIPTOR_CONTROL}
- TSecurityDescriptorControl = SECURITY_DESCRIPTOR_CONTROL;
- PSecurityDescriptorControl = PSECURITY_DESCRIPTOR_CONTROL;
- const
- SE_OWNER_DEFAULTED = ($0001);
- {$EXTERNALSYM SE_OWNER_DEFAULTED}
- SE_GROUP_DEFAULTED = ($0002);
- {$EXTERNALSYM SE_GROUP_DEFAULTED}
- SE_DACL_PRESENT = ($0004);
- {$EXTERNALSYM SE_DACL_PRESENT}
- SE_DACL_DEFAULTED = ($0008);
- {$EXTERNALSYM SE_DACL_DEFAULTED}
- SE_SACL_PRESENT = ($0010);
- {$EXTERNALSYM SE_SACL_PRESENT}
- SE_SACL_DEFAULTED = ($0020);
- {$EXTERNALSYM SE_SACL_DEFAULTED}
- SE_DACL_AUTO_INHERIT_REQ = ($0100);
- {$EXTERNALSYM SE_DACL_AUTO_INHERIT_REQ}
- SE_SACL_AUTO_INHERIT_REQ = ($0200);
- {$EXTERNALSYM SE_SACL_AUTO_INHERIT_REQ}
- SE_DACL_AUTO_INHERITED = ($0400);
- {$EXTERNALSYM SE_DACL_AUTO_INHERITED}
- SE_SACL_AUTO_INHERITED = ($0800);
- {$EXTERNALSYM SE_SACL_AUTO_INHERITED}
- SE_DACL_PROTECTED = ($1000);
- {$EXTERNALSYM SE_DACL_PROTECTED}
- SE_SACL_PROTECTED = ($2000);
- {$EXTERNALSYM SE_SACL_PROTECTED}
- SE_RM_CONTROL_VALID = ($4000);
- {$EXTERNALSYM SE_RM_CONTROL_VALID}
- SE_SELF_RELATIVE = ($8000);
- {$EXTERNALSYM SE_SELF_RELATIVE}
- //
- // Where:
- //
- // SE_OWNER_DEFAULTED - This boolean flag, when set, indicates that the
- // SID pointed to by the Owner field was provided by a
- // defaulting mechanism rather than explicitly provided by the
- // original provider of the security descriptor. This may
- // affect the treatment of the SID with respect to inheritence
- // of an owner.
- //
- // SE_GROUP_DEFAULTED - This boolean flag, when set, indicates that the
- // SID in the Group field was provided by a defaulting mechanism
- // rather than explicitly provided by the original provider of
- // the security descriptor. This may affect the treatment of
- // the SID with respect to inheritence of a primary group.
- //
- // SE_DACL_PRESENT - This boolean flag, when set, indicates that the
- // security descriptor contains a discretionary ACL. If this
- // flag is set and the Dacl field of the SECURITY_DESCRIPTOR is
- // null, then a null ACL is explicitly being specified.
- //
- // SE_DACL_DEFAULTED - This boolean flag, when set, indicates that the
- // ACL pointed to by the Dacl field was provided by a defaulting
- // mechanism rather than explicitly provided by the original
- // provider of the security descriptor. This may affect the
- // treatment of the ACL with respect to inheritence of an ACL.
- // This flag is ignored if the DaclPresent flag is not set.
- //
- // SE_SACL_PRESENT - This boolean flag, when set, indicates that the
- // security descriptor contains a system ACL pointed to by the
- // Sacl field. If this flag is set and the Sacl field of the
- // SECURITY_DESCRIPTOR is null, then an empty (but present)
- // ACL is being specified.
- //
- // SE_SACL_DEFAULTED - This boolean flag, when set, indicates that the
- // ACL pointed to by the Sacl field was provided by a defaulting
- // mechanism rather than explicitly provided by the original
- // provider of the security descriptor. This may affect the
- // treatment of the ACL with respect to inheritence of an ACL.
- // This flag is ignored if the SaclPresent flag is not set.
- //
- // SE_SELF_RELATIVE - This boolean flag, when set, indicates that the
- // security descriptor is in self-relative form. In this form,
- // all fields of the security descriptor are contiguous in memory
- // and all pointer fields are expressed as offsets from the
- // beginning of the security descriptor. This form is useful
- // for treating security descriptors as opaque data structures
- // for transmission in communication protocol or for storage on
- // secondary media.
- //
- //
- //
- // Pictorially the structure of a security descriptor is as follows:
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +---------------------------------------------------------------+
- // | Control |Reserved1 (SBZ)| Revision |
- // +---------------------------------------------------------------+
- // | Owner |
- // +---------------------------------------------------------------+
- // | Group |
- // +---------------------------------------------------------------+
- // | Sacl |
- // +---------------------------------------------------------------+
- // | Dacl |
- // +---------------------------------------------------------------+
- //
- // In general, this data structure should be treated opaquely to ensure future
- // compatibility.
- //
- //
- type
- PSECURITY_DESCRIPTOR_RELATIVE = ^SECURITY_DESCRIPTOR_RELATIVE;
- {$EXTERNALSYM PSECURITY_DESCRIPTOR_RELATIVE}
- _SECURITY_DESCRIPTOR_RELATIVE = record
- Revision: Byte;
- Sbz1: Byte;
- Control: SECURITY_DESCRIPTOR_CONTROL;
- Owner: DWORD;
- Group: DWORD;
- Sacl: DWORD;
- Dacl: DWORD;
- end;
- {$EXTERNALSYM _SECURITY_DESCRIPTOR_RELATIVE}
- SECURITY_DESCRIPTOR_RELATIVE = _SECURITY_DESCRIPTOR_RELATIVE;
- {$EXTERNALSYM SECURITY_DESCRIPTOR_RELATIVE}
- TSecurityDescriptorRelative = SECURITY_DESCRIPTOR_RELATIVE;
- PSecurityDescriptorRelative = PSECURITY_DESCRIPTOR_RELATIVE;
- PSECURITY_DESCRIPTOR = ^SECURITY_DESCRIPTOR;
- {$EXTERNALSYM PSECURITY_DESCRIPTOR}
- _SECURITY_DESCRIPTOR = record
- Revision: Byte;
- Sbz1: Byte;
- Control: SECURITY_DESCRIPTOR_CONTROL;
- Owner: PSID;
- Group: PSID;
- Sacl: PACL;
- Dacl: PACL;
- end;
- {$EXTERNALSYM _SECURITY_DESCRIPTOR}
- SECURITY_DESCRIPTOR = _SECURITY_DESCRIPTOR;
- {$EXTERNALSYM SECURITY_DESCRIPTOR}
- TSecurityDescriptor = SECURITY_DESCRIPTOR;
- PSecurityDescriptor = PSECURITY_DESCRIPTOR;
- PPSECURITY_DESCRIPTOR = ^PSECURITY_DESCRIPTOR;
- {$NODEFINE PPSECURITY_DESCRIPTOR}
- const
- SECURITY_DESCRIPTOR_MIN_LENGTH = SizeOf(SECURITY_DESCRIPTOR);
- {$EXTERNALSYM SECURITY_DESCRIPTOR_MIN_LENGTH}
- // Where:
- //
- // Revision - Contains the revision level of the security
- // descriptor. This allows this structure to be passed between
- // systems or stored on disk even though it is expected to
- // change in the future.
- //
- // Control - A set of flags which qualify the meaning of the
- // security descriptor or individual fields of the security
- // descriptor.
- //
- // Owner - is a pointer to an SID representing an object's owner.
- // If this field is null, then no owner SID is present in the
- // security descriptor. If the security descriptor is in
- // self-relative form, then this field contains an offset to
- // the SID, rather than a pointer.
- //
- // Group - is a pointer to an SID representing an object's primary
- // group. If this field is null, then no primary group SID is
- // present in the security descriptor. If the security descriptor
- // is in self-relative form, then this field contains an offset to
- // the SID, rather than a pointer.
- //
- // Sacl - is a pointer to a system ACL. This field value is only
- // valid if the DaclPresent control flag is set. If the
- // SaclPresent flag is set and this field is null, then a null
- // ACL is specified. If the security descriptor is in
- // self-relative form, then this field contains an offset to
- // the ACL, rather than a pointer.
- //
- // Dacl - is a pointer to a discretionary ACL. This field value is
- // only valid if the DaclPresent control flag is set. If the
- // DaclPresent flag is set and this field is null, then a null
- // ACL (unconditionally granting access) is specified. If the
- // security descriptor is in self-relative form, then this field
- // contains an offset to the ACL, rather than a pointer.
- //
- ////////////////////////////////////////////////////////////////////////
- // //
- // Object Type list for AccessCheckByType //
- // //
- ////////////////////////////////////////////////////////////////////////
- type
- POBJECT_TYPE_LIST = ^OBJECT_TYPE_LIST;
- {$EXTERNALSYM POBJECT_TYPE_LIST}
- _OBJECT_TYPE_LIST = record
- Level: Word;
- Sbz: Word;
- ObjectType: PGUID;
- end;
- {$EXTERNALSYM _OBJECT_TYPE_LIST}
- OBJECT_TYPE_LIST = _OBJECT_TYPE_LIST;
- {$EXTERNALSYM OBJECT_TYPE_LIST}
- TObjectTypeList = OBJECT_TYPE_LIST;
- PObjectTypeList = POBJECT_TYPE_LIST;
- //
- // DS values for Level
- //
- const
- ACCESS_OBJECT_GUID = 0;
- {$EXTERNALSYM ACCESS_OBJECT_GUID}
- ACCESS_PROPERTY_SET_GUID = 1;
- {$EXTERNALSYM ACCESS_PROPERTY_SET_GUID}
- ACCESS_PROPERTY_GUID = 2;
- {$EXTERNALSYM ACCESS_PROPERTY_GUID}
- ACCESS_MAX_LEVEL = 4;
- {$EXTERNALSYM ACCESS_MAX_LEVEL}
- //
- // Parameters to NtAccessCheckByTypeAndAditAlarm
- //
- type
- _AUDIT_EVENT_TYPE = (AuditEventObjectAccess, AuditEventDirectoryServiceAccess);
- {$EXTERNALSYM _AUDIT_EVENT_TYPE}
- AUDIT_EVENT_TYPE = _AUDIT_EVENT_TYPE;
- {$EXTERNALSYM AUDIT_EVENT_TYPE}
- PAUDIT_EVENT_TYPE = ^AUDIT_EVENT_TYPE;
- {$EXTERNALSYM PAUDIT_EVENT_TYPE}
- TAuditEventType = AUDIT_EVENT_TYPE;
- PAuditEventType = PAUDIT_EVENT_TYPE;
- const
- AUDIT_ALLOW_NO_PRIVILEGE = $1;
- {$EXTERNALSYM AUDIT_ALLOW_NO_PRIVILEGE}
- //
- // DS values for Source and ObjectTypeName
- //
- ACCESS_DS_SOURCE_A = 'DS';
- {$EXTERNALSYM ACCESS_DS_SOURCE_A}
- ACCESS_DS_SOURCE_W = WideString('DS');
- {$EXTERNALSYM ACCESS_DS_SOURCE_W}
- ACCESS_DS_OBJECT_TYPE_NAME_A = 'Directory Service Object';
- {$EXTERNALSYM ACCESS_DS_OBJECT_TYPE_NAME_A}
- ACCESS_DS_OBJECT_TYPE_NAME_W = WideString('Directory Service Object');
- {$EXTERNALSYM ACCESS_DS_OBJECT_TYPE_NAME_W}
- ////////////////////////////////////////////////////////////////////////
- // //
- // Privilege Related Data Structures //
- // //
- ////////////////////////////////////////////////////////////////////////
- //
- // Privilege attributes
- //
- const
- SE_PRIVILEGE_ENABLED_BY_DEFAULT = ($00000001);
- {$EXTERNALSYM SE_PRIVILEGE_ENABLED_BY_DEFAULT}
- SE_PRIVILEGE_ENABLED = ($00000002);
- {$EXTERNALSYM SE_PRIVILEGE_ENABLED}
- SE_PRIVILEGE_REMOVED = ($00000004);
- {$EXTERNALSYM SE_PRIVILEGE_REMOVED}
- SE_PRIVILEGE_USED_FOR_ACCESS = DWORD($80000000);
- {$EXTERNALSYM SE_PRIVILEGE_USED_FOR_ACCESS}
- //
- // Privilege Set Control flags
- //
- PRIVILEGE_SET_ALL_NECESSARY = (1);
- {$EXTERNALSYM PRIVILEGE_SET_ALL_NECESSARY}
- //
- // Privilege Set - This is defined for a privilege set of one.
- // If more than one privilege is needed, then this structure
- // will need to be allocated with more space.
- //
- // Note: don't change this structure without fixing the INITIAL_PRIVILEGE_SET
- // structure (defined in se.h)
- //
- type
- PPRIVILEGE_SET = ^PRIVILEGE_SET;
- {$EXTERNALSYM PPRIVILEGE_SET}
- _PRIVILEGE_SET = record
- PrivilegeCount: DWORD;
- Control: DWORD;
- Privilege: array [0..ANYSIZE_ARRAY - 1] of LUID_AND_ATTRIBUTES;
- //Privilege: LUID_AND_ATTRIBUTES;
- end;
- {$EXTERNALSYM _PRIVILEGE_SET}
- PRIVILEGE_SET = _PRIVILEGE_SET;
- {$EXTERNALSYM PRIVILEGE_SET}
- TPrivilegeSet = PRIVILEGE_SET;
- PPrivilegeSet = PPRIVILEGE_SET;
- ////////////////////////////////////////////////////////////////////////
- // //
- // NT Defined Privileges //
- // //
- ////////////////////////////////////////////////////////////////////////
- const
- SE_CREATE_TOKEN_NAME = 'SeCreateTokenPrivilege';
- {$EXTERNALSYM SE_CREATE_TOKEN_NAME}
- SE_ASSIGNPRIMARYTOKEN_NAME = 'SeAssignPrimaryTokenPrivilege';
- {$EXTERNALSYM SE_ASSIGNPRIMARYTOKEN_NAME}
- SE_LOCK_MEMORY_NAME = 'SeLockMemoryPrivilege';
- {$EXTERNALSYM SE_LOCK_MEMORY_NAME}
- SE_INCREASE_QUOTA_NAME = 'SeIncreaseQuotaPrivilege';
- {$EXTERNALSYM SE_INCREASE_QUOTA_NAME}
- SE_UNSOLICITED_INPUT_NAME = 'SeUnsolicitedInputPrivilege';
- {$EXTERNALSYM SE_UNSOLICITED_INPUT_NAME}
- SE_MACHINE_ACCOUNT_NAME = 'SeMachineAccountPrivilege';
- {$EXTERNALSYM SE_MACHINE_ACCOUNT_NAME}
- SE_TCB_NAME = 'SeTcbPrivilege';
- {$EXTERNALSYM SE_TCB_NAME}
- SE_SECURITY_NAME = 'SeSecurityPrivilege';
- {$EXTERNALSYM SE_SECURITY_NAME}
- SE_TAKE_OWNERSHIP_NAME = 'SeTakeOwnershipPrivilege';
- {$EXTERNALSYM SE_TAKE_OWNERSHIP_NAME}
- SE_LOAD_DRIVER_NAME = 'SeLoadDriverPrivilege';
- {$EXTERNALSYM SE_LOAD_DRIVER_NAME}
- SE_SYSTEM_PROFILE_NAME = 'SeSystemProfilePrivilege';
- {$EXTERNALSYM SE_SYSTEM_PROFILE_NAME}
- SE_SYSTEMTIME_NAME = 'SeSystemtimePrivilege';
- {$EXTERNALSYM SE_SYSTEMTIME_NAME}
- SE_PROF_SINGLE_PROCESS_NAME = 'SeProfileSingleProcessPrivilege';
- {$EXTERNALSYM SE_PROF_SINGLE_PROCESS_NAME}
- SE_INC_BASE_PRIORITY_NAME = 'SeIncreaseBasePriorityPrivilege';
- {$EXTERNALSYM SE_INC_BASE_PRIORITY_NAME}
- SE_CREATE_PAGEFILE_NAME = 'SeCreatePagefilePrivilege';
- {$EXTERNALSYM SE_CREATE_PAGEFILE_NAME}
- SE_CREATE_PERMANENT_NAME = 'SeCreatePermanentPrivilege';
- {$EXTERNALSYM SE_CREATE_PERMANENT_NAME}
- SE_BACKUP_NAME = 'SeBackupPrivilege';
- {$EXTERNALSYM SE_BACKUP_NAME}
- SE_RESTORE_NAME = 'SeRestorePrivilege';
- {$EXTERNALSYM SE_RESTORE_NAME}
- SE_SHUTDOWN_NAME = 'SeShutdownPrivilege';
- {$EXTERNALSYM SE_SHUTDOWN_NAME}
- SE_DEBUG_NAME = 'SeDebugPrivilege';
- {$EXTERNALSYM SE_DEBUG_NAME}
- SE_AUDIT_NAME = 'SeAuditPrivilege';
- {$EXTERNALSYM SE_AUDIT_NAME}
- SE_SYSTEM_ENVIRONMENT_NAME = 'SeSystemEnvironmentPrivilege';
- {$EXTERNALSYM SE_SYSTEM_ENVIRONMENT_NAME}
- SE_CHANGE_NOTIFY_NAME = 'SeChangeNotifyPrivilege';
- {$EXTERNALSYM SE_CHANGE_NOTIFY_NAME}
- SE_REMOTE_SHUTDOWN_NAME = 'SeRemoteShutdownPrivilege';
- {$EXTERNALSYM SE_REMOTE_SHUTDOWN_NAME}
- SE_UNDOCK_NAME = 'SeUndockPrivilege';
- {$EXTERNALSYM SE_UNDOCK_NAME}
- SE_SYNC_AGENT_NAME = 'SeSyncAgentPrivilege';
- {$EXTERNALSYM SE_SYNC_AGENT_NAME}
- SE_ENABLE_DELEGATION_NAME = 'SeEnableDelegationPrivilege';
- {$EXTERNALSYM SE_ENABLE_DELEGATION_NAME}
- SE_MANAGE_VOLUME_NAME = 'SeManageVolumePrivilege';
- {$EXTERNALSYM SE_MANAGE_VOLUME_NAME}
- ////////////////////////////////////////////////////////////////////
- // //
- // Security Quality Of Service //
- // //
- // //
- ////////////////////////////////////////////////////////////////////
- //
- // Impersonation Level
- //
- // Impersonation level is represented by a pair of bits in Windows.
- // If a new impersonation level is added or lowest value is changed from
- // 0 to something else, fix the Windows CreateFile call.
- //
- type
- _SECURITY_IMPERSONATION_LEVEL = (SecurityAnonymous, SecurityIdentification,
- SecurityImpersonation, SecurityDelegation);
- {$EXTERNALSYM _SECURITY_IMPERSONATION_LEVEL}
- SECURITY_IMPERSONATION_LEVEL = _SECURITY_IMPERSONATION_LEVEL;
- {$EXTERNALSYM SECURITY_IMPERSONATION_LEVEL}
- PSECURITY_IMPERSONATION_LEVEL = ^SECURITY_IMPERSONATION_LEVEL;
- {$EXTERNALSYM PSECURITY_IMPERSONATION_LEVEL}
- TSecurityImpersonationLevel = SECURITY_IMPERSONATION_LEVEL;
- PSecurityImpersonationLevel = PSECURITY_IMPERSONATION_LEVEL;
- const
- SECURITY_MAX_IMPERSONATION_LEVEL = SecurityDelegation;
- {$EXTERNALSYM SECURITY_MAX_IMPERSONATION_LEVEL}
- SECURITY_MIN_IMPERSONATION_LEVEL = SecurityAnonymous;
- {$EXTERNALSYM SECURITY_MIN_IMPERSONATION_LEVEL}
- DEFAULT_IMPERSONATION_LEVEL = SecurityImpersonation;
- {$EXTERNALSYM DEFAULT_IMPERSONATION_LEVEL}
- function VALID_IMPERSONATION_LEVEL(L: TSecurityImpersonationLevel): BOOL;
- {$EXTERNALSYM VALID_IMPERSONATION_LEVEL}
- ////////////////////////////////////////////////////////////////////
- // //
- // Token Object Definitions //
- // //
- // //
- ////////////////////////////////////////////////////////////////////
- //
- // Token Specific Access Rights.
- //
- const
- TOKEN_ASSIGN_PRIMARY = ($0001);
- {$EXTERNALSYM TOKEN_ASSIGN_PRIMARY}
- TOKEN_DUPLICATE = ($0002);
- {$EXTERNALSYM TOKEN_DUPLICATE}
- TOKEN_IMPERSONATE = ($0004);
- {$EXTERNALSYM TOKEN_IMPERSONATE}
- TOKEN_QUERY = ($0008);
- {$EXTERNALSYM TOKEN_QUERY}
- TOKEN_QUERY_SOURCE = ($0010);
- {$EXTERNALSYM TOKEN_QUERY_SOURCE}
- TOKEN_ADJUST_PRIVILEGES = ($0020);
- {$EXTERNALSYM TOKEN_ADJUST_PRIVILEGES}
- TOKEN_ADJUST_GROUPS = ($0040);
- {$EXTERNALSYM TOKEN_ADJUST_GROUPS}
- TOKEN_ADJUST_DEFAULT = ($0080);
- {$EXTERNALSYM TOKEN_ADJUST_DEFAULT}
- TOKEN_ADJUST_SESSIONID = ($0100);
- {$EXTERNALSYM TOKEN_ADJUST_SESSIONID}
- TOKEN_ALL_ACCESS_P = STANDARD_RIGHTS_REQUIRED or TOKEN_ASSIGN_PRIMARY or
- TOKEN_DUPLICATE or TOKEN_IMPERSONATE or TOKEN_QUERY or TOKEN_QUERY_SOURCE or
- TOKEN_ADJUST_PRIVILEGES or TOKEN_ADJUST_GROUPS or TOKEN_ADJUST_DEFAULT;
- {$EXTERNALSYM TOKEN_ALL_ACCESS_P}
- TOKEN_ALL_ACCESS = TOKEN_ALL_ACCESS_P or TOKEN_ADJUST_SESSIONID;
- {$EXTERNALSYM TOKEN_ALL_ACCESS}
- TOKEN_READ = (STANDARD_RIGHTS_READ or TOKEN_QUERY);
- {$EXTERNALSYM TOKEN_READ}
- TOKEN_WRITE = (STANDARD_RIGHTS_WRITE or TOKEN_ADJUST_PRIVILEGES or
- TOKEN_ADJUST_GROUPS or TOKEN_ADJUST_DEFAULT);
- {$EXTERNALSYM TOKEN_WRITE}
- TOKEN_EXECUTE = (STANDARD_RIGHTS_EXECUTE);
- {$EXTERNALSYM TOKEN_EXECUTE}
- //
- // Token Types
- //
- type
- _TOKEN_TYPE = (TokenTypePad0, TokenPrimary, TokenImpersonation);
- {$EXTERNALSYM _TOKEN_TYPE}
- TOKEN_TYPE = _TOKEN_TYPE;
- {$EXTERNALSYM TOKEN_TYPE}
- PTOKEN_TYPE = ^TOKEN_TYPE;
- {$EXTERNALSYM PTOKEN_TYPE}
- TTokenType = TOKEN_TYPE;
- PTokenType = PTOKEN_TYPE;
- //
- // Token Information Classes.
- //
- type
- _TOKEN_INFORMATION_CLASS = (TokenInfoClassPad0, TokenUser, TokenGroups,
- TokenPrivileges, TokenOwner, TokenPrimaryGroup, TokenDefaultDacl, TokenSource,
- TokenType, TokenImpersonationLevel, TokenStatistics, TokenRestrictedSids,
- TokenSessionId, TokenGroupsAndPrivileges, TokenSessionReference,
- TokenSandBoxInert, TokenAuditPolicy,
- MaxTokenInfoClass); {MaxTokenInfoClass should always be the last enum}
- {$EXTERNALSYM _TOKEN_INFORMATION_CLASS}
- TOKEN_INFORMATION_CLASS = _TOKEN_INFORMATION_CLASS;
- {$EXTERNALSYM TOKEN_INFORMATION_CLASS}
- PTOKEN_INFORMATION_CLASS = ^TOKEN_INFORMATION_CLASS;
- {$EXTERNALSYM PTOKEN_INFORMATION_CLASS}
- TTokenInformationClass = TOKEN_INFORMATION_CLASS;
- PTokenInformationClass = PTOKEN_INFORMATION_CLASS;
- //
- // Token information class structures
- //
- type
- PTOKEN_USER = ^TOKEN_USER;
- {$EXTERNALSYM PTOKEN_USER}
- _TOKEN_USER = record
- User: SID_AND_ATTRIBUTES;
- end;
- {$EXTERNALSYM _TOKEN_USER}
- TOKEN_USER = _TOKEN_USER;
- {$EXTERNALSYM TOKEN_USER}
- TTokenUser = TOKEN_USER;
- PTokenUser = PTOKEN_USER;
- PTOKEN_GROUPS = ^TOKEN_GROUPS;
- {$EXTERNALSYM PTOKEN_GROUPS}
- _TOKEN_GROUPS = record
- GroupCount: DWORD;
- Groups: array [0..ANYSIZE_ARRAY - 1] of SID_AND_ATTRIBUTES;
- end;
- {$EXTERNALSYM _TOKEN_GROUPS}
- TOKEN_GROUPS = _TOKEN_GROUPS;
- {$EXTERNALSYM TOKEN_GROUPS}
- TTokenGroups = TOKEN_GROUPS;
- PTokenGroups = PTOKEN_GROUPS;
- PTOKEN_PRIVILEGES = ^TOKEN_PRIVILEGES;
- {$EXTERNALSYM PTOKEN_PRIVILEGES}
- _TOKEN_PRIVILEGES = record
- PrivilegeCount: DWORD;
- Privileges: array [0..ANYSIZE_ARRAY - 1] of LUID_AND_ATTRIBUTES;
- end;
- {$EXTERNALSYM _TOKEN_PRIVILEGES}
- TOKEN_PRIVILEGES = _TOKEN_PRIVILEGES;
- {$EXTERNALSYM TOKEN_PRIVILEGES}
- TTokenPrivileges = TOKEN_PRIVILEGES;
- PTokenPrivileges = PTOKEN_PRIVILEGES;
- PTOKEN_OWNER = ^TOKEN_OWNER;
- {$EXTERNALSYM PTOKEN_OWNER}
- _TOKEN_OWNER = record
- Owner: PSID;
- end;
- {$EXTERNALSYM _TOKEN_OWNER}
- TOKEN_OWNER = _TOKEN_OWNER;
- {$EXTERNALSYM TOKEN_OWNER}
- TTokenOwner = TOKEN_OWNER;
- PTokenOwner = PTOKEN_OWNER;
- PTOKEN_PRIMARY_GROUP = ^TOKEN_PRIMARY_GROUP;
- {$EXTERNALSYM PTOKEN_PRIMARY_GROUP}
- _TOKEN_PRIMARY_GROUP = record
- PrimaryGroup: PSID;
- end;
- {$EXTERNALSYM _TOKEN_PRIMARY_GROUP}
- TOKEN_PRIMARY_GROUP = _TOKEN_PRIMARY_GROUP;
- {$EXTERNALSYM TOKEN_PRIMARY_GROUP}
- TTokenPrimaryGroup = TOKEN_PRIMARY_GROUP;
- PTokenPrimaryGroup = PTOKEN_PRIMARY_GROUP;
- PTOKEN_DEFAULT_DACL = ^TOKEN_DEFAULT_DACL;
- {$EXTERNALSYM PTOKEN_DEFAULT_DACL}
- _TOKEN_DEFAULT_DACL = record
- DefaultDacl: PACL;
- end;
- {$EXTERNALSYM _TOKEN_DEFAULT_DACL}
- TOKEN_DEFAULT_DACL = _TOKEN_DEFAULT_DACL;
- {$EXTERNALSYM TOKEN_DEFAULT_DACL}
- TTokenDefaultDacl = TOKEN_DEFAULT_DACL;
- PTokenDefaultDacl = PTOKEN_DEFAULT_DACL;
- _TOKEN_GROUPS_AND_PRIVILEGES = record
- SidCount: DWORD;
- SidLength: DWORD;
- Sids: PSID_AND_ATTRIBUTES;
- RestrictedSidCount: DWORD;
- RestrictedSidLength: DWORD;
- RestrictedSids: PSID_AND_ATTRIBUTES;
- PrivilegeCount: DWORD;
- PrivilegeLength: DWORD;
- Privileges: PLUID_AND_ATTRIBUTES;
- AuthenticationId: LUID;
- end;
- {$EXTERNALSYM _TOKEN_GROUPS_AND_PRIVILEGES}
- TOKEN_GROUPS_AND_PRIVILEGES = _TOKEN_GROUPS_AND_PRIVILEGES;
- {$EXTERNALSYM TOKEN_GROUPS_AND_PRIVILEGES}
- PTOKEN_GROUPS_AND_PRIVILEGES = ^TOKEN_GROUPS_AND_PRIVILEGES;
- {$EXTERNALSYM PTOKEN_GROUPS_AND_PRIVILEGES}
- TTokenGroupsAndPrivileges = TOKEN_GROUPS_AND_PRIVILEGES;
- PTokenGroupsAndPrivileges = PTOKEN_GROUPS_AND_PRIVILEGES;
- //
- // Valid bits for each TOKEN_AUDIT_POLICY policy mask field.
- //
- const
- TOKEN_AUDIT_SUCCESS_INCLUDE = $1;
- {$EXTERNALSYM TOKEN_AUDIT_SUCCESS_INCLUDE}
- TOKEN_AUDIT_SUCCESS_EXCLUDE = $2;
- {$EXTERNALSYM TOKEN_AUDIT_SUCCESS_EXCLUDE}
- TOKEN_AUDIT_FAILURE_INCLUDE = $4;
- {$EXTERNALSYM TOKEN_AUDIT_FAILURE_INCLUDE}
- TOKEN_AUDIT_FAILURE_EXCLUDE = $8;
- {$EXTERNALSYM TOKEN_AUDIT_FAILURE_EXCLUDE}
- VALID_AUDIT_POLICY_BITS = (TOKEN_AUDIT_SUCCESS_INCLUDE or
- TOKEN_AUDIT_SUCCESS_EXCLUDE or
- TOKEN_AUDIT_FAILURE_INCLUDE or
- TOKEN_AUDIT_FAILURE_EXCLUDE);
- {$EXTERNALSYM VALID_AUDIT_POLICY_BITS}
- type
- _TOKEN_AUDIT_POLICY_ELEMENT = record
- Category: DWORD;
- PolicyMask: DWORD;
- end;
- {$EXTERNALSYM _TOKEN_AUDIT_POLICY_ELEMENT}
- TOKEN_AUDIT_POLICY_ELEMENT = _TOKEN_AUDIT_POLICY_ELEMENT;
- {$EXTERNALSYM TOKEN_AUDIT_POLICY_ELEMENT}
- PTOKEN_AUDIT_POLICY_ELEMENT = ^TOKEN_AUDIT_POLICY_ELEMENT;
- {$EXTERNALSYM PTOKEN_AUDIT_POLICY_ELEMENT}
- TTokenAuditPolicyElement = TOKEN_AUDIT_POLICY_ELEMENT;
- PTokenAuditPolicyElement = PTOKEN_AUDIT_POLICY_ELEMENT;
- // TODO Implementation references AuditEventMaxType, which isn't defined anywhere
- //function VALID_TOKEN_AUDIT_POLICY_ELEMENT(P: TOKEN_AUDIT_POLICY_ELEMENT): BOOL;
- //{$EXTERNALSYM VALID_TOKEN_AUDIT_POLICY_ELEMENT}
- type
- _TOKEN_AUDIT_POLICY = record
- PolicyCount: DWORD;
- Policy: array [0..ANYSIZE_ARRAY - 1] of TOKEN_AUDIT_POLICY_ELEMENT;
- end;
- {$EXTERNALSYM _TOKEN_AUDIT_POLICY}
- TOKEN_AUDIT_POLICY = _TOKEN_AUDIT_POLICY;
- {$EXTERNALSYM TOKEN_AUDIT_POLICY}
- PTOKEN_AUDIT_POLICY = ^TOKEN_AUDIT_POLICY;
- {$EXTERNALSYM PTOKEN_AUDIT_POLICY}
- TTokenAuditPolicy = TOKEN_AUDIT_POLICY;
- PTokenAuditPolicy = PTOKEN_AUDIT_POLICY;
- function PER_USER_AUDITING_POLICY_SIZE(p: PTOKEN_AUDIT_POLICY): DWORD;
- {$EXTERNALSYM PER_USER_AUDITING_POLICY_SIZE}
- function PER_USER_AUDITING_POLICY_SIZE_BY_COUNT(C: DWORD): DWORD;
- {$EXTERNALSYM PER_USER_AUDITING_POLICY_SIZE_BY_COUNT}
- const
- TOKEN_SOURCE_LENGTH = 8;
- {$EXTERNALSYM TOKEN_SOURCE_LENGTH}
- type
- PTOKEN_SOURCE = ^TOKEN_SOURCE;
- {$EXTERNALSYM PTOKEN_SOURCE}
- _TOKEN_SOURCE = record
- SourceName: array [0..TOKEN_SOURCE_LENGTH - 1] of CHAR;
- SourceIdentifier: LUID;
- end;
- {$EXTERNALSYM _TOKEN_SOURCE}
- TOKEN_SOURCE = _TOKEN_SOURCE;
- {$EXTERNALSYM TOKEN_SOURCE}
- TTokenSource = TOKEN_SOURCE;
- PTokenSource = PTOKEN_SOURCE;
- PTOKEN_STATISTICS = ^TOKEN_STATISTICS;
- {$EXTERNALSYM PTOKEN_STATISTICS}
- _TOKEN_STATISTICS = record
- TokenId: LUID;
- AuthenticationId: LUID;
- ExpirationTime: LARGE_INTEGER;
- TokenType: TOKEN_TYPE;
- ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL;
- DynamicCharged: DWORD;
- DynamicAvailable: DWORD;
- GroupCount: DWORD;
- PrivilegeCount: DWORD;
- ModifiedId: LUID;
- end;
- {$EXTERNALSYM _TOKEN_STATISTICS}
- TOKEN_STATISTICS = _TOKEN_STATISTICS;
- {$EXTERNALSYM TOKEN_STATISTICS}
- TTokenStatistics = TOKEN_STATISTICS;
- PTokenStatistics = PTOKEN_STATISTICS;
- PTOKEN_CONTROL = ^TOKEN_CONTROL;
- {$EXTERNALSYM PTOKEN_CONTROL}
- _TOKEN_CONTROL = record
- TokenId: LUID;
- AuthenticationId: LUID;
- ModifiedId: LUID;
- TokenSource: TOKEN_SOURCE;
- end;
- {$EXTERNALSYM _TOKEN_CONTROL}
- TOKEN_CONTROL = _TOKEN_CONTROL;
- {$EXTERNALSYM TOKEN_CONTROL}
- TTokenControl = TOKEN_CONTROL;
- PTokenControl = PTOKEN_CONTROL;
- //
- // Security Tracking Mode
- //
- const
- SECURITY_DYNAMIC_TRACKING = (TRUE);
- {$EXTERNALSYM SECURITY_DYNAMIC_TRACKING}
- SECURITY_STATIC_TRACKING = (FALSE);
- {$EXTERNALSYM SECURITY_STATIC_TRACKING}
- type
- SECURITY_CONTEXT_TRACKING_MODE = ByteBool;
- {$EXTERNALSYM SECURITY_CONTEXT_TRACKING_MODE}
- PSECURITY_CONTEXT_TRACKING_MODE = ^SECURITY_CONTEXT_TRACKING_MODE;
- {$EXTERNALSYM PSECURITY_CONTEXT_TRACKING_MODE}
- //
- // Quality Of Service
- //
- PSECURITY_QUALITY_OF_SERVICE = ^SECURITY_QUALITY_OF_SERVICE;
- {$EXTERNALSYM PSECURITY_QUALITY_OF_SERVICE}
- _SECURITY_QUALITY_OF_SERVICE = record
- Length: DWORD;
- ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL;
- ContextTrackingMode: SECURITY_CONTEXT_TRACKING_MODE;
- EffectiveOnly: ByteBool;
- end;
- {$EXTERNALSYM _SECURITY_QUALITY_OF_SERVICE}
- SECURITY_QUALITY_OF_SERVICE = _SECURITY_QUALITY_OF_SERVICE;
- {$EXTERNALSYM SECURITY_QUALITY_OF_SERVICE}
- TSecurityQualityOfService = SECURITY_QUALITY_OF_SERVICE;
- PSecurityQualityOfService = PSECURITY_QUALITY_OF_SERVICE;
- //
- // Used to represent information related to a thread impersonation
- //
- PSE_IMPERSONATION_STATE = ^SE_IMPERSONATION_STATE;
- {$EXTERNALSYM PSE_IMPERSONATION_STATE}
- _SE_IMPERSONATION_STATE = record
- Token: PACCESS_TOKEN;
- CopyOnOpen: ByteBool;
- EffectiveOnly: ByteBool;
- Level: SECURITY_IMPERSONATION_LEVEL;
- end;
- {$EXTERNALSYM _SE_IMPERSONATION_STATE}
- SE_IMPERSONATION_STATE = _SE_IMPERSONATION_STATE;
- {$EXTERNALSYM SE_IMPERSONATION_STATE}
- TSeImpersonationState = SE_IMPERSONATION_STATE;
- PSeImpersonationState = PSE_IMPERSONATION_STATE;
- const
- DISABLE_MAX_PRIVILEGE = $1;
- {$EXTERNALSYM DISABLE_MAX_PRIVILEGE}
- SANDBOX_INERT = $2;
- {$EXTERNALSYM SANDBOX_INERT}
- type
- SECURITY_INFORMATION = DWORD;
- {$EXTERNALSYM SECURITY_INFORMATION}
- PSECURITY_INFORMATION = ^SECURITY_INFORMATION;
- {$EXTERNALSYM PSECURITY_INFORMATION}
- TSecurityInformation = SECURITY_INFORMATION;
- PSecurityInformation = PSECURITY_INFORMATION;
- const
- OWNER_SECURITY_INFORMATION = ($00000001);
- {$EXTERNALSYM OWNER_SECURITY_INFORMATION}
- GROUP_SECURITY_INFORMATION = ($00000002);
- {$EXTERNALSYM GROUP_SECURITY_INFORMATION}
- DACL_SECURITY_INFORMATION = ($00000004);
- {$EXTERNALSYM DACL_SECURITY_INFORMATION}
- SACL_SECURITY_INFORMATION = ($00000008);
- {$EXTERNALSYM SACL_SECURITY_INFORMATION}
- PROTECTED_DACL_SECURITY_INFORMATION = ($80000000);
- {$EXTERNALSYM PROTECTED_DACL_SECURITY_INFORMATION}
- PROTECTED_SACL_SECURITY_INFORMATION = ($40000000);
- {$EXTERNALSYM PROTECTED_SACL_SECURITY_INFORMATION}
- UNPROTECTED_DACL_SECURITY_INFORMATION = ($20000000);
- {$EXTERNALSYM UNPROTECTED_DACL_SECURITY_INFORMATION}
- UNPROTECTED_SACL_SECURITY_INFORMATION = ($10000000);
- {$EXTERNALSYM UNPROTECTED_SACL_SECURITY_INFORMATION}
- PROCESS_TERMINATE = ($0001);
- {$EXTERNALSYM PROCESS_TERMINATE}
- PROCESS_CREATE_THREAD = ($0002);
- {$EXTERNALSYM PROCESS_CREATE_THREAD}
- PROCESS_SET_SESSIONID = ($0004);
- {$EXTERNALSYM PROCESS_SET_SESSIONID}
- PROCESS_VM_OPERATION = ($0008);
- {$EXTERNALSYM PROCESS_VM_OPERATION}
- PROCESS_VM_READ = ($0010);
- {$EXTERNALSYM PROCESS_VM_READ}
- PROCESS_VM_WRITE = ($0020);
- {$EXTERNALSYM PROCESS_VM_WRITE}
- PROCESS_DUP_HANDLE = ($0040);
- {$EXTERNALSYM PROCESS_DUP_HANDLE}
- PROCESS_CREATE_PROCESS = ($0080);
- {$EXTERNALSYM PROCESS_CREATE_PROCESS}
- PROCESS_SET_QUOTA = ($0100);
- {$EXTERNALSYM PROCESS_SET_QUOTA}
- PROCESS_SET_INFORMATION = ($0200);
- {$EXTERNALSYM PROCESS_SET_INFORMATION}
- PROCESS_QUERY_INFORMATION = ($0400);
- {$EXTERNALSYM PROCESS_QUERY_INFORMATION}
- PROCESS_SUSPEND_RESUME = ($0800);
- {$EXTERNALSYM PROCESS_SUSPEND_RESUME}
- PROCESS_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $FFF);
- {$EXTERNALSYM PROCESS_ALL_ACCESS}
- MAXIMUM_PROCESSORS = 32;
- {$EXTERNALSYM MAXIMUM_PROCESSORS}
- THREAD_TERMINATE = ($0001);
- {$EXTERNALSYM THREAD_TERMINATE}
- THREAD_SUSPEND_RESUME = ($0002);
- {$EXTERNALSYM THREAD_SUSPEND_RESUME}
- THREAD_GET_CONTEXT = ($0008);
- {$EXTERNALSYM THREAD_GET_CONTEXT}
- THREAD_SET_CONTEXT = ($0010);
- {$EXTERNALSYM THREAD_SET_CONTEXT}
- THREAD_SET_INFORMATION = ($0020);
- {$EXTERNALSYM THREAD_SET_INFORMATION}
- THREAD_QUERY_INFORMATION = ($0040);
- {$EXTERNALSYM THREAD_QUERY_INFORMATION}
- THREAD_SET_THREAD_TOKEN = ($0080);
- {$EXTERNALSYM THREAD_SET_THREAD_TOKEN}
- THREAD_IMPERSONATE = ($0100);
- {$EXTERNALSYM THREAD_IMPERSONATE}
- THREAD_DIRECT_IMPERSONATION = ($0200);
- {$EXTERNALSYM THREAD_DIRECT_IMPERSONATION}
- THREAD_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3FF);
- {$EXTERNALSYM THREAD_ALL_ACCESS}
- JOB_OBJECT_ASSIGN_PROCESS = ($0001);
- {$EXTERNALSYM JOB_OBJECT_ASSIGN_PROCESS}
- JOB_OBJECT_SET_ATTRIBUTES = ($0002);
- {$EXTERNALSYM JOB_OBJECT_SET_ATTRIBUTES}
- JOB_OBJECT_QUERY = ($0004);
- {$EXTERNALSYM JOB_OBJECT_QUERY}
- JOB_OBJECT_TERMINATE = ($0008);
- {$EXTERNALSYM JOB_OBJECT_TERMINATE}
- JOB_OBJECT_SET_SECURITY_ATTRIBUTES = ($0010);
- {$EXTERNALSYM JOB_OBJECT_SET_SECURITY_ATTRIBUTES}
- JOB_OBJECT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $1F );
- {$EXTERNALSYM JOB_OBJECT_ALL_ACCESS}
- type
- _JOB_SET_ARRAY = record
- JobHandle: HANDLE; // Handle to job object to insert
- MemberLevel: DWORD; // Level of this job in the set. Must be > 0. Can be sparse.
- Flags: DWORD; // Unused. Must be zero
- end;
- {$EXTERNALSYM _JOB_SET_ARRAY}
- JOB_SET_ARRAY = _JOB_SET_ARRAY;
- {$EXTERNALSYM JOB_SET_ARRAY}
- PJOB_SET_ARRAY = ^JOB_SET_ARRAY;
- {$EXTERNALSYM PJOB_SET_ARRAY}
- TJobSetArray = JOB_SET_ARRAY;
- PJobSetArray = PJOB_SET_ARRAY;
- const
- FLS_MAXIMUM_AVAILABLE = 128;
- {$EXTERNALSYM FLS_MAXIMUM_AVAILABLE}
- TLS_MINIMUM_AVAILABLE = 64;
- {$EXTERNALSYM TLS_MINIMUM_AVAILABLE}
- type
- PEXCEPTION_REGISTRATION_RECORD = ^EXCEPTION_REGISTRATION_RECORD;
- _EXCEPTION_REGISTRATION_RECORD = packed record
- pNext: PEXCEPTION_REGISTRATION_RECORD;
- pfnHandler: FARPROC;
- end;
- EXCEPTION_REGISTRATION_RECORD = _EXCEPTION_REGISTRATION_RECORD;
- TExceptionRegistrationRecord = EXCEPTION_REGISTRATION_RECORD;
- PExceptionRegistrationRecord = PEXCEPTION_REGISTRATION_RECORD;
- PNT_TIB = ^NT_TIB;
- {$EXTERNALSYM PNT_TIB}
- _NT_TIB = record
- ExceptionList: PEXCEPTION_REGISTRATION_RECORD; // 00h Head of exception record list
- StackBase: PVOID; // 04h Top of user stack
- StackLimit: PVOID; // 08h Base of user stack
- //union // 0Ch (NT/Win95 differences)
- //{
- // struct // Win95 fields
- // {
- // WORD pvTDB; // 0Ch TDB
- // WORD pvThunkSS; // 0Eh SS selector used for thunking to 16 bits
- // DWORD unknown1; // 10h
- // } WIN95;
- //
- // struct // WinNT fields
- // {
- SubSystemTib: PVOID; // 0Ch
- Union: record // 10H
- case Integer of
- 0: (FiberData: PVOID);
- 1: (Version: DWORD);
- end;
- // } WINNT;
- //} TIB_UNION1;
- ArbitraryUserPointer: PVOID; // 14h Available for application use
- Self: PNT_TIB; // 18h Linear address of TIB structure
- //union // 1Ch (NT/Win95 differences)
- //{
- // struct // Win95 fields
- // {
- // WORD TIBFlags; // 1Ch
- // WORD Win16MutexCount; // 1Eh
- // DWORD DebugContext; // 20h
- // DWORD pCurrentPriority; // 24h
- // DWORD pvQueue; // 28h Message Queue selector
- // } WIN95;
- //