Index: Include/api_system.sbp
===================================================================
--- Include/api_system.sbp	(revision 160)
+++ Include/api_system.sbp	(revision 170)
@@ -143,39 +143,14 @@
 '-------------------
 ' default constants
-Const NULL = 0
-Const TRUE = 1
-Const FALSE = 0
-
-Const _System_TRUE = -1
-Const _System_FALSE = 0
-
-Const MAX_PATH = 260
 Const INVALID_HANDLE_VALUE = -1 As HANDLE
 Const INVALID_SET_FILE_POINTER = &HFFFFFFFF
 
-Const SYNCHRONIZE = &H00100000
-Const STANDARD_RIGHTS_REQUIRED = &H000F0000
-
-Const MAXIMUM_WAIT_OBJECTS = 64
-
 '-----------------
 ' data structs
-Type LARGE_INTEGER
-	LowPart As DWord
-	HighPart As Long
-End Type
-Type ULARGE_INTEGER
-	LowPart As DWord
-	HighPart As DWord
-End Type
-
-
-'Globally Unique Identifier 128 bit(16 byte)
-Type GUID
-	Data1 As DWord
-	Data2 As Word
-	Data3 As Word
-	Data4[7] As Byte
-End Type
+
+'variable type - System
+TypeDef HFILE = Long
+Type _System_DeclareHandle_HANDLE:unused As DWord:End Type
+TypeDef HRSRC = *_System_DeclareHandle_HANDLE
 
 ' File structure
@@ -192,9 +167,4 @@
 	OffsetHigh As DWord
 	hEvent As HANDLE
-End Type
-
-Type FILETIME
-	dwLowDateTime As DWord
-	dwHighDateTime As DWord
 End Type
 
@@ -210,181 +180,4 @@
 	wMilliseconds As Word
 End Type
-
-#ifdef _WIN64
-Const CONTEXT_AMD64 = &h100000
-
-Const CONTEXT_CONTROL = (CONTEXT_AMD64 Or &h1)
-Const CONTEXT_INTEGER = (CONTEXT_AMD64 Or &h2)
-Const CONTEXT_SEGMENTS = (CONTEXT_AMD64 Or &h4)
-Const CONTEXT_FLOATING_POINT = (CONTEXT_AMD64 Or &h8)
-Const CONTEXT_DEBUG_REGISTERS = (CONTEXT_AMD64 Or &h10)
-
-Const CONTEXT_FULL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_FLOATING_POINT)
-
-Const CONTEXT_ALL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_SEGMENTS Or CONTEXT_FLOATING_POINT Or CONTEXT_DEBUG_REGISTERS)
-
-Type Align(16) M128
-	Low As QWord
-	High As Int64
-End Type
-
-Type LEGACY_SAVE_AREA 'Winnt.h
-	ControlWord As Word
-	Reserved0 As Word
-	StatusWord As Word
-	Reserved1 As Word
-	TagWord As Word
-	Reserved2 As Word
-	ErrorOffset As DWord
-	ErrorSelector As Word
-	ErrorOpcode As Word
-	DataOffset As DWord
-	DataSelector As Word
-	Reserved3 As Word
-	FloatRegisters[ELM(8 * 10)] As Byte
-End Type
-
-Type Align(16) CONTEXT 'Winnt.h
-	'Register parameter home addresses.
-	P1Home As QWord
-	P2Home As QWord
-	P3Home As QWord
-	P4Home As QWord
-	P5Home As QWord
-	P6Home As QWord
-	'Control flags.
-	ContextFlags As DWord
-	MxCsr As DWord
-	'Segment Registers and processor flags.
-	SegCs As Word
-	SegDs As Word
-	SegEs As Word
-	SegFs As Word
-	SegGs As Word
-	SegSs As Word
-	EFlags As DWord
-	'Debug registers
-	Dr0 As QWord
-	Dr1 As QWord
-	Dr2 As QWord
-	Dr3 As QWord
-	Dr6 As QWord
-	Dr7 As QWord
-	'Integer registers.
-	Rax As QWord
-	Rcx As QWord
-	Rdx As QWord
-	Rbx As QWord
-	Rsp As QWord
-	Rbp As QWord
-	Rsi As QWord
-	Rdi As QWord
-	R8 As QWord
-	R9 As QWord
-	R10 As QWord
-	R11 As QWord
-	R12 As QWord
-	R13 As QWord
-	R14 As QWord
-	R15 As QWord
-	'Program counter.
-	Rip As QWord
-	'MMX/floating point state.
-	Header[ELM(2)] As M128
-	Legacy[ELM(8)] As M128
-	Xmm0 As M128
-	Xmm1 As M128
-	Xmm2 As M128
-	Xmm3 As M128
-	Xmm4 As M128
-	Xmm5 As M128
-	Xmm6 As M128
-	Xmm7 As M128
-	Xmm8 As M128
-	Xmm9 As M128
-	Xmm10 As M128
-	Xmm11 As M128
-	Xmm12 As M128
-	Xmm13 As M128
-	Xmm14 As M128
-	Xmm15 As M128
-	Reserve[ELM(96)] As Byte
-	'Vector registers
-	VectorRegisters[ELM(26)] As M128
-	VectorControl As QWord
-	'Special debug control registers.
-	DebugControl As QWord
-	LastBranchToRip As QWord
-	LastBranchFromRip As QWord
-	LastExceptionToRip As QWord
-	LastExceptionFromRip As QWord
-End Type
-
-#else
-
-Const SIZE_OF_80387_REGISTERS = 80
-Const MAXIMUM_SUPPORTED_EXTENSION = 512
-
-Type FLOATING_SAVE_AREA
-	ControlWord As DWord
-	StatusWord As DWord
-	TagWord As DWord
-	ErrorOffset As DWord
-	ErrorSelector As DWord
-	DataOffset As DWord
-	DataSelector As DWord
-	RegisterArea[ELM(SIZE_OF_80387_REGISTERS)] As Byte
-	Cr0NpxState As DWord
-End Type
-
-Const CONTEXT_i386 = &h00010000
-Const CONTEXT_i486 = &h00010000
-
-Const CONTEXT_CONTROL = (CONTEXT_i386 Or &h00000001) 'SS:SP, CS:IP, FLAGS, BP
-Const CONTEXT_INTEGER = (CONTEXT_i386 Or &h00000002) 'AX, BX, CX, DX, SI, DI
-Const CONTEXT_SEGMENTS = (CONTEXT_i386 Or &h00000004) 'DS, ES, FS, GS
-Const CONTEXT_FLOATING_POINT = (CONTEXT_i386 Or &h00000008) '387 state
-Const CONTEXT_DEBUG_REGISTERS = (CONTEXT_i386 Or &h00000010) 'DB 0-3,6,7
-Const CONTEXT_EXTENDED_REGISTERS = (CONTEXT_i386 Or &h0000002) 'cpu specific extensions
-
-Const CONTEXT_FULL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_SEGMENTS)
-
-Const CONTEXT_ALL = (CONTEXT_CONTROL Or CONTEXT_INTEGER Or CONTEXT_SEGMENTS Or CONTEXT_FLOATING_POINT Or CONTEXT_DEBUG_REGISTERS Or CONTEXT_EXTENDED_REGISTERS)
-
-Type CONTEXT
-	ContextFlags As DWord
-
-	Dr0 As DWord
-	Dr1 As DWord
-	Dr2 As DWord
-	Dr3 As DWord
-	Dr6 As DWord
-	Dr7 As DWord
-
-	FloatSave As FLOATING_SAVE_AREA
-
-	SegGs As DWord
-	SegFs As DWord
-	SegEs As DWord
-	SegDs As DWord
-
-	Edi As DWord
-	Esi As DWord
-	Ebx As DWord
-	Edx As DWord
-	Ecx As DWord
-	Eax As DWord
-
-	Ebp As DWord
-	Eip As DWord
-	SegCs As DWord
-	EFlags As DWord
-	Esp As DWord
-	SegSs As DWord
-
-	ExtendedRegisters[ELM(MAXIMUM_SUPPORTED_EXTENSION)] As Byte
-End Type
-
-#endif
 
 ' Global Memory Flags
