home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sibdemo3.zip / SOURCE.DAT / SOURCE / WIN32 / WINNT.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-03  |  13KB  |  341 lines

  1. UNIT WinNT;
  2.  
  3. {***************************************************************************
  4.  *                                                                         *
  5.  * 32 Bit Windows constants and types for use with Win32 and DAX           *
  6.  *                                                                         *
  7.  *                                                                         *
  8.  ***************************************************************************}
  9.  
  10. INTERFACE
  11.  
  12. CONST
  13.      HEAP_NO_SERIALIZE               =$00000001;
  14.      HEAP_GROWABLE                   =$00000002;
  15.      HEAP_GENERATE_EXCEPTIONS        =$00000004;
  16.      HEAP_ZERO_MEMORY                =$00000008;
  17.      HEAP_REALLOC_IN_PLACE_ONLY      =$00000010;
  18.      HEAP_TAIL_CHECKING_ENABLED      =$00000020;
  19.      HEAP_FREE_CHECKING_ENABLED      =$00000040;
  20.      HEAP_DISABLE_COALESCE_ON_FREE   =$00000080;
  21.  
  22.  
  23. TYPE
  24.     LPCH       = PChar;
  25.     PCH        = PChar;
  26.  
  27.     PSHORT     = ^SHORT;
  28.     SHORT      = ShortInt;
  29.     PLONG      = ^LONG;
  30.     LONG       = LongInt;
  31.  
  32.     Handle     = LONGWORD;
  33.  
  34.     CCHAR      = char;
  35.     DWORD      = LONGWORD;
  36.  
  37.     PLCID      = ^LCID;
  38.     LCID       = DWORD;
  39.  
  40.  
  41. CONST
  42.      APPLICATION_ERROR_MASK       =$20000000;
  43.      ERROR_SEVERITY_SUCCESS       =$00000000;
  44.      ERROR_SEVERITY_INFORMATIONAL =$40000000;
  45.      ERROR_SEVERITY_WARNING       =$80000000;
  46.      ERROR_SEVERITY_ERROR         =$C0000000;
  47.  
  48. CONST
  49.      MINCHAR        =$80;
  50.      MAXCHAR        =$7F;
  51.      MINSHORT       =$8000;
  52.      MAXSHORT       =$7FFF;
  53.      MINLONG        =$80000000;
  54.      MAXLONG        =$7FFFFFFF;
  55.      MAXBYTE        =$ff;
  56.      MAXWORD        =$ffff;
  57.      MAXDWORD       =$ffffffff;
  58.  
  59. CONST
  60.      LANG_NEUTRAL                   = $00;
  61.      LANG_BULGARIAN                 = $02;
  62.      LANG_CHINESE                   = $04;
  63.      LANG_CROATIAN                  = $1a;
  64.      LANG_CZECH                     = $05;
  65.      LANG_DANISH                    = $06;
  66.      LANG_DUTCH                     = $13;
  67.      LANG_ENGLISH                   = $09;
  68.      LANG_FINNISH                   = $0b;
  69.      LANG_FRENCH                    = $0c;
  70.      LANG_GERMAN                    = $07;
  71.      LANG_GREEK                     = $08;
  72.      LANG_HUNGARIAN                 = $0e;
  73.      LANG_ICELANDIC                 = $0f;
  74.      LANG_ITALIAN                   = $10;
  75.      LANG_JAPANESE                  = $11;
  76.      LANG_KOREAN                    = $12;
  77.      LANG_NORWEGIAN                 = $14;
  78.      LANG_POLISH                    = $15;
  79.      LANG_PORTUGUESE                = $16;
  80.      LANG_ROMANIAN                  = $18;
  81.      LANG_RUSSIAN                   = $19;
  82.      LANG_SLOVAK                    = $1b;
  83.      LANG_SLOVENIAN                 = $24;
  84.      LANG_SPANISH                   = $0a;
  85.      LANG_SWEDISH                   = $1d;
  86.      LANG_TURKISH                   = $1f;
  87.  
  88.      SUBLANG_NEUTRAL                = $00;   /* language neutral */
  89.      SUBLANG_DEFAULT                = $01;   /* user default */
  90.      SUBLANG_SYS_DEFAULT            = $02;   /* system default */
  91.  
  92.      SUBLANG_CHINESE_TRADITIONAL    = $01;   /* Chinese (Taiwan) */
  93.      SUBLANG_CHINESE_SIMPLIFIED     = $02;   /* Chinese (PR China) */
  94.      SUBLANG_CHINESE_HONGKONG       = $03;   /* Chinese (Hong Kong) */
  95.      SUBLANG_CHINESE_SINGAPORE      = $04;   /* Chinese (Singapore) */
  96.      SUBLANG_DUTCH                  = $01;   /* Dutch */
  97.      SUBLANG_DUTCH_BELGIAN          = $02;   /* Dutch (Belgian) */
  98.      SUBLANG_ENGLISH_US             = $01;   /* English (USA) */
  99.      SUBLANG_ENGLISH_UK             = $02;   /* English (UK) */
  100.      SUBLANG_ENGLISH_AUS            = $03;   /* English (Australian) */
  101.      SUBLANG_ENGLISH_CAN            = $04;   /* English (Canadian) */
  102.      SUBLANG_ENGLISH_NZ             = $05;   /* English (New Zealand) */
  103.      SUBLANG_ENGLISH_EIRE           = $06;   /* English (Irish) */
  104.      SUBLANG_FRENCH                 = $01;   /* French */
  105.      SUBLANG_FRENCH_BELGIAN         = $02;   /* French (Belgian) */
  106.      SUBLANG_FRENCH_CANADIAN        = $03;   /* French (Canadian) */
  107.      SUBLANG_FRENCH_SWISS           = $04;   /* French (Swiss) */
  108.      SUBLANG_GERMAN                 = $01;   /* German */
  109.      SUBLANG_GERMAN_SWISS           = $02;   /* German (Swiss) */
  110.      SUBLANG_GERMAN_AUSTRIAN        = $03;   /* German (Austrian) */
  111.      SUBLANG_ITALIAN                = $01;   /* Italian */
  112.      SUBLANG_ITALIAN_SWISS          = $02;   /* Italian (Swiss) */
  113.      SUBLANG_NORWEGIAN_BOKMAL       = $01;   /* Norwegian (Bokmal) */
  114.      SUBLANG_NORWEGIAN_NYNORSK      = $02;   /* Norwegian (Nynorsk) */
  115.      SUBLANG_PORTUGUESE             = $02;   /* Portuguese */
  116.      SUBLANG_PORTUGUESE_BRAZILIAN   = $01;   /* Portuguese (Brazilian) */
  117.      SUBLANG_SPANISH                = $01;   /* Spanish (Castilian) */
  118.      SUBLANG_SPANISH_MEXICAN        = $02;   /* Spanish (Mexican) */
  119.      SUBLANG_SPANISH_MODERN         = $03;   /* Spanish (Modern) */
  120.  
  121. CONST
  122.     SORT_DEFAULT                   = $0;     /* sorting default */
  123.  
  124.     SORT_JAPANESE_XJIS             = $0;     /* Japanese XJIS order */
  125.     SORT_JAPANESE_UNICODE          = $1;     /* Japanese Unicode order */
  126.  
  127.     SORT_CHINESE_BIG5              = $0;     /* Chinese BIG5 order */
  128.     SORT_CHINESE_UNICODE           = $1;     /* Chinese Unicode order */
  129.  
  130.     SORT_KOREAN_KSC                = $0;     /* Korean KSC order */
  131.     SORT_KOREAN_UNICODE            = $1;     /* Korean Unicode order */
  132.  
  133.  
  134. CONST
  135.      NLS_VALID_LOCALE_MASK  =$000fffff;
  136.  
  137. CONST
  138.      STATUS_WAIT_0                    =$00000000;
  139.      STATUS_ABANDONED_WAIT_0          =$00000080;
  140.      STATUS_USER_APC                  =$000000C0;
  141.      STATUS_TIMEOUT                   =$00000102;
  142.      STATUS_PENDING                   =$00000103;
  143.      STATUS_GUARD_PAGE_VIOLATION      =$80000001;
  144.      STATUS_DATATYPE_MISALIGNMENT     =$80000002;
  145.      STATUS_BREAKPOINT                =$80000003;
  146.      STATUS_SINGLE_STEP               =$80000004;
  147.      STATUS_ACCESS_VIOLATION          =$C0000005;
  148.      STATUS_IN_PAGE_ERROR             =$C0000006;
  149.      STATUS_NO_MEMORY                 =$C0000017;
  150.      STATUS_ILLEGAL_INSTRUCTION       =$C000001D;
  151.      STATUS_NONCONTINUABLE_EXCEPTION  =$C0000025;
  152.      STATUS_INVALID_DISPOSITION       =$C0000026;
  153.      STATUS_ARRAY_BOUNDS_EXCEEDED     =$C000008C;
  154.      STATUS_FLOAT_DENORMAL_OPERAND    =$C000008D;
  155.      STATUS_FLOAT_DIVIDE_BY_ZERO      =$C000008E;
  156.      STATUS_FLOAT_INEXACT_RESULT      =$C000008F;
  157.      STATUS_FLOAT_INVALID_OPERATION   =$C0000090;
  158.      STATUS_FLOAT_OVERFLOW            =$C0000091;
  159.      STATUS_FLOAT_STACK_CHECK         =$C0000092;
  160.      STATUS_FLOAT_UNDERFLOW           =$C0000093;
  161.      STATUS_INTEGER_DIVIDE_BY_ZERO    =$C0000094;
  162.      STATUS_INTEGER_OVERFLOW          =$C0000095;
  163.      STATUS_PRIVILEGED_INSTRUCTION    =$C0000096;
  164.      STATUS_STACK_OVERFLOW            =$C00000FD;
  165.      STATUS_CONTROL_C_EXIT            =$C000013A;
  166.  
  167. CONST
  168.      MAXIMUM_WAIT_OBJECTS   = 64;
  169.      MAXIMUM_SUSPEND_COUNT  = MAXCHAR;
  170.  
  171. CONST
  172.      CONTEXT_i386    = $00010000;    // this assumes that i386 and
  173.      CONTEXT_i486    = $00010000;    // i486 have identical context records
  174.  
  175.      CONTEXT_CONTROL = CONTEXT_i386 OR $00000001; // SS:SP, CS:IP, FLAGS, BP
  176.      CONTEXT_INTEGER = CONTEXT_i386 OR $00000002; // AX, BX, CX, DX, SI, DI
  177.      CONTEXT_SEGMENTS= CONTEXT_i386 OR $00000004; // DS, ES, FS, GS
  178.      CONTEXT_FLOATING_POINT=CONTEXT_i386 OR $00000008;  // 387 state
  179.      CONTEXT_DEBUG_REGISTERS=CONTEXT_i386 OR $00000010; // DB 0-3,6,7
  180.      CONTEXT_FULL    = CONTEXT_CONTROL OR CONTEXT_INTEGER OR CONTEXT_SEGMENTS;
  181.  
  182. CONST
  183.      PAGE_NOACCESS          =$01;
  184.      PAGE_READONLY          =$02;
  185.      PAGE_READWRITE         =$04;
  186.      PAGE_WRITECOPY         =$08;
  187.      PAGE_EXECUTE           =$10;
  188.      PAGE_EXECUTE_READ      =$20;
  189.      PAGE_EXECUTE_READWRITE =$40;
  190.      PAGE_EXECUTE_WRITECOPY =$80;
  191.      PAGE_GUARD             =$100;
  192.      PAGE_NOCACHE           =$200;
  193.      MEM_COMMIT             =$1000;
  194.      MEM_RESERVE            =$2000;
  195.      MEM_DECOMMIT           =$4000;
  196.      MEM_RELEASE            =$8000;
  197.      MEM_FREE               =$10000;
  198.      MEM_PRIVATE            =$20000;
  199.      MEM_MAPPED             =$40000;
  200.      MEM_TOP_DOWN           =$100000;
  201.      SEC_FILE               =$800000;
  202.      SEC_IMAGE              =$1000000;
  203.      SEC_RESERVE            =$4000000;
  204.      SEC_COMMIT             =$8000000;
  205.      SEC_NOCACHE            =$10000000;
  206.      MEM_IMAGE              =SEC_IMAGE;
  207.  
  208. {access rights to files and directories}
  209. CONST
  210.     GENERIC_READ            =$80000000;
  211.     GENERIC_WRITE           =$40000000;
  212.     GENERIC_EXECUTE         =$20000000;
  213.     GENERIC_ALL             =$10000000;
  214.  
  215. CONST
  216.     FILE_READ_DATA            =$0001;
  217.     FILE_LIST_DIRECTORY       =$0001;
  218.     FILE_WRITE_DATA           =$0002;
  219.     FILE_ADD_FILE             =$0002;
  220.     FILE_APPEND_DATA          =$0004;
  221.     FILE_ADD_SUBDIRECTORY     =$0004;
  222.     FILE_CREATE_PIPE_INSTANCE =$0004;
  223.     FILE_READ_EA              =$0008;
  224.     FILE_READ_PROPERTIES      =FILE_READ_EA;
  225.     FILE_WRITE_EA             =$0010;
  226.     FILE_WRITE_PROPERTIES     =FILE_WRITE_EA;
  227.     FILE_EXECUTE              =$0020;
  228.     FILE_TRAVERSE             =$0020;
  229.     FILE_DELETE_CHILD         =$0040;
  230.     FILE_READ_ATTRIBUTES      =$0080;
  231.     FILE_WRITE_ATTRIBUTES     =$0100;
  232.  
  233. CONST
  234.     FILE_SHARE_READ                 =$00000001;
  235.     FILE_SHARE_WRITE                =$00000002;
  236.     FILE_ATTRIBUTE_READONLY         =$00000001;
  237.     FILE_ATTRIBUTE_HIDDEN           =$00000002;
  238.     FILE_ATTRIBUTE_SYSTEM           =$00000004;
  239.     FILE_ATTRIBUTE_DIRECTORY        =$00000010;
  240.     FILE_ATTRIBUTE_ARCHIVE          =$00000020;
  241.     FILE_ATTRIBUTE_NORMAL           =$00000080;
  242.     FILE_ATTRIBUTE_TEMPORARY        =$00000100;
  243.     FILE_ATTRIBUTE_ATOMIC_WRITE     =$00000200;
  244.     FILE_ATTRIBUTE_XACTION_WRITE    =$00000400;
  245.     FILE_ATTRIBUTE_COMPRESSED       =$00000800;
  246.     FILE_ATTRIBUTE_HAS_EMBEDDING    =$00001000;
  247.     FILE_NOTIFY_CHANGE_FILE_NAME    =$00000001;
  248.     FILE_NOTIFY_CHANGE_DIR_NAME     =$00000002;
  249.     FILE_NOTIFY_CHANGE_ATTRIBUTES   =$00000004;
  250.     FILE_NOTIFY_CHANGE_SIZE         =$00000008;
  251.     FILE_NOTIFY_CHANGE_LAST_WRITE   =$00000010;
  252.     FILE_NOTIFY_CHANGE_SECURITY     =$00000100;
  253.     MAILSLOT_NO_MESSAGE             =-1;
  254.     MAILSLOT_WAIT_FOREVER           =-1;
  255.     FILE_CASE_SENSITIVE_SEARCH      =$00000001;
  256.     FILE_CASE_PRESERVED_NAMES       =$00000002;
  257.     FILE_UNICODE_ON_DISK            =$00000004;
  258.     FILE_PERSISTENT_ACLS            =$00000008;
  259.     FILE_FILE_COMPRESSION           =$00000010;
  260.     FILE_VOLUME_IS_COMPRESSED       =$00008000;
  261.     IO_COMPLETION_MODIFY_STATE      =$0002;
  262.     DUPLICATE_CLOSE_SOURCE          =$00000001;
  263.     DUPLICATE_SAME_ACCESS           =$00000002;
  264.  
  265.     TLS_MINIMUM_AVAILABLE       =64;
  266.     THREAD_BASE_PRIORITY_LOWRT  =15;
  267.     THREAD_BASE_PRIORITY_MAX    =2;
  268.     THREAD_BASE_PRIORITY_MIN    =-2;
  269.     THREAD_BASE_PRIORITY_IDLE   =-15;
  270.     EVENT_MODIFY_STATE          =2;
  271.     MUTANT_QUERY_STATE          =1;
  272.     ANYSIZE_ARRAY               =1;
  273.  
  274.     API_DELETE                  =$00010000; {was DELETE !!!!!!!!!!}
  275.     READ_CONTROL                =$00020000;
  276.     WRITE_DAC                   =$00040000;
  277.     WRITE_OWNER                 =$00080000;
  278.     SYNCHRONIZE                 =$00100000;
  279.  
  280.     STANDARD_RIGHTS_REQUIRED    =$000F0000;
  281.     STANDARD_RIGHTS_READ        =READ_CONTROL;
  282.     STANDARD_RIGHTS_WRITE       =READ_CONTROL;
  283.     STANDARD_RIGHTS_EXECUTE     =READ_CONTROL;
  284.  
  285.     STANDARD_RIGHTS_ALL         =$001F0000;
  286.  
  287.     SPECIFIC_RIGHTS_ALL         =$0000FFFF;
  288.  
  289.     EVENT_ALL_ACCESS  = STANDARD_RIGHTS_REQUIRED OR SYNCHRONIZE OR 3;
  290.     MUTANT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED OR SYNCHRONIZE OR MUTANT_QUERY_STATE;
  291.  
  292. TYPE
  293.     PMEMORY_BASIC_INFORMATION=^MEMORY_BASIC_INFORMATION;
  294.     MEMORY_BASIC_INFORMATION=RECORD
  295.                                    BaseAddress:POINTER;
  296.                                    AllocationBase:POINTER;
  297.                                    AllocationProtect:LONGWORD;
  298.                                    RegionSize:LONGWORD;
  299.                                    State:LONGWORD;
  300.                                    Protect:LONGWORD;
  301.                                    aType:LONGWORD;
  302.                              END;
  303.  
  304. CONST
  305.      SECTION_QUERY       =$0001;
  306.      SECTION_MAP_WRITE   =$0002;
  307.      SECTION_MAP_READ    =$0004;
  308.      SECTION_MAP_EXECUTE =$0008;
  309.      SECTION_EXTEND_SIZE =$0010;
  310.  
  311. CONST
  312.      DBG_CONTINUE              =$00010002;
  313.      DBG_TERMINATE_THREAD      =$40010003;
  314.      DBG_TERMINATE_PROCESS     =$40010004;
  315.      DBG_CONTROL_C             =$40010005;
  316.      DBG_CONTROL_BREAK         =$40010008;
  317.      DBG_EXCEPTION_NOT_HANDLED =$80010001;
  318.  
  319. FUNCTION MAKELANGID(p,s:LONGWORD):LONGWORD;
  320. FUNCTION PRIMARYLANGID(lgid:LONGWORD):LONGWORD;
  321. FUNCTION SUBLANGID(lgid:LONGWORD):LONGWORD;
  322.  
  323. IMPLEMENTATION
  324.  
  325. FUNCTION MAKELANGID(p,s:LONGWORD):LONGWORD;
  326. BEGIN
  327.      result:=(s SHL 10) OR p;
  328. END;
  329.  
  330. FUNCTION PRIMARYLANGID(lgid:LONGWORD):LONGWORD;
  331. BEGIN
  332.      result:=lgid AND $3ff;
  333. END;
  334.  
  335. FUNCTION SUBLANGID(lgid:LONGWORD):LONGWORD;
  336. BEGIN
  337.      result:=lgid SHR 10;
  338. END;
  339.  
  340. END.
  341.