]> git.8kb.co.uk Git - dataflex/df32func/blob - src/df32/win32.h
Add function show_window to iminimise cmd windows via Win32 ShowWindow
[dataflex/df32func] / src / df32 / win32.h
1 //-------------------------------------------------------------------------\r
2 // win32.h\r
3 //      This file contains definitions of "Win32" api functions as well as\r
4 //      their related constants and structs.  These functions are exposed as\r
5 //      dynamic link libraries provided on systems running Windows XP or greater.\r
6 //\r
7 // This file is to be included when using Win32 capabilities in df32func.mk\r
8 //\r
9 // Copyright (c) 2006-2015, glyn@8kb.co.uk\r
10 // \r
11 // df32func/win32.h\r
12 //-------------------------------------------------------------------------\r
13 \r
14 Define __win32_h__\r
15 \r
16 //-------------------------------------------------------------------------\r
17 // External functions\r
18 //-------------------------------------------------------------------------\r
19 \r
20 external_function GetDateFormat "GetDateFormatA" kernel32.dll dword LCID dword dwFlags pointer lpsSystemTime pointer lpFormat pointer lpDateStr integer cchDate returns integer\r
21 external_function GetTimeFormat "GetTimeFormatA" kernel32.dll dword LCID dword dwFlags pointer lpsSystemTime pointer lpFormat pointer lpTimeStr integer cchTime returns integer\r
22 external_function GetFileTime "GetFileTime" kernel32.dll handle hFileHandle pointer lpCreationTime pointer lpLastAccessTime pointer lpLastWriteTime returns integer\r
23 external_function FileTimeToSystemTime "FileTimeToSystemTime" kernel32.dll pointer lpFileTime Pointer lpSystemTime returns integer\r
24 external_function FileTimeToLocalFileTime "FileTimeToLocalFileTime" kernel32.dll pointer lpFileTime Pointer lpSystemTime returns integer\r
25 external_function FindFirstFile "FindFirstFileA" kernel32.dll pointer lpFileName pointer lpFindFileData returns handle\r
26 external_function FindNextFile "FindNextFileA" kernel32.dll handle hFindFile pointer lpFindFileData returns integer\r
27 external_function FindClose "FindClose" kernel32.dll handle hFindFile returns integer\r
28 external_function LockFile "LockFile" kernel32.dll handle hFile dword dwFileOffsetLow dword dwFileOffsetHigh dword nNumberOfBytesToLockLow dword nNumberOfBytesToLockHigh returns integer\r
29 external_function UnlockFile "UnlockFile" kernel32.dll handle hFile dword dwFileOffsetLow dword dwFileOffsetHigh dword nNumberOfBytesToLockLow dword nNumberOfBytesToLockHigh returns integer\r
30 external_function SHFileOperation "SHFileOperationA" shell32.dll pointer lpFileOp returns integer\r
31 external_function32 GetTempPath "GetTempPathA" kernel32.dll integer nBufferLength pointer lpBuffer_ptr returns integer\r
32 external_function GetSystemDirectory "GetSystemDirectoryA" kernel32.dll pointer lpBuffer integer uSize returns integer\r
33 external_function32 mciSendString "mciSendStringA" winmm.dll pointer lpstrCommand pointer lpstrReturnString integer uReturnLength integer hwndCallback returns integer\r
34 external_function ExitProcessEx  "ExitProcess" Kernel32.dll integer iExitCode returns integer\r
35 external_function GetComputername "GetComputerNameA" kernel32.dll pointer sBuffer pointer lSize returns integer\r
36 external_function WNetGetUser "WNetGetUserA" MPR.dll pointer lpName pointer lpUserName string  lpnLength returns DWord\r
37 external_function SHBrowseForFolder "SHBrowseForFolder" shell32.dll pointer lpsBrowseInfo returns dword\r
38 external_function SHGetPathFromIDList "SHGetPathFromIDList" shell32.dll pointer pidList pointer lpBuffer returns dWord\r
39 external_function CoTaskMemFree "CoTaskMemFree" ole32.dll pointer pV returns integer\r
40 external_function GetPID "_getpid" msvcrt.dll returns integer\r
41 external_function getShortPathName "GetShortPathNameA" kernel32.dll pointer lpszLongPath pointer lpszShortPath integer cchBuffer returns integer\r
42 external_function SetConsoleTitle "SetConsoleTitleA" Kernel32.dll string lpszTitle returns integer\r
43 external_function FindWindow "FindWindowA" user32.dll pointer lpszClassName string lpszWindowName returns handle\r
44 external_function GetSystemMenu "GetSystemMenu" user32.dll handle hwnd dword bRevert returns dword\r
45 external_function EnableMenuItem "EnableMenuItem" user32.dll handle hmenu integer uIDEnableItem integer uEnable returns integer\r
46 external_function ShowWindow "ShowWindow" user32.dll handle hWnd integer nCmdShow returns integer
47 external_function ShellExecute "ShellExecuteA" shell32.dll handle hWnd pointer lpOperation pointer lpFile pointer lpParameters pointer lpDirectory integer nShowCmd returns integer\r
48 external_function CreateProcess "CreateProcessA" kernel32.dll pointer lpAN pointer lpCL pointer lpPA pointer lpTA integer bIH dword dwCF pointer lpE pointer lpCD pointer lpSI pointer lpPi returns integer\r
49 external_function OpenProcess "OpenProcess" kernel32.dll dword dwDesiredAccessas integer bInheritHandle dword dwProcId returns handle\r
50 external_function TerminateProcess "TerminateProcess" kernel32.dll handle hProcess integer uExitCode returns integer\r
51 external_function CloseHandle "CloseHandle" kernel32.dll handle hObject returns integer\r
52 external_function WaitForSingleObject "WaitForSingleObject" kernel32.dll handle hHandle dword dwMilliseconds returns integer\r
53 external_function32 Message_Beep "MessageBeep" user32.dll integer iSound returns integer\r
54 external_function32 ExitWindowsEx "ExitWindowsEx" user32.dll integer uFlags integer dwReserved returns integer\r
55 external_function lOpen "_lopen" kernel32.dll string lpPathName integer iReadWrite returns integer\r
56 external_function lClose "_lclose" kernel32.dll handle hFile returns integer\r
57 external_function GetLastError "GetLastError" kernel32.dll returns integer\r
58 external_function CreateFile "CreateFileA" kernel32.dll pointer lpFNname dword dwDAccess dword dwSMode pointer lpSecAttrib dword dwCreationDisp dword dwFlagsAndAttrib handle hTemplateFile returns handle\r
59 external_function GetFileSize "GetFileSize" kernel32.dll handle hFile pointer lpFileSizeHigh returns integer\r
60 external_function SetFilePointer "SetFilePointer" kernel32.dll handle hFile dword lDistanceToMove pointer lpDistanceToMoveHigh dword dwMoveMethod returns handle\r
61 external_function ReadFile "ReadFile" kernel32.dll handle hFile pointer lpBuffer integer nNumberOfBytesToRead pointer lpNumberOfBytesRead pointer lpOverlapped returns integer\r
62 external_function CopyMemory "RtlMoveMemory" kernel32.dll pointer pDst pointer pSrc integer byteLen returns integer\r
63 external_function EnumProcesses "EnumProcesses" psapi.dll pointer lpidProcess integer cb pointer cbNeeded returns integer\r
64 external_function EnumProcessModules "EnumProcessModules" psapi.dll  handle hProcess pointer lphModule integer cb integer cbNeeded returns integer\r
65 external_function WideCharToMultiByte "WideCharToMultiByte" kernel32.dll integer cp dword dwF pointer lpWCS integer cchWC pointer lpMBS integer cchMB string dC string uDC returns integer\r
66 external_function CharToOem "CharToOemA" user32.dll pointer lpszSrc pointer lpszDst returns integer\r
67 external_function OemToChar "OemToCharA" user32.dll pointer lpszSrc pointer lpszDst returns integer\r
68 external_function GetSystemTime "GetSystemTime" kernel32.dll Pointer lpGST returns VOID_TYPE\r
69 external_function GetTickCount "GetTickCount" kernel32.dll returns dWord\r
70 external_function32 CoCreateGuid "CoCreateGuid" ole32.dll pointer pGUIDStructure returns word\r
71 external_function32 StringFromGUID2 "StringFromGUID2" ole32.dll pointer pGUIDStructure pointer lpstrClsId integer cbMax returns dword\r
72 external_function MsiQueryProductState "MsiQueryProductStateA" msi.dll string szProduct returns integer\r
73 external_function MilliSleep "Sleep" kernel32.dll integer dwMilliseconds returns integer\r
74 external_function SetLastError "SetLastError" kernel32.dll dword dwErrCode returns integer\r
75 external_function FormatMessage "FormatMessageA" kernel32.dll integer dwFlags pointer lpSource dword dwMessageId dword dwLanguageId pointer lpBuffer integer nSize dword Arguments returns integer\r
76 external_function GetProcessMemoryInfo "GetProcessMemoryInfo" PSAPI.DLL dword l_hProcess pointer ppsmemCounters dword cb returns integer\r
77 external_function MultiByteToWideChar "MultiByteToWideChar" kernel32.dll integer cp dword dwF pointer lpWCS integer cchWC pointer lpMBS integer cchMB string dC string uDC returns integer\r
78 external_function GetDiskFreeSpace "GetDiskFreeSpaceA" kernel32.dll string lpRootPathName pointer lpSectorsPC pointer lpBytesPS pointer lpNumberOfFreeClusters pointer lpTotalNOC returns integer\r
79 external_function InternetCanonicalizeUrl "InternetCanonicalizeUrlA" wininet.dll pointer lpszUrl pointer lpszBuffer pointer lpdwBufferLength dword dwFlags returns integer\r
80 external_function CryptAcquireContext "CryptAcquireContextA" advapi32.dll pointer phProv string pszContainer string pszProvider dword dwProvType dword dwFlags returns integer\r
81 external_function CryptReleaseContext "CryptReleaseContext" advapi32.dll pointer phProv dword dwFlags returns integer\r
82 external_function CryptCreateHash "CryptCreateHash" advapi32.dll handle hProv dword Algid handle hKey dword dwFlags pointer phHash returns integer\r
83 external_function CryptDestroyHash "CryptDestroyHash" advapi32.dll handle hHash returns integer\r
84 external_function CryptHashData "CryptHashData" advapi32.dll handle hHash pointer pbData dword dwDataLen dword dwFlags returns integer\r
85 external_function CryptGetHashParam "CryptGetHashParam" advapi32.dll handle hHash dword dwParam pointer pbData pointer pdwDataLen dword dwFlags returns integer\r
86 external_function CryptEnumProviders "CryptEnumProvidersA" advapi32.dll dword dwIndex pointer pdwReserved dword dwFlags pointer pdwProvType pointer pcbProvName pointer pszProvName returns integer\r
87 external_function CryptBinaryToString "CryptBinaryToStringA" crypt32.dll dword pbBinary dword cbBinary dword dwFlags pointer pszString pointer pcchString returns integer\r
88 external_function CryptGetProvParam "CryptGetProvParam" advapi32.dll handle hProv dword dwParam pointer pbData pointer pdwDataLen dword dwFlags returns integer\r
89 external_function CryptContextAddRef "CryptGetProvParam" advapi32.dll handle hProv dword pdwReserved dword dwFlags returns integer\r
90 external_function CryptImportKey "CryptImportKey" advapi32.dll handle hProv pointer pbData pointer pdwDataLen dword hPubKey dword dwFlags pointer phKey returns integer\r
91 external_function CryptExportKey "CryptExportKey" advapi32.dll handle hKey handle hExpKey dword dwBlobType dword dwFlags pointer pbData pointer pdwDataLen returns integer\r
92 external_function CryptDeriveKey "CryptDeriveKey" advapi32.dll handle hProv dword Algid handle hHash dword dwFlags pointer phKey returns integer\r
93 external_function CryptDestroyKey "CryptDestroyKey" advapi32.dll handle hKey returns integer\r
94 external_function CryptEncrypt "CryptEncrypt" advapi32.dll handle hKey handle hHash dword bFinal dword dwFlags pointer pbData pointer pdwDataLen dword dwBufLen returns integer\r
95 external_function CryptDecrypt "CryptDecrypt" advapi32.dll handle hKey handle hHash dword bFinal dword dwFlags pointer pbData pointer pdwDataLen returns integer\r
96 external_function CryptSetKeyParam "CryptSetKeyParam" advapi32.dll handle hKey dword dwParam pointer pbData dword dwFlags returns integer\r
97 external_function CryptBinaryToString "CryptBinaryToStringA" crypt32.dll dword pbBinary dword cbBinary dword dwFlags pointer pszString pointer pcchString returns integer\r
98 external_function CryptStringToBinary "CryptStringToBinaryA" crypt32.dll pointer pszString dword cchString dword dwFlags pointer pbBinary pointer pcbBinary pointer pdwSkip pointer pdwFlags returns integer\r
99 external_function GetVersionEx "GetVersionExA" kernel32.dll pointer lpVersionInfo returns integer\r
100 external_function GetSystemTime "GetSystemTime" kernel32.dll pointer lpSystemTime returns integer\r
101 external_function GetTimeZoneInformation "GetTimeZoneInformation" kernel32.dll pointer lpTimeZoneInformation returns integer\r
102 \r
103 //-------------------------------------------------------------------------\r
104 // Constants\r
105 //-------------------------------------------------------------------------\r
106 \r
107 // MSI Constants\r
108 #REPLACE INSTALLSTATE_UNKNOWN               |CI$-0000001   // No action to be taken on the feature or component.\r
109 #REPLACE INSTALLSTATE_BROKEN                |CI$00000000   // The feature is broken\r
110 #REPLACE INSTALLSTATE_ADVERTISED            |CI$00000001   //  Advertised feature\r
111 #REPLACE INSTALLSTATE_ABSENT                |CI$00000002   //  The feature is not installed.\r
112 #REPLACE INSTALLSTATE_LOCAL                 |CI$00000003   //  The feature is installed locally.\r
113 #REPLACE INSTALLSTATE_DEFAULT               |CI$00000005   //  The product is to be installed with all features installed to the default states specified in the Feature table.\r
114 \r
115 // MCI Constants\r
116 #REPLACE SIMPLE_BEEP                        |CI$-0000001    // SimpleBeep = -1,\r
117 #REPLACE WINMDOWS_OK                        |CI$00000000    // A standard windows OK beep = 0x00,\r
118 #REPLACE WINDOWS_QUESTION                   |CI$00000020    // A standard windows Question beep = 0x20,\r
119 #REPLACE WINDOWS_EXCLAMATION                |CI$00000030    // A standard windows Exclamation beep = 0x30,\r
120 #REPLACE WINDOWS_ASTERISK                   |CI$00000040    // A standard windows Asterisk beep = 0x40,\r
121 \r
122 // ExitWindowsEx Constants\r
123 #REPLACE EWX_LOGOFF                         |CI$00000000    // logoff\r
124 #REPLACE EWX_SHUTDOWN                       |CI$00000001    // shutdown\r
125 #REPLACE EWX_REBOOT                         |CI$00000002    // Reboot\r
126 #REPLACE EWX_FORCE                          |CI$00000004    // Force shutdown\r
127 \r
128 // SHFileOperation Constants\r
129 #REPLACE MaxDword                           |CI$FFFFFFFF\r
130 #REPLACE FO_COPY                            |CI$00000002    //  FO_COPY              &H2     Copies a file or folder\r
131 #REPLACE FO_DELETE                          |CI$00000003    //  FO_DELETE            &H3     Deletes a file or folder\r
132 #REPLACE FO_MOVE                            |CI$00000001    //  FO_MOVE              &H1     Moves a file or folder\r
133 #REPLACE FO_RENAME                          |CI$00000004    //  FO_RENAME            &H4     Renames a file or folder\r
134 #REPLACE FOF_ALLOWUNDO                      |CI$00000040    //  FOF_ALLOWUNDO        &H40    Used with Rename. When used with Delete the files get sent to the Recycle Bin.\r
135 #REPLACE FOF_FILESONLY                      |CI$00000080    //  FOF_FILESONLY        &H80    Only allows files.\r
136 #REPLACE FOF_NOCONFIRMATION                 |CI$00000010    //  FOF_NOCONFIRMATION   &H10    Does not display the Delete or Overwrite confirmation dialog.\r
137 #REPLACE FOF_SILENT                         |CI$00000004    //  FOF_SILENT           &H4     Does not display the Windows animation while performing the opperation.\r
138 #REPLACE FOF_SIMPLEPROGRESS                 |CI$00000100    //  FOF_SIMPLEPROGRESS   &H100   Does not display filenames.\r
139 #REPLACE FOF_NOCOPYSECURITYATTRIBS          |CI$00000800    //  Do not copy NT file Security Attributes\r
140 #REPLACE FOF_NOERRORUI                      |CI$00000400    //  Do not display a dialog to the user if an error occurs.\r
141 #REPLACE FOF_NOCONFIRMMKDIR                 |CI$00000200    //  Do not ask the user to confirm the creation of a new directory if the operation requires one to be created\r
142 \r
143 // FolderBrowse Constants\r
144 #REPLACE BIF_RETURNONLYFSDIRS               |CI$00000001    // Window will only return when user selects a filesystem folder\r
145 #REPLACE BIF_DONTGOBELOWDOMAIN              |CI$00000002    // Do not include network folders below the domain level\r
146 #REPLACE BIF_STATUSTEXT                     |CI$00000004    // Sets the window label to the chosen folder\r
147 #REPLACE BIF_RETURNFSANCESTORS              |CI$00000008    // Only return file system directories.\r
148 #REPLACE BIF_EDITBOX                        |CI$00000010    // Show edit, so user can edit path\r
149 #REPLACE BIF_BROWSEFORCOMPUTER              |CI$00001000    // Only return computers\r
150 #REPLACE BIF_BROWSEFORPRINTER               |CI$00002000    // Only return printers\r
151 #REPLACE BIF_BROWSEINCLUDEFILES             |CI$00004000    // Display files as well as folders\r
152 \r
153 // GDI Window Constants\r
154 #REPLACE SC_CLOSE                           |CI$0000F060\r
155 #REPLACE MF_BYCOMMAND                       |CI1\r
156 #REPLACE MF_ENABLED                         |CI0\r
157 #REPLACE MF_GRAYED                          |CI1\r
158 \r
159 // ShellExecute Constants\r
160 #REPLACE SW_HIDE                            |CI00       // Hides the window and activates another window;\r
161 #REPLACE SW_MAXIMIZE                        |CI01       // Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.\r
162 #REPLACE SW_MINIMIZE                        |CI02       // Minimizes the specified window and activates the next top-level window in the Z order\r
163 #REPLACE SW_RESTORE                         |CI03       // Maximizes the specified window\r
164 #REPLACE SW_SHOW                            |CI04       // Displays a window in its most recent size and position. The active window remains active.\r
165 #REPLACE SW_SHOWDEFAULT                     |CI05       // Activates the window and displays it in its current size and position\r
166 #REPLACE SW_SHOWMAXIMIZED                   |CI06       // Minimizes the specified window and activates the next top-level window in the Z order\r
167 #REPLACE SW_SHOWMINIMIZED                   |CI07       // Displays the window as a minimized window. The active window remains active\r
168 #REPLACE SW_SHOWMINNOACTIVE                 |CI08       // Displays the window in its current state. The active window remains active\r
169 #REPLACE SW_SHOWNA                          |CI09       // Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.\r
170 #REPLACE SW_SHOWNOACTIVATE                  |CI10       // Displays a window in its most recent size and position. The active window remains active.\r
171 #REPLACE SW_SHOWNORMAL                      |CI11       // Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.\r
172 \r
173 // CreateProcess constants\r
174 #REPLACE SYNCHRONIZE                        |CI1048576\r
175 #REPLACE NORMAL_PRIORITY_CLASS              |CI$00000020\r
176 #REPLACE HEXNULL                            |CI$00000000\r
177 #REPLACE HEXTRUE                            |CI$00000001\r
178 #REPLACE STRINGNULL                         |CS''\r
179 #REPLACE INFINITE                           |CI$-0000001    // Wait until process terminates\r
180 \r
181 #REPLACE CREATE_NEW_CONSOLE                 |CI$00000010    // The new process has a new console, instead of inheriting the parent's console.\r
182 #REPLACE CREATE_NEW_PROCESS_GROUP           |CI$00000200    // Not supported.\r
183 #REPLACE CREATE_SEPARATE_WOW_VDM            |CI$00000800    // Not supported.\r
184 #REPLACE CREATE_SHARED_WOW_VDM              |CI$00001000    // Not supported.\r
185 #REPLACE CREATE_SUSPENDED                   |CI$00000004    // The primary thread of the new process is created in a suspended state, and does not run until the ResumeThread function is called.\r
186 #REPLACE CREATE_UNICODE_ENVIRONMENT         |CI000000400    // Not supported.\r
187 #REPLACE DEBUG_PROCESS                      |CI$00000001    // If this flag is set, the calling process is treated as a debugger, and the new process is a process being debugged. Child processes of the new process are also debugged.\r
188                                                             // The system notifies the debugger of all debug events that occur in the process being debugged.\r
189                                                             // If you create a process with this flag set, only the calling thread (the thread that called CreateProcess) can call the WaitForDebugEvent function.\r
190 #REPLACE DEBUG_ONLY_THIS_PROCESS            |CI$00000002    // If this flag is set, the calling process is treated as a debugger, and the new process is a process being debugged. No child processes of the new process are debugged.\r
191                                                             // The system notifies the debugger of all debug events that occur in the process being debugged.\r
192 #REPLACE DETACHED_PROCESS                   |CI$00000008    // Not supported.\r
193 #REPLACE INHERIT_CALLER_PRIORITY            |CI$00020000    // If this flag is set, the new process inherits the priority of the creator process.\r
194 #REPLACE REALTIME_PRIORITY_CLASS            |CI000000100\r
195 #REPLACE HIGH_PRIORITY_CLASS                |CI$00000080\r
196 #REPLACE IDLE_PRIORITY_CLASS                |CI$00000040\r
197 \r
198 // Readmode Constants\r
199 #REPLACE OF_READ                            |CI$00000000\r
200 #REPLACE OF_WRITE                           |CI$00000001\r
201 #REPLACE OF_READWRITE                       |CI$00000002\r
202 \r
203 // Attribute Constants\r
204 #REPLACE FILE_ATTRIBUTE_READONLY            |CI$00000001\r
205 #REPLACE FILE_ATTRIBUTE_HIDDEN              |CI$00000002\r
206 #REPLACE FILE_ATTRIBUTE_SYSTEM              |CI$00000004\r
207 #REPLACE FILE_ATTRIBUTE_DIRECTORY           |CI$00000010\r
208 #REPLACE FILE_ATTRIBUTE_ARCHIVE             |CI$00000020\r
209 #REPLACE FILE_ATTRIBUTE_NORMAL              |CI$00000080\r
210 #REPLACE FILE_ATTRIBUTE_TEMPORARY           |CI$00000100\r
211 #REPLACE FILE_ATTRIBUTE_ENCRYPTED           |CI$00000040  //  NT, Windows 2000 only\r
212 #REPLACE FILE_ATTRIBUTE_OFFLINE             |CI$00001000  //  Windows 2000 only\r
213 #REPLACE FILE_ATTRIBUTE_NOT_CONTENT_INDEXED |CI$00002000  //  NT, Windows 2000 only\r
214 \r
215 // Sharemode Constants\r
216 #REPLACE OF_SHARE_COMPAT                    |CI$00000000\r
217 #REPLACE OF_SHARE_EXCLUSIVE                 |CI$00000010\r
218 #REPLACE OF_SHARE_DENY_WRITE                |CI$00000020\r
219 #REPLACE OF_SHARE_DENY_READ                 |CI$00000030\r
220 #REPLACE OF_SHARE_DENY_NONE                 |CI$00000040\r
221 #REPLACE OF_PARSE                           |CI$00000100\r
222 #REPLACE OF_DELETE                          |CI$00000200\r
223 #REPLACE OF_VERIFY                          |CI$00000400\r
224 #REPLACE OF_CANCEL                          |CI$00000800\r
225 #REPLACE OF_CREATE                          |CI$00001000\r
226 #REPLACE OF_PROMPT                          |CI$00002000\r
227 #REPLACE OF_EXIST                           |CI$00004000\r
228 #REPLACE OF_REOPEN                          |CI$00008000\r
229 \r
230 // Accessmode Constants\r
231 #REPLACE FILE_SHARE_DELETE                  |CI$00000000\r
232 #REPLACE FILE_SHARE_READ                    |CI$00000001\r
233 #REPLACE FILE_SHARE_WRITE                   |CI$00000002\r
234 #REPLACE FILE_BEGIN                         |CI0\r
235 #REPLACE FILE_CURRENT                       |CI1\r
236 #REPLACE FILE_END                           |CI2\r
237 #REPLACE OPEN_EXISTING                      |CI3\r
238 #REPLACE OPEN_ALWAYS                        |CI4\r
239 #REPLACE TRUNCATE_EXISTING                  |CI5\r
240 #REPLACE GENERIC_READ                       |CI$80000000\r
241 #REPLACE GENERIC_WRITE                      |CI$40000000\r
242 \r
243 // file handle\r
244 #REPLACE INVALID_HANDLE_VALUE               |CI-00000001\r
245 \r
246 // dwFlags Constants\r
247 #REPLACE WC_NO_BEST_FIT_CHARS               |CI$00000400\r
248 #REPLACE WC_COMPOSITECHECK                  |CI$00000200\r
249 #REPLACE WC_DISCARDNS                       |CI$00000010\r
250 #REPLACE WC_SEPCHARS                        |CI$00000020\r
251 #REPLACE WC_DEFAULTCHAR                     |CI$00000040\r
252 #REPLACE WC_ERR_INVALID_CHARS               |CI$00000080 // Vista onwards only\r
253 \r
254 // Codepage Constants\r
255 #REPLACE CP_ACP                             |CI0\r
256 #REPLACE CP_OEMCP                           |CI1\r
257 #REPLACE CP_MACCP                           |CI2\r
258 #REPLACE CP_UTF7                            |CI65000\r
259 #REPLACE CP_UTF8                            |CI65001\r
260 \r
261 // Running Process Constants\r
262 #REPLACE PROCESS_QUERY_INFORMATION_X        |CI$00001024\r
263 #REPLACE PROCESS_QUERY_INFORMATION          |CI$00000400\r
264 #REPLACE PROCESS_VM_READ_X                  |CI$00000016\r
265 #REPLACE PROCESS_VM_READ                    |CI$00000010\r
266 #REPLACE STANDARD_RIGHTS_REQUIRED           |CI$FFFF0000\r
267 \r
268 \r
269 // GUID Constants\r
270 #REPLACE GUID_STRING_LENGTH                 |CI$00000050       // GUID Length\r
271 \r
272 // FormatMessage\r
273 #REPLACE FORMAT_MESSAGE_ALLOCATE_BUFFER     |CI$00000100\r
274 #REPLACE FORMAT_MESSAGE_FROM_SYSTEM         |CI$00001000\r
275 #REPLACE LANG_NEUTRAL                       |CI$00000000\r
276 #REPLACE SUBLANG_DEFAULT                    |CI$00000001\r
277 #REPLACE ERROR_BAD_USERNAME                 |CI$00002202\r
278 \r
279 // InternetCanonicalizeUrl\r
280 #REPLACE ICU_NO_ENCODE                      |CI$20000000        // Don't convert unsafe characters to escape sequence\r
281 #REPLACE ICU_DECODE                         |CI$10000000        // Convert %XX escape sequences to characters\r
282 #REPLACE ICU_NO_META                        |CI$08000000        // Don't convert .. etc. meta path sequences\r
283 #REPLACE ICU_ENCODE_SPACES_ONLY             |CI$04000000        // Encode spaces only\r
284 #REPLACE ICU_BROWSER_MODE                   |CI$02000000        // Special encode/decode rules for browser\r
285 \r
286 // advapi32 Crypt* constants\r
287 #REPLACE PROV_RSA_FULL                      |CI00000001\r
288 #REPLACE PROV_RSA_SIG                       |CI00000002\r
289 #REPLACE PROV_DSS                           |CI00000003\r
290 #REPLACE PROV_FORTEZZA                      |CI00000004\r
291 #REPLACE PROV_MS_EXCHANGE                   |CI00000005\r
292 #REPLACE PROV_SSL                           |CI00000006\r
293 #REPLACE PROV_RSA_SCHANNEL                  |CI00000012\r
294 #REPLACE PROV_DSS_DH                        |CI00000013\r
295 #REPLACE PROV_EC_ECDSA_SIG                  |CI00000014\r
296 #REPLACE PROV_EC_ECNRA_SIG                  |CI00000015\r
297 #REPLACE PROV_EC_ECDSA_FULL                 |CI00000016\r
298 #REPLACE PROV_EC_ECNRA_FULL                 |CI00000017\r
299 #REPLACE PROV_DH_SCHANNEL                   |CI00000018\r
300 #REPLACE PROV_SPYRUS_LYNKS                  |CI00000020\r
301 #REPLACE PROV_RNG                           |CI00000021\r
302 #REPLACE PROV_INTEL_SEC                     |CI00000022\r
303 #REPLACE PROV_REPLACE_OWF                   |CI00000023\r
304 #REPLACE PROV_RSA_AES                       |CI00000024\r
305 \r
306 #REPLACE CRYPT_VERIFYCONTEXT                |CI00000000         // Supposedly |CI$F0000000\r
307 #REPLACE CRYPT_NEWKEYSET                    |CI00000008\r
308 #REPLACE CRYPT_DELETEKEYSET                 |CI00000016\r
309 #REPLACE CRYPT_MACHINE_KEYSET               |CI00000032\r
310 #REPLACE CRYPT_SILENT                       |CI00000064\r
311 #REPLACE CRYPT_EXPORTABLE                   |CI00000001\r
312 #REPLACE CRYPT_USER_PROTECTED               |CI00000002\r
313 #REPLACE CRYPT_CREATE_SALT                  |CI00000004\r
314 #REPLACE CRYPT_UPDATE_KEY                   |CI00000008\r
315 \r
316 #REPLACE CALG_3DES                          |CI$00006603    // Triple DES encryption algorithm.\r
317 #REPLACE CALG_3DES_112                      |CI$00006609    // Two-key triple DES encryption with effective key length equal to 112 bits.\r
318 #REPLACE CALG_AES                           |CI$00006611    // Advanced Encryption Standard (AES). This algorithm is supported by the Microsoft AES Cryptographic Provider.\r
319 #REPLACE CALG_AES_128                       |CI$0000660E    // 128 bit AES. This algorithm is supported by the Microsoft AES Cryptographic Provider.\r
320 #REPLACE CALG_AES_192                       |CI$0000660F    // 192 bit AES. This algorithm is supported by the Microsoft AES Cryptographic Provider.\r
321 #REPLACE CALG_AES_256                       |CI$00006610    // 256 bit AES. This algorithm is supported by the Microsoft AES Cryptographic Provider.\r
322 #REPLACE CALG_AGREEDKEY_ANY                 |CI$0000AA03    // Temporary algorithm identifier for handles of Diffie-Hellman-agreed keys.\r
323 #REPLACE CALG_CYLINK_MEK                    |CI$0000660C    // An algorithm to create a 40-bit DES key that has parity bits and zeroed key bits to make its key length 64 bits. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
324 #REPLACE CALG_DES                           |CI$00006601    // DES encryption algorithm.\r
325 #REPLACE CALG_DESX                          |CI$00006604    // DESX encryption algorithm.\r
326 #REPLACE CALG_DH_EPHEM                      |CI$0000AA02    // Diffie-Hellman ephemeral key exchange algorithm.\r
327 #REPLACE CALG_DH_SF                         |CI$0000AA01    // Diffie-Hellman store and forward key exchange algorithm.\r
328 #REPLACE CALG_DSS_SIGN                      |CI$00002200    // DSA public key signature algorithm.\r
329 #REPLACE CALG_ECDH                          |CI$0000AA05    // Elliptic curve Diffie-Hellman key exchange algorithm.\r
330 #REPLACE CALG_ECDSA                         |CI$00002203    // Elliptic curve digital signature algorithm.\r
331 #REPLACE CALG_ECMQV                         |CI$0000A001    // Elliptic curve Menezes, Qu, and Vanstone (MQV) key exchange algorithm. This algorithm is not supported.\r
332 #REPLACE CALG_HASH_REPLACE_OWF              |CI$0000800B    // One way function hashing algorithm.\r
333 #REPLACE CALG_HUGHES_MD5                    |CI$0000A003    // Hughes MD5 hashing algorithm.\r
334 #REPLACE CALG_HMAC                          |CI$00008009    // HMAC keyed hash algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
335 #REPLACE CALG_KEA_KEYX                      |CI$0000AA04    // KEA key exchange algorithm (FORTEZZA). This algorithm is not supported.\r
336 #REPLACE CALG_MAC                           |CI$00008005    // MAC keyed hash algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
337 #REPLACE CALG_MD2                           |CI$00008001    // MD2 hashing algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
338 #REPLACE CALG_MD4                           |CI$00008002    // MD4 hashing algorithm.\r
339 #REPLACE CALG_MD5                           |CI$00008003    // MD5 hashing algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
340 #REPLACE CALG_NO_SIGN                       |CI$00002000    // No signature algorithm.\r
341 #REPLACE CALG_OID_INFO_CNG_ONLY             |CI$FFFFFFFF    // The algorithm is only implemented in CNG. The macro, IS_SPECIAL_OID_INFO_ALGID, can be used to determine whether a cryptography algorithm is only supported by using the CNG functions.\r
342 #REPLACE CALG_OID_INFO_PARAMETERS           |CI$FFFFFFFE    // The algorithm is defined in the encoded parameters. The algorithm is only supported by using CNG. The macro, IS_SPECIAL_OID_INFO_ALGID, can be used to determine whether a cryptography algorithm is only supported by using the CNG functions.\r
343 #REPLACE CALG_PCT1_MASTER                   |CI$00004C04    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
344 #REPLACE CALG_RC2                           |CI$00006602    // RC2 block encryption algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
345 #REPLACE CALG_RC4                           |CI$00006801    // RC4 stream encryption algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
346 #REPLACE CALG_RC5                           |CI$0000660D    // RC5 block encryption algorithm.\r
347 #REPLACE CALG_RSA_KEYX                      |CI$0000A400    // RSA public key exchange algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
348 #REPLACE CALG_RSA_SIGN                      |CI$00002400    // RSA public key signature algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
349 #REPLACE CALG_SCHANNEL_ENC_KEY              |CI$00004C07    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
350 #REPLACE CALG_SCHANNEL_MAC_KEY              |CI$00004C03    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
351 #REPLACE CALG_SCHANNEL_MASTER_HASH          |CI$00004C02    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
352 #REPLACE CALG_SEAL                          |CI$00006802    // SEAL encryption algorithm. This algorithm is not supported.\r
353 #REPLACE CALG_SHA                           |CI$00008004    // SHA hashing algorithm. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
354 #REPLACE CALG_SHA1                          |CI$00008004    // Same as CALG_SHA. This algorithm is supported by the Microsoft Base Cryptographic Provider.\r
355 #REPLACE CALG_SHA_256                       |CI$0000800C    // 256 bit SHA hashing algorithm. This algorithm is supported by Microsoft Enhanced RSA and AES Cryptographic Provider..\r
356 #REPLACE CALG_SHA_384                       |CI$0000800D    // 384 bit SHA hashing algorithm. This algorithm is supported by Microsoft Enhanced RSA and AES Cryptographic Provider.\r
357 #REPLACE CALG_SHA_512                       |CI$0000800E    // 512 bit SHA hashing algorithm. This algorithm is supported by Microsoft Enhanced RSA and AES Cryptographic Provider.\r
358 #REPLACE CALG_SKIPJACK                      |CI$0000660A    // Skipjack block encryption algorithm (FORTEZZA). This algorithm is not supported.\r
359 #REPLACE CALG_SSL2_MASTER                   |CI$00004C05    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
360 #REPLACE CALG_SSL3_MASTER                   |CI$00004C01    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
361 #REPLACE CALG_SSL3_SHAMD5                   |CI$00008008    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
362 #REPLACE CALG_TEK                           |CI$0000660B    // TEK (FORTEZZA). This algorithm is not supported.\r
363 #REPLACE CALG_TLS1_MASTER                   |CI$00004C06    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
364 #REPLACE CALG_TLS1PRF                       |CI$0000800A    // Used by the Schannel.dll operations system. This ALG_ID should not be used by applications.\r
365 \r
366 #REPLACE HP_ALGID                           |CI00000001\r
367 #REPLACE HP_HASHVAL                         |CI00000002\r
368 #REPLACE HP_HASHSIZE                        |CI00000004\r
369 \r
370 #REPLACE MS_ENH_RSA_AES_PROV_XP             "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"\r
371 #REPLACE MS_ENH_RSA_AES_PROV                "Microsoft Enhanced RSA and AES Cryptographic Provider"\r
372 #REPLACE MS_DEF_PROV                        "Microsoft Base Cryptographic Provider v1.0"\r
373 \r
374 #REPLACE PP_ADMIN_PIN                       |CI$0000001F  // Returns the administrator personal identification number (PIN) in the pbData parameter as a LPSTR.\r
375 #REPLACE PP_CERTCHAIN                       |CI$00000009  // Returns the certificate chain associated with the hProv handle. The returned certificate chain is \r
376                                                           // X509_ASN_ENCODING encoded.\r
377 #REPLACE PP_CONTAINER                       |CI$00000006  // The name of the current key container as a null-terminated CHAR string. \r
378                                                           // This string is exactly the same as the one passed in the pszContainer \r
379                                                           // parameter of the CryptAcquireContext function to specify the key \r
380                                                           // container to use. The pszContainer parameter can be read to determine \r
381                                                           // the name of the default key container.\r
382 #REPLACE PP_ENUMALGS                        |CI$00000001  // A PROV_ENUMALGS structure that contains information about one algorithm supported by the CSP being queried.\r
383 #REPLACE PP_ENUMALGS_EX                     |CI$00000016  // A PROV_ENUMALGS_EX structure that contains information about one algorithm supported by the CSP being queried. \r
384                                                           // The structure returned contains more information about the algorithm than the structure returned for PP_ENUMALGS.\r
385 #REPLACE PP_ENUMCONTAINERS                  |CI$00000002  // The name of one of the key containers maintained by the CSP in the form of a null-terminated CHAR string. \r
386 #REPLACE PP_ENUMEX_SIGNING_PROT             |CI$00000028  // Indicates that the current CSP supports the dwProtocols member of the PROV_ENUMALGS_EX structure. \r
387                                                           // If this function succeeds, the CSP supports the dwProtocols member of the PROV_ENUMALGS_EX structure. \r
388                                                           // If this function fails with an NTE_BAD_TYPE error code, the CSP does not support the dwProtocols member.\r
389 #REPLACE PP_IMPTYPE                         |CI$00000003  // A DWORD value that indicates how the CSP is implemented. For a table of possible values, see Remarks.\r
390 #REPLACE PP_KEYEXCHANGE_PIN                 |CI$00000020  // Specifies that the key exchange PIN is contained in pbData. The PIN is represented as a null-terminated ASCII string.\r
391 #REPLACE PP_KEYSET_SEC_DESCR                |CI$00000008  // Retrieves the security descriptor for the key storage container. The pbData parameter is the address of a \r
392                                                           // SECURITY_DESCRIPTOR structure that receives the security descriptor for the key storage container. \r
393                                                           // The security descriptor is returned in self-relative format.\r
394 #REPLACE PP_NAME                            |CI$00000004  // The name of the CSP in the form of a null-terminated CHAR string. This string is identical to the one passed in \r
395                                                           // the pszProvider parameter of the CryptAcquireContext function to specify that the current CSP be used.\r
396 \r
397 // Encryption key formats\r
398 #REPLACE PUBLICKEYBLOB                      |CI$00000006\r
399 #REPLACE PRIVATEKEYBLOB                     |CI$00000007\r
400 #REPLACE PLAINTEXTKEYBLOB                   |CI$00000008\r
401 \r
402 // Key params for advapi32 cryptography dwParam\r
403 #REPLACE KP_IV                              |CI1         // Initialization vector\r
404 #REPLACE KP_SALT                            |CI2         // Salt value\r
405 #REPLACE KP_PADDING                         |CI3         // Padding values\r
406 #REPLACE KP_MODE                            |CI4         // Mode of the cipher\r
407 #REPLACE KP_MODE_BITS                       |CI5         // Number of bits to feedback\r
408 #REPLACE KP_PERMISSIONS                     |CI6         // Key permissions DWORD\r
409 #REPLACE KP_ALGID                           |CI7         // Key algorithm\r
410 #REPLACE KP_BLOCKLEN                        |CI8         // Block size of the cipher\r
411 #REPLACE KP_KEYLEN                          |CI9         // Length of key in bits\r
412 #REPLACE KP_SALT_EX                         |CI10        // Length of salt in bytes\r
413 #REPLACE KP_P                               |CI11        // DSS/Diffie-Hellman P value\r
414 #REPLACE KP_G                               |CI12        // DSS/Diffie-Hellman G value\r
415 #REPLACE KP_Q                               |CI13        // DSS Q value\r
416 #REPLACE KP_X                               |CI14        // Diffie-Hellman X value\r
417 #REPLACE KP_Y                               |CI15        // Y value\r
418 #REPLACE KP_RA                              |CI16        // Fortezza RA value\r
419 #REPLACE KP_RB                              |CI17        // Fortezza RB value\r
420 #REPLACE KP_INFO                            |CI18        // For putting information into an RSA envelope\r
421 #REPLACE KP_EFFECTIVE_KEYLEN                |CI19        // Setting and getting RC2 effective key length\r
422 #REPLACE KP_SCHANNEL_ALG                    |CI20        // for setting the Secure Channel algorithms\r
423 #REPLACE KP_CLIENT_RANDOM                   |CI21        // for setting the Secure Channel client random data\r
424 #REPLACE KP_SERVER_RANDOM                   |CI22        // for setting the Secure Channel server random data\r
425 #REPLACE KP_RP                              |CI23\r
426 #REPLACE KP_PRECOMP_MD5                     |CI24\r
427 #REPLACE KP_PRECOMP_SHA                     |CI25\r
428 #REPLACE KP_CERTIFICATE                     |CI26        // for setting Secure Channel certificate data (PCT1)\r
429 #REPLACE KP_CLEAR_KEY                       |CI27        // for setting Secure Channel clear key data (PCT1)\r
430 #REPLACE KP_PUB_EX_LEN                      |CI28\r
431 #REPLACE KP_PUB_EX_VAL                      |CI29\r
432 #REPLACE KP_KEYVAL                          |CI30\r
433 #REPLACE KP_ADMIN_PIN                       |CI31\r
434 #REPLACE KP_KEYEXCHANGE_PIN                 |CI32\r
435 #REPLACE KP_SIGNATURE_PIN                   |CI33\r
436 #REPLACE KP_PREHASH                         |CI34 \r
437 #REPLACE KP_OAEP_PARAMS                     |CI36        // for setting OAEP params on RSA keys\r
438 #REPLACE KP_CMS_KEY_INFO                    |CI37\r
439 #REPLACE KP_CMS_DH_KEY_INFO                 |CI38\r
440 #REPLACE KP_PUB_PARAMS                      |CI39        // for setting public parameters\r
441 #REPLACE KP_VERIFY_PARAMS                   |CI40        // for verifying DSA and DH parameters\r
442 #REPLACE KP_HIGHEST_VERSION                 |CI41        // for TLS protocol version setting \r
443 \r
444 // Key params for advapi32 cryptography KP_PADDING\r
445 #REPLACE PKCS5_PADDING                       |CI1         // PKCS 5 (sec 6.2) padding method\r
446 #REPLACE RANDOM_PADDING                      |CI2\r
447 #REPLACE ZERO_PADDING                        |CI3 \r
448 \r
449 // Key params for advapi32 cryptography KP_MODE\r
450 #REPLACE CRYPT_MODE_CBC                      |CI1         // Cipher block chaining\r
451 #REPLACE CRYPT_MODE_ECB                      |CI2         // Electronic code book\r
452 #REPLACE CRYPT_MODE_OFB                      |CI3         // Output feedback mode\r
453 #REPLACE CRYPT_MODE_CFB                      |CI4         // Cipher feedback mode\r
454 #REPLACE CRYPT_MODE_CTS                      |CI5         // Ciphertext stealing mode \r
455 \r
456 // Params for crypt32 hashing\r
457 #REPLACE CRYPT_STRING_BASE64                |CI$00000001\r
458 #REPLACE CRYPT_STRING_HEX                   |CI$00000004\r
459 #REPLACE CRYPT_STRING_HEXASCII              |CI$00000005\r
460 #REPLACE CRYPT_STRING_HEXADDR               |CI$0000000A\r
461 #REPLACE CRYPT_STRING_HEXASCIIADDR          |CI$0000000B\r
462 #REPLACE CRYPT_STRING_HEXRAW                |CI$0000000C\r
463 \r
464 // Used by out GetTimeZoneInformation / GetSystemTime\r
465 #REPLACE TIME_ZONE_ID_UNKNOWN               |CI$00000000\r
466 #REPLACE TIME_ZONE_ID_STANDARD              |CI$00000001\r
467 #REPLACE TIME_ZONE_ID_DAYLIGHT              |CI$00000002\r
468 #REPLACE TIME_ZONE_ID_INVALID               |CI$FFFFFFFF\r
469 \r
470 //-------------------------------------------------------------------------\r
471 // Structs\r
472 //-------------------------------------------------------------------------\r
473 \r
474 // Used by convert_date_format to convert two dword values representing file mod time into string\r
475 type _FILETIME\r
476     field FILETIME.dwLowDateTime as dword\r
477     field FILETIME.dwHighDateTime as dword\r
478 end_type\r
479 \r
480 // Used by convert_date_format to convert two dword values representing system time into string\r
481 type _SYSTEMTIME\r
482     field SYSTEMTIME.wYear as word\r
483     field SYSTEMTIME.wMonth as word\r
484     field SYSTEMTIME.wDayOfWeek as word\r
485     field SYSTEMTIME.wDay as word\r
486     field SYSTEMTIME.wHour as word\r
487     field SYSTEMTIME.wMinute as word\r
488     field SYSTEMTIME.wSecond as word\r
489     field SYSTEMTIME.wMilliseconds as word\r
490 end_type\r
491 \r
492 type _SYSTEMTIME2\r
493     field SYSTEMTIME2.wYear as char 2\r
494     field SYSTEMTIME2.wMonth as char 2\r
495     field SYSTEMTIME2.wDayOfWeek as char 2\r
496     field SYSTEMTIME2.wDay as char 2\r
497     field SYSTEMTIME2.wHour as char 2\r
498     field SYSTEMTIME2.wMinute as char 2\r
499     field SYSTEMTIME2.wSecond as char 2\r
500     field SYSTEMTIME2.wMilliseconds as char 2\r
501 end_type\r
502 \r
503 // Used by list_directory to read data out of string returned by kernel32\r
504 type _WIN32_FIND_DATA\r
505     field WIN32_FIND_DATA.dwFileAttributes as dword\r
506     field WIN32_FIND_DATA.ftCreationLowDateTime as dword\r
507     field WIN32_FIND_DATA.ftCreationHighDateTime as dword\r
508     field WIN32_FIND_DATA.ftLastAccessLowDateTime as dword\r
509     field WIN32_FIND_DATA.ftLastAccessHighDateTime As dword\r
510     field WIN32_FIND_DATA.ftLastWriteLowDateTime as dword\r
511     field WIN32_FIND_DATA.ftLastWriteHighDateTime as dword\r
512     field WIN32_FIND_DATA.nFileSizeHigh as dword\r
513     field WIN32_FIND_DATA.nFileSizeLow as dword\r
514     field WIN32_FIND_DATA.dwReserved0 as dword\r
515     field WIN32_FIND_DATA.dwReserved1 as dword\r
516     field WIN32_FIND_DATA.cFileName as char 260\r
517     field WIN32_FIND_DATA.cAlternateFileName as char 14\r
518 end_type\r
519 // used by fileopp to pass details into SHFileOperation\r
520 type _SHFILEOPSTRUCT\r
521     field SHFileOpStruct.hWnd as dword // Handle of dialog box to display status info - think this is for vb c# etc\r
522     field SHFileOpStruct.wFunc as dword // Operation to perform\r
523     field SHFileOpStruct.pFrom as pointer // char // A string specifying one or more source file names. Multiple names must be null-separated. The list of names must be double null-terminated\r
524     field SHFileOpStruct.pTo as pointer // char // Same as pFrom except for the destination\r
525     field SHFileOpStruct.fFlags as integer // Flags that control the file operation\r
526     field SHFileOpStruct.fAnyOperationsAborted as dword // TRUE if an operation was aborted before it was completed\r
527     field SHFileOpStruct.hNameMappings as dword // Only used with certain flags\r
528     field SHFileOpStruct.lpszProgressTitle as dword // Title for a progress dialog box\r
529 end_type\r
530 \r
531 // Used by getComputerName to read computer name out into\r
532 type _SIZEGETCOMPUTERNAME\r
533     field SIZEGETCOMPUTERNAME.dwSize as dWord\r
534 end_type\r
535 \r
536 // Used by folderbrowse to send parameters to and read data out from SHBrowseFolder\r
537 type _BROWSEINFO\r
538     field BROWSEINFO.hWndOwner as handle\r
539     field BROWSEINFO.pIDLRoot as pointer\r
540     field BROWSEINFO.pszDisplayName as pointer\r
541     field BROWSEINFO.lpszTitle as pointer\r
542     field BROWSEINFO.ulFlags as dword\r
543     field BROWSEINFO.lpfnCallback as pointer\r
544     field BROWSEINFO.lParam as dword\r
545     field BROWSEINFO.iImage as dword\r
546 end_type\r
547 // Used by create_proc to read created process details out of kernel32\r
548 type _PROCESS_INFORMATION\r
549     field PROCESS_INFORMATION.hProcess as handle\r
550     field PROCESS_INFORMATION.hThread as handle\r
551     field PROCESS_INFORMATION.dwProcessId as dword\r
552     field PROCESS_INFORMATION.dwThreadId as dword\r
553 end_type\r
554 // Used by create_proc to read create process details into of kernel32\r
555 type _STARTUPINFO\r
556     field STARTUPINFO.cb as integer\r
557     field STARTUPINFO.lpReserved as pointer // to string\r
558     field STARTUPINFO.lpDesktop as pointer // to string\r
559     field STARTUPINFO.lpTitle as pointer // to string\r
560     field STARTUPINFO.dwX as dword\r
561     field STARTUPINFO.dwY as dword\r
562     field STARTUPINFO.dwXSize as dword\r
563     field STARTUPINFO.dwYSize as dword\r
564     field STARTUPINFO.dwXCountChars as dword\r
565     field STARTUPINFO.dwYCountChars as dword\r
566     field STARTUPINFO.dwFillAttribute as dword\r
567     field STARTUPINFO.dwFlags as dword\r
568     field STARTUPINFO.wShowWindow as integer\r
569     field STARTUPINFO.cbReserved2 as integer\r
570     field STARTUPINFO.lpReserved2 as pointer\r
571     field STARTUPINFO.hStdInput as handle\r
572     field STARTUPINFO.hStdOutput as handle\r
573     field STARTUPINFO.hStdError as handle\r
574 end_type\r
575 // Used to receive an array from get_procs\r
576 type _PROCESSARRAY\r
577     field PROCESSARRAY.arrayItem as dword\r
578 end_type\r
579 \r
580 // Used by ReadFile\r
581 type _STRUCTBYTESREAD\r
582     field STRUCTBYTESREAD.integer0 as dword\r
583 end_type\r
584 // Used by get_procs\r
585 type _STRUCTBYTESBACK\r
586     field STRUCTBYTESBACK.integer0 as dword\r
587 end_type\r
588 \r
589 // Used by create_guid (http:// msdn.microsoft.com/en-us/library/aa373931(VS.85).aspx)\r
590 type _GUID\r
591     field GUID.data1 as dword\r
592     field GUID.data2 as word\r
593     field GUID.data3 as word\r
594     field GUID.data4 as char 8\r
595 end_type\r
596 \r
597 type _DISKDATA1\r
598     field DISKDATA1.sectorsPerCluster as dword\r
599 end_type\r
600 type _DISKDATA2\r
601     field DISKDATA2.bytesPerSector as dword\r
602 end_type\r
603 type _DISKDATA3\r
604     field DISKDATA3.numberOfFreeClusters as dword\r
605 end_type\r
606 type _DISKDATA4\r
607     field DISKDATA4.totalNumberOfClusters as dword\r
608 end_type\r
609 \r
610 // Used by GetProcessMemoryInfo\r
611 type _PROCESS_MEMORY_COUNTERS\r
612     field PROCESS_MEMORY_COUNTERS.cb as dword               // The size of the structure, in bytes.\r
613     field PROCESS_MEMORY_COUNTERS.PageFaultCount as dword           // The number of page faults.\r
614     field PROCESS_MEMORY_COUNTERS.PeakWorkingSetSize as dword       // The peak working set size, in bytes.\r
615     field PROCESS_MEMORY_COUNTERS.WorkingSetSize as dword           // The current working set size, in bytes.\r
616     field PROCESS_MEMORY_COUNTERS.QuotaPeakPagedPoolUsage as dword      // The peak paged pool usage, in bytes.\r
617     field PROCESS_MEMORY_COUNTERS.QuotaPagedPoolUsage as dword      // The current paged pool usage, in bytes.\r
618     field PROCESS_MEMORY_COUNTERS.QuotaPeakNonPagedPoolUsage as dword   // The peak nonpaged pool usage, in bytes.\r
619     field PROCESS_MEMORY_COUNTERS.QuotaNonPagedPoolUsage as dword       // The current nonpaged pool usage, in bytes.\r
620     field PROCESS_MEMORY_COUNTERS.PagefileUsage as dword            // The current space allocated for the pagefile, in bytes. Those pages may or may not be in memory.\r
621     field PROCESS_MEMORY_COUNTERS.PeakPagefileUsage as dword        // The peak space allocated for the pagefile, in bytes.\r
622 end_type\r
623 \r
624 // Used by hashing algorithms based on advapi32\r
625 type _HCRYPTHASH\r
626     field HCRYPTHASH.value as dword\r
627 end_type\r
628 \r
629 // Used by encryption algorithms based on advapi32\r
630 type _HCRYPTKEY\r
631     field HCRYPTKEY.value as dword\r
632 end_type\r
633 \r
634 // Used by encryption algorithms to import / export keys\r
635 type _PLAINTEXTKEYBLOB \r
636     field PLAINTEXTKEYBLOB.BLOBHEADER AS char 8 //64 bit\r
637     field PLAINTEXTKEYBLOB.dwKeySize AS dword\r
638     field PLAINTEXTKEYBLOB.rgbKeyData AS char 512\r
639 end_type\r
640 \r
641 // Used by encryption algorithms to import / export keys\r
642 type _BLOBHEADER\r
643     field BLOBHEADER.bType AS byte\r
644     field BLOBHEADER.bVersion AS byte\r
645     field BLOBHEADER.Reserved AS word\r
646     field BLOBHEADER.ALG_ID AS byte //UInt\r
647 end_type\r
648 \r
649 // Used for numeric (int,dword,ptr etc) address referencing\r
650 type _DW_TYPE\r
651     field DW_TYPE.value as dword\r
652 end_type\r
653 \r
654 // Used by GetVersionEx\r
655 type _OSVERSIONINFO\r
656   field OSVERSIONINFO.dwOSVersionInfoSize as dword\r
657   field OSVERSIONINFO.dwMajorVersion as dword\r
658   field OSVERSIONINFO.dwMinorVersion as dword\r
659   field OSVERSIONINFO.dwBuildNumber as dword\r
660   field OSVERSIONINFO.dwPlatformId as dword\r
661   field OSVERSIONINFO.szCSDVersion as char 128\r
662 end_type\r
663 \r
664 // TimeZoneInfo\r
665 type _TIME_ZONE_INFORMATION\r
666     field TIME_ZONE_INFORMATION.Bias as dword // long\r
667     field TIME_ZONE_INFORMATION.StandardName as char 64 // wchar array\r
668     field TIME_ZONE_INFORMATION.StandardDate as char 16 // SYSTEMTIME (structure but not actually SYSTEMTIME)\r
669     field TIME_ZONE_INFORMATION.StandardBias as dword // long\r
670     field TIME_ZONE_INFORMATION.DaylightName as char 64 // wchar array (structure but not actually SYSTEMTIME)\r
671     field TIME_ZONE_INFORMATION.DaylightDate as char 16 // SYSTEMTIME\r
672     field TIME_ZONE_INFORMATION.DaylightBias as dword // long\r
673 end_type\r
674 \r
675 //-------------------------------------------------------------------------\r
676 // Global arrays used to store results from legacy functions\r
677 //-------------------------------------------------------------------------            \r
678 \r
679 // Global arrays for temporary use by win32 functions\r
680 object Win32API_result1 is an array             \r
681 end_object\r
682 object Win32API_result2 is an array\r
683 end_object\r
684 object Win32API_result3 is an array\r
685 end_object\r
686 object Win32API_result4 is an array\r
687 end_object\r
688 object Win32API_result5 is an array\r
689 end_object\r
690 \r
691 // Used for buffering text files via win32\r
692 object Win32API_buffer is an array\r
693 end_object\r
694 \r
695 // Used by list_directory for sorting\r
696 object Win32API_sort is an array\r
697 end_object\r
698 object Win32API_sort1 is an array\r
699 end_object\r
700 object Win32API_sort2 is an array\r
701 end_object\r
702 object Win32API_sort3 is an array\r
703 end_object\r
704 object Win32API_sort4 is an array\r
705 end_object\r
706 object Win32API_sort5 is an array\r
707 end_object\r
708 object Win32API_sort6 is an array\r
709 end_object\r
710 \r
711 //-------------------------------------------------------------------------\r
712 // Global variables\r
713 //-------------------------------------------------------------------------\r
714 integer g_sConsoleTitleIsSet\r
715 move "" to g_sConsoleTitleIsSet\r