@@ -404,21 +197,6 @@
 Const GMEM_DISCARDED =      &H4000
 
-
-' Heap
-Const HEAP_NO_SERIALIZE =             &H00000001
-Const HEAP_GROWABLE =                 &H00000002
-Const HEAP_GENERATE_EXCEPTIONS =      &H00000004
-Const HEAP_ZERO_MEMORY =              &H00000008
-Const HEAP_REALLOC_IN_PLACE_ONLY =    &H00000010
-
-
-' Locale
-Const LOCALE_SYSTEM_DEFAULT = &H400 'Standard Systemsprache
-Const LOCALE_USER_DEFAULT =   &H800 'Standard Benutzersprache
-
-
 ' Locale flag
 Const LOCALE_NOUSEROVERRIDE = &H80000000
-
 
 'Critical Section
@@ -432,28 +210,6 @@
 End Type
 
-
-'DllMain
-Const DLL_PROCESS_ATTACH = 1
-Const DLL_THREAD_ATTACH =  2
-Const DLL_THREAD_DETACH =  3
-Const DLL_PROCESS_DETACH = 0
-
-'Event
-Const EVENT_MODIFY_STATE = &H0002
-Const EVENT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
-
 'Mutex
-Const MUTANT_QUERY_STATE = &H0001
-Const MUTANT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or MUTANT_QUERY_STATE)
 Const MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS
-
-'Semaphore
-Const SEMAPHORE_MODIFY_STATE = &H0002
-Const SEMAPHORE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
-
-'Timer
-Const TIMER_QUERY_STATE = &H0001
-Const TIMER_MODIFY_STATE = &H0002
-Const TIMER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or TIMER_QUERY_STATE Or TIMER_MODIFY_STATE)
 
 '----------------------
@@ -506,9 +262,4 @@
 Declare Function CancelWaitableTimer Lib "kernel32" (hTimer As HANDLE) As BOOL
 
-Const GENERIC_READ =  &H80000000
-Const GENERIC_WRITE = &H40000000
-Const FILE_SHARE_READ =               &H00000001
-Const FILE_SHARE_WRITE =              &H00000002
-Const FILE_SHARE_DELETE =             &H00000004
 Const CREATE_NEW =        1
 Const CREATE_ALWAYS =     2
@@ -516,16 +267,4 @@
 Const OPEN_ALWAYS =       4
 Const TRUNCATE_EXISTING = 5
-Const FILE_ATTRIBUTE_READONLY =            &H00000001
-Const FILE_ATTRIBUTE_HIDDEN =              &H00000002
-Const FILE_ATTRIBUTE_SYSTEM =              &H00000004
-Const FILE_ATTRIBUTE_DIRECTORY =           &H00000010
-Const FILE_ATTRIBUTE_ARCHIVE =             &H00000020
-Const FILE_ATTRIBUTE_ENCRYPTED =           &H00000040
-Const FILE_ATTRIBUTE_NORMAL =              &H00000080
-Const FILE_ATTRIBUTE_TEMPORARY =           &H00000100
-Const FILE_ATTRIBUTE_SPARSE_FILE =         &H00000200
-Const FILE_ATTRIBUTE_REPARSE_POINT =       &H00000400
-Const FILE_ATTRIBUTE_COMPRESSED =          &H00000800
-Const FILE_ATTRIBUTE_OFFLINE =             &H00001000
 Const FILE_FLAG_WRITE_THROUGH =       &H80000000
 Const FILE_FLAG_OVERLAPPED =          &H40000000
@@ -540,11 +279,4 @@
 Declare Function CreateFile Lib "kernel32" Alias _FuncName_CreateFile (pFileName As PCTSTR, dwDesiredAccess As DWord, dwShareMode As DWord, ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, dwCreationDisposition As DWord, dwFlagsAndAttributes As DWord, hTemplateFile As HANDLE) As HANDLE
 
-Const SECTION_QUERY = &H0001
-Const SECTION_MAP_WRITE = &H0002
-Const SECTION_MAP_READ = &H0004
-Const SECTION_MAP_EXECUTE = &H0008
-Const SECTION_EXTEND_SIZE = &H0010
-Const SECTION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SECTION_QUERY Or SECTION_MAP_WRITE Or SECTION_MAP_READ Or SECTION_MAP_EXECUTE Or SECTION_EXTEND_SIZE)
-
 Const FILE_MAP_COPY   = SECTION_QUERY
 Const FILE_MAP_WRITE   = SECTION_MAP_WRITE
@@ -557,6 +289,4 @@
 Declare Function FlushViewOfFile Lib "kernel32" (lpBaseAddress As VoidPtr, dwNumberOfBytesToFlush As DWord) As BOOL
 Declare Function UnmapViewOfFile Lib "kernel32" (lpBaseAddress As VoidPtr) As BOOL
-
-Const MAILSLOT_WAIT_FOREVER = &HFFFFFFFF
 Declare Function CreateMailslot Lib "kernel32" Alias _FuncName_CreateMailslot (pName As PCTSTR, nMaxMessageSize As DWord, lReadTimeout As DWord, pSecurityAttributes As *SECURITY_ATTRIBUTES) As HANDLE
 
@@ -662,9 +392,5 @@
 Declare Function DisableThreadLibraryCalls Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
 Declare Function DosDateTimeToFileTime Lib "kernel32" (wFatDate As Word, wFatTime As Word, ByRef FileTime As FILETIME) As BOOL
-
-Const DUPLICATE_CLOSE_SOURCE = 1
-Const DUPLICATE_SAME_ACCESS  = 2
 Declare Function DuplicateHandle Lib "kernel32" (hSourceProcessHandle As HANDLE, hSourceHandle As HANDLE, hTargetProcessHandle As HANDLE, ByRef TargetHandle As HANDLE, dwDesiredAccess As DWord, bInheritHandle As BOOL, dwOptions As DWord) As BOOL
-
 Declare Sub EnterCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
 Declare Sub ExitProcess Lib "kernel32" (dwExitCode As DWord)
@@ -869,9 +595,5 @@
 Declare Function GetTempPath Lib "kernel32" Alias _FuncName_GetTempPath (nBufferLength As DWord, lpBuffer As PTSTR) As DWord
 Declare Function GetThreadContext Lib "kernel32" (hThread As HANDLE, ByRef Context As CONTEXT) As BOOL
-
-Const THREAD_BASE_PRIORITY_LOWRT =  15
-Const THREAD_BASE_PRIORITY_MAX =    2
-Const THREAD_BASE_PRIORITY_MIN =   -2
-Const THREAD_BASE_PRIORITY_IDLE =  -15
+/*
 Const THREAD_PRIORITY_LOWEST =        THREAD_BASE_PRIORITY_MIN
 Const THREAD_PRIORITY_BELOW_NORMAL =  THREAD_PRIORITY_LOWEST+1
@@ -882,4 +604,5 @@
 Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
 Const THREAD_PRIORITY_IDLE =          THREAD_BASE_PRIORITY_IDLE
+*/
 Declare Function GetThreadPriority Lib "kernel32" (hThread As HANDLE) As Long
 Declare Function GetThreadPriorityBoost Lib "kernel32" (
@@ -895,32 +618,5 @@
 Declare Function GetUserDefaultLCID Lib "kernel32" () As LCID
 Declare Function GetUserName Lib "advapi32" Alias _FuncName_GetUserName (pBuffer As PTSTR, ByRef nSize As DWord) As BOOL
-
-Const VER_PLATFORM_WIN32s        = 0
-Const VER_PLATFORM_WIN32_WINDOWS = 1
-Const VER_PLATFORM_WIN32_NT      = 2
-Const VER_PLATFORM_WIN32_CE      = 3
-Type OSVERSIONINFOW
-	dwOSVersionInfoSize As DWord
-	dwMajorVersion As DWord
-	dwMinorVersion As DWord
-	dwBuildNumber As DWord
-	dwPlatformId As DWord
-	szCSDVersion[ELM(128)] As WCHAR
-End Type
-Type OSVERSIONINFOA
-	dwOSVersionInfoSize As DWord
-	dwMajorVersion As DWord
-	dwMinorVersion As DWord
-	dwBuildNumber As DWord
-	dwPlatformId As DWord
-	szCSDVersion[ELM(128)] As SByte
-End Type
-#ifdef UNICODE
-TypeDef OSVERSIONINFO = OSVERSIONINFOW
-#else
-TypeDef OSVERSIONINFO = OSVERSIONINFOA
-#endif
 Declare Function GetVersionEx Lib "kernel32" Alias _FuncName_GetVersionEx (ByRef VersionInformation As OSVERSIONINFO) As BOOL
-
 Declare Function GetWindowsDirectory Lib "kernel32" Alias _FuncName_GetWindowsDirectory (pBuffer As PTSTR, uSize As DWord) As DWord
 Declare Function GlobalAlloc Lib "kernel32" (uFlags As DWord, dwBytes As SIZE_T) As HGLOBAL
@@ -1022,23 +718,8 @@
 
 Declare Function MultiByteToWideChar Lib "kernel32" (CodePage As DWord, dwFlags As DWord, pMultiByteStr As PCSTR, cchMultiByte As Long, pWideCharStr As PWSTR, cchWideChar As Long) As Long
-
 Declare Function OpenEvent Lib "kernel32" Alias _FuncName_OpenEvent (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
 Declare Function OpenMutex Lib "kernel32" Alias _FuncName_OpenMutex (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
 Declare Function OpenSemaphore Lib "kernel32" Alias _FuncName_OpenSemaphore (dwDesiredAccess As DWord, bInheritHandle As BOOL, lpName As LPCTSTR) As HANDLE
-
-Const PROCESS_TERMINATE =         &H0001
-Const PROCESS_CREATE_THREAD =     &H0002
-Const PROCESS_SET_SESSIONID =     &H0004
-Const PROCESS_VM_OPERATION =      &H0008
-Const PROCESS_VM_READ =           &H0010
-Const PROCESS_VM_WRITE =          &H0020
-Const PROCESS_DUP_HANDLE =        &H0040
-Const PROCESS_CREATE_PROCESS =    &H0080
-Const PROCESS_SET_QUOTA =         &H0100
-Const PROCESS_SET_INFORMATION =   &H0200
-Const PROCESS_QUERY_INFORMATION = &H0400
-Const PROCESS_ALL_ACCESS =        STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or &HFFF
 Declare Function OpenProcess Lib "kernel32" (dwDesiredAccess As DWord, bInheritHandle As Long, dwProcessId As DWord) As HANDLE
-
 Declare Sub OutputDebugStringA Lib "kernel32" (pOutputString As PCSTR)
 Declare Sub OutputDebugStringW Lib "kernel32" (pOutputString As PCWSTR)
@@ -1092,20 +773,4 @@
 ) As BOOL
 
-Const EXCEPTION_MAXIMUM_PARAMETERS = 15
-
-Type EXCEPTION_RECORD
-	ExceptionCode As DWord
-	ExceptionFlags As DWord
-	ExceptionRecord As *EXCEPTION_RECORD
-	ExceptionAddress As VoidPtr
-	NumberParameters As DWord
-	ExceptionInformation[ELM(EXCEPTION_MAXIMUM_PARAMETERS)] As ULONG_PTR
-End Type
-
-Type EXCEPTION_POINTERS
-	ExceptionRecord As *EXCEPTION_RECORD
-	ContextRecord As *CONTEXT
-End Type
-
 TypeDef PTOP_LEVEL_EXCEPTION_FILTER = *Function(ByRef ExceptionInfo As EXCEPTION_POINTERS) As Long
 
@@ -1126,26 +791,4 @@
 Declare Function UnlockFile Lib "kernel32" (hFile As HANDLE, dwFileOffsetLow As DWord, dwFileOffsetHigh As DWord, nNumberOfBytesToUnlockLow As DWord, nNumberOfBytesToUnlockHigh As DWord) As BOOL
 Declare Function UnhandledExceptionFilter Lib "kernel32" (ByRef ExceptionInfo As EXCEPTION_POINTERS) As Long
-
-Const PAGE_NOACCESS =          &H01
-Const PAGE_READONLY =          &H02
-Const PAGE_READWRITE =         &H04
-Const PAGE_WRITECOPY =         &H08
-Const PAGE_EXECUTE =           &H10
-Const PAGE_EXECUTE_READ =      &H20
-Const PAGE_EXECUTE_READWRITE = &H40
-Const PAGE_EXECUTE_WRITECOPY = &H80
-Const PAGE_GUARD =             &H100
-Const PAGE_NOCACHE =           &H200
-Const PAGE_WRITECOMBINE =      &H400
-Const MEM_COMMIT =    &H1000
-Const MEM_RESERVE =   &H2000
-Const MEM_DECOMMIT =  &H4000
-Const MEM_RELEASE =   &H8000
-Const MEM_FREE =      &H10000
-Const MEM_PRIVATE =   &H20000
-Const MEM_MAPPED =    &H40000
-Const MEM_RESET =     &H80000
-Const MEM_TOP_DOWN =  &H100000
-Const MEM_4MB_PAGES = &H80000000
 Declare Function VirtualAlloc Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T, flAllocationType As DWord, flProtect As DWord) As VoidPtr
 Declare Function VirtualFree Lib "kernel32" (lpAddress As VoidPtr, dwSize As SIZE_T, dwFreeType As DWord) As BOOL
@@ -1164,13 +807,4 @@
 	ByRef flOldProtect As DWord
 ) As BOOL
-Type MEMORY_BASIC_INFORMATION
-	BaseAddress As VoidPtr
-	AllocationBase As VoidPtr
-	AllocationProtect As DWord
-	RegionSize As SIZE_T
-	State As DWord
-	Protect As DWord
-	MBIType As DWord
-End Type
 Declare Function VirtualQuery Lib "kernel32" (
 	pAddress As VoidPtr,
@@ -1209,236 +843,14 @@
 Declare Sub ZeroMemory Lib "kernel32" Alias "RtlZeroMemory" (Destination As VoidPtr, dwLength As DWord)
 
-Const MAKELCID(lgid, srtid) = ((((srtid As Word) As DWord)<<16) or ((lgid As Word) As DWord))
-Const MAKELANGID(p, s)    =  (((s As Word) << 10) or (p As Word))
-Const PRIMARYLANGID(lgid) =  ((lgid As Word) and &H3ff)
-Const SUBLANGID(lgid)     =  ((lgid As Word) >> 10)
-
-
-'
-'  Primary language IDs.
-'
-
-Const LANG_NEUTRAL                     = &H00
-Const LANG_INVARIANT                   = &H7f
-
-Const LANG_AFRIKAANS                   = &H36
-Const LANG_ALBANIAN                    = &H1c
-Const LANG_ARABIC                      = &H01
-Const LANG_ARMENIAN                    = &H2b
-Const LANG_ASSAMESE                    = &H4d
-Const LANG_AZERI                       = &H2c
-Const LANG_BASQUE                      = &H2d
-Const LANG_BELARUSIAN                  = &H23
-Const LANG_BENGALI                     = &H45
-Const LANG_BULGARIAN                   = &H02
-Const LANG_CATALAN                     = &H03
-Const LANG_CHINESE                     = &H04
-Const LANG_CROATIAN                    = &H1a
-Const LANG_CZECH                       = &H05
-Const LANG_DANISH                      = &H06
-Const LANG_DIVEHI                      = &H65
-Const LANG_DUTCH                       = &H13
-Const LANG_ENGLISH                     = &H09
-Const LANG_ESTONIAN                    = &H25
-Const LANG_FAEROESE                    = &H38
-Const LANG_FARSI                       = &H29
-Const LANG_FINNISH                     = &H0b
-Const LANG_FRENCH                      = &H0c
-Const LANG_GALICIAN                    = &H56
-Const LANG_GEORGIAN                    = &H37
-Const LANG_GERMAN                      = &H07
-Const LANG_GREEK                       = &H08
-Const LANG_GUJARATI                    = &H47
-Const LANG_HEBREW                      = &H0d
-Const LANG_HINDI                       = &H39
-Const LANG_HUNGARIAN                   = &H0e
-Const LANG_ICELANDIC                   = &H0f
-Const LANG_INDONESIAN                  = &H21
-Const LANG_ITALIAN                     = &H10
-Const LANG_JAPANESE                    = &H11
-Const LANG_KANNADA                     = &H4b
-Const LANG_KASHMIRI                    = &H60
-Const LANG_KAZAK                       = &H3f
-Const LANG_KONKANI                     = &H57
-Const LANG_KOREAN                      = &H12
-Const LANG_KYRGYZ                      = &H40
-Const LANG_LATVIAN                     = &H26
-Const LANG_LITHUANIAN                  = &H27
-Const LANG_MACEDONIAN                  = &H2f   ' the Former Yugoslav Republic of Macedonia
-Const LANG_MALAY                       = &H3e
-Const LANG_MALAYALAM                   = &H4c
-Const LANG_MANIPURI                    = &H58
-Const LANG_MARATHI                     = &H4e
-Const LANG_MONGOLIAN                   = &H50
-Const LANG_NEPALI                      = &H61
-Const LANG_NORWEGIAN                   = &H14
-Const LANG_ORIYA                       = &H48
-Const LANG_POLISH                      = &H15
-Const LANG_PORTUGUESE                  = &H16
-Const LANG_PUNJABI                     = &H46
-Const LANG_ROMANIAN                    = &H18
-Const LANG_RUSSIAN                     = &H19
-Const LANG_SANSKRIT                    = &H4f
-Const LANG_SERBIAN                     = &H1a
-Const LANG_SINDHI                      = &H59
-Const LANG_SLOVAK                      = &H1b
-Const LANG_SLOVENIAN                   = &H24
-Const LANG_SPANISH                     = &H0a
-Const LANG_SWAHILI                     = &H41
-Const LANG_SWEDISH                     = &H1d
-Const LANG_SYRIAC                      = &H5a
-Const LANG_TAMIL                       = &H49
-Const LANG_TATAR                       = &H44
-Const LANG_TELUGU                      = &H4a
-Const LANG_THAI                        = &H1e
-Const LANG_TURKISH                     = &H1f
-Const LANG_UKRAINIAN                   = &H22
-Const LANG_URDU                        = &H20
-Const LANG_UZBEK                       = &H43
-Const LANG_VIETNAMESE                  = &H2a
-
-'
-'  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.
-'
-
-Const SUBLANG_NEUTRAL                  = &H00    ' language neutral
-Const SUBLANG_DEFAULT                  = &H01    ' user default
-Const SUBLANG_SYS_DEFAULT              = &H02    ' system default
-
-Const SUBLANG_ARABIC_SAUDI_ARABIA      = &H01    ' Arabic (Saudi Arabia)
-Const SUBLANG_ARABIC_IRAQ              = &H02    ' Arabic (Iraq)
-Const SUBLANG_ARABIC_EGYPT             = &H03    ' Arabic (Egypt)
-Const SUBLANG_ARABIC_LIBYA             = &H04    ' Arabic (Libya)
-Const SUBLANG_ARABIC_ALGERIA           = &H05    ' Arabic (Algeria)
-Const SUBLANG_ARABIC_MOROCCO           = &H06    ' Arabic (Morocco)
-Const SUBLANG_ARABIC_TUNISIA           = &H07    ' Arabic (Tunisia)
-Const SUBLANG_ARABIC_OMAN              = &H08    ' Arabic (Oman)
-Const SUBLANG_ARABIC_YEMEN             = &H09    ' Arabic (Yemen)
-Const SUBLANG_ARABIC_SYRIA             = &H0a    ' Arabic (Syria)
-Const SUBLANG_ARABIC_JORDAN            = &H0b    ' Arabic (Jordan)
-Const SUBLANG_ARABIC_LEBANON           = &H0c    ' Arabic (Lebanon)
-Const SUBLANG_ARABIC_KUWAIT            = &H0d    ' Arabic (Kuwait)
-Const SUBLANG_ARABIC_UAE               = &H0e    ' Arabic (U.A.E)
-Const SUBLANG_ARABIC_BAHRAIN           = &H0f    ' Arabic (Bahrain)
-Const SUBLANG_ARABIC_QATAR             = &H10    ' Arabic (Qatar)
-Const SUBLANG_AZERI_LATIN              = &H01    ' Azeri (Latin)
-Const SUBLANG_AZERI_CYRILLIC           = &H02    ' Azeri (Cyrillic)
-Const SUBLANG_CHINESE_TRADITIONAL      = &H01    ' Chinese (Taiwan)
-Const SUBLANG_CHINESE_SIMPLIFIED       = &H02    ' Chinese (PR China)
-Const SUBLANG_CHINESE_HONGKONG         = &H03    ' Chinese (Hong Kong S.A.R., P.R.C.)
-Const SUBLANG_CHINESE_SINGAPORE        = &H04    ' Chinese (Singapore)
-Const SUBLANG_CHINESE_MACAU            = &H05    ' Chinese (Macau S.A.R.)
-Const SUBLANG_DUTCH                    = &H01    ' Dutch
-Const SUBLANG_DUTCH_BELGIAN            = &H02    ' Dutch (Belgian)
-Const SUBLANG_ENGLISH_US               = &H01    ' English (USA)
-Const SUBLANG_ENGLISH_UK               = &H02    ' English (UK)
-Const SUBLANG_ENGLISH_AUS              = &H03    ' English (Australian)
-Const SUBLANG_ENGLISH_CAN              = &H04    ' English (Canadian)
-Const SUBLANG_ENGLISH_NZ               = &H05    ' English (New Zealand)
-Const SUBLANG_ENGLISH_EIRE             = &H06    ' English (Irish)
-Const SUBLANG_ENGLISH_SOUTH_AFRICA     = &H07    ' English (South Africa)
-Const SUBLANG_ENGLISH_JAMAICA          = &H08    ' English (Jamaica)
-Const SUBLANG_ENGLISH_CARIBBEAN        = &H09    ' English (Caribbean)
-Const SUBLANG_ENGLISH_BELIZE           = &H0a    ' English (Belize)
-Const SUBLANG_ENGLISH_TRINIDAD         = &H0b    ' English (Trinidad)
-Const SUBLANG_ENGLISH_ZIMBABWE         = &H0c    ' English (Zimbabwe)
-Const SUBLANG_ENGLISH_PHILIPPINES      = &H0d    ' English (Philippines)
-Const SUBLANG_FRENCH                   = &H01    ' French
-Const SUBLANG_FRENCH_BELGIAN           = &H02    ' French (Belgian)
-Const SUBLANG_FRENCH_CANADIAN          = &H03    ' French (Canadian)
-Const SUBLANG_FRENCH_SWISS             = &H04    ' French (Swiss)
-Const SUBLANG_FRENCH_LUXEMBOURG        = &H05    ' French (Luxembourg)
-Const SUBLANG_FRENCH_MONACO            = &H06    ' French (Monaco)
-Const SUBLANG_GERMAN                   = &H01    ' German
-Const SUBLANG_GERMAN_SWISS             = &H02    ' German (Swiss)
-Const SUBLANG_GERMAN_AUSTRIAN          = &H03    ' German (Austrian)
-Const SUBLANG_GERMAN_LUXEMBOURG        = &H04    ' German (Luxembourg)
-Const SUBLANG_GERMAN_LIECHTENSTEIN     = &H05    ' German (Liechtenstein)
-Const SUBLANG_ITALIAN                  = &H01    ' Italian
-Const SUBLANG_ITALIAN_SWISS            = &H02    ' Italian (Swiss)
-Const SUBLANG_KASHMIRI_SASIA           = &H02    ' Kashmiri (South Asia)
-Const SUBLANG_KOREAN                   = &H01    ' Korean (Extended Wansung)
-Const SUBLANG_LITHUANIAN               = &H01    ' Lithuanian
-Const SUBLANG_MALAY_MALAYSIA           = &H01    ' Malay (Malaysia)
-Const SUBLANG_MALAY_BRUNEI_DARUSSALAM  = &H02    ' Malay (Brunei Darussalam)
-Const SUBLANG_NEPALI_INDIA             = &H02    ' Nepali (India)
-Const SUBLANG_NORWEGIAN_BOKMAL         = &H01    ' Norwegian (Bokmal)
-Const SUBLANG_NORWEGIAN_NYNORSK        = &H02    ' Norwegian (Nynorsk)
-Const SUBLANG_PORTUGUESE               = &H02    ' Portuguese
-Const SUBLANG_PORTUGUESE_BRAZILIAN     = &H01    ' Portuguese (Brazilian)
-Const SUBLANG_SERBIAN_LATIN            = &H02    ' Serbian (Latin)
-Const SUBLANG_SERBIAN_CYRILLIC         = &H03    ' Serbian (Cyrillic)
-Const SUBLANG_SPANISH                  = &H01    ' Spanish (Castilian)
-Const SUBLANG_SPANISH_MEXICAN          = &H02    ' Spanish (Mexican)
-Const SUBLANG_SPANISH_MODERN           = &H03    ' Spanish (Spain)
-Const SUBLANG_SPANISH_GUATEMALA        = &H04    ' Spanish (Guatemala)
-Const SUBLANG_SPANISH_COSTA_RICA       = &H05    ' Spanish (Costa Rica)
-Const SUBLANG_SPANISH_PANAMA           = &H06    ' Spanish (Panama)
-Const SUBLANG_SPANISH_DOMINICAN_REPUBLIC = &H07  ' Spanish (Dominican Republic)
-Const SUBLANG_SPANISH_VENEZUELA        = &H08    ' Spanish (Venezuela)
-Const SUBLANG_SPANISH_COLOMBIA         = &H09    ' Spanish (Colombia)
-Const SUBLANG_SPANISH_PERU             = &H0a    ' Spanish (Peru)
-Const SUBLANG_SPANISH_ARGENTINA        = &H0b    ' Spanish (Argentina)
-Const SUBLANG_SPANISH_ECUADOR          = &H0c    ' Spanish (Ecuador)
-Const SUBLANG_SPANISH_CHILE            = &H0d    ' Spanish (Chile)
-Const SUBLANG_SPANISH_URUGUAY          = &H0e    ' Spanish (Uruguay)
-Const SUBLANG_SPANISH_PARAGUAY         = &H0f    ' Spanish (Paraguay)
-Const SUBLANG_SPANISH_BOLIVIA          = &H10    ' Spanish (Bolivia)
-Const SUBLANG_SPANISH_EL_SALVADOR      = &H11    ' Spanish (El Salvador)
-Const SUBLANG_SPANISH_HONDURAS         = &H12    ' Spanish (Honduras)
-Const SUBLANG_SPANISH_NICARAGUA        = &H13    ' Spanish (Nicaragua)
-Const SUBLANG_SPANISH_PUERTO_RICO      = &H14    ' Spanish (Puerto Rico)
-Const SUBLANG_SWEDISH                  = &H01    ' Swedish
-Const SUBLANG_SWEDISH_FINLAND          = &H02    ' Swedish (Finland)
-Const SUBLANG_URDU_PAKISTAN            = &H01    ' Urdu (Pakistan)
-Const SUBLANG_URDU_INDIA               = &H02    ' Urdu (India)
-Const SUBLANG_UZBEK_LATIN              = &H01    ' Uzbek (Latin)
-Const SUBLANG_UZBEK_CYRILLIC           = &H02    ' Uzbek (Cyrillic)
-
-
-Const LANG_SYSTEM_DEFAULT = (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
-Const LANG_USER_DEFAULT   = (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
-
-
-'
-'  Sorting IDs.
-'
-
-Const SORT_DEFAULT                = &H0     ' sorting default
-
-Const SORT_JAPANESE_XJIS          = &H0     ' Japanese XJIS order
-Const SORT_JAPANESE_UNICODE       = &H1     ' Japanese Unicode order
-
-Const SORT_CHINESE_BIG5           = &H0     ' Chinese BIG5 order
-Const SORT_CHINESE_PRCP           = &H0     ' PRC Chinese Phonetic order
-Const SORT_CHINESE_UNICODE        = &H1     ' Chinese Unicode order
-Const SORT_CHINESE_PRC            = &H2     ' PRC Chinese Stroke Count order
-Const SORT_CHINESE_BOPOMOFO       = &H3     ' Traditional Chinese Bopomofo order
-
-Const SORT_KOREAN_KSC             = &H0     ' Korean KSC order
-Const SORT_KOREAN_UNICODE         = &H1     ' Korean Unicode order
-
-Const SORT_GERMAN_PHONE_BOOK      = &H1     ' German Phone Book order
-
-Const SORT_HUNGARIAN_DEFAULT      = &H0     ' Hungarian Default order
-Const SORT_HUNGARIAN_TECHNICAL    = &H1     ' Hungarian Technical order
-
-Const SORT_GEORGIAN_TRADITIONAL   = &H0     ' Georgian Traditional order
-Const SORT_GEORGIAN_MODERN        = &H1     ' Georgian Modern order
-
 '
 '  Wait functions' results.
 '
 Const WAIT_FAILED = (&hFFFFFFFF As DWord)
-Const WAIT_OBJECT_0 = 0 '((STATUS_WAIT_0 ) + 0)
-
-Const WAIT_ABANDONED = &h00000080 As DWord '((STATUS_ABANDONED_WAIT_0 ) + 0)
-Const WAIT_ABANDONED_0 = WAIT_ABANDONED '((STATUS_ABANDONED_WAIT_0 ) + 0)
-
-Const WAIT_IO_COMPLETION = &h000000C0 'STATUS_USER_APC
+Const WAIT_OBJECT_0 = ((STATUS_WAIT_0 ) + 0)
+
+Const WAIT_ABANDONED = ((STATUS_ABANDONED_WAIT_0 ) + 0)
+Const WAIT_ABANDONED_0 = ((STATUS_ABANDONED_WAIT_0 ) + 0)
+
+Const WAIT_IO_COMPLETION = STATUS_USER_APC
 
 Declare Function FindResource Lib "kernel32" Alias _FuncName_FindResource (hInstance As HINSTANCE, lpName As LPCTSTR, lpType As LPCTSTR) As HRSRC
@@ -1488,22 +900,4 @@
 Declare Function WaitCommEvent Lib "kernel32" (hFile As HANDLE, ByRef EvtMask As DWord, lpOverlapped As *OVERLAPPED)  As BOOL
 
-Const ANYSIZE_ARRAY = 1
-Type LUID
-	LowPart As DWord
-	HighPart As Long
-End Type
-Type LUID_AND_ATTRIBUTES
-	Luid As LUID
-	Attributes As DWord
-End Type
-TypeDef PLUID_AND_ATTRIBUTES = *LUID_AND_ATTRIBUTES
-'TypeDef LUID_AND_ATTRIBUTES_ARRAY = LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY]
-'TypeDef PLUID_AND_ATTRIBUTES_ARRAY = *LUID_AND_ATTRIBUTES_ARRAY
-
-Type TOKEN_PRIVILEGES
-	PrivilegeCount As DWord
-	Privileges[ELM(ANYSIZE_ARRAY)] As LUID_AND_ATTRIBUTES
-End Type
-
 Declare Function OpenProcessToken Lib "advapi32" (ProcessHandle As HANDLE, DesiredAccess As DWord, ByRef TokenHandle As HANDLE) As BOOL
 Declare Function LookupPrivilegeValue Lib "advapi32" Alias _FuncName_LookupPrivilegeValue (lpSystemName As LPCTSTR, lpName As LPCTSTR, ByRef Luid As LUID) As Long
