├── .gitattributes ├── .gitignore ├── README.md └── Units ├── Win32.ACLApi.pas ├── Win32.ACLUi.pas ├── Win32.AVRT.pas ├── Win32.ActiveCf.pas ├── Win32.Adc.pas ├── Win32.AdoDef.pas ├── Win32.AudioClient.pas ├── Win32.AudioEndPoints.pas ├── Win32.AudioMediaType.pas ├── Win32.AudioPolicy.pas ├── Win32.AudioSessionTypes.pas ├── Win32.Authz.pas ├── Win32.BTHDef.pas ├── Win32.BTHIOCtl.pas ├── Win32.BTHLEDef.pas ├── Win32.BTHSDPDef.pas ├── Win32.BlueToothAPIs.pas ├── Win32.BlueToothLEAPIs.pas ├── Win32.CAPI.pas ├── Win32.ComCat.pas ├── Win32.DPAPI.pas ├── Win32.DirectXMath.pas ├── Win32.FileAPI.pas ├── Win32.IntSafe.pas ├── Win32.MMDeviceApi.pas ├── Win32.MinWinBase.pas ├── Win32.NTDef.pas ├── Win32.NTStatus.pas ├── Win32.OAIdl.pas ├── Win32.OLEDB.pas ├── Win32.ObjIdl.pas ├── Win32.ObjIdlBase.pas ├── Win32.ObjectArray.pas ├── Win32.OleIdl.pas ├── Win32.ProcessThreadsAPI.pas ├── Win32.PropIdl.pas ├── Win32.PropSys.pas ├── Win32.RPCNDR.pas ├── Win32.SDKDDKVer.inc ├── Win32.SDKDDKVer.pas ├── Win32.SHTypes.pas ├── Win32.ServProv.pas ├── Win32.ShObjIdl - Kopie.pas ├── Win32.ShObjIdl.pas ├── Win32.ShObjIdl_Core.pas ├── Win32.ShellAPI.pas ├── Win32.ShlObj.pas ├── Win32.StructuredQueryCondition.pas ├── Win32.Synchapi.pas ├── Win32.SysInfoAPI.pas ├── Win32.TCGuid.pas ├── Win32.WS2BTH.pas ├── Win32.WTypes.pas ├── Win32.WinAPI.inc ├── Win32.WinBase.pas ├── Win32.WinNT.pas ├── Win32.WinUser.pas ├── Win32.X3DAudio.pas ├── Win32.XAPO.pas ├── Win32.XAPOBase.pas ├── Win32.XAPOFx.pas ├── Win32.XAudio2.pas ├── Win32.XAudio2Fx.pas ├── Win32.Xinput.pas ├── win32.AccCtrl.pas └── win32.WTypesBase.pas /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WindowsAPI 2 | Win32 Headers for Delphi and FPC 3 | based on SDK 10.0.14393.0 4 | 5 | The files are available under Apache License, Version 2.0. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | So this license should be okay also for commerical projects. 10 | 11 | Many of the Win32 Headers outside are quit out of date. Most of them don't have Vista, Win7, Win8 or Win10 support. 12 | So the time has come for a new approach to translate the headers to pascal... 13 | 14 | Use the Win32.WinAPI.inc to define what version the headers should support at compile time. This approach tries to 15 | be as close as possible at the original MS headers. 16 | 17 | Btw, since this are ** many ** header files, help is welcome :) -------------------------------------------------------------------------------- /Units/Win32.ACLApi.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AclAPI; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | {++ BUILD Version: 0001 // Increment this if a change has global effects 21 | 22 | Copyright (c) 1993-1999: ; Microsoft Corporation 23 | 24 | Module Name: 25 | 26 | aclapi.h 27 | 28 | Abstract: 29 | 30 | Public 31 | Structure/constant definitions and typedefines for the Win32 Access 32 | Control APIs 33 | 34 | --} 35 | 36 | { Header Definition: 10.0.14393.0 } 37 | 38 | {$IFDEF FPC} 39 | {$mode delphiunicode}{$H+} 40 | {$ENDIF} 41 | 42 | {$I Win32.WinAPI.inc} 43 | 44 | interface 45 | 46 | uses 47 | Classes, SysUtils, 48 | Windows, 49 | Win32.AccCtrl; 50 | 51 | const 52 | 53 | dll_advapi = 'Advapi32.dll'; 54 | 55 | 56 | type 57 | TACCESS_MASK = DWORD; (* from WinNT.h *) 58 | PACCESS_MASK = ^TACCESS_MASK; 59 | TSECURITY_INFORMATION = DWORD; 60 | PSECURITY_INFORMATION = ^TSECURITY_INFORMATION; 61 | 62 | PSECURITY_DESCRIPTOR = pointer; 63 | 64 | {$IF (DEFINED(WINAPI_PARTITION_DESKTOP) or DEFINED(WINAPI_PARTITION_SYSTEM))} 65 | type 66 | 67 | // Progress Function: 68 | // Caller of tree operation implements this Progress function, then 69 | // passes its function pointer to tree operation. 70 | // Tree operation invokes Progress function to provide progress and error 71 | // information to the caller during the potentially long execution 72 | // of the tree operation. Tree operation provides the name of the object 73 | // last processed and the error status of the operation on that object. 74 | // Tree operation also passes the current InvokeSetting value. 75 | // Caller may change the InvokeSetting value, for example, from "Always" 76 | // to "Only On Error." 77 | 78 | 79 | FN_PROGRESS = procedure(pObjectName: LPWSTR; 80 | // name of object just processed 81 | Status: DWORD; // status of operation on object 82 | var pInvokeSetting: TPROG_INVOKE_SETTING; // Never, always, 83 | Args: Pointer; // Caller specific data 84 | SecuritySet: boolean // Whether security was set 85 | ); 86 | 87 | 88 | function SetEntriesInAclA(cCountOfExplicitEntries: ULONG; pListOfExplicitEntries: PEXPLICIT_ACCESS_A; OldAcl: PACL; out NewAcl: PACL): DWORD; 89 | stdcall; external dll_advapi; 90 | 91 | function SetEntriesInAclW(cCountOfExplicitEntries: ULONG; pListOfExplicitEntries: PEXPLICIT_ACCESS_W; OldAcl: PACL; out NewAcl: PACL): DWORD; 92 | stdcall; external dll_advapi; 93 | 94 | 95 | 96 | function GetExplicitEntriesFromAclA(pacl: PACL; out pcCountOfExplicitEntries: ULONG; out pListOfExplicitEntries: PEXPLICIT_ACCESS_A): DWORD; 97 | stdcall; external dll_advapi; 98 | 99 | 100 | function GetExplicitEntriesFromAclW(pacl: PACL; out pcCountOfExplicitEntries: ULONG; out pListOfExplicitEntries: PEXPLICIT_ACCESS_W): DWORD; 101 | stdcall; external dll_advapi; 102 | 103 | 104 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) } 105 | 106 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 107 | 108 | function GetEffectiveRightsFromAclA(pacl: PACL; const pTrustee: TTRUSTEE_A; out pAccessRights: TACCESS_MASK): DWORD; stdcall; external dll_advapi; 109 | 110 | function GetEffectiveRightsFromAclW(pacl: PACL; const pTrustee: TTRUSTEE_W; out pAccessRights: TACCESS_MASK): DWORD; stdcall; external dll_advapi; 111 | 112 | function GetAuditedPermissionsFromAclA(pacl: PACL; const pTrustee: TTRUSTEE_A; out pSuccessfulAuditedRights: TACCESS_MASK; 113 | out pFailedAuditRights: TACCESS_MASK): DWORD; stdcall; external dll_advapi; 114 | 115 | 116 | function GetAuditedPermissionsFromAclW(pacl: PACL; const pTrustee: TTRUSTEE_W; out pSuccessfulAuditedRights: TACCESS_MASK; 117 | out pFailedAuditRights: TACCESS_MASK): DWORD; stdcall; external dll_advapi; 118 | 119 | 120 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 121 | 122 | 123 | {$IF (DEFINED(WINAPI_PARTITION_DESKTOP) or DEFINED(WINAPI_PARTITION_SYSTEM))} 124 | function GetNamedSecurityInfoA(pObjectName: LPCSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 125 | out ppsidOwner: TSID; out ppsidGroup: TSID; out ppDacl: TACL; out ppSacl: TACL; out ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; 126 | stdcall; external dll_advapi; 127 | 128 | 129 | function GetNamedSecurityInfoW(pObjectName: LPCWSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 130 | out ppsidOwner: TSID; out ppsidGroup: TSID; out ppDacl: TACL; out ppSacl: TACL; out ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; 131 | stdcall; external dll_advapi; 132 | 133 | 134 | function GetSecurityInfo(handle: HANDLE; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; out ppsidOwner: PSID; 135 | out ppsidGroup: PSID; out ppDacl: TACL; out ppSacl: TACL; out ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; stdcall; external dll_advapi; 136 | 137 | 138 | function SetNamedSecurityInfoA(pObjectName: LPSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 139 | psidOwner: PSID; psidGroup: PSID; pDacl: PACL; pSacl: PACL): DWORD; stdcall; external dll_advapi; 140 | 141 | 142 | function SetNamedSecurityInfoW(pObjectName: LPWSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 143 | psidOwner: PSID; psidGroup: PSID; pDacl: PACL; pSacl: PACL): DWORD; stdcall; external dll_advapi; 144 | 145 | 146 | function SetSecurityInfo(handle: HANDLE; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; psidOwner: PSID; 147 | psidGroup: PSID; pDacl: PACL; pSacl: PACL): DWORD; stdcall; external dll_advapi; 148 | 149 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) } 150 | 151 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 152 | function GetInheritanceSourceA(pObjectName: LPSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 153 | Container: boolean; pObjectClassGuids: PGUID; GuidCount: DWORD; pAcl: PACL; pfnArray: PFN_OBJECT_MGR_FUNCTS; 154 | pGenericMapping: PGENERIC_MAPPING; out pInheritArray: PINHERITED_FROMA): DWORD; stdcall; external dll_advapi; 155 | 156 | 157 | function GetInheritanceSourceW(pObjectName: LPWSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 158 | Container: boolean; pObjectClassGuids: PGUID; GuidCount: DWORD; pAcl: PACL; pfnArray: PFN_OBJECT_MGR_FUNCTS; 159 | pGenericMapping: PGENERIC_MAPPING; out pInheritArray: PINHERITED_FROMW): DWORD; stdcall; external dll_advapi; 160 | 161 | 162 | function FreeInheritedFromArray(pInheritArray: PINHERITED_FROMW; AceCnt: USHORT; pfnArray: PFN_OBJECT_MGR_FUNCTS): DWORD; stdcall; external dll_advapi; 163 | 164 | 165 | function TreeResetNamedSecurityInfoA(pObjectName: LPSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 166 | pOwner: PSID; pGroup: PSID; pDacl: PACL; pSacl: PACL; KeepExplicit: boolean; fnProgress: FN_PROGRESS; 167 | ProgressInvokeSetting: TPROG_INVOKE_SETTING; Args: pointer): DWORD; stdcall; external dll_advapi; 168 | 169 | 170 | function TreeResetNamedSecurityInfoW(pObjectName: LPWSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 171 | pOwner: PSID; pGroup: PSID; pDacl: PACL; pSacl: PACL; KeepExplicit: boolean; fnProgress: FN_PROGRESS; 172 | ProgressInvokeSetting: TPROG_INVOKE_SETTING; Args: pointer): DWORD; stdcall; external dll_advapi; 173 | 174 | 175 | 176 | 177 | {$IF (NTDDI_VERSION >= NTDDI_VISTA)} 178 | function TreeSetNamedSecurityInfoA(pObjectName: LPSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 179 | pOwner: PSID; pGroup: PSID; pDacl: PACL; pSacl: PACL; dwAction: DWORD; fnProgress: FN_PROGRESS; ProgressInvokeSetting: TPROG_INVOKE_SETTING; 180 | Args: pointer): DWORD; stdcall; external dll_advapi; 181 | 182 | 183 | function TreeSetNamedSecurityInfoW(pObjectName: LPWSTR; ObjectType: TSE_OBJECT_TYPE; SecurityInfo: TSECURITY_INFORMATION; 184 | pOwner: PSID; pGroup: PSID; pDacl: PACL; pSacl: PACL; dwAction: DWORD; fnProgress: FN_PROGRESS; ProgressInvokeSetting: TPROG_INVOKE_SETTING; 185 | Args: pointer): DWORD; stdcall; external dll_advapi; 186 | 187 | {$ENDIF}// (NTDDI_VERSION >= NTDDI_VISTA) 188 | 189 | 190 | 191 | 192 | //---------------------------------------------------------------------------- 193 | // The following API are provided for trusted servers to use to 194 | // implement access control on their own objects. 195 | //---------------------------------------------------------------------------- 196 | 197 | 198 | 199 | function BuildSecurityDescriptorA(pOwner: PTRUSTEE_A; pGroup: PTRUSTEE_A; cCountOfAccessEntries: ULONG; 200 | pListOfAccessEntries: PEXPLICIT_ACCESS_A; cCountOfAuditEntries: ULONG; pListOfAuditEntries: PEXPLICIT_ACCESS_A; 201 | pOldSD: PSECURITY_DESCRIPTOR; out pSizeNewSD: ULONG; out pNewSD: PSECURITY_DESCRIPTOR): DWORD; stdcall; external dll_advapi; 202 | 203 | 204 | function BuildSecurityDescriptorW(pOwner: PTRUSTEE_W; pGroup: PTRUSTEE_W; cCountOfAccessEntries: ULONG; 205 | pListOfAccessEntries: PEXPLICIT_ACCESS_W; cCountOfAuditEntries: ULONG; pListOfAuditEntries: PEXPLICIT_ACCESS_W; 206 | pOldSD: PSECURITY_DESCRIPTOR; out pSizeNewSD: ULONG; out pNewSD: PSECURITY_DESCRIPTOR): DWORD; stdcall; external dll_advapi; 207 | 208 | 209 | 210 | 211 | function LookupSecurityDescriptorPartsA(out ppOwner: PTRUSTEE_A; out ppGroup: PTRUSTEE_A; out pcCountOfAccessEntries: ULONG; 212 | out ppListOfAccessEntries: PEXPLICIT_ACCESS_A; out pcCountOfAuditEntries: ULONG; out ppListOfAuditEntries: PEXPLICIT_ACCESS_A; 213 | pSD: PSECURITY_DESCRIPTOR): DWORD; stdcall; external dll_advapi; 214 | 215 | 216 | function LookupSecurityDescriptorPartsW(out ppOwner: PTRUSTEE_W; out ppGroup: PTRUSTEE_W; out pcCountOfAccessEntries: ULONG; 217 | out ppListOfAccessEntries: PEXPLICIT_ACCESS_W; out pcCountOfAuditEntries: ULONG; out ppListOfAuditEntries: PEXPLICIT_ACCESS_W; 218 | pSD: PSECURITY_DESCRIPTOR): DWORD; stdcall; external dll_advapi; 219 | 220 | 221 | 222 | //---------------------------------------------------------------------------- 223 | // The following helper API are provided for building 224 | // access control structures. 225 | //---------------------------------------------------------------------------- 226 | 227 | 228 | procedure BuildExplicitAccessWithNameA(var pExplicitAccess: TEXPLICIT_ACCESS_A; pTrusteeName: LPSTR; AccessPermissions: DWORD; 229 | AccessMode: TACCESS_MODE; Inheritance: DWORD); stdcall; external dll_advapi; 230 | 231 | procedure BuildExplicitAccessWithNameW(var pExplicitAccess: TEXPLICIT_ACCESS_W; pTrusteeName: LPWSTR; AccessPermissions: DWORD; 232 | AccessMode: TACCESS_MODE; Inheritance: DWORD); stdcall; external dll_advapi; 233 | 234 | procedure BuildImpersonateExplicitAccessWithNameA(var pExplicitAccess: TEXPLICIT_ACCESS_A; pTrusteeName: LPSTR; 235 | const pTrustee: TTRUSTEE_A; AccessPermissions: DWORD; AccessMode: TACCESS_MODE; Inheritance: DWORD); stdcall; external dll_advapi; 236 | 237 | procedure BuildImpersonateExplicitAccessWithNameW(var pExplicitAccess: TEXPLICIT_ACCESS_W; pTrusteeName: LPWSTR; 238 | const pTrustee: TTRUSTEE_W; AccessPermissions: DWORD; AccessMode: TACCESS_MODE; Inheritance: DWORD); stdcall; external dll_advapi; 239 | 240 | procedure BuildTrusteeWithNameA(var pTrustee: TTRUSTEE_A; pName: LPSTR); stdcall; external dll_advapi; 241 | 242 | procedure BuildTrusteeWithNameW(var pTrustee: TTRUSTEE_W; pName: LPWSTR); stdcall; external dll_advapi; 243 | 244 | procedure BuildImpersonateTrusteeA(var pTrustee: TTRUSTEE_A; const pImpersonateTrustee: TTRUSTEE_A); stdcall; external dll_advapi; 245 | 246 | procedure BuildImpersonateTrusteeW(var pTrustee: TTRUSTEE_W; const pImpersonateTrustee: TTRUSTEE_W); stdcall; external dll_advapi; 247 | 248 | procedure BuildTrusteeWithSidA(var pTrustee: TTRUSTEE_A; pSid: PSID); stdcall; external dll_advapi; 249 | 250 | procedure BuildTrusteeWithSidW(var pTrustee: TTRUSTEE_W; pSid: PSID); stdcall; external dll_advapi; 251 | 252 | 253 | procedure BuildTrusteeWithObjectsAndSidA(var pTrustee: TTRUSTEE_A; const pObjSid: TOBJECTS_AND_SID; const pObjectGuid: TGUID; 254 | const pInheritedObjectGuid: TGUID; pSid: PSID); stdcall; external dll_advapi; 255 | 256 | procedure BuildTrusteeWithObjectsAndSidW(var pTrustee: TTRUSTEE_W; const pObjSid: TOBJECTS_AND_SID; const pObjectGuid: TGUID; 257 | const pInheritedObjectGuid: TGUID; pSid: PSID); stdcall; 258 | external dll_advapi; 259 | 260 | procedure BuildTrusteeWithObjectsAndNameA(var pTrustee: TTRUSTEE_A; const pObjName: TOBJECTS_AND_NAME_A; ObjectType: SE_OBJECT_TYPE; 261 | ObjectTypeName: LPSTR; InheritedObjectTypeName: LPSTR; Name: LPSTR); stdcall; external dll_advapi; 262 | 263 | procedure BuildTrusteeWithObjectsAndNameW(var pTrustee: TTRUSTEE_W; const pObjName: TOBJECTS_AND_NAME_W; ObjectType: TSE_OBJECT_TYPE; 264 | ObjectTypeName: LPWSTR; InheritedObjectTypeName: LPWSTR; Name: LPWSTR); stdcall; external dll_advapi; 265 | 266 | function GetTrusteeNameA(const pTrustee: TTRUSTEE_A): LPSTR; stdcall; external dll_advapi; 267 | 268 | function GetTrusteeNameW(const pTrustee: TTRUSTEE_W): LPWSTR; stdcall; external dll_advapi; 269 | 270 | function GetTrusteeTypeA(const pTrustee: TTRUSTEE_A): TTRUSTEE_TYPE; stdcall; external dll_advapi; 271 | 272 | function GetTrusteeTypeW(const pTrustee: TTRUSTEE_W): TTRUSTEE_TYPE; stdcall; external dll_advapi; 273 | 274 | function GetTrusteeFormA(const pTrustee: TTRUSTEE_A): TTRUSTEE_FORM; stdcall; external dll_advapi; 275 | 276 | function GetTrusteeFormW(const pTrustee: TTRUSTEE_W): TTRUSTEE_FORM; stdcall; external dll_advapi; 277 | 278 | function GetMultipleTrusteeOperationA(const pTrustee: TTRUSTEE_A): TMULTIPLE_TRUSTEE_OPERATION; stdcall; external dll_advapi; 279 | 280 | function GetMultipleTrusteeOperationW(const pTrustee: TTRUSTEE_W): TMULTIPLE_TRUSTEE_OPERATION; stdcall; external dll_advapi; 281 | 282 | function GetMultipleTrusteeA(const pTrustee: TTRUSTEE_A): TTRUSTEE_A; stdcall; external dll_advapi; 283 | 284 | function GetMultipleTrusteeW(const pTrustee: TTRUSTEE_W): TTRUSTEE_W; stdcall; external dll_advapi; 285 | 286 | 287 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 288 | 289 | implementation 290 | 291 | end. 292 | -------------------------------------------------------------------------------- /Units/Win32.ACLUi.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AclUI; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | {+-------------------------------------------------------------------------- 21 | 22 | Microsoft Windows 23 | Copyright (c) Microsoft Corporation. All rights reserved. 24 | 25 | File: aclui.h 26 | 27 | Contents: Definitions and prototypes for the ACLUI.DLL 28 | 29 | ---------------------------------------------------------------------------} 30 | 31 | { Header Definition: 10.0.14393.0 } 32 | 33 | {$IFDEF FPC} 34 | {$mode delphiunicode}{$H+} 35 | {$ENDIF} 36 | 37 | {$I Win32.WinAPI.inc} 38 | 39 | interface 40 | 41 | uses 42 | Windows, Classes, SysUtils, 43 | Win32.WTypesBase, 44 | Win32.WinNT, 45 | Win32.AccCtrl,Win32.AuthZ, 46 | Win32.AclAPI, Win32.ObjIdl; 47 | 48 | const 49 | 50 | dll_aclui = 'Aclui.dll'; 51 | 52 | const 53 | IID_ISecurityInformation: TGUID = '{965FC360-16FF-11d0-91CB-00AA00BBB723}'; 54 | IID_ISecurityInformation2: TGUID = '{c3ccfdb4-6f88-11d2-a3ce-00c04fb1782a}'; 55 | IID_IEffectivePermission: TGUID = '{3853DC76-9F35-407c-88A1-D19344365FBC}'; 56 | IID_ISecurityObjectTypeInfo: TGUID = '{FC3066EB-79EF-444b-9111-D18A75EBF2FA}'; 57 | IID_ISecurityInformation3: TGUID = '{E2CDC9CC-31BD-4f8f-8C8B-B641AF516A1A}'; 58 | IID_ISecurityInformation4: TGUID = '{EA961070-CD14-4621-ACE4-F63C03E583E4}'; 59 | IID_IEffectivePermission2: TGUID = '{941FABCA-DD47-4FCA-90BB-B0E10255F20D}'; 60 | 61 | 62 | 63 | type 64 | HINSTANCE = handle; // Todo 65 | 66 | 67 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 68 | 69 | 70 | // ISecurityInformation interface 71 | 72 | // Methods: 73 | 74 | // GetObjectInformation - Allows UI to determine type of object being 75 | // edited. Also allows determining if object is a container. 76 | 77 | // GetSecurity - Allows retrieving of ACLs from the original object 78 | // NOTE: ACLUI will LocalFree the security descriptor 79 | // returned by GetSecurity. 80 | // SetSecurity - Allows setting of the ACLs on the original object 81 | 82 | // GetAccessRights - For retrieving the list of rights allowed 83 | // on this object. 84 | 85 | // MapGeneric - For mapping generic rights to standard & specific rights 86 | 87 | // GetInheritTypes - For retrieving the list of possible sub-object types 88 | // for a container. 89 | 90 | // PropertySheetCallback - A method which is called back during the various 91 | // security UI property pages so that specialized work can be 92 | // done. Similar to PropSheetPageProc. If uMsg == PSPCB_CREATE, 93 | // then any error return value other than E_NOTIMPL will abort 94 | // the creation of that page. The type of page being created or 95 | // destroyed is indicated by the uPage parameter. 96 | 97 | 98 | type 99 | TSI_OBJECT_INFO = record 100 | dwFlags: DWORD; 101 | hInstance: HINSTANCE; // resources (e.g. strings) reside here 102 | pszServerName: LPWSTR; // must be present 103 | pszObjectName: LPWSTR; // must be present 104 | pszPageTitle: LPWSTR; // only valid if SI_PAGE_TITLE is set 105 | guidObjectType: TGUID; // only valid if SI_OBJECT_GUID is set 106 | end; 107 | PSI_OBJECT_INFO = ^TSI_OBJECT_INFO; 108 | 109 | 110 | // SI_OBJECT_INFO flags 111 | const 112 | SI_EDIT_PERMS = $00000000; // always implied 113 | SI_EDIT_OWNER = $00000001; 114 | SI_EDIT_AUDITS = $00000002; 115 | SI_CONTAINER = $00000004; 116 | SI_READONLY = $00000008; 117 | SI_ADVANCED = $00000010; 118 | SI_RESET = $00000020; //equals to SI_RESET_DACLor SI_RESET_SACLor SI_RESET_OWNER 119 | SI_OWNER_READONLY = $00000040; 120 | SI_EDIT_PROPERTIES = $00000080; 121 | SI_OWNER_RECURSE = $00000100; 122 | SI_NO_ACL_PROTECT = $00000200; 123 | SI_NO_TREE_APPLY = $00000400; 124 | SI_PAGE_TITLE = $00000800; 125 | SI_SERVER_IS_DC = $00001000; 126 | SI_RESET_DACL_TREE = $00004000; 127 | SI_RESET_SACL_TREE = $00008000; 128 | SI_OBJECT_GUID = $00010000; 129 | SI_EDIT_EFFECTIVE = $00020000; 130 | SI_RESET_DACL = $00040000; 131 | SI_RESET_SACL = $00080000; 132 | SI_RESET_OWNER = $00100000; 133 | SI_NO_ADDITIONAL_PERMISSION = $00200000; 134 | {$IF (NTDDI_VERSION >= NTDDI_VISTA)} 135 | SI_VIEW_ONLY = $00400000; 136 | SI_PERMS_ELEVATION_REQUIRED = $01000000; 137 | SI_AUDITS_ELEVATION_REQUIRED = $02000000; 138 | SI_OWNER_ELEVATION_REQUIRED = $04000000; 139 | 140 | {$IF (NTDDI_VERSION >= NTDDI_WIN8)} 141 | SI_SCOPE_ELEVATION_REQUIRED = $08000000; 142 | {$endif}// NTDDI_VERSION >= NTDDI_WIN8 143 | 144 | {$endif}// (NTDDI_VERSION >= NTDDI_VISTA) 145 | SI_MAY_WRITE = $10000000; //not sure if user can write permission 146 | 147 | {$IF (NTDDI_VERSION >= NTDDI_WIN8)} 148 | SI_ENABLE_EDIT_ATTRIBUTE_CONDITION = $20000000; 149 | SI_ENABLE_CENTRAL_POLICY = $40000000; 150 | SI_DISABLE_DENY_ACE = $80000000; 151 | {$endif}// NTDDI_VERSION >= NTDDI_WIN8 152 | 153 | SI_EDIT_ALL = (SI_EDIT_PERMS or SI_EDIT_OWNER or SI_EDIT_AUDITS); 154 | 155 | 156 | type 157 | TSI_ACCESS = record 158 | pguid: PGUID; 159 | mask: ACCESS_MASK; 160 | pszName: LPCWSTR; // may be resource ID 161 | dwFlags: DWORD; 162 | end; 163 | PSI_ACCESS = ^TSI_ACCESS; 164 | 165 | // SI_ACCESS flags 166 | const 167 | SI_ACCESS_SPECIFIC = $00010000; 168 | SI_ACCESS_GENERAL = $00020000; 169 | SI_ACCESS_CONTAINER = $00040000; // general access, container-only 170 | SI_ACCESS_PROPERTY = $00080000; 171 | // ACE inheritance flags (CONTAINER_INHERIT_ACE, etc.) may also be set. 172 | // They will be used as the inheritance when an access is turned on. 173 | 174 | type 175 | TSI_INHERIT_TYPE = record 176 | pguid: PGUID; 177 | dwFlags: ULONG; 178 | pszName: LPCWSTR; // may be resource ID 179 | end; 180 | PSI_INHERIT_TYPE = ^TSI_INHERIT_TYPE; 181 | 182 | // SI_INHERIT_TYPE flags are a combination of INHERIT_ONLY_ACE, 183 | // CONTAINER_INHERIT_ACE, and OBJECT_INHERIT_ACE. 184 | 185 | // For EditSecurityEx/2, the argument actually takes a UINT 186 | // The bottom half is SI_PAGE_TYPE, so the enum value for this 187 | // should never be greater than $0000ffff 188 | TSI_PAGE_TYPE = ( 189 | SI_PAGE_PERM = 0, 190 | SI_PAGE_ADVPERM, 191 | SI_PAGE_AUDIT, 192 | SI_PAGE_OWNER, 193 | SI_PAGE_EFFECTIVE, 194 | {$IF (NTDDI_VERSION >= NTDDI_VISTA)} 195 | SI_PAGE_TAKEOWNERSHIP, 196 | {$endif}// (NTDDI_VERSION >= NTDDI_VISTA) 197 | {$IF (NTDDI_VERSION >= NTDDI_WIN8)} 198 | SI_PAGE_SHARE 199 | {$endif} 200 | ); 201 | 202 | // Page types used by the new advanced ACL UI 203 | 204 | TSI_PAGE_ACTIVATED = ( 205 | SI_SHOW_DEFAULT = 0, 206 | SI_SHOW_PERM_ACTIVATED, 207 | SI_SHOW_AUDIT_ACTIVATED, 208 | SI_SHOW_OWNER_ACTIVATED, 209 | SI_SHOW_EFFECTIVE_ACTIVATED, 210 | SI_SHOW_SHARE_ACTIVATED, 211 | SI_SHOW_CENTRAL_POLICY_ACTIVATED); 212 | 213 | function GET_PAGE_TYPE(X: uint): UINT; 214 | function GET_ACTIVATION_TYPE(Y: UINT): UINT; 215 | function COMBINE_PAGE_ACTIVATION(X, Y: UINT): UINT; 216 | 217 | const 218 | DOBJ_RES_CONT = $00000001; 219 | DOBJ_RES_ROOT = $00000002; 220 | DOBJ_VOL_NTACLS = $00000004; // NTFS or OFS 221 | DOBJ_COND_NTACLS = $00000008; // Conditional aces supported. 222 | DOBJ_RIBBON_LAUNCH = $00000010; // Invoked from explorer ribbon. 223 | 224 | 225 | // Message to PropertySheetPageCallback (in addition to 226 | // PSPCB_CREATE and PSPCB_RELEASE) 227 | PSPCB_SI_INITDIALOG = (WM_USER + 1); 228 | 229 | 230 | 231 | type 232 | ISecurityInformation = interface(IUnknown) 233 | ['{965FC360-16FF-11d0-91CB-00AA00BBB723}'] 234 | function GetObjectInformation(out pObjectInfo: TSI_OBJECT_INFO): HResult; stdcall; 235 | function GetSecurity(RequestedInformation: TSECURITY_INFORMATION; out ppSecurityDescriptor: PSECURITY_DESCRIPTOR; 236 | fDefault: boolean): HResult; stdcall; 237 | function SetSecurity(SecurityInformation: TSECURITY_INFORMATION; pSecurityDescriptor: PSECURITY_DESCRIPTOR): HResult; 238 | stdcall; 239 | function GetAccessRights(const pguidObjectType: TGUID; dwFlags: DWORD; // SI_EDIT_AUDITS, SI_EDIT_PROPERTIES 240 | out ppAccess: PSI_ACCESS; out pcAccesses: ULONG; out piDefaultAccess: ULONG): HResult; stdcall; 241 | function MapGeneric(const pguidObjectType: TGUID; pAceFlags: PUCHAR; const pMask: TACCESS_MASK): HResult; stdcall; 242 | function GetInheritTypes(out ppInheritTypes: PSI_INHERIT_TYPE; out pcInheritTypes: ULONG): HResult; stdcall; 243 | function PropertySheetPageCallback(hwnd: HWND; uMsg: UINT; uPage: TSI_PAGE_TYPE): HResult; stdcall; 244 | end; 245 | 246 | PISecurityInformation = ^ISecurityInformation; 247 | 248 | ISecurityInformation2 = interface(IUnknown) 249 | ['{c3ccfdb4-6f88-11d2-a3ce-00c04fb1782a}'] 250 | function IsDaclCanonical(pDacl: PACL): boolean; stdcall; 251 | function LookupSids(cSids: ULONG; rgpSids: PSID; out ppdo: IDataObject): HResult; stdcall; 252 | end; 253 | 254 | PISecurityInformation2 = ^ISecurityInformation2; 255 | 256 | 257 | 258 | // HGLOBAL containing SID_INFO_LIST returned by ISecurityInformation2::LookupSids 259 | const 260 | CFSTR_ACLUI_SID_INFO_LIST: WideString = 'CFSTR_ACLUI_SID_INFO_LIST'; 261 | 262 | type 263 | // Data structures corresponding to CFSTR_ACLUI_SID_INFO_LIST 264 | TSID_INFO = record 265 | pSid: PSID; 266 | pwzCommonName: PWSTR; 267 | pwzClass: PWSTR; // Used for selecting icon, e.g. "User" or "Group" 268 | pwzUPN: PWSTR; // Optional, may be NULL 269 | end; 270 | PSID_INFO = ^TSID_INFO; 271 | 272 | TSID_INFO_LIST = record 273 | cItems: ULONG; 274 | aSidInfo: array [0..ANYSIZE_ARRAY - 1] of TSID_INFO; 275 | end; 276 | PSID_INFO_LIST = ^TSID_INFO_LIST; 277 | 278 | 279 | IEffectivePermission = interface(IUnknown) 280 | ['{3853DC76-9F35-407c-88A1-D19344365FBC}'] 281 | function GetEffectivePermission(const pguidObjectType: TGUID; pUserSid: PSID; pszServerName: LPCWSTR; 282 | pSD: PSECURITY_DESCRIPTOR; out ppObjectTypeList: POBJECT_TYPE_LIST; out pcObjectTypeListLength: ULONG; 283 | out ppGrantedAccessList: PACCESS_MASK; out pcGrantedAccessListLength: ULONG): HResult; stdcall; 284 | end; 285 | 286 | PIEffectivePermission = ^IEffectivePermission; 287 | 288 | ISecurityObjectTypeInfo = interface(IUnknown) 289 | ['{FC3066EB-79EF-444b-9111-D18A75EBF2FA}'] 290 | function GetInheritSource(si: TSECURITY_INFORMATION; pACL: PACL; out ppInheritArray: PINHERITED_FROM): HResult; stdcall; 291 | end; 292 | 293 | PISecurityObjectTypeInfo = ^ISecurityObjectTypeInfo; 294 | 295 | {$IF (NTDDI_VERSION >= NTDDI_VISTA)} 296 | // Support for separation or read-only ACL viewer and elevated ACL editor 297 | 298 | ISecurityInformation3 = interface(IUnknown) 299 | ['{E2CDC9CC-31BD-4f8f-8C8B-B641AF516A1A}'] 300 | function GetFullResourceName(out ppszResourceName: LPWSTR): HResult; stdcall; 301 | function OpenElevatedEditor(hWnd: HWND; uPage: TSI_PAGE_TYPE): HResult; stdcall; 302 | end; 303 | 304 | PISecurityInformation3 = ^ISecurityInformation3; 305 | 306 | {$endif}// (NTDDI_VERSION >= NTDDI_VISTA) 307 | 308 | {$IF (NTDDI_VERSION >= NTDDI_WIN8)} 309 | TSECURITY_OBJECT = record 310 | pwszName: PWSTR; 311 | pData: PByte; 312 | cbData: DWORD; 313 | pData2: PByte; 314 | cbData2: DWORD; 315 | Id: DWORD; 316 | fWellKnown: boolean; 317 | end; 318 | PSECURITY_OBJECT = ^TSECURITY_OBJECT; 319 | 320 | const 321 | SECURITY_OBJECT_ID_OBJECT_SD = 1; 322 | SECURITY_OBJECT_ID_SHARE = 2; 323 | SECURITY_OBJECT_ID_CENTRAL_POLICY = 3; 324 | SECURITY_OBJECT_ID_CENTRAL_ACCESS_RULE = 4; 325 | 326 | type 327 | TEFFPERM_RESULT_LIST = record 328 | fEvaluated: boolean; 329 | cObjectTypeListLength: ULONG; 330 | pObjectTypeList: POBJECT_TYPE_LIST; 331 | pGrantedAccessList: PACCESS_MASK; 332 | end; 333 | PEFFPERM_RESULT_LIST = ^TEFFPERM_RESULT_LIST; 334 | 335 | 336 | ISecurityInformation4 = interface(IUnknown) 337 | ['{EA961070-CD14-4621-ACE4-F63C03E583E4}'] 338 | function GetSecondarySecurity(out pSecurityObjects: PSECURITY_OBJECT; out pSecurityObjectCount: ULONG): HResult; 339 | stdcall; 340 | end; 341 | 342 | PISecurityInformation4 = ^ISecurityInformation4; 343 | 344 | 345 | 346 | IEffectivePermission2 = interface(IUnknown) 347 | ['{941FABCA-DD47-4FCA-90BB-B0E10255F20D}'] 348 | function ComputeEffectivePermissionWithSecondarySecurity(pSid: PSID; pDeviceSid: PSID; pszServerName: PCWSTR; 349 | var pSecurityObjects: PSECURITY_OBJECT; dwSecurityObjectCount: DWORD; pUserGroups: PTOKEN_GROUPS; 350 | pAuthzUserGroupsOperations: PAUTHZ_SID_OPERATION; pDeviceGroups: PTOKEN_GROUPS; pAuthzDeviceGroupsOperations: PAUTHZ_SID_OPERATION; 351 | pAuthzUserClaims: PAUTHZ_SECURITY_ATTRIBUTES_INFORMATION; pAuthzUserClaimsOperations: PAUTHZ_SECURITY_ATTRIBUTE_OPERATION; 352 | pAuthzDeviceClaims: PAUTHZ_SECURITY_ATTRIBUTES_INFORMATION; pAuthzDeviceClaimsOperations: PAUTHZ_SECURITY_ATTRIBUTE_OPERATION; 353 | var pEffpermResultLists: PEFFPERM_RESULT_LIST): HRESULT; stdcall; 354 | end; 355 | 356 | PIEffectivePermission2 = ^IEffectivePermission2; 357 | 358 | {$endif}// (NTDDI_VERSION >= NTDDI_WIN8) 359 | 360 | function CreateSecurityPage(psi: LPSECURITYINFO): HPROPSHEETPAGE; stdcall; external dll_aclui; 361 | function EditSecurity(hwndOwner: HWND; psi: LPSECURITYINFO): boolean; stdcall; external dll_aclui; 362 | 363 | {$IF (NTDDI_VERSION >= NTDDI_VISTA)} 364 | function EditSecurityAdvanced(hwndOwner: HWND; psi: LPSECURITYINFO; uSIPage: TSI_PAGE_TYPE): HRESULT; stdcall; external dll_aclui; 365 | {$endif}// (NTDDI_VERSION >= NTDDI_VISTA) 366 | 367 | 368 | 369 | 370 | {$endif}{ DEFINED(WINAPI_PARTITION_DESKTOP) } 371 | 372 | implementation 373 | 374 | function GET_PAGE_TYPE(X: uint): UINT; 375 | begin 376 | Result := (X and $0000ffff); 377 | end; 378 | 379 | function GET_ACTIVATION_TYPE(Y: UINT): UINT; 380 | begin 381 | Result := ((Y shr 16) and $0000ffff); 382 | end; 383 | 384 | function COMBINE_PAGE_ACTIVATION(X, Y: UINT): UINT; 385 | begin 386 | Result := ((Y shl 16) or X); 387 | end; 388 | 389 | end. 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | -------------------------------------------------------------------------------- /Units/Win32.AVRT.pas: -------------------------------------------------------------------------------- 1 | (* 2 | This module contains the multimedia class scheduler APIs and any public data 3 | structures needed to call these APIs. 4 | *) 5 | unit Win32.AVRT; 6 | { Header Version 10.0.17134 } 7 | 8 | {$mode delphiunicode}{$H+} 9 | 10 | interface 11 | 12 | uses 13 | Classes, SysUtils, Windows; 14 | 15 | const 16 | Avrt_dll = 'Avrt.dll'; 17 | 18 | 19 | type 20 | 21 | // AvRt Priorities 22 | TAVRT_PRIORITY = ( 23 | AVRT_PRIORITY_VERYLOW = -2, 24 | AVRT_PRIORITY_LOW, 25 | AVRT_PRIORITY_NORMAL, 26 | AVRT_PRIORITY_HIGH, 27 | AVRT_PRIORITY_CRITICAL); 28 | 29 | PAVRT_PRIORITY = ^TAVRT_PRIORITY; 30 | 31 | 32 | // Infinite timeout for a thread order group. 33 | 34 | 35 | const 36 | THREAD_ORDER_GROUP_INFINITE_TIMEOUT = int64(-1); 37 | 38 | 39 | // Define API decoration for direct importing of DLL references. 40 | 41 | 42 | function AvSetMmThreadCharacteristicsA(TaskName: LPCSTR; var TaskIndex: DWORD): HANDLE; stdcall; external Avrt_dll; 43 | 44 | function AvSetMmThreadCharacteristicsW(TaskName: LPCWSTR; var TaskIndex: DWORD): HANDLE; stdcall; external Avrt_dll; 45 | 46 | function AvSetMmMaxThreadCharacteristicsA(FirstTask: LPCSTR; SecondTask: LPCSTR; var TaskIndex: DWORD): HANDLE; 47 | stdcall; external Avrt_dll; 48 | 49 | function AvSetMmMaxThreadCharacteristicsW(FirstTask: LPCWSTR; SecondTask: LPCWSTR; var TaskIndex: DWORD): HANDLE; 50 | stdcall; external Avrt_dll; 51 | 52 | function AvRevertMmThreadCharacteristics(AvrtHandle: HANDLE): boolean; stdcall; external Avrt_dll; 53 | 54 | function AvSetMmThreadPriority(AvrtHandle: HANDLE; Priority: TAVRT_PRIORITY): boolean; stdcall; external Avrt_dll; 55 | 56 | function AvRtCreateThreadOrderingGroup(out Context: HANDLE; Period: PLARGE_INTEGER; var ThreadOrderingGuid: TGUID; 57 | Timeout: PLARGE_INTEGER): boolean; stdcall; external Avrt_dll; 58 | 59 | function AvRtCreateThreadOrderingGroupExA(out Context: HANDLE; Period: PLARGE_INTEGER; var ThreadOrderingGuid: TGUID; 60 | Timeout: PLARGE_INTEGER; TaskName: LPCSTR): boolean; stdcall; external Avrt_dll; 61 | 62 | function AvRtCreateThreadOrderingGroupExW(out Context: HANDLE; Period: PLARGE_INTEGER; var ThreadOrderingGuid: TGUID; 63 | Timeout: PLARGE_INTEGER; TaskName: LPCWSTR): boolean; stdcall; external Avrt_dll; 64 | 65 | function AvRtJoinThreadOrderingGroup(out Context: HANDLE; const ThreadOrderingGuid: TGUID; Before: boolean): boolean; 66 | stdcall; external Avrt_dll; 67 | 68 | function AvRtWaitOnThreadOrderingGroup(Context: HANDLE): boolean; stdcall; external Avrt_dll; 69 | 70 | function AvRtLeaveThreadOrderingGroup(Context: HANDLE): boolean; stdcall; external Avrt_dll; 71 | 72 | function AvRtDeleteThreadOrderingGroup(Context: HANDLE): boolean; stdcall; external Avrt_dll; 73 | 74 | function AvQuerySystemResponsiveness(AvrtHandle: HANDLE; out SystemResponsivenessValue: ULONG): boolean; stdcall; external Avrt_dll; 75 | 76 | implementation 77 | 78 | end. 79 | 80 | -------------------------------------------------------------------------------- /Units/Win32.ActiveCf.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ActiveCf; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | //------------------------------------------------------------------------------ 21 | // File: ActiveCf.h 22 | 23 | // Desc: Contains the data formats for the transfer of VfW4 filters via the 24 | // clipboard. 25 | 26 | // Copyright (c) 1992 - 2001, Microsoft Corporation. All rights reserved. 27 | //------------------------------------------------------------------------------ 28 | 29 | 30 | 31 | { Header Definition: 10.0.14393.0 } 32 | 33 | {$IFDEF FPC} 34 | {$mode delphiunicode}{$H+} 35 | {$ENDIF} 36 | 37 | {$I Win32.WinAPI.inc} 38 | 39 | interface 40 | 41 | uses 42 | Windows, Classes, SysUtils; 43 | 44 | 45 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 46 | 47 | const 48 | CFSTR_VFW_FILTERLIST: ansistring = 'Video for Windows 4 Filters'; 49 | 50 | type 51 | TVFW_FILTERLIST = record 52 | cFilters: UINT; // number of CLSIDs in aClsId 53 | aClsId: PCLSID; // ClsId of each filter 54 | end; 55 | 56 | tagVFW_FILTERLIST = TVFW_FILTERLIST; 57 | PVFW_FILTERLIST = ^TVFW_FILTERLIST; 58 | 59 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 60 | 61 | 62 | implementation 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /Units/Win32.Adc.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ADC; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | //----------------------------------------------------------------------------- 21 | 22 | // File: adc.h 23 | 24 | // Contents: Adc external constants and GUIDS 25 | 26 | // Comments: 27 | 28 | //----------------------------------------------------------------------------- 29 | 30 | 31 | 32 | { Header Definition: 10.0.14393.0 } 33 | 34 | {$IFDEF FPC} 35 | {$mode delphiunicode}{$H+} 36 | {$ENDIF} 37 | 38 | {$I Win32.WinAPI.inc} 39 | 40 | interface 41 | 42 | uses 43 | Windows, Classes, SysUtils; 44 | 45 | 46 | 47 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 48 | 49 | const 50 | CLSID_FoxRowset: TGUID = '{3ff292b6-b204-11cf-8d23-00aa005ffe58}'; 51 | DBPROPSET_ADC: TGUID = '{b68e3cc1-6deb-11d0-8df6-00aa005ffe58}'; 52 | IID_IAsyncAllowed: TGUID = '{f5f2893a-ba9e-11d0-abb9-00c04fc29f8f}'; 53 | IID_IRowsetADCExtensions: TGUID = '{F17324c4-68E0-11D0-AD45-00C04FC29863}'; 54 | IID_IUpdateInfo: TGUID = '{a0385420-62b8-11d1-9a06-00a0c903aa45}'; 55 | IID_IRowsetSynchronize: TGUID = '{1be41e60-807a-11d1-9a14-00a0c903aa45}'; 56 | IID_IRowsetProperties: TGUID = '{1e837070-bcfc-11d1-9a2c-00a0c903aa45}'; 57 | 58 | type 59 | 60 | 61 | TADCPROPENUM = ( 62 | DBPROP_ADC_ASYNCHFETCHSIZE = 3, 63 | DBPROP_ADC_BATCHSIZE = 4, 64 | DBPROP_ADC_UPDATECRITERIA = 5, 65 | // dropping support for the UPDATEOPERTION property, but should not reuse the number 66 | // DBPROP_ADC_UPDATEOPERATION = 6, 67 | DBPROP_ADC_ASYNCHPREFETCHSIZE = 7, 68 | DBPROP_ADC_ASYNCHTHREADPRIORITY = 8, 69 | DBPROP_ADC_CACHECHILDROWS = 9, 70 | DBPROP_ADC_MAINTAINCHANGESTATUS = 10, 71 | DBPROP_ADC_AUTORECALC = 11, 72 | DBPROP_ADC_UNIQUETABLE = 13, 73 | DBPROP_ADC_UNIQUESCHEMA = 14, 74 | DBPROP_ADC_UNIQUECATALOG = 15, 75 | DBPROP_ADC_CUSTOMRESYNCH = 16, 76 | DBPROP_ADC_CEVER = 17, 77 | DBPROP_ADC_RESHAPENAME = 18, 78 | DBPROP_ADC_UPDATERESYNC = 19, 79 | // removing SaveMode, but we should not reuse the number 80 | // DBPROP_ADC_SAVEMODE = 20, 81 | DBPROP_ADC_BACKINGSTORE = 21, 82 | DBPROP_ADC_RELEASESHAPEONDISCONNECT = 22 83 | ); 84 | 85 | 86 | // these enums are defined in both adc.h and adoint.h 87 | // do not re define them here if adoint.h has already been included 88 | {$IFNDEF _COMMON_ADC_AND_ADO_PROPS_} 89 | {$DEFINE _COMMON_ADC_AND_ADO_PROPS_} 90 | 91 | TADCPROP_UPDATECRITERIA_ENUM = (adCriteriaKey = 0, 92 | adCriteriaAllCols = 1, 93 | adCriteriaUpdCols = 2, 94 | adCriteriaTimeStamp = 3 95 | ); 96 | 97 | TADCPROP_ASYNCTHREADPRIORITY_ENUM = (adPriorityLowest = 1, 98 | adPriorityBelowNormal = 2, 99 | adPriorityNormal = 3, 100 | adPriorityAboveNormal = 4, 101 | adPriorityHighest = 5 102 | ); 103 | 104 | TADCPROP_UPDATERESYNC_ENUM = (adResyncNone = 0, 105 | adResyncAutoIncrement = $1, 106 | adResyncConflicts = $2, 107 | adResyncUpdates = $4, 108 | adResyncInserts = $8, 109 | adResyncAll = $0F 110 | ); 111 | 112 | TADCPROP_AUTORECALC_ENUM = ( 113 | adRecalcUpFront = 0, 114 | adRecalcAlways = 1 115 | ); 116 | 117 | {$ENDIF}// _COMMON_ADC_AND_ADO_PROPS_ 118 | 119 | TFOXROWSETPROPENUM = ( 120 | DBPROP_FOXTABLENAME = $eeff); 121 | 122 | 123 | {$endif}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 124 | 125 | 126 | implementation 127 | 128 | end. 129 | 130 | -------------------------------------------------------------------------------- /Units/Win32.AdoDef.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ADODef; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | //----------------------------------------------------------------------------- 21 | // File: ADODEF.H 22 | 23 | // Contents: ADO version definition. 24 | 25 | 26 | // Comments: 27 | 28 | //----------------------------------------------------------------------------- 29 | 30 | 31 | 32 | { Header Definition: 10.0.14393.0 } 33 | 34 | {$IFDEF FPC} 35 | {$mode delphiunicode}{$H+} 36 | {$ENDIF} 37 | 38 | {$I Win32.WinAPI.inc} 39 | 40 | interface 41 | 42 | uses 43 | Windows, Classes, SysUtils; 44 | 45 | 46 | // Change the version numbers below when there are any updates in the version of the type libraries, 47 | // which should be changed after some updates to the type libraries 48 | 49 | const 50 | // TYPELIB MAJOR VERSIONS 51 | 52 | ADO_MAJOR = 6; 53 | ADOR_MAJOR = 6; 54 | ADOX_MAJOR = 6; 55 | ADOMD_MAJOR = 6; 56 | JRO_MAJOR = 2; 57 | 58 | // TYPELIB MINOR VERSION 59 | ADO_MINOR = 1; 60 | ADOR_MINOR = 0; 61 | ADOX_MINOR = 0; 62 | ADOMD_MINOR = 0; 63 | JRO_MINOR = 6; 64 | 65 | ADO_VERSION: ansistring = chr(ADO_MAJOR) + '.' + chr(ADO_MINOR); 66 | ADOR_VERSION: ansistring = chr(ADOR_MAJOR) + '.' + chr(ADOR_MINOR); 67 | ADOX_VERSION: ansistring = chr(ADOX_MAJOR) + '.' + chr(ADOX_MINOR); 68 | ADOMD_VERSION: ansistring = chr(ADOMD_MAJOR) + '.' + chr(ADOMD_MINOR); 69 | JRO_VERSION: ansistring = chr(JRO_MAJOR) + '.' + chr(JRO_MINOR); 70 | 71 | ADO_LIBRARYNAME: ansistring = 'Microsoft ActiveX Data Objects 6.1 Library'; 72 | ADOR_LIBRARYNAME: ansistring = 'Microsoft ActiveX Data Objects Recordset 6.0 Library'; 73 | ADOX_LIBRARYNAME: ansistring = 'Microsoft ADO Ext. 6.0 for DDL and Security'; 74 | ADOMD_LIBRARYNAME: ansistring = 'Microsoft ActiveX Data Objects (Multi-dimensional) 6.0 Library'; 75 | JRO_LIBRARYNAME: ansistring = 'Microsoft Jet and Replication Objects 2.6 Library'; 76 | 77 | ADOMD_TYPELIB_UUID: TGUID = '{22813728-8BD3-11D0-B4EF-00A0C9138CA4}'; 78 | JRO_TYPELIB_UUID: TGUID = '{AC3B8B4C-B6CA-11d1-9F31-00C04FC29D52}'; 79 | 80 | 81 | implementation 82 | 83 | end. 84 | 85 | -------------------------------------------------------------------------------- /Units/Win32.AudioEndPoints.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AudioEndPoints; 2 | 3 | {$IFDEF FPC} 4 | {$mode delphiunicode}{$H+} 5 | {$ENDIF} 6 | 7 | {$I Win32.WinAPI.inc} 8 | 9 | interface 10 | 11 | uses 12 | Classes, SysUtils; 13 | 14 | const 15 | ENDPOINT_FORMAT_RESET_MIX_ONLY = $00000001; 16 | 17 | 18 | IID_IAudioEndpointFormatControl: TGUID = '{784CFD40-9F89-456E-A1A6-873B006A664E}'; 19 | 20 | 21 | type 22 | 23 | IAudioEndpointFormatControl = interface(IUnknown) 24 | ['{784CFD40-9F89-456E-A1A6-873B006A664E}'] 25 | function ResetToDefault(ResetFlags: DWORD): HResult; stdcall; 26 | end; 27 | 28 | implementation 29 | 30 | end. 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Units/Win32.AudioMediaType.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AudioMediaType; 2 | 3 | 4 | interface 5 | 6 | {$IFDEF FPC} 7 | {$mode delphiunicode}{$H+} 8 | {$ENDIF} 9 | 10 | {$I Win32.WinAPI.inc} 11 | 12 | uses 13 | Classes, SysUtils, 14 | Win32.AudioSessionTypes; 15 | 16 | const 17 | IID_IAudioMediaType: TGUID = '{4E997F73-B71F-4798-873B-ED7DFCF15B4D}'; 18 | 19 | const 20 | AUDIOMEDIATYPE_EQUAL_FORMAT_TYPES = $00000002; 21 | AUDIOMEDIATYPE_EQUAL_FORMAT_DATA = $00000004; 22 | AUDIOMEDIATYPE_EQUAL_FORMAT_USER_DATA = $00000008; 23 | 24 | 25 | type 26 | 27 | // {$if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)} 28 | 29 | TUNCOMPRESSEDAUDIOFORMAT = record 30 | guidFormatType: TGUID; 31 | dwSamplesPerFrame: DWORD; 32 | dwBytesPerSampleContainer: DWORD; 33 | dwValidBitsPerSample: DWORD; 34 | fFramesPerSecond: single; 35 | dwChannelMask: DWORD; 36 | end; 37 | 38 | 39 | 40 | IAudioMediaType = interface(IUnknown) 41 | ['{4E997F73-B71F-4798-873B-ED7DFCF15B4D}'] 42 | function IsCompressedFormat(out pfCompressed: boolean): HResult; stdcall; 43 | function IsEqual(pIAudioType: IAudioMediaType; out pdwFlags: DWORD): HResult; stdcall; 44 | function GetAudioFormat(): TWAVEFORMATEX; stdcall; 45 | function GetUncompressedAudioFormat(out pUncompressedAudioFormat: TUNCOMPRESSEDAUDIOFORMAT): HResult; stdcall; 46 | end; 47 | 48 | 49 | 50 | 51 | // CreateAudioMediaType 52 | 53 | function CreateAudioMediaType(const pAudioFormat: TWAVEFORMATEX; cbAudioFormatSize: UINT32; ppIAudioMediaType: IAudioMediaType): HResult; 54 | stdcall; external; 55 | 56 | // CreateAudioMediaTypeFromUncompressedAudioFormat 57 | 58 | function CreateAudioMediaTypeFromUncompressedAudioFormat(const pUncompressedAudioFormat: TUNCOMPRESSEDAUDIOFORMAT; 59 | ppIAudioMediaType: IAudioMediaType): HResult; stdcall; external; 60 | 61 | // {$endif} { WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 62 | 63 | implementation 64 | 65 | end. 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Units/Win32.AudioPolicy.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AudioPolicy; 2 | 3 | interface 4 | 5 | {$IFDEF FPC} 6 | {$mode delphiunicode}{$H+} 7 | {$ENDIF} 8 | 9 | //{$I Win32.WinAPI.inc} 10 | 11 | uses 12 | Classes, SysUtils, 13 | Windows, 14 | Win32.AudioSessionTypes, Win32.AudioClient; 15 | 16 | const 17 | IID_IAudioSessionEvents: TGUID = '{24918ACC-64B3-37C1-8CA9-74A66E9957A8}'; 18 | IID_IAudioSessionControl: TGUID = '{F4B1A599-7266-4319-A8CA-E70ACB11E8CD}'; 19 | IID_IAudioSessionControl2: TGUID = '{bfb7ff88-7239-4fc9-8fa2-07c950be9c6d}'; 20 | IID_IAudioSessionManager: TGUID = '{BFA971F1-4D5E-40BB-935E-967039BFBEE4}'; 21 | IID_IAudioVolumeDuckNotification: TGUID = '{C3B284D4-6D39-4359-B3CF-B56DDB3BB39C}'; 22 | 23 | IID_IAudioSessionNotification: TGUID = '{641DD20B-4D41-49CC-ABA3-174B9477BB08}'; 24 | IID_IAudioSessionEnumerator: TGUID = '{E2F5BB11-0570-40CA-ACDD-3AA01277DEE8}'; 25 | IID_IAudioSessionManager2: TGUID = '{77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F}'; 26 | 27 | 28 | // {$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)} 29 | type 30 | TAudioSessionDisconnectReason = ( 31 | DisconnectReasonDeviceRemoval = 0, 32 | DisconnectReasonServerShutdown = (DisconnectReasonDeviceRemoval + 1), 33 | DisconnectReasonFormatChanged = (DisconnectReasonServerShutdown + 1), 34 | DisconnectReasonSessionLogoff = (DisconnectReasonFormatChanged + 1), 35 | DisconnectReasonSessionDisconnected = (DisconnectReasonSessionLogoff + 1), 36 | DisconnectReasonExclusiveModeOverride = (DisconnectReasonSessionDisconnected + 1) 37 | ); 38 | 39 | 40 | 41 | 42 | LPCWSTR = PWideChar; 43 | 44 | 45 | 46 | IAudioSessionEvents = interface(IUnknown) 47 | ['{24918ACC-64B3-37C1-8CA9-74A66E9957A8}'] 48 | function OnDisplayNameChanged(NewDisplayName: LPCWSTR; const EventContext: TGUID): HResult; stdcall; 49 | function OnIconPathChanged(NewIconPath: LPCWSTR; const EventContext: TGUID): HResult; stdcall; 50 | function OnSimpleVolumeChanged(NewVolume: single; NewMute: boolean; const EventContext: TGUID): HResult; stdcall; 51 | function OnChannelVolumeChanged(ChannelCount: DWORD; NewChannelVolumeArray: Psingle; ChangedChannel: DWORD; 52 | const EventContext: TGUID): HResult; stdcall; 53 | function OnGroupingParamChanged(const NewGroupingParam: TGUID; const EventContext: TGUID): HResult; stdcall; 54 | function OnStateChanged(NewState: TAudioSessionState): HResult; stdcall; 55 | function OnSessionDisconnected(DisconnectReason: TAudioSessionDisconnectReason): HResult; stdcall; 56 | end; 57 | 58 | //{$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) } 59 | 60 | //{$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)} 61 | 62 | IAudioSessionControl = interface(IUnknown) 63 | ['{F4B1A599-7266-4319-A8CA-E70ACB11E8CD}'] 64 | function GetState(out pRetVal: TAudioSessionState): HResult; stdcall; 65 | function GetDisplayName(out pRetVal: LPWSTR): HResult; stdcall; 66 | function SetDisplayName(Value: LPCWSTR; const EventContext: TGUID): HResult; stdcall; 67 | function GetIconPath(out pRetVal: LPWSTR): HResult; stdcall; 68 | function SetIconPath(Value: LPCWSTR; const EventContext: TGUID): HResult; stdcall; 69 | function GetGroupingParam(out pRetVal: TGUID): HResult; stdcall; 70 | function SetGroupingParam(const _Override: TGUID; const EventContext: TGUID): HResult; stdcall; 71 | function RegisterAudioSessionNotification(NewNotifications: IAudioSessionEvents): HResult; stdcall; 72 | function UnregisterAudioSessionNotification(NewNotifications: IAudioSessionEvents): HResult; stdcall; 73 | end; 74 | 75 | 76 | 77 | // {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) } 78 | 79 | 80 | // {$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)} 81 | 82 | 83 | 84 | IAudioSessionControl2 = interface(IAudioSessionControl) 85 | ['{bfb7ff88-7239-4fc9-8fa2-07c950be9c6d}'] 86 | function GetSessionIdentifier(out pRetVal: LPWSTR): HResult; stdcall; 87 | function GetSessionInstanceIdentifier(out pRetVal: LPWSTR): HResult; stdcall; 88 | function GetProcessId(out pRetVal: DWORD): HResult; stdcall; 89 | function IsSystemSoundsSession(): HResult; stdcall; 90 | function SetDuckingPreference(optOut: boolean): HResult; stdcall; 91 | end; 92 | 93 | 94 | 95 | 96 | IAudioSessionManager = interface(IUnknown) 97 | ['{BFA971F1-4D5E-40BB-935E-967039BFBEE4}'] 98 | function GetAudioSessionControl(const AudioSessionGuid: TGUID; StreamFlags: DWORD; 99 | out SessionControl: IAudioSessionControl): HResult; stdcall; 100 | function GetSimpleAudioVolume(const AudioSessionGuid: TGUID; StreamFlags: DWORD; 101 | out AudioVolume: ISimpleAudioVolume): HResult; stdcall; 102 | end; 103 | 104 | 105 | 106 | IAudioVolumeDuckNotification = interface(IUnknown) 107 | ['{C3B284D4-6D39-4359-B3CF-B56DDB3BB39C}'] 108 | function OnVolumeDuckNotification(sessionID: LPCWSTR; countCommunicationSessions: UINT32): HResult; stdcall; 109 | function OnVolumeUnduckNotification(sessionID: LPCWSTR): HResult; stdcall; 110 | end; 111 | 112 | 113 | IAudioSessionNotification = interface(IUnknown) 114 | ['{641DD20B-4D41-49CC-ABA3-174B9477BB08}'] 115 | function OnSessionCreated(NewSession: IAudioSessionControl): HResult; stdcall; 116 | end; 117 | 118 | 119 | 120 | 121 | IAudioSessionEnumerator = interface(IUnknown) 122 | ['{E2F5BB11-0570-40CA-ACDD-3AA01277DEE8}'] 123 | function GetCount(out SessionCount: integer): HResult; stdcall; 124 | function GetSession(SessionCount: integer; out Session: IAudioSessionControl): HResult; stdcall; 125 | end; 126 | 127 | 128 | 129 | 130 | IAudioSessionManager2 = interface(IAudioSessionManager) 131 | ['{77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F}'] 132 | function GetSessionEnumerator(out SessionEnum: IAudioSessionEnumerator): HResult; stdcall; 133 | function RegisterSessionNotification(SessionNotification: IAudioSessionNotification): HResult; stdcall; 134 | function UnregisterSessionNotification(SessionNotification: IAudioSessionNotification): HResult; stdcall; 135 | function RegisterDuckNotification(sessionID: LPCWSTR; duckNotification: IAudioVolumeDuckNotification): HResult; stdcall; 136 | function UnregisterDuckNotification(duckNotification: IAudioVolumeDuckNotification): HResult; stdcall; 137 | end; 138 | 139 | 140 | 141 | implementation 142 | 143 | end. 144 | -------------------------------------------------------------------------------- /Units/Win32.AudioSessionTypes.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AudioSessionTypes; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | // AudioSessionTypes.h -- Copyright Microsoft Corporation, All Rights Reserved. 21 | 22 | // Description: Type definitions used by the audio session manager RPC/COM interfaces 23 | 24 | 25 | { Header Definition: 10.0.14393.0 } 26 | 27 | {$IFDEF FPC} 28 | {$mode delphiunicode}{$H+} 29 | {$ENDIF} 30 | 31 | {$I Win32.WinAPI.inc} 32 | 33 | interface 34 | 35 | uses 36 | Windows, Classes; 37 | 38 | {$IF DEFINED(WINAPI_PARTITION_APP)} 39 | 40 | //------------------------------------------------------------------------- 41 | // Description: AudioClient stream flags 42 | 43 | // Can be a combination of AUDCLNT_STREAMFLAGS and AUDCLNT_SYSFXFLAGS: 44 | 45 | // AUDCLNT_STREAMFLAGS (this group of flags uses the high word, 46 | // w/exception of high-bit which is reserved, $7FFF0000): 47 | 48 | 49 | // AUDCLNT_STREAMFLAGS_CROSSPROCESS - Audio policy control for this stream will be shared with 50 | // with other process sessions that use the same audio session 51 | // GUID. 52 | 53 | // AUDCLNT_STREAMFLAGS_LOOPBACK - Initializes a renderer endpoint for a loopback audio application. 54 | // In this mode, a capture stream will be opened on the specified 55 | // renderer endpoint. Shared mode and a renderer endpoint is required. 56 | // Otherwise the IAudioClient::Initialize call will fail. If the 57 | // initialize is successful, a capture stream will be available 58 | // from the IAudioClient object. 59 | 60 | // AUDCLNT_STREAMFLAGS_EVENTCALLBACK - An exclusive mode client will supply an event handle that will be 61 | // signaled when an IRP completes (or a waveRT buffer completes) telling 62 | // it to fill the next buffer 63 | 64 | // AUDCLNT_STREAMFLAGS_NOPERSIST - Session state will not be persisted 65 | 66 | // AUDCLNT_STREAMFLAGS_RATEADJUST - The sample rate of the stream is adjusted to a rate specified by an application. 67 | 68 | // AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY - When used with AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM, a sample rate 69 | // converter with better quality than the default conversion but with a 70 | // higher performance cost is used. This should be used if the audio is 71 | // ultimately intended to be heard by humans as opposed to other 72 | // scenarios such as pumping silence or populating a meter. 73 | 74 | // AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM - A channel matrixer and a sample rate converter are inserted as necessary 75 | // to convert between the uncompressed format supplied to 76 | // IAudioClient::Initialize and the audio engine mix format. 77 | 78 | // AUDCLNT_STREAMFLAGS_KEYWORDDETECTOR - Initializes a capture endpoint for keyword detector streaming. 79 | 80 | // AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED - Session expires when there are no streams and no owning 81 | // session controls. 82 | 83 | // AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE - Don't show volume control in the Volume Mixer. 84 | 85 | // AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED - Don't show volume control in the Volume Mixer after the 86 | // session expires. 87 | 88 | // AUDCLNT_SYSFXFLAGS (these flags use low word $0000FFFF): 89 | 90 | // none defined currently 91 | 92 | const 93 | AUDCLNT_STREAMFLAGS_CROSSPROCESS = $00010000; 94 | AUDCLNT_STREAMFLAGS_LOOPBACK = $00020000; 95 | AUDCLNT_STREAMFLAGS_EVENTCALLBACK = $00040000; 96 | AUDCLNT_STREAMFLAGS_NOPERSIST = $00080000; 97 | AUDCLNT_STREAMFLAGS_RATEADJUST = $00100000; 98 | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY = $08000000; 99 | AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM = $80000000; 100 | AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED = $10000000; 101 | AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE = $20000000; 102 | AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED = $40000000; 103 | 104 | //------------------------------------------------------------------------- 105 | // Description: AudioClient share mode 106 | 107 | // AUDCLNT_SHAREMODE_SHARED - The device will be opened in shared mode and use the 108 | // WAS format. 109 | // AUDCLNT_SHAREMODE_EXCLUSIVE - The device will be opened in exclusive mode and use the 110 | // application specified format. 111 | 112 | type 113 | TAUDCLNT_SHAREMODE = ( 114 | AUDCLNT_SHAREMODE_SHARED, 115 | AUDCLNT_SHAREMODE_EXCLUSIVE); 116 | PAUDCLNT_SHAREMODE = ^TAUDCLNT_SHAREMODE; 117 | 118 | //------------------------------------------------------------------------- 119 | // Description: Audio stream categories 120 | 121 | // ForegroundOnlyMedia - (deprecated for Win10) Music, Streaming audio 122 | // BackgroundCapableMedia - (deprecated for Win10) Video with audio 123 | // Communications - VOIP, chat, phone call 124 | // Alerts - Alarm, Ring tones 125 | // SoundEffects - Sound effects, clicks, dings 126 | // GameEffects - Game sound effects 127 | // GameMedia - Background audio for games 128 | // GameChat - In game player chat 129 | // Speech - Speech recognition 130 | // Media - Music, Streaming audio 131 | // Movie - Video with audio 132 | // Other - All other streams (default) 133 | 134 | TAUDIO_STREAM_CATEGORY = ( 135 | AudioCategory_Other = 0, 136 | AudioCategory_ForegroundOnlyMedia = 1, 137 | {$IF (NTDDI_VERSION < NTDDI_THRESHOLD)} 138 | AudioCategory_BackgroundCapableMedia = 2, 139 | {$ENDIF} 140 | AudioCategory_Communications = 3, 141 | AudioCategory_Alerts = 4, 142 | AudioCategory_SoundEffects = 5, 143 | AudioCategory_GameEffects = 6, 144 | AudioCategory_GameMedia = 7, 145 | AudioCategory_GameChat = 8, 146 | AudioCategory_Speech = 9, 147 | AudioCategory_Movie = 10, 148 | AudioCategory_Media = 11); 149 | PAUDIO_STREAM_CATEGORY = ^TAudioSessionState; 150 | 151 | 152 | 153 | 154 | //------------------------------------------------------------------------- 155 | // Description: AudioSession State. 156 | 157 | // AudioSessionStateInactive - The session has no active audio streams. 158 | // AudioSessionStateActive - The session has active audio streams. 159 | // AudioSessionStateExpired - The session is dormant. 160 | TAudioSessionState = ( 161 | AudioSessionStateInactive = 0, 162 | AudioSessionStateActive = 1, 163 | AudioSessionStateExpired = 2); 164 | PAudioSessionState = ^TAudioSessionState; 165 | 166 | {$ENDIF} 167 | 168 | implementation 169 | 170 | end. 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /Units/Win32.Authz.pas: -------------------------------------------------------------------------------- 1 | unit Win32.AuthZ; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | {++ 21 | 22 | Copyright (c) 2000 Microsoft Corporation 23 | 24 | Module Name: 25 | 26 | authz.h 27 | 28 | Abstract: 29 | 30 | This module contains the authorization framework APIs and any public data 31 | structures needed to call these APIs. 32 | 33 | Revision History: 34 | 35 | Created - March 2000 36 | 37 | --} 38 | 39 | 40 | { Header Definition: 10.0.14393.0 } 41 | 42 | {$IFDEF FPC} 43 | {$mode delphiunicode}{$H+} 44 | {$ENDIF} 45 | 46 | {$I Win32.WinAPI.inc} 47 | 48 | interface 49 | 50 | uses 51 | Windows, Classes, SysUtils; 52 | 53 | 54 | {$IF (DEFINED(WINAPI_PARTITION_DESKTOP) or DEFINED(WINAPI_PARTITION_SYSTEM))} 55 | // Flags which may be used at the time of client context creation using a sid. 56 | 57 | const 58 | AUTHZ_SKIP_TOKEN_GROUPS = $2; 59 | AUTHZ_REQUIRE_S4U_LOGON = $4; 60 | AUTHZ_COMPUTE_PRIVILEGES = $8; 61 | 62 | type 63 | TAUTHZ_ACCESS_CHECK_RESULTS_HANDLE = Handle; 64 | TAUTHZ_CLIENT_CONTEXT_HANDLE = Handle; 65 | TAUTHZ_RESOURCE_MANAGER_HANDLE = Handle; 66 | TAUTHZ_AUDIT_EVENT_HANDLE = Handle; 67 | TAUTHZ_AUDIT_EVENT_TYPE_HANDLE = Handle; 68 | TAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE = Handle; 69 | 70 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 71 | TAUTHZ_CAP_CHANGE_SUBSCRIPTION_HANDLE = Handle; 72 | {$ENDIF}// (_WIN32_WINNT >= _WIN32_WINNT_WIN8) 73 | 74 | 75 | PAUTHZ_ACCESS_CHECK_RESULTS_HANDLE = ^TAUTHZ_ACCESS_CHECK_RESULTS_HANDLE; 76 | PAUTHZ_CLIENT_CONTEXT_HANDLE = ^TAUTHZ_CLIENT_CONTEXT_HANDLE; 77 | PAUTHZ_RESOURCE_MANAGER_HANDLE = ^TAUTHZ_RESOURCE_MANAGER_HANDLE; 78 | PAUTHZ_AUDIT_EVENT_HANDLE = ^TAUTHZ_AUDIT_EVENT_HANDLE; 79 | PAUTHZ_AUDIT_EVENT_TYPE_HANDLE = ^TAUTHZ_AUDIT_EVENT_TYPE_HANDLE; 80 | PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE = ^TAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE; 81 | 82 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 83 | PAUTHZ_CAP_CHANGE_SUBSCRIPTION_HANDLE = ^TAUTHZ_CAP_CHANGE_SUBSCRIPTION_HANDLE; 84 | {$ENDIF}// (_WIN32_WINNT >= _WIN32_WINNT_WIN8) 85 | 86 | 87 | PAUTHZ_SID_OPERATION = pointer; 88 | PAUTHZ_SECURITY_ATTRIBUTES_INFORMATION = pointer; 89 | PAUTHZ_SECURITY_ATTRIBUTE_OPERATION = pointer; 90 | LPSECURITYINFO = pointer; 91 | 92 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) } 93 | 94 | implementation 95 | 96 | end. 97 | 98 | -------------------------------------------------------------------------------- /Units/Win32.BTHSDPDef.pas: -------------------------------------------------------------------------------- 1 | unit Win32.BTHSDPDef; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | // Copyright (C) Microsoft. All rights reserved. 20 | 21 | { Header Definition: 10.0.14393.0 } 22 | 23 | {$IFDEF FPC} 24 | {$mode delphiunicode}{$H+} 25 | {$ENDIF} 26 | 27 | {$I Win32.WinAPI.inc} 28 | 29 | interface 30 | 31 | uses 32 | Windows, Classes; 33 | 34 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 35 | 36 | {$IF (NTDDI_VERSION >= NTDDI_WINXPSP2)} 37 | type 38 | TSDP_LARGE_INTEGER_16 = record 39 | LowPart: ULONGLONG; 40 | HighPart: LONGLONG; 41 | end; 42 | PSDP_LARGE_INTEGER_16 = ^TSDP_LARGE_INTEGER_16; 43 | 44 | 45 | TSDP_ULARGE_INTEGER_16 = record 46 | LowPart: ULONGLONG; 47 | HighPart: ULONGLONG; 48 | end; 49 | PSDP_ULARGE_INTEGER_16 = ^TSDP_ULARGE_INTEGER_16; 50 | 51 | 52 | TNodeContainerType = ( 53 | NodeContainerTypeSequence, 54 | NodeContainerTypeAlternative); 55 | 56 | 57 | type 58 | TSDP_ERROR = USHORT; 59 | PSDP_ERROR = ^TSDP_ERROR; 60 | 61 | TSDP_TYPE = ( 62 | SDP_TYPE_NIL = $00, 63 | SDP_TYPE_UINT = $01, 64 | SDP_TYPE_INT = $02, 65 | SDP_TYPE_UUID = $03, 66 | SDP_TYPE_STRING = $04, 67 | SDP_TYPE_BOOLEAN = $05, 68 | SDP_TYPE_SEQUENCE = $06, 69 | SDP_TYPE_ALTERNATIVE = $07, 70 | SDP_TYPE_URL = $08, 71 | SDP_TYPE_CONTAINER = $20); 72 | // 9 - 31 are reserved 73 | 74 | 75 | // allow for a little easier type checking / sizing for integers and UUIDs 76 | // ((SDP_ST_XXX & $F0) >> 4) == SDP_TYPE_XXX 77 | // size of the data (in bytes) is encoded as ((SDP_ST_XXX & $F0) >> 8) 78 | TSDP_SPECIFICTYPE = ( 79 | SDP_ST_NONE = $0000, 80 | 81 | SDP_ST_UINT8 = $0010, 82 | SDP_ST_UINT16 = $0110, 83 | SDP_ST_UINT32 = $0210, 84 | SDP_ST_UINT64 = $0310, 85 | SDP_ST_UINT128 = $0410, 86 | 87 | SDP_ST_INT8 = $0020, 88 | SDP_ST_INT16 = $0120, 89 | SDP_ST_INT32 = $0220, 90 | SDP_ST_INT64 = $0320, 91 | SDP_ST_INT128 = $0420, 92 | 93 | SDP_ST_UUID16 = $0130, 94 | SDP_ST_UUID32 = $0220, 95 | SDP_ST_UUID128 = $0430); 96 | 97 | 98 | TSdpAttributeRange = record 99 | minAttribute: USHORT; 100 | maxAttribute: USHORT; 101 | end; 102 | PSdpAttributeRange = ^TSdpAttributeRange; 103 | 104 | 105 | type 106 | TSdpQueryUuidUnion = record 107 | case integer of 108 | 0: (uuid128: TGUID); 109 | 1: (uuid32: ULONG); 110 | 2: (uuid16: USHORT); 111 | end; 112 | PSdpQueryUuidUnion = ^TSdpQueryUuidUnion; 113 | 114 | TSdpQueryUuid = record 115 | u: TSdpQueryUuidUnion; 116 | uuidType: USHORT; 117 | end; 118 | PSdpQueryUuid = ^TSdpQueryUuid; 119 | 120 | {$ENDIF}// (NTDDI_VERSION >= NTDDI_WINXPSP2) 121 | 122 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 123 | 124 | 125 | implementation 126 | 127 | end. 128 | -------------------------------------------------------------------------------- /Units/Win32.CAPI.pas: -------------------------------------------------------------------------------- 1 | unit Win32.CAPI; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | //+--------------------------------------------------------------------------- 21 | 22 | // Microsoft Windows 23 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 24 | 25 | // File: capi.h 26 | 27 | //---------------------------------------------------------------------------- 28 | 29 | { Header Definition: 10.0.14393.0 } 30 | 31 | {$IFDEF FPC} 32 | {$mode delphiunicode}{$H+} 33 | {$ENDIF} 34 | 35 | {$I Win32.WinAPI.inc} 36 | 37 | interface 38 | 39 | uses 40 | Windows, Classes, SysUtils; 41 | 42 | {$IF DEFINED (WINAPI_PARTITION_DESKTOP)} 43 | 44 | {$IFNDEF JAVA_TRUST_PROVIDER} 45 | {$DEFINE JAVA_TRUST_PROVIDER} 46 | type 47 | TJAVA_TRUST = record 48 | cbSize: DWORD; // Size of structure 49 | flag: DWORD; // Reserved 50 | fAllActiveXPermissions: boolean; 51 | // ActiveX explicitly asked for all (must have been signed) 52 | fAllPermissions: boolean; // Java permissions, explicit ask for all 53 | dwEncodingType: DWORD; // Encoding type 54 | pbJavaPermissions: PBYTE; // Encoded java permission blob 55 | cbJavaPermissions: DWORD; 56 | pbSigner: PBYTE; // Encoded signer. 57 | cbSigner: DWORD; 58 | pwszZone: LPCWSTR; // Zone index (copied from action data) 59 | guidZone: TGUID; // Not used currently 60 | hVerify: HRESULT; // Authenticode policy return 61 | end; 62 | PJAVA_TRUST = ^TJAVA_TRUST; 63 | 64 | 65 | {$ENDIF}// !defined(JAVA_TRUST_PROVIDER) 66 | 67 | {$ENDIF}(* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) *) 68 | 69 | implementation 70 | 71 | end. 72 | -------------------------------------------------------------------------------- /Units/Win32.ComCat.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ComCat; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | windows,Classes, SysUtils; 9 | 10 | type 11 | IEnumGUID =interface( IUnknown) 12 | ['{0002E000-0000-0000-C000-000000000046}'] 13 | end; 14 | 15 | implementation 16 | 17 | end. 18 | 19 | -------------------------------------------------------------------------------- /Units/Win32.DPAPI.pas: -------------------------------------------------------------------------------- 1 | unit Win32.DPAPI; 2 | { ************************************************************************** 3 | Copyright (C) 2017 CMC Development Team 4 | 5 | CMC is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | CMC is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with CMC. If not, see . 17 | ************************************************************************** } 18 | 19 | //+--------------------------------------------------------------------------- 20 | // 21 | // Microsoft Windows 22 | // Copyright (C) Microsoft Corporation, 2009. 23 | // 24 | // File: dpapi.h 25 | // 26 | // Contents: Data Protection API 27 | // 28 | //---------------------------------------------------------------------------- 29 | 30 | 31 | 32 | { Header Definition: 10.0.14393.0 } 33 | 34 | {$IFDEF FPC} 35 | {$mode delphiunicode}{$H+} 36 | {$ENDIF} 37 | 38 | {$I Win32.WinAPI.inc} 39 | 40 | interface 41 | 42 | uses 43 | Classes, SysUtils; 44 | 45 | implementation 46 | 47 | end. 48 | 49 | -------------------------------------------------------------------------------- /Units/Win32.DirectXMath.pas: -------------------------------------------------------------------------------- 1 | unit Win32.DirectXMath; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Classes, SysUtils; 9 | 10 | type 11 | //------------------------------------------------------------------------------ 12 | // 3D Vector; 32 bit floating point components 13 | 14 | { TXMFLOAT3 } 15 | 16 | TXMFLOAT3 = record 17 | x:single; 18 | y:single; 19 | z:single; 20 | 21 | (* XMFLOAT3() XM_CTOR_DEFAULT 22 | XM_CONSTEXPR XMFLOAT3(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {} 23 | explicit XMFLOAT3(_In_reads_(3) const float *pArray) : x(pArray[0]), y(pArray[1]), z(pArray[2]) {} *) 24 | end; 25 | 26 | implementation 27 | 28 | { TXMFLOAT3 } 29 | 30 | end. 31 | 32 | -------------------------------------------------------------------------------- /Units/Win32.FileAPI.pas: -------------------------------------------------------------------------------- 1 | (******************************************************************************** 2 | * * 3 | * FileApi.h -- ApiSet Contract for api-ms-win-core-file-l1 * 4 | * * 5 | * Copyright (c) Microsoft Corporation. All rights reserved. * 6 | * * 7 | ********************************************************************************) 8 | unit Win32.FileAPI; 9 | 10 | {$mode delphi} 11 | 12 | {$I Win32.WinAPI.inc} 13 | 14 | interface 15 | 16 | uses 17 | Windows, Classes, SysUtils, 18 | Win32.MinWinBase; 19 | 20 | const 21 | KERNEL32_DLL = 'Kernel32.dll'; 22 | 23 | 24 | // Constants 25 | CREATE_NEW = 1; 26 | CREATE_ALWAYS = 2; 27 | OPEN_EXISTING = 3; 28 | OPEN_ALWAYS = 4; 29 | TRUNCATE_EXISTING = 5; 30 | 31 | INVALID_FILE_SIZE: DWORD = $FFFFFFFF; 32 | INVALID_SET_FILE_POINTER: DWORD = -1; 33 | INVALID_FILE_ATTRIBUTES: DWORD = -1; 34 | 35 | 36 | 37 | 38 | function CompareFileTime(const lpFileTime1: TFILETIME; const lpFileTime2: TFILETIME): LONG; 39 | stdcall; external KERNEL32_DLL; 40 | function CreateDirectoryA(lpPathName: LPCSTR; lpSecurityAttributes: TSECURITY_ATTRIBUTES): boolean; 41 | stdcall; external KERNEL32_DLL; 42 | function CreateDirectoryW(lpPathName: LPCWSTR; lpSecurityAttributes: TSECURITY_ATTRIBUTES): boolean; 43 | stdcall; external KERNEL32_DLL; 44 | function CreateFileA(lpFileName: LPCSTR; dwDesiredAccess: DWORD; dwShareMode: DWORD; lpSecurityAttributes: TSECURITY_ATTRIBUTES; 45 | dwCreationDisposition: DWORD; dwFlagsAndAttributes: DWORD; hTemplateFile: THANDLE): THANDLE; stdcall; external KERNEL32_DLL; 46 | function CreateFileW(lpFileName: LPCWSTR; dwDesiredAccess: DWORD; dwShareMode: DWORD; lpSecurityAttributes: TSECURITY_ATTRIBUTES; 47 | dwCreationDisposition: DWORD; dwFlagsAndAttributes: DWORD; hTemplateFile: THANDLE): THANDLE; stdcall; external KERNEL32_DLL; 48 | function DefineDosDeviceW(dwFlags: DWORD; lpDeviceName: LPCWSTR; lpTargetPath: LPCWSTR): boolean; 49 | stdcall; external KERNEL32_DLL; 50 | function DeleteFileA(lpFileName: LPCSTR): boolean; stdcall; external KERNEL32_DLL; 51 | function DeleteFileW(lpFileName: LPCWSTR): boolean; stdcall; external KERNEL32_DLL; 52 | function DeleteVolumeMountPointW(lpszVolumeMountPoint: LPCWSTR): boolean; stdcall; external KERNEL32_DLL; 53 | function FileTimeToLocalFileTime(const lpFileTime: TFILETIME; out lpLocalFileTime: TFILETIME): boolean; 54 | stdcall; external KERNEL32_DLL; 55 | function FindClose(var hFindFile: THANDLE): boolean; stdcall; external KERNEL32_DLL; 56 | function FindCloseChangeNotification(hChangeHandle: THANDLE): boolean; stdcall; external KERNEL32_DLL; 57 | function FindFirstChangeNotificationA(lpPathName: LPCSTR; bWatchSubtree: boolean; dwNotifyFilter: DWORD): THANDLE; stdcall; external KERNEL32_DLL; 58 | function FindFirstChangeNotificationW(lpPathName: LPCWSTR; bWatchSubtree: boolean; dwNotifyFilter: DWORD): THANDLE; 59 | stdcall; external KERNEL32_DLL; 60 | function FindFirstFileA(lpFileName: LPCSTR; out lpFindFileData: TWIN32_FIND_DATAA): THANDLE; 61 | stdcall; external KERNEL32_DLL; 62 | 63 | 64 | 65 | {$IF (_WIN32_WINNT >= $0600)} 66 | 67 | function SetFileInformationByHandle(hFile: THANDLE; FileInformationClass: TFILE_INFO_BY_HANDLE_CLASS; 68 | lpFileInformation {dwBufferSize}: pointer; dwBufferSize: DWORD): boolean; stdcall; external KERNEL32_DLL; 69 | 70 | {$ENDIF} 71 | 72 | implementation 73 | 74 | end. 75 | 76 | 77 | -------------------------------------------------------------------------------- /Units/Win32.IntSafe.pas: -------------------------------------------------------------------------------- 1 | (****************************************************************** 2 | * * 3 | * intsafe.h -- This module defines helper functions to prevent * 4 | * integer overflow bugs. * 5 | * * 6 | * Copyright (c) Microsoft Corp. All rights reserved. * 7 | * * 8 | ******************************************************************) 9 | unit Win32.IntSafe; 10 | 11 | {$mode delphi} 12 | {$MACRO ON} 13 | 14 | interface 15 | 16 | uses 17 | Windows, Classes, SysUtils; 18 | 19 | const 20 | S_OK: HRESULT = 0; 21 | INTSAFE_E_ARITHMETIC_OVERFLOW: HRESULT = $80070216; // $216 = 534 = ERROR_ARITHMETIC_OVERFLOW 22 | 23 | ULONG_MAX = $ffffffff; 24 | 25 | ULONG_ERROR = $ffffffff; 26 | 27 | function SUCCEEDED(hr: HResult): boolean; 28 | function FAILED(hr: HResult): boolean; 29 | 30 | 31 | 32 | 33 | // DWORD multiplication 34 | 35 | 36 | 37 | // ULONG multiplication 38 | function ULongMult(ulMultiplicand: ULONG; ulMultiplier: ULONG; out pulResult: ULONG): HRESULT; 39 | function DWordMult(ulMultiplicand: ULONG; ulMultiplier: ULONG; out pulResult: ULONG): HRESULT; 40 | 41 | // UInt32x32To64 macro 42 | function UInt32x32To64(a: ULONG; b: ULONG): ULONGLONG; 43 | 44 | // ULONGLONG -> ULONG conversion 45 | function ULongLongToULong(ullOperand: ULONGLONG; out pulResult: ULONG): HRESULT; 46 | 47 | 48 | 49 | 50 | implementation 51 | 52 | 53 | 54 | function SUCCEEDED(hr: HResult): boolean; 55 | begin 56 | Result := (hr >= 0); 57 | end; 58 | 59 | 60 | 61 | function FAILED(hr: HResult): boolean; 62 | begin 63 | Result := (hr < 0); 64 | end; 65 | 66 | 67 | // ULONG multiplication 68 | 69 | function ULongMult(ulMultiplicand: ULONG; ulMultiplier: ULONG; out pulResult: ULONG): HRESULT; inline; 70 | var 71 | ull64Result: ULONGLONG; 72 | begin 73 | ull64Result := UInt32x32To64(ulMultiplicand, ulMultiplier); 74 | 75 | Result := ULongLongToULong(ull64Result, pulResult); 76 | end; 77 | 78 | 79 | 80 | function DWordMult(ulMultiplicand: ULONG; ulMultiplier: ULONG; out pulResult: ULONG): HRESULT; inline; 81 | begin 82 | Result := ULongMult(ulMultiplicand, ulMultiplier, pulResult); 83 | end; 84 | 85 | 86 | 87 | // UInt32x32To64 macro 88 | function UInt32x32To64(a: ULONG; b: ULONG): ULONGLONG; inline; 89 | begin 90 | Result := a * b; 91 | end; 92 | 93 | 94 | // ULONGLONG -> ULONG conversion 95 | function ULongLongToULong(ullOperand: ULONGLONG; out pulResult: ULONG): HRESULT; inline; 96 | begin 97 | if (ullOperand <= ULONG_MAX) then 98 | begin 99 | pulResult := ULONG(ullOperand); 100 | Result := S_OK; 101 | end 102 | else 103 | begin 104 | pulResult := ULONG_ERROR; 105 | Result := INTSAFE_E_ARITHMETIC_OVERFLOW; 106 | end; 107 | end; 108 | 109 | 110 | 111 | 112 | end. 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /Units/Win32.MMDeviceApi.pas: -------------------------------------------------------------------------------- 1 | unit Win32.MMDeviceApi; 2 | 3 | interface 4 | 5 | {$IFDEF FPC} 6 | {$mode delphiunicode}{$H+} 7 | {$ENDIF} 8 | 9 | //{$I Win32.WinAPI.inc} 10 | 11 | uses 12 | Classes, SysUtils, 13 | Windows, 14 | ActiveX, 15 | Win32.WTypes, 16 | Win32.PropSys; 17 | 18 | // {$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)} 19 | // #define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) 20 | // #define E_UNSUPPORTED_TYPE HRESULT_FROM_WIN32(ERROR_UNSUPPORTED_TYPE) 21 | const 22 | DEVICE_STATE_ACTIVE = $00000001; 23 | DEVICE_STATE_DISABLED = $00000002; 24 | DEVICE_STATE_NOTPRESENT = $00000004; 25 | DEVICE_STATE_UNPLUGGED = $00000008; 26 | DEVICE_STATEMASK_ALL = $0000000f; 27 | 28 | ENDPOINT_SYSFX_ENABLED = $00000000; // System Effects are enabled. 29 | ENDPOINT_SYSFX_DISABLED = $00000001; // System Effects are disabled. 30 | 31 | 32 | // {$ENDIF} 33 | 34 | (* 35 | #ifdef INITGUID 36 | #define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY DECLSPEC_SELECTANY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } 37 | #else 38 | #define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY name 39 | {$ENDIF} // INITGUID 40 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FormFactor : TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 0); 41 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_ControlPanelPageProvider: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 1); 42 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Association: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 2); 43 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 3); 44 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 4); 45 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Disable_SysFx: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 5); 46 | 47 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FullRangeSpeakers: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 6); 48 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Supports_EventDriven_Mode: TGUID ='{$1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 7); 49 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_JackSubType: TGUID ='{1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 8); 50 | DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Default_VolumeInDb: TGUID ='{$1da5d803, $d492, $4edd, $8c, $23, $e0, $c0, $ff, $ee, $7f, $0e, 9); 51 | DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat: TGUID ='{f19f064d, $82c, $4e27, $bc, $73, $68, $82, $a1, $bb, $8e, $4c, 0); 52 | DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat: TGUID ='{e4870e26, $3cc5, $4cd2, $ba, $46, $ca, $a, $9a, $70, $ed, $4, 3); 53 | DEFINE_PROPERTYKEY(PKEY_AudioEndpointLogo_IconEffects: TGUID ='{$f1ab780d, $2010, $4ed3, $a3, $a6, $8b, $87, $f0, $f0, $c4, $76, 0); 54 | DEFINE_PROPERTYKEY(PKEY_AudioEndpointLogo_IconPath: TGUID ='{f1ab780d, $2010, $4ed3, $a3, $a6, $8b, $87, $f0, $f0, $c4, $76, 1); 55 | DEFINE_PROPERTYKEY(PKEY_AudioEndpointSettings_MenuText: TGUID ='{14242002, $0320, $4de4, $95, $55, $a7, $d8, $2b, $73, $c2, $86, 0); 56 | DEFINE_PROPERTYKEY(PKEY_AudioEndpointSettings_LaunchContract: TGUID ='{14242002, $0320, $4de4, $95, $55, $a7, $d8, $2b, $73, $c2, $86, 1); 57 | 58 | *) 59 | type 60 | { PPROPERTYKEY = ^TPROPERTYKEY; 61 | 62 | TPROPERTYKEY = packed record 63 | fmtid: TGUID; 64 | pid: DWORD; 65 | end; } 66 | 67 | 68 | TDIRECTX_AUDIO_ACTIVATION_PARAMS = record 69 | cbDirectXAudioActivationParams: DWORD; 70 | guidAudioSession: TGUID; 71 | dwAudioStreamFlags: DWORD; 72 | end; 73 | 74 | PDIRECTX_AUDIO_ACTIVATION_PARAMS = ^TDIRECTX_AUDIO_ACTIVATION_PARAMS; 75 | 76 | TEDataFlow = ( 77 | eRender = 0, 78 | eCapture = (eRender + 1), 79 | eAll = (eCapture + 1), 80 | EDataFlow_enum_count = (eAll + 1) 81 | ); 82 | 83 | TERole = ( 84 | eConsole = 0, 85 | eMultimedia = (eConsole + 1), 86 | eCommunications = (eMultimedia + 1), 87 | ERole_enum_count = (eCommunications + 1) 88 | ); 89 | 90 | 91 | TEndpointFormFactor = ( 92 | RemoteNetworkDevice = 0, 93 | Speakers = (RemoteNetworkDevice + 1), 94 | LineLevel = (Speakers + 1), 95 | Headphones = (LineLevel + 1), 96 | Microphone = (Headphones + 1), 97 | Headset = (Microphone + 1), 98 | Handset = (Headset + 1), 99 | UnknownDigitalPassthrough = (Handset + 1), 100 | SPDIF = (UnknownDigitalPassthrough + 1), 101 | DigitalAudioDisplayDevice = (SPDIF + 1), 102 | UnknownFormFactor = (DigitalAudioDisplayDevice + 1), 103 | EndpointFormFactor_enum_count = (UnknownFormFactor + 1) 104 | ); 105 | 106 | // #define HDMI DigitalAudioDisplayDevice 107 | 108 | // {$ENDIF} (* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) *) 109 | 110 | // {$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)} 111 | 112 | const 113 | CLSID_MMDeviceEnumerator: TGUID = '{BCDE0395-E52F-467C-8E3D-C4579291692E}'; 114 | // ---------------------------------------------------------------------- 115 | // Device Interface Classes 116 | // ---------------------------------------------------------------------- 117 | 118 | 119 | DEVINTERFACE_AUDIO_RENDER: TGUID = '{E6327CAD-DCEC-4949-AE8A-991E976A79D2}'; 120 | DEVINTERFACE_AUDIO_CAPTURE: TGUID = '{2EEF81BE-33FA-4800-9670-1CD474972C3F}'; 121 | //{$IF (NTDDI_VERSION > NTDDI_WINBLUE OR (NTDDI_VERSION = NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14)))} 122 | DEVINTERFACE_MIDI_OUTPUT: TGUID = '{6DC23320-AB33-4CE4-80D4-BBB3EBBF2814}'; 123 | DEVINTERFACE_MIDI_INPUT: TGUID = '{504BE32C-CCF6-4D2C-B73F-6F8B3747E22B}'; 124 | // {$ENDIF} 125 | // {$ENDIF} (* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) *) 126 | 127 | //{$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)} 128 | 129 | IID_IMMNotificationClient: TGUID = '{7991EEC9-7E89-4D85-8390-6C703CEC60C0}'; 130 | IID_IMMDevice: TGUID = '{D666063F-1587-4E43-81F1-B948E807363F}'; 131 | IID_IMMDeviceCollection: TGUID = '{0BD7A1BE-7A1A-44DB-8397-CC5392387B5E}'; 132 | IID_IMMEndpoint: TGUID = '{1BE09788-6894-4089-8586-9A2A6C265AC5}'; 133 | IID_IMMDeviceEnumerator: TGUID = '{A95664D2-9614-4F35-A746-DE8DB63617E6}'; 134 | IID_IMMDeviceActivator: TGUID = '{3B0D0EA4-D0A9-4B0E-935B-09516746FAC0}'; 135 | IID_IActivateAudioInterfaceCompletionHandler: TGUID = '{41D949AB-9862-444A-80F6-C261334DA5EB}'; 136 | IID_IActivateAudioInterfaceAsyncOperation: TGUID = '{72A22D78-CDE4-431D-B8CC-843A71199B6D}'; 137 | 138 | type 139 | LPCWSTR = PWideChar; 140 | LPWSTR = Pwidechar; 141 | 142 | IMMNotificationClient = interface(IUnknown) 143 | ['{7991EEC9-7E89-4D85-8390-6C703CEC60C0}'] 144 | function OnDeviceStateChanged(pwstrDeviceId: LPCWSTR; dwNewState: DWORD): HResult; stdcall; 145 | function OnDeviceAdded(pwstrDeviceId: LPCWSTR): HResult; stdcall; 146 | function OnDeviceRemoved(pwstrDeviceId: LPCWSTR): HResult; stdcall; 147 | function OnDefaultDeviceChanged(flow: TEDataFlow; role: TERole; pwstrDefaultDeviceId: LPCWSTR): HResult; stdcall; 148 | function OnPropertyValueChanged(pwstrDeviceId: LPCWSTR; const key: TPROPERTYKEY): HResult; stdcall; 149 | end; 150 | 151 | 152 | 153 | 154 | IMMDevice = interface(IUnknown) 155 | ['{D666063F-1587-4E43-81F1-B948E807363F}'] 156 | function Activate(const iid: TGUID; dwClsCtx: DWORD; pActivationParams: PPROPVARIANT; out ppInterface): HResult; stdcall; 157 | function OpenPropertyStore(stgmAccess: DWORD; out ppProperties: IPropertyStore): HResult; stdcall; 158 | function GetId(out ppstrId: LPWSTR): HResult; stdcall; 159 | function GetState(out pdwState: DWORD): HResult; stdcall; 160 | end; 161 | 162 | 163 | 164 | 165 | IMMDeviceCollection = interface(IUnknown) 166 | ['{0BD7A1BE-7A1A-44DB-8397-CC5392387B5E}'] 167 | function GetCount(out pcDevices: UINT32): HResult; stdcall; 168 | function Item(nDevice: UINT32; out ppDevice: IMMDevice): HResult; stdcall; 169 | end; 170 | 171 | 172 | 173 | 174 | IMMEndpoint = interface(IUnknown) 175 | ['{1BE09788-6894-4089-8586-9A2A6C265AC5}'] 176 | function GetDataFlow(out pDataFlow: TEDataFlow): HResult; stdcall; 177 | end; 178 | 179 | 180 | 181 | 182 | IMMDeviceEnumerator = interface(IUnknown) 183 | ['{A95664D2-9614-4F35-A746-DE8DB63617E6}'] 184 | function EnumAudioEndpoints(dataFlow: TEDataFlow; dwStateMask: DWORD; out ppDevices: IMMDeviceCollection): HResult; stdcall; 185 | function GetDefaultAudioEndpoint(dataFlow: TEDataFlow; role: TERole; out ppEndpoint: IMMDevice): HResult; stdcall; 186 | function GetDevice(pwstrId: LPCWSTR; out ppDevice: IMMDevice): HResult; stdcall; 187 | function RegisterEndpointNotificationCallback(pClient: IMMNotificationClient): HResult; stdcall; 188 | function UnregisterEndpointNotificationCallback(pClient: IMMNotificationClient): HResult; stdcall; 189 | end; 190 | 191 | 192 | 193 | 194 | IMMDeviceActivator = interface(IUnknown) 195 | ['{3B0D0EA4-D0A9-4B0E-935B-09516746FAC0}'] 196 | function Activate(const iid: TGUID; pDevice: IMMDevice; pActivationParams: PPROPVARIANT; out ppInterface): HResult; stdcall; 197 | end; 198 | 199 | 200 | 201 | (* IMMDeviceActivator is reserved for system use *) 202 | //{$ENDIF} (* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) *) 203 | 204 | //{$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)} 205 | 206 | 207 | 208 | IActivateAudioInterfaceAsyncOperation = interface; 209 | 210 | IActivateAudioInterfaceCompletionHandler = interface(IUnknown) 211 | ['{41D949AB-9862-444A-80F6-C261334DA5EB}'] 212 | function ActivateCompleted(activateOperation: IActivateAudioInterfaceAsyncOperation): HResult; stdcall; 213 | end; 214 | 215 | 216 | 217 | 218 | IActivateAudioInterfaceAsyncOperation = interface(IUnknown) 219 | ['{72A22D78-CDE4-431D-B8CC-843A71199B6D}'] 220 | function GetActivateResult(out activateResult: HRESULT; out activatedInterface): HResult; stdcall; 221 | end; 222 | 223 | 224 | 225 | 226 | // ---------------------------------------------------------------------- 227 | // Function: ActivateAudioInterfaceAsync 228 | // This function takes 229 | // * a device interface instance identifier representing either 230 | // - an audio device interface instance (e.g., built-in speakers), or 231 | // - an device interface class (e.g., audio render devices) 232 | // * a COM interface identifier 233 | // * activation parameters specific to the interface being activated 234 | // and asynchronously returns a pointer to the specified interface 235 | // ---------------------------------------------------------------------- 236 | function ActivateAudioInterfaceAsync(deviceInterfacePath: LPCWSTR; const riid: TGUID; activationParams: PPROPVARIANT; 237 | completionHandler: IActivateAudioInterfaceCompletionHandler; out activationOperation: IActivateAudioInterfaceAsyncOperation): HResult; 238 | stdcall; external; 239 | // {$ENDIF} (* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) *) 240 | 241 | // {$IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)} 242 | type 243 | TAudioExtensionParams = record 244 | AddPageParam: LPARAM; 245 | pEndpoint: IMMDevice; 246 | pPnpInterface: IMMDevice; 247 | pPnpDevnode: IMMDevice; 248 | end; 249 | 250 | 251 | (* 252 | LIBID_MMDeviceAPILib: TGUID ='{2FDAAFA3-7523-4F66-9957-9D5E7FE698F6}'; 253 | IMMDeviceEnumerator : TGUID ='{BCDE0395-E52F-467C-8E3D-C4579291692E}'; 254 | EXTERN_C const CLSID CLSID_MMDeviceEnumerator; 255 | *) 256 | 257 | 258 | 259 | implementation 260 | 261 | end. 262 | -------------------------------------------------------------------------------- /Units/Win32.MinWinBase.pas: -------------------------------------------------------------------------------- 1 | (************************************************************************ 2 | * * 3 | * minwinbase.h -- This module defines the 32-Bit Windows Base APIs * 4 | * * 5 | * Copyright (c) Microsoft Corp. All rights reserved. * 6 | * * 7 | ************************************************************************) 8 | unit Win32.MinWinBase; 9 | 10 | {$mode delphi} 11 | 12 | 13 | {$MACRO ON} 14 | 15 | 16 | // _WIN32_WINNT version constants 17 | 18 | {$DEFINE _WIN32_WINNT_NT4:=$0400} 19 | {$DEFINE _WIN32_WINNT_WIN2K := $0500} 20 | {$DEFINE _WIN32_WINNT_WINXP := $0501} 21 | {$DEFINE _WIN32_WINNT_WS03 := $0502} 22 | {$DEFINE _WIN32_WINNT_WIN6 := $0600} 23 | {$DEFINE _WIN32_WINNT_VISTA := $0600} 24 | {$DEFINE _WIN32_WINNT_WS08 := $0600} 25 | {$DEFINE _WIN32_WINNT_LONGHORN := $0600} 26 | {$DEFINE _WIN32_WINNT_WIN7 := $0601} 27 | {$DEFINE _WIN32_WINNT_WIN8 := $0602} 28 | {$DEFINE _WIN32_WINNT_WINBLUE := $0603} 29 | {$DEFINE _WIN32_WINNT_WINTHRESHOLD := $0A00}(* ABRACADABRA_THRESHOLD*) 30 | {$DEFINE _WIN32_WINNT_WIN10:=$0A00}(* ABRACADABRA_THRESHOLD*) 31 | {$DEFINE _WIN32_WINNT_WIN10_RS1:=$0A00}(* ABRACADABRA_THRESHOLD*) 32 | {$DEFINE _WIN32_WINNT_WIN10_RS4:=$0A00}(* ABRACADABRA_THRESHOLD*) 33 | 34 | {$DEFINE _WIN32_WINNT:=_WIN32_WINNT_WIN10} 35 | 36 | interface 37 | 38 | uses 39 | Windows, Classes, SysUtils, 40 | Win32.WinNT, 41 | Win32.NTStatus; 42 | 43 | const 44 | 45 | {$IF (_WIN32_WINNT >= $0400)} 46 | FIND_FIRST_EX_CASE_SENSITIVE = $00000001; 47 | FIND_FIRST_EX_LARGE_FETCH = $00000002; 48 | {$IF (NTDDI_VERSION >= NTDDI_WIN10_RS4)} 49 | FIND_FIRST_EX_ON_DISK_ENTRIES_ONLY = $00000004; 50 | {$endif} 51 | 52 | LOCKFILE_FAIL_IMMEDIATELY = $00000001; 53 | LOCKFILE_EXCLUSIVE_LOCK = $00000002; 54 | 55 | PROCESS_HEAP_REGION = $0001; 56 | PROCESS_HEAP_UNCOMMITTED_RANGE = $0002; 57 | PROCESS_HEAP_ENTRY_BUSY = $0004; 58 | PROCESS_HEAP_SEG_ALLOC = $0008; 59 | PROCESS_HEAP_ENTRY_MOVEABLE = $0010; 60 | PROCESS_HEAP_ENTRY_DDESHARE = $0020; 61 | 62 | 63 | // Debug APIs 64 | 65 | EXCEPTION_DEBUG_EVENT = 1; 66 | CREATE_THREAD_DEBUG_EVENT = 2; 67 | CREATE_PROCESS_DEBUG_EVENT = 3; 68 | EXIT_THREAD_DEBUG_EVENT = 4; 69 | EXIT_PROCESS_DEBUG_EVENT = 5; 70 | LOAD_DLL_DEBUG_EVENT = 6; 71 | UNLOAD_DLL_DEBUG_EVENT = 7; 72 | OUTPUT_DEBUG_STRING_EVENT = 8; 73 | RIP_EVENT = 9; 74 | 75 | (* Local Memory Flags *) 76 | LMEM_FIXED = $0000; 77 | LMEM_MOVEABLE = $0002; 78 | LMEM_NOCOMPACT = $0010; 79 | LMEM_NODISCARD = $0020; 80 | LMEM_ZEROINIT = $0040; 81 | LMEM_MODIFY = $0080; 82 | LMEM_DISCARDABLE = $0F00; 83 | LMEM_VALID_FLAGS = $0F72; 84 | LMEM_INVALID_HANDLE = $8000; 85 | 86 | LHND = (LMEM_MOVEABLE or LMEM_ZEROINIT); 87 | LPTR = (LMEM_FIXED or LMEM_ZEROINIT); 88 | 89 | NONZEROLHND = (LMEM_MOVEABLE); 90 | NONZEROLPTR = (LMEM_FIXED); 91 | 92 | (* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) *) 93 | LMEM_DISCARDED = $4000; 94 | LMEM_LOCKCOUNT = $00FF; 95 | 96 | 97 | // NUMA values 98 | 99 | 100 | NUMA_NO_PREFERRED_NODE: DWORD = -1; 101 | {$endif}(* _WIN32_WINNT >= $0400 *) 102 | 103 | (* compatibility macros *) 104 | STILL_ACTIVE = STATUS_PENDING; 105 | EXCEPTION_ACCESS_VIOLATION = STATUS_ACCESS_VIOLATION; 106 | EXCEPTION_DATATYPE_MISALIGNMENT = STATUS_DATATYPE_MISALIGNMENT; 107 | EXCEPTION_BREAKPOINT = STATUS_BREAKPOINT; 108 | EXCEPTION_SINGLE_STEP = STATUS_SINGLE_STEP; 109 | EXCEPTION_ARRAY_BOUNDS_EXCEEDED = STATUS_ARRAY_BOUNDS_EXCEEDED; 110 | EXCEPTION_FLT_DENORMAL_OPERAND = STATUS_FLOAT_DENORMAL_OPERAND; 111 | EXCEPTION_FLT_DIVIDE_BY_ZERO = STATUS_FLOAT_DIVIDE_BY_ZERO; 112 | EXCEPTION_FLT_INEXACT_RESULT = STATUS_FLOAT_INEXACT_RESULT; 113 | EXCEPTION_FLT_INVALID_OPERATION = STATUS_FLOAT_INVALID_OPERATION; 114 | EXCEPTION_FLT_OVERFLOW = STATUS_FLOAT_OVERFLOW; 115 | EXCEPTION_FLT_STACK_CHECK = STATUS_FLOAT_STACK_CHECK; 116 | EXCEPTION_FLT_UNDERFLOW = STATUS_FLOAT_UNDERFLOW; 117 | EXCEPTION_INT_DIVIDE_BY_ZERO = STATUS_INTEGER_DIVIDE_BY_ZERO; 118 | EXCEPTION_INT_OVERFLOW = STATUS_INTEGER_OVERFLOW; 119 | EXCEPTION_PRIV_INSTRUCTION = STATUS_PRIVILEGED_INSTRUCTION; 120 | EXCEPTION_IN_PAGE_ERROR = STATUS_IN_PAGE_ERROR; 121 | EXCEPTION_ILLEGAL_INSTRUCTION = STATUS_ILLEGAL_INSTRUCTION; 122 | EXCEPTION_NONCONTINUABLE_EXCEPTION = STATUS_NONCONTINUABLE_EXCEPTION; 123 | EXCEPTION_STACK_OVERFLOW = STATUS_STACK_OVERFLOW; 124 | EXCEPTION_INVALID_DISPOSITION = STATUS_INVALID_DISPOSITION; 125 | EXCEPTION_GUARD_PAGE = STATUS_GUARD_PAGE_VIOLATION; 126 | EXCEPTION_INVALID_HANDLE = STATUS_INVALID_HANDLE; 127 | EXCEPTION_POSSIBLE_DEADLOCK = STATUS_POSSIBLE_DEADLOCK; 128 | CONTROL_C_EXIT = STATUS_CONTROL_C_EXIT; 129 | 130 | type 131 | 132 | TSECURITY_ATTRIBUTES = record 133 | nLength: DWORD; 134 | lpSecurityDescriptor: LPVOID; 135 | bInheritHandle: longbool; 136 | end; 137 | PSECURITY_ATTRIBUTES = ^TSECURITY_ATTRIBUTES; 138 | 139 | TOVERLAPPED = record 140 | Internal: ULONG_PTR; 141 | InternalHigh: ULONG_PTR; 142 | case integer of 143 | 0: (Offset: DWORD; 144 | OffsetHigh: DWORD; 145 | hEvent: THANDLE;); 146 | 1: (_Pointer: PVOID;); 147 | end; 148 | POVERLAPPED = ^TOVERLAPPED; 149 | 150 | TOVERLAPPED_ENTRY = record 151 | lpCompletionKey: ULONG_PTR; 152 | lpOverlapped: POVERLAPPED; 153 | Internal: ULONG_PTR; 154 | dwNumberOfBytesTransferred: DWORD; 155 | end; 156 | POVERLAPPED_ENTRY = ^TOVERLAPPED_ENTRY; 157 | 158 | 159 | // File System time stamps are represented with the following structure: 160 | 161 | 162 | 163 | TFILETIME = record 164 | dwLowDateTime: DWORD; 165 | dwHighDateTime: DWORD; 166 | end; 167 | PFILETIME = ^TFILETIME; 168 | 169 | 170 | 171 | // System time is represented with the following structure: 172 | 173 | 174 | TSYSTEMTIME = record 175 | wYear: word; 176 | wMonth: word; 177 | wDayOfWeek: word; 178 | wDay: word; 179 | wHour: word; 180 | wMinute: word; 181 | wSecond: word; 182 | wMilliseconds: word; 183 | end; 184 | PSYSTEMTIME = ^TSYSTEMTIME; 185 | 186 | 187 | TWIN32_FIND_DATAA = record 188 | dwFileAttributes: DWORD; 189 | ftCreationTime: TFILETIME; 190 | ftLastAccessTime: TFILETIME; 191 | ftLastWriteTime: TFILETIME; 192 | nFileSizeHigh: DWORD; 193 | nFileSizeLow: DWORD; 194 | dwReserved0: DWORD; 195 | dwReserved1: DWORD; 196 | cFileName: array [0.. MAX_PATH - 1] of char; 197 | cAlternateFileName: array[0..13] of char; 198 | {$IFDEF _MAC} 199 | dwFileType: DWORD; 200 | dwCreatorType: DWORD; 201 | wFinderFlags: word; 202 | {$ENDIF} 203 | 204 | end; 205 | PWIN32_FIND_DATAA = ^TWIN32_FIND_DATAA; 206 | 207 | 208 | TWIN32_FIND_DATAW = record 209 | dwFileAttributes: DWORD; 210 | ftCreationTime: TFILETIME; 211 | ftLastAccessTime: TFILETIME; 212 | ftLastWriteTime: TFILETIME; 213 | nFileSizeHigh: DWORD; 214 | nFileSizeLow: DWORD; 215 | dwReserved0: DWORD; 216 | dwReserved1: DWORD; 217 | cFileName: array[0.. MAX_PATH - 1] of WCHAR; 218 | cAlternateFileName: array [0.. 13] of WCHAR; 219 | {$IFDEF _MAC} 220 | dwFileType: DWORD; 221 | dwCreatorType: DWORD; 222 | wFinderFlags: word; 223 | {$endif} 224 | end; 225 | PWIN32_FIND_DATAW = ^TWIN32_FIND_DATAW; 226 | 227 | 228 | 229 | {$IF (_WIN32_WINNT >= $0400)} 230 | TFINDEX_INFO_LEVELS = ( 231 | FindExInfoStandard, 232 | FindExInfoBasic, 233 | FindExInfoMaxInfoLevel); 234 | 235 | 236 | 237 | TFINDEX_SEARCH_OPS = ( 238 | FindExSearchNameMatch, 239 | FindExSearchLimitToDirectories, 240 | FindExSearchLimitToDevices, 241 | FindExSearchMaxSearchOp); 242 | {$endif}(* _WIN32_WINNT >= $0400 *) 243 | 244 | {$IF (_WIN32_WINNT >= $0400)} 245 | {$IF (NTDDI_VERSION >= NTDDI_WIN10_RS3)} 246 | TREAD_DIRECTORY_NOTIFY_INFORMATION_CLASS = ( 247 | ReadDirectoryNotifyInformation = 1, 248 | ReadDirectoryNotifyExtendedInformation // 2 249 | ); 250 | PREAD_DIRECTORY_NOTIFY_INFORMATION_CLASS = ^TREAD_DIRECTORY_NOTIFY_INFORMATION_CLASS; 251 | {$endif} 252 | {$endif}(* _WIN32_WINNT >= $0400 *) 253 | 254 | TGET_FILEEX_INFO_LEVELS = ( 255 | GetFileExInfoStandard, 256 | GetFileExMaxInfoLevel); 257 | 258 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN)} 259 | TFILE_INFO_BY_HANDLE_CLASS = ( 260 | FileBasicInfo, 261 | FileStandardInfo, 262 | FileNameInfo, 263 | FileRenameInfo, 264 | FileDispositionInfo, 265 | FileAllocationInfo, 266 | FileEndOfFileInfo, 267 | FileStreamInfo, 268 | FileCompressionInfo, 269 | FileAttributeTagInfo, 270 | FileIdBothDirectoryInfo, 271 | FileIdBothDirectoryRestartInfo, 272 | FileIoPriorityHintInfo, 273 | FileRemoteProtocolInfo, 274 | FileFullDirectoryInfo, 275 | FileFullDirectoryRestartInfo, 276 | {$if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 277 | FileStorageInfo, 278 | FileAlignmentInfo, 279 | FileIdInfo, 280 | FileIdExtdDirectoryInfo, 281 | FileIdExtdDirectoryRestartInfo, 282 | {$ENDIF} 283 | {$if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1) } 284 | FileDispositionInfoEx, 285 | FileRenameInfoEx, 286 | {$ENDIF} 287 | MaximumFileInfoByHandleClass); 288 | PFILE_INFO_BY_HANDLE_CLASS = ^TFILE_INFO_BY_HANDLE_CLASS; 289 | {$ENDIF} 290 | 291 | POVERLAPPED_COMPLETION_ROUTINE = procedure(dwErrorCode: DWORD; dwNumberOfBytesTransfered: DWORD; var lpOverlapped: TOVERLAPPED); stdcall; 292 | 293 | 294 | 295 | TPROCESS_HEAP_ENTRY_Block = record 296 | hMem: THANDLE; 297 | dwReserved: array [0..2] of DWORD; 298 | end; 299 | 300 | TPROCESS_HEAP_ENTRY_Region = record 301 | dwCommittedSize: DWORD; 302 | dwUnCommittedSize: DWORD; 303 | lpFirstBlock: pointer; 304 | lpLastBlock: pointer; 305 | end; 306 | 307 | TPROCESS_HEAP_ENTRY = record 308 | lpData: pointer; 309 | cbData: DWORD; 310 | cbOverhead: byte; 311 | iRegionIndex: byte; 312 | wFlags: word; 313 | case integer of 314 | 0: (Block: TPROCESS_HEAP_ENTRY_Block); 315 | 1: (Region: TPROCESS_HEAP_ENTRY_Region); 316 | end; 317 | PPROCESS_HEAP_ENTRY = ^TPROCESS_HEAP_ENTRY; 318 | 319 | TREASON_CONTEXT_Detailed = record 320 | LocalizedReasonModule: HMODULE; 321 | LocalizedReasonId: ULONG; 322 | ReasonStringCount: ULONG; 323 | ReasonStrings: PLPWSTR; 324 | end; 325 | 326 | TREASON_CONTEXT_Reason = record 327 | case integer of 328 | 0: (Detailed: TREASON_CONTEXT_Detailed); 329 | 1: (SimpleReasonString: LPWSTR); 330 | end; 331 | 332 | TREASON_CONTEXT = record 333 | Version: ULONG; 334 | Flags: DWORD; 335 | Reason: TREASON_CONTEXT_Reason; 336 | end; 337 | PREASON_CONTEXT = ^TREASON_CONTEXT; 338 | 339 | PTHREAD_START_ROUTINE = function(lpThreadParameter: pointer): DWORD; stdcall; 340 | 341 | 342 | 343 | PENCLAVE_ROUTINE = function(lpThreadParameter: pointer): pointer; stdcall; 344 | 345 | 346 | TEXCEPTION_DEBUG_INFO = record 347 | ExceptionRecord: TEXCEPTION_RECORD; 348 | dwFirstChance: DWORD; 349 | end; 350 | PEXCEPTION_DEBUG_INFO = ^TEXCEPTION_DEBUG_INFO; 351 | 352 | TCREATE_THREAD_DEBUG_INFO = record 353 | hThread: THANDLE; 354 | lpThreadLocalBase: pointer; 355 | lpStartAddress: PTHREAD_START_ROUTINE; 356 | end; 357 | PCREATE_THREAD_DEBUG_INFO = ^TCREATE_THREAD_DEBUG_INFO; 358 | 359 | TCREATE_PROCESS_DEBUG_INFO = record 360 | hFile: THANDLE; 361 | hProcess: THANDLE; 362 | hThread: THANDLE; 363 | lpBaseOfImage: pointer; 364 | dwDebugInfoFileOffset: DWORD; 365 | nDebugInfoSize: DWORD; 366 | lpThreadLocalBase: pointer; 367 | lpStartAddress: PTHREAD_START_ROUTINE; 368 | lpImageName: pointer; 369 | fUnicode: word; 370 | end; 371 | PCREATE_PROCESS_DEBUG_INFO = ^TCREATE_PROCESS_DEBUG_INFO; 372 | 373 | TEXIT_THREAD_DEBUG_INFO = record 374 | dwExitCode: DWORD; 375 | end; 376 | PEXIT_THREAD_DEBUG_INFO = ^TEXIT_THREAD_DEBUG_INFO; 377 | 378 | TEXIT_PROCESS_DEBUG_INFO = record 379 | dwExitCode: DWORD; 380 | end; 381 | PEXIT_PROCESS_DEBUG_INFO = ^TEXIT_PROCESS_DEBUG_INFO; 382 | 383 | TLOAD_DLL_DEBUG_INFO = record 384 | hFile: THANDLE; 385 | lpBaseOfDll: pointer; 386 | dwDebugInfoFileOffset: DWORD; 387 | nDebugInfoSize: DWORD; 388 | lpImageName: pointer; 389 | fUnicode: word; 390 | end; 391 | PLOAD_DLL_DEBUG_INFO = ^TLOAD_DLL_DEBUG_INFO; 392 | 393 | TUNLOAD_DLL_DEBUG_INFO = record 394 | lpBaseOfDll: pointer; 395 | end; 396 | PUNLOAD_DLL_DEBUG_INFO = ^TUNLOAD_DLL_DEBUG_INFO; 397 | 398 | TOUTPUT_DEBUG_STRING_INFO = record 399 | lpDebugStringData: LPSTR; 400 | fUnicode: word; 401 | nDebugStringLength: word; 402 | end; 403 | POUTPUT_DEBUG_STRING_INFO = ^TOUTPUT_DEBUG_STRING_INFO; 404 | 405 | TRIP_INFO = record 406 | dwError: DWORD; 407 | dwType: DWORD; 408 | end; 409 | PRIP_INFO = ^TRIP_INFO; 410 | 411 | 412 | TDEBUG_EVENT = record 413 | dwDebugEventCode: DWORD; 414 | dwProcessId: DWORD; 415 | dwThreadId: DWORD; 416 | case integer of 417 | 0: (Exception: TEXCEPTION_DEBUG_INFO); 418 | 1: (CreateThread: TCREATE_THREAD_DEBUG_INFO); 419 | 2: (CreateProcessInfo: TCREATE_PROCESS_DEBUG_INFO); 420 | 3: (ExitThread: TEXIT_THREAD_DEBUG_INFO); 421 | 4: (ExitProcess: TEXIT_PROCESS_DEBUG_INFO); 422 | 5: (LoadDll: TLOAD_DLL_DEBUG_INFO); 423 | 6: (UnloadDll: TUNLOAD_DLL_DEBUG_INFO); 424 | 7: (DebugString: TOUTPUT_DEBUG_STRING_INFO); 425 | 8: (RipInfo: TRIP_INFO); 426 | end; 427 | PDEBUG_EVENT = ^TDEBUG_EVENT; 428 | 429 | function LocalDiscard( hMem:HLOCAL ):HLOCAL; stdcall; 430 | 431 | implementation 432 | 433 | function LocalDiscard(hMem: HLOCAL): HLOCAL; stdcall; inline; 434 | begin 435 | result:=LocalReAlloc(hMem,0, LMEM_MOVEABLE); 436 | end; 437 | 438 | 439 | 440 | end. 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | -------------------------------------------------------------------------------- /Units/Win32.NTDef.pas: -------------------------------------------------------------------------------- 1 | unit Win32.NTDef; 2 | 3 | {$mode delphiunicode}{$H+} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Classes, SysUtils; 9 | 10 | type 11 | PZZWSTR = PWideChar; 12 | PCZZWSTR = PWideChar; 13 | 14 | PCZZSTR = PAnsiChar; 15 | 16 | 17 | PHICON = ^HICON; 18 | 19 | // sind woanders definiert, aber momentan zur vereinfachung 20 | 21 | PWSTR = ^WCHAR; 22 | 23 | TSECURITY_ATTRIBUTES = record 24 | nLength:DWORD; 25 | lpSecurityDescriptor:Pointer; 26 | bInheritHandle:BOOLean; 27 | end; 28 | 29 | PSECURITY_ATTRIBUTES = ^TSECURITY_ATTRIBUTES; 30 | 31 | implementation 32 | 33 | end. 34 | 35 | -------------------------------------------------------------------------------- /Units/Win32.OLEDB.pas: -------------------------------------------------------------------------------- 1 | unit Win32.OleDB; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Classes, SysUtils; 9 | 10 | type 11 | TINHERITED_FROMA = record 12 | GenerationGap: LONG; 13 | AncestorName: LPSTR; 14 | end; 15 | 16 | 17 | PINHERITED_FROMA = ^TINHERITED_FROMA; 18 | 19 | TINHERITED_FROMW = record 20 | GenerationGap: LONG; 21 | AncestorName: LPWSTR; 22 | end; 23 | 24 | PINHERITED_FROMW = ^TINHERITED_FROMW; 25 | 26 | implementation 27 | 28 | end. 29 | 30 | 31 | -------------------------------------------------------------------------------- /Units/Win32.ObjIdl.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ObjIdl; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Classes, SysUtils; 9 | 10 | type 11 | 12 | 13 | 14 | // ToDo 15 | 16 | IDataObject = interface(IUnknown) 17 | ['{0000010e-0000-0000-C000-000000000046}'] 18 | end; 19 | 20 | IBindCtx = interface(IUnknown) 21 | ['{0000000e-0000-0000-C000-000000000046}'] 22 | end; 23 | 24 | 25 | 26 | IPersist = interface(IUnknown) 27 | ['{0000010c-0000-0000-C000-000000000046}'] 28 | function GetClassID(out pClassID: CLSID): HResult; stdcall; 29 | end; 30 | 31 | IStorage = interface(IUnknown) 32 | ['{0000000b-0000-0000-C000-000000000046}'] 33 | end; 34 | 35 | 36 | IMalloc = interface(IUnknown) 37 | ['{00000002-0000-0000-C000-000000000046}'] 38 | end; 39 | 40 | implementation 41 | 42 | end. 43 | 44 | 45 | -------------------------------------------------------------------------------- /Units/Win32.ObjIdlBase.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ObjIdlBase; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Windows,Classes, SysUtils; 9 | 10 | type 11 | IStream = interface (IUnknown) {Wrong !!!} 12 | ['{0000000c-0000-0000-C000-000000000046}'] 13 | end; 14 | 15 | implementation 16 | 17 | end. 18 | 19 | -------------------------------------------------------------------------------- /Units/Win32.ObjectArray.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ObjectArray; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | 21 | //+------------------------------------------------------------------------- 22 | 23 | // Microsoft Windows 24 | // Copyright (c) Microsoft Corporation. All rights reserved. 25 | 26 | //-------------------------------------------------------------------------- 27 | 28 | { Header Definition: 10.0.14393.0 } 29 | 30 | {$IFDEF FPC} 31 | {$mode delphiunicode}{$H+} 32 | {$ENDIF} 33 | 34 | {$I Win32.WinAPI.inc} 35 | 36 | interface 37 | 38 | uses 39 | Windows, Classes, SysUtils; 40 | 41 | const 42 | IID_IObjectArray: TGUID = '{92CA9DCD-5622-4bba-A805-5E9F541BD8C9}'; 43 | IID_IObjectCollection: TGUID = '{5632b1a4-e38a-400a-928a-d4cd63230295}'; 44 | 45 | //{$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 46 | 47 | type 48 | 49 | IObjectArray = interface(IUnknown) 50 | ['{92CA9DCD-5622-4bba-A805-5E9F541BD8C9}'] 51 | function GetCount(out pcObjects: UINT): HResult; stdcall; 52 | function GetAt(uiIndex: UINT; const riid: TGUID; out ppv): HResult; stdcall; 53 | end; 54 | 55 | 56 | IObjectCollection = interface(IObjectArray) 57 | ['{5632b1a4-e38a-400a-928a-d4cd63230295}'] 58 | function AddObject(punk: IUnknown): HResult; stdcall; 59 | function AddFromArray(poaSource: IObjectArray): HResult; stdcall; 60 | function RemoveObjectAt(uiIndex: UINT): HResult; stdcall; 61 | function Clear(): HResult; stdcall; 62 | end; 63 | 64 | 65 | //{$ENDIF} 66 | 67 | implementation 68 | 69 | end. 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Units/Win32.OleIdl.pas: -------------------------------------------------------------------------------- 1 | unit Win32.OleIdl; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Classes, SysUtils; 9 | 10 | const 11 | MK_ALT = $20; 12 | 13 | DROPEFFECT_NONE = 0; 14 | 15 | DROPEFFECT_COPY = 1; 16 | 17 | DROPEFFECT_MOVE = 2; 18 | 19 | DROPEFFECT_LINK = 4; 20 | 21 | DROPEFFECT_SCROLL = $80000000; 22 | 23 | type 24 | IOleWindow = interface(IUnknown) 25 | ['{00000114-0000-0000-C000-000000000046}'] 26 | end; 27 | 28 | TOleMenuGroupWidths = record 29 | Width: array [0.. 5] of LONG; 30 | end; 31 | POLEMENUGROUPWIDTHS = ^TOleMenuGroupWidths; 32 | 33 | HOLEMENU = HGLOBAL; 34 | 35 | implementation 36 | 37 | end. 38 | 39 | -------------------------------------------------------------------------------- /Units/Win32.ProcessThreadsAPI.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ProcessThreadsAPI; 2 | 3 | {$mode delphiunicode}{$H+} 4 | 5 | interface 6 | 7 | uses 8 | Windows,Classes, SysUtils; 9 | 10 | 11 | type 12 | 13 | TPROCESS_INFORMATION = record 14 | hProcess:HANDLE; 15 | hThread:HANDLE; 16 | dwProcessId:DWORD; 17 | dwThreadId:DWORD; 18 | end; 19 | PPROCESS_INFORMATION=^TPROCESS_INFORMATION; 20 | 21 | implementation 22 | 23 | end. 24 | 25 | -------------------------------------------------------------------------------- /Units/Win32.PropIdl.pas: -------------------------------------------------------------------------------- 1 | unit Win32.PropIdl; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Classes, SysUtils, Windows, ActiveX; 9 | 10 | { 11 | type 12 | TPROPVARIANT = packed record 13 | 14 | end; 15 | PPROPVARIANT = ^TPROPVARIANT; } 16 | 17 | function PropVariantClear(var pvar: TPROPVARIANT): HResult; stdcall; external 'Ole32.dll'; 18 | 19 | procedure PropVariantInit(var pvar: TPROPVARIANT); inline; 20 | 21 | implementation 22 | 23 | 24 | 25 | procedure PropVariantInit(var pvar: TPROPVARIANT); inline; 26 | begin 27 | ZeroMemory(@pvar, sizeOf(TPROPVARIANT)); 28 | end; 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /Units/Win32.PropSys.pas: -------------------------------------------------------------------------------- 1 | unit Win32.PropSys; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Classes, SysUtils, 9 | ActiveX, 10 | Win32.WTypes; 11 | 12 | type 13 | 14 | REFPROPERTYKEY = PPROPERTYKEY; 15 | 16 | TGETPROPERTYSTOREFLAGS = ( 17 | // If no flags are specified (GPS_DEFAULT), a read-only property store is returned that includes properties for the file or item. 18 | // In the case that the shell item is a file, the property store contains: 19 | // 1. properties about the file from the file system 20 | // 2. properties from the file itself provided by the file's property handler, unless that file is offline, 21 | // see GPS_OPENSLOWITEM 22 | // 3. if requested by the file's property handler and supported by the file system, properties stored in the 23 | // alternate property store. 24 | 25 | // Non-file shell items should return a similar read-only store 26 | 27 | // Specifying other GPS_ flags modifies the store that is returned 28 | GPS_DEFAULT = $00000000, 29 | GPS_HANDLERPROPERTIESONLY = $00000001, // only include properties directly from the file's property handler 30 | GPS_READWRITE = $00000002, // Writable stores will only include handler properties 31 | GPS_TEMPORARY = $00000004, // A read/write store that only holds properties for the lifetime of the IShellItem object 32 | GPS_FASTPROPERTIESONLY = $00000008, 33 | // do not include any properties from the file's property handler (because the file's property handler will hit the disk) 34 | GPS_OPENSLOWITEM = $00000010, 35 | // include properties from a file's property handler, even if it means retrieving the file from offline storage. 36 | GPS_DELAYCREATION = $00000020, 37 | // delay the creation of the file's property handler until those properties are read, written, or enumerated 38 | GPS_BESTEFFORT = $00000040, 39 | // For readonly stores, succeed and return all available properties, even if one or more sources of properties fails. Not valid with GPS_READWRITE. 40 | GPS_NO_OPLOCK = $00000080, // some data sources protect the read property store with an oplock, this disables that 41 | GPS_PREFERQUERYPROPERTIES = $00000100, // For file system WDS results, only retrieve properties from the indexer 42 | GPS_EXTRINSICPROPERTIES = $00000200, // include properties from the file's secondary stream 43 | GPS_EXTRINSICPROPERTIESONLY = $00000400, // only include properties from the file's secondary stream 44 | GPS_MASK_VALID = $000007FF); 45 | 46 | 47 | IPropertyChangeArray = interface(IUnknown) 48 | ['{380f5cad-1b5e-42f2-805d-637fd392d31e}'] 49 | end; 50 | 51 | IPropertyStore = interface(IUnknown) 52 | ['{886d8eeb-8cf2-4446-8d02-cdba1dbdcf99}'] 53 | function GetCount( 54 | out cProps:DWORD):HResult; stdcall; 55 | 56 | function GetAt( 57 | iProp:DWORD; 58 | out pkey:TPROPERTYKEY):HResult; stdcall; 59 | 60 | function GetValue( 61 | const key:TPROPERTYKEY; 62 | out pv:TPROPVARIANT) :HResult; stdcall; 63 | 64 | function SetValue( 65 | const key:TPROPERTYKEY; 66 | const propvar:TPROPVARIANT):HResult; stdcall; 67 | 68 | function Commit( ) :HResult; stdcall; 69 | end; 70 | 71 | 72 | IPropertyDescriptionList = interface(IUnknown) 73 | ['{1f9fc1d0-c39b-4b26-817f-011967d3440e}'] 74 | end; 75 | 76 | implementation 77 | 78 | end. 79 | -------------------------------------------------------------------------------- /Units/Win32.RPCNDR.pas: -------------------------------------------------------------------------------- 1 | unit Win32.RPCNDR; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Classes, SysUtils; 9 | 10 | type 11 | THyper = double; 12 | PHyper = ^THyper; 13 | 14 | implementation 15 | 16 | end. 17 | 18 | 19 | -------------------------------------------------------------------------------- /Units/Win32.SDKDDKVer.inc: -------------------------------------------------------------------------------- 1 | (* 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Module Name: 6 | 7 | sdkddkver.h 8 | 9 | Abstract: 10 | 11 | Master include file for versioning windows SDK/DDK. 12 | 13 | *) 14 | 15 | // _WIN32_WINNT version constants 16 | 17 | {$DEFINE _WIN32_WINNT_NT4 := $0400} 18 | {$DEFINE _WIN32_WINNT_WIN2K := $0500} 19 | {$DEFINE _WIN32_WINNT_WINXP := $0501} 20 | {$DEFINE _WIN32_WINNT_WS03 := $0502} 21 | {$DEFINE _WIN32_WINNT_WIN6 := $0600} 22 | {$DEFINE _WIN32_WINNT_VISTA := $0600} 23 | {$DEFINE _WIN32_WINNT_WS08 := $0600} 24 | {$DEFINE _WIN32_WINNT_LONGHORN := $0600} 25 | {$DEFINE _WIN32_WINNT_WIN7 := $0601} 26 | {$DEFINE _WIN32_WINNT_WIN8 := $0602} 27 | {$DEFINE _WIN32_WINNT_WINBLUE := $0603} 28 | {$DEFINE _WIN32_WINNT_WINTHRESHOLD := $0A00} 29 | {$DEFINE _WIN32_WINNT_WIN10 := $0A00} 30 | 31 | 32 | // _WIN32_IE_ version constants 33 | 34 | {$DEFINE _WIN32_IE_IE20 := $0200} 35 | {$DEFINE _WIN32_IE_IE30 := $0300} 36 | {$DEFINE _WIN32_IE_IE302 := $0302} 37 | {$DEFINE _WIN32_IE_IE40 := $0400} 38 | {$DEFINE _WIN32_IE_IE401 := $0401} 39 | {$DEFINE _WIN32_IE_IE50 := $0500} 40 | {$DEFINE _WIN32_IE_IE501 := $0501} 41 | {$DEFINE _WIN32_IE_IE55 := $0550} 42 | {$DEFINE _WIN32_IE_IE60 := $0600} 43 | {$DEFINE _WIN32_IE_IE60SP1 := $0601} 44 | {$DEFINE _WIN32_IE_IE60SP2 := $0603} 45 | {$DEFINE _WIN32_IE_IE70 := $0700} 46 | {$DEFINE _WIN32_IE_IE80 := $0800} 47 | {$DEFINE _WIN32_IE_IE90 := $0900} 48 | {$DEFINE _WIN32_IE_IE100 := $0A00} 49 | {$DEFINE _WIN32_IE_IE110 := $0A00}(* ABRACADABRA_THRESHOLD *) 50 | 51 | 52 | // IE <-> OS version mapping 53 | 54 | // NT4 supports IE versions 2.0 -> 6.0 SP1 55 | {$DEFINE _WIN32_IE_NT4 := _WIN32_IE_IE20} 56 | {$DEFINE _WIN32_IE_NT4SP1 := _WIN32_IE_IE20} 57 | {$DEFINE _WIN32_IE_NT4SP2 := _WIN32_IE_IE20} 58 | {$DEFINE _WIN32_IE_NT4SP3 := _WIN32_IE_IE302} 59 | {$DEFINE _WIN32_IE_NT4SP4 := _WIN32_IE_IE401} 60 | {$DEFINE _WIN32_IE_NT4SP5 :=_WIN32_IE_IE401} 61 | {$DEFINE _WIN32_IE_NT4SP6 := _WIN32_IE_IE50} 62 | // Win98 supports IE versions 4.01 -> 6.0 SP1 63 | {$DEFINE _WIN32_IE_WIN98 := _WIN32_IE_IE401} 64 | // Win98SE supports IE versions 5.0 -> 6.0 SP1 65 | {$DEFINE _WIN32_IE_WIN98SE := _WIN32_IE_IE50} 66 | // WinME supports IE versions 5.5 -> 6.0 SP1 67 | {$DEFINE _WIN32_IE_WINME :=_WIN32_IE_IE55} 68 | // Win2k supports IE versions 5.01 -> 6.0 SP1 69 | {$DEFINE _WIN32_IE_WIN2K := _WIN32_IE_IE501} 70 | {$DEFINE _WIN32_IE_WIN2KSP1 := _WIN32_IE_IE501} 71 | {$DEFINE _WIN32_IE_WIN2KSP2 := _WIN32_IE_IE501} 72 | {$DEFINE _WIN32_IE_WIN2KSP3 := _WIN32_IE_IE501} 73 | {$DEFINE _WIN32_IE_WIN2KSP4 := _WIN32_IE_IE501} 74 | {$DEFINE _WIN32_IE_XP := _WIN32_IE_IE60} 75 | {$DEFINE _WIN32_IE_XPSP1 := _WIN32_IE_IE60SP1} 76 | {$DEFINE _WIN32_IE_XPSP2 := _WIN32_IE_IE60SP2} 77 | {$DEFINE _WIN32_IE_WS03 := $0602} 78 | {$DEFINE _WIN32_IE_WS03SP1 := _WIN32_IE_IE60SP2} 79 | {$DEFINE _WIN32_IE_WIN6 := _WIN32_IE_IE70} 80 | {$DEFINE _WIN32_IE_LONGHORN := _WIN32_IE_IE70} 81 | {$DEFINE _WIN32_IE_WIN7 := _WIN32_IE_IE80} 82 | {$DEFINE _WIN32_IE_WIN8 := _WIN32_IE_IE100} 83 | {$DEFINE _WIN32_IE_WINBLUE := _WIN32_IE_IE100} 84 | {$DEFINE _WIN32_IE_WINTHRESHOLD := _WIN32_IE_IE110}(* ABRACADABRA_THRESHOLD *) 85 | {$DEFINE _WIN32_IE_WIN10 := _WIN32_IE_IE110}(* ABRACADABRA_THRESHOLD *) 86 | 87 | 88 | 89 | // NTDDI version constants 90 | 91 | {$DEFINE NTDDI_WIN2K := $05000000} 92 | {$DEFINE NTDDI_WIN2KSP1 := $05000100} 93 | {$DEFINE NTDDI_WIN2KSP2 := $05000200} 94 | {$DEFINE NTDDI_WIN2KSP3 := $05000300} 95 | {$DEFINE NTDDI_WIN2KSP4 := $05000400} 96 | 97 | {$DEFINE NTDDI_WINXP := $05010000} 98 | {$DEFINE NTDDI_WINXPSP1 := $05010100} 99 | {$DEFINE NTDDI_WINXPSP2 := $05010200} 100 | {$DEFINE NTDDI_WINXPSP3 := $05010300} 101 | {$DEFINE NTDDI_WINXPSP4 := $05010400} 102 | 103 | {$DEFINE NTDDI_WS03 := $05020000} 104 | {$DEFINE NTDDI_WS03SP1 := $05020100} 105 | {$DEFINE NTDDI_WS03SP2 := $05020200} 106 | {$DEFINE NTDDI_WS03SP3 := $05020300} 107 | {$DEFINE NTDDI_WS03SP4 := $05020400} 108 | 109 | {$DEFINE NTDDI_WIN6 := $06000000} 110 | {$DEFINE NTDDI_WIN6SP1 := $06000100} 111 | {$DEFINE NTDDI_WIN6SP2 := $06000200} 112 | {$DEFINE NTDDI_WIN6SP3 := $06000300} 113 | {$DEFINE NTDDI_WIN6SP4 := $06000400} 114 | 115 | {$DEFINE NTDDI_VISTA := NTDDI_WIN6} 116 | {$DEFINE NTDDI_VISTASP1:= NTDDI_WIN6SP1} 117 | {$DEFINE NTDDI_VISTASP2:= NTDDI_WIN6SP2} 118 | {$DEFINE NTDDI_VISTASP3:= NTDDI_WIN6SP3} 119 | {$DEFINE NTDDI_VISTASP4:= NTDDI_WIN6SP4} 120 | 121 | {$DEFINE NTDDI_LONGHORN:= NTDDI_VISTA} 122 | 123 | {$DEFINE NTDDI_WS08:= NTDDI_WIN6SP1} 124 | {$DEFINE NTDDI_WS08SP2:= NTDDI_WIN6SP2} 125 | {$DEFINE NTDDI_WS08SP3:= NTDDI_WIN6SP3} 126 | {$DEFINE NTDDI_WS08SP4:= NTDDI_WIN6SP4} 127 | 128 | {$DEFINE NTDDI_WIN7:= $06010000} 129 | {$DEFINE NTDDI_WIN8:= $06020000} 130 | {$DEFINE NTDDI_WINBLUE:= $06030000} 131 | {$DEFINE NTDDI_WINTHRESHOLD:= $0A000000 }(* ABRACADABRA_THRESHOLD *) 132 | {$DEFINE NTDDI_WIN10:= $0A000000 }(* ABRACADABRA_THRESHOLD *) 133 | {$DEFINE NTDDI_WIN10_TH2:= $0A000001}(* ABRACADABRA_WIN10_TH2 *) 134 | {$DEFINE NTDDI_WIN10_RS1:= $0A000002}(* ABRACADABRA_WIN10_RS1 *) 135 | {$DEFINE NTDDI_WIN10_RS2:= $0A000003}(* ABRACADABRA_WIN10_RS2 *) 136 | {$DEFINE NTDDI_WIN10_RS3:= $0A000004}(* ABRACADABRA_WIN10_RS3 *) 137 | {$DEFINE NTDDI_WIN10_RS4:= $0A000005}(* ABRACADABRA_WIN10_RS4 *) 138 | {$DEFINE NTDDI_WIN10_RS5:= $0A000006}(* ABRACADABRA_WIN10_RS5 *) 139 | 140 | {$DEFINE WDK_NTDDI_VERSION:= NTDDI_WIN10_RS5}(* ABRACADABRA_WIN10_RS5 *) 141 | 142 | 143 | 144 | // masks for version macros 145 | 146 | {$DEFINE OSVERSION_MASK:= $FFFF0000} 147 | {$DEFINE SPVERSION_MASK:= $0000FF00} 148 | {$DEFINE SUBVERSION_MASK:= $000000FF} 149 | 150 | 151 | 152 | {$IFNDEF _WIN32_WINNT} // AND NOT DEFINED(_CHICAGO_)} 153 | {$DEFINE _WIN32_WINNT := $0A00} 154 | {$ENDIF} 155 | 156 | 157 | -------------------------------------------------------------------------------- /Units/Win32.SDKDDKVer.pas: -------------------------------------------------------------------------------- 1 | unit Win32.SDKDDKVer; 2 | 3 | (* 4 | 5 | Copyright (c) Microsoft Corporation. All rights reserved. 6 | 7 | Module Name: 8 | 9 | sdkddkver.h 10 | 11 | Abstract: 12 | 13 | Master include file for versioning windows SDK/DDK. 14 | 15 | *) 16 | 17 | 18 | {$mode delphi} 19 | 20 | interface 21 | 22 | uses 23 | Windows, Classes, SysUtils; 24 | 25 | 26 | 27 | // _WIN32_WINNT version constants 28 | 29 | {$DEFINE _WIN32_WINNT_NT4 := $0400} 30 | {$DEFINE _WIN32_WINNT_WIN2K := $0500} 31 | {$DEFINE _WIN32_WINNT_WINXP := $0501} 32 | {$DEFINE _WIN32_WINNT_WS03 := $0502} 33 | {$DEFINE _WIN32_WINNT_WIN6 := $0600} 34 | {$DEFINE _WIN32_WINNT_VISTA := $0600} 35 | {$DEFINE _WIN32_WINNT_WS08 := $0600} 36 | {$DEFINE _WIN32_WINNT_LONGHORN := $0600} 37 | {$DEFINE _WIN32_WINNT_WIN7 := $0601} 38 | {$DEFINE _WIN32_WINNT_WIN8 := $0602} 39 | {$DEFINE _WIN32_WINNT_WINBLUE := $0603} 40 | {$DEFINE _WIN32_WINNT_WINTHRESHOLD := $0A00} 41 | {$DEFINE _WIN32_WINNT_WIN10 := $0A00} 42 | 43 | 44 | // _WIN32_IE_ version constants 45 | 46 | {$DEFINE _WIN32_IE_IE20 := $0200} 47 | {$DEFINE _WIN32_IE_IE30 := $0300} 48 | {$DEFINE _WIN32_IE_IE302 := $0302} 49 | {$DEFINE _WIN32_IE_IE40 := $0400} 50 | {$DEFINE _WIN32_IE_IE401 := $0401} 51 | {$DEFINE _WIN32_IE_IE50 := $0500} 52 | {$DEFINE _WIN32_IE_IE501 := $0501} 53 | {$DEFINE _WIN32_IE_IE55 := $0550} 54 | {$DEFINE _WIN32_IE_IE60 := $0600} 55 | {$DEFINE _WIN32_IE_IE60SP1 := $0601} 56 | {$DEFINE _WIN32_IE_IE60SP2 := $0603} 57 | {$DEFINE _WIN32_IE_IE70 := $0700} 58 | {$DEFINE _WIN32_IE_IE80 := $0800} 59 | {$DEFINE _WIN32_IE_IE90 := $0900} 60 | {$DEFINE _WIN32_IE_IE100 := $0A00} 61 | {$DEFINE _WIN32_IE_IE110 := $0A00}(* ABRACADABRA_THRESHOLD *) 62 | 63 | 64 | // IE <-> OS version mapping 65 | 66 | // NT4 supports IE versions 2.0 -> 6.0 SP1 67 | {$DEFINE _WIN32_IE_NT4 := _WIN32_IE_IE20} 68 | {$DEFINE _WIN32_IE_NT4SP1 := _WIN32_IE_IE20} 69 | {$DEFINE _WIN32_IE_NT4SP2 := _WIN32_IE_IE20} 70 | {$DEFINE _WIN32_IE_NT4SP3 := _WIN32_IE_IE302} 71 | {$DEFINE _WIN32_IE_NT4SP4 := _WIN32_IE_IE401} 72 | {$DEFINE _WIN32_IE_NT4SP5 :=_WIN32_IE_IE401} 73 | {$DEFINE _WIN32_IE_NT4SP6 := _WIN32_IE_IE50} 74 | // Win98 supports IE versions 4.01 -> 6.0 SP1 75 | {$DEFINE _WIN32_IE_WIN98 := _WIN32_IE_IE401} 76 | // Win98SE supports IE versions 5.0 -> 6.0 SP1 77 | {$DEFINE _WIN32_IE_WIN98SE := _WIN32_IE_IE50} 78 | // WinME supports IE versions 5.5 -> 6.0 SP1 79 | {$DEFINE _WIN32_IE_WINME :=_WIN32_IE_IE55} 80 | // Win2k supports IE versions 5.01 -> 6.0 SP1 81 | {$DEFINE _WIN32_IE_WIN2K := _WIN32_IE_IE501} 82 | {$DEFINE _WIN32_IE_WIN2KSP1 := _WIN32_IE_IE501} 83 | {$DEFINE _WIN32_IE_WIN2KSP2 := _WIN32_IE_IE501} 84 | {$DEFINE _WIN32_IE_WIN2KSP3 := _WIN32_IE_IE501} 85 | {$DEFINE _WIN32_IE_WIN2KSP4 := _WIN32_IE_IE501} 86 | {$DEFINE _WIN32_IE_XP := _WIN32_IE_IE60} 87 | {$DEFINE _WIN32_IE_XPSP1 := _WIN32_IE_IE60SP1} 88 | {$DEFINE _WIN32_IE_XPSP2 := _WIN32_IE_IE60SP2} 89 | {$DEFINE _WIN32_IE_WS03 := $0602} 90 | {$DEFINE _WIN32_IE_WS03SP1 := _WIN32_IE_IE60SP2} 91 | {$DEFINE _WIN32_IE_WIN6 := _WIN32_IE_IE70} 92 | {$DEFINE _WIN32_IE_LONGHORN := _WIN32_IE_IE70} 93 | {$DEFINE _WIN32_IE_WIN7 := _WIN32_IE_IE80} 94 | {$DEFINE _WIN32_IE_WIN8 := _WIN32_IE_IE100} 95 | {$DEFINE _WIN32_IE_WINBLUE := _WIN32_IE_IE100} 96 | {$DEFINE _WIN32_IE_WINTHRESHOLD := _WIN32_IE_IE110}(* ABRACADABRA_THRESHOLD *) 97 | {$DEFINE _WIN32_IE_WIN10 := _WIN32_IE_IE110}(* ABRACADABRA_THRESHOLD *) 98 | 99 | 100 | 101 | // NTDDI version constants 102 | 103 | {$DEFINE NTDDI_WIN2K := $05000000} 104 | {$DEFINE NTDDI_WIN2KSP1 := $05000100} 105 | {$DEFINE NTDDI_WIN2KSP2 := $05000200} 106 | {$DEFINE NTDDI_WIN2KSP3 := $05000300} 107 | {$DEFINE NTDDI_WIN2KSP4 := $05000400} 108 | 109 | {$DEFINE NTDDI_WINXP := $05010000} 110 | {$DEFINE NTDDI_WINXPSP1 := $05010100} 111 | {$DEFINE NTDDI_WINXPSP2 := $05010200} 112 | {$DEFINE NTDDI_WINXPSP3 := $05010300} 113 | {$DEFINE NTDDI_WINXPSP4 := $05010400} 114 | 115 | {$DEFINE NTDDI_WS03 := $05020000} 116 | {$DEFINE NTDDI_WS03SP1 := $05020100} 117 | {$DEFINE NTDDI_WS03SP2 := $05020200} 118 | {$DEFINE NTDDI_WS03SP3 := $05020300} 119 | {$DEFINE NTDDI_WS03SP4 := $05020400} 120 | 121 | {$DEFINE NTDDI_WIN6 := $06000000} 122 | {$DEFINE NTDDI_WIN6SP1 := $06000100} 123 | {$DEFINE NTDDI_WIN6SP2 := $06000200} 124 | {$DEFINE NTDDI_WIN6SP3 := $06000300} 125 | {$DEFINE NTDDI_WIN6SP4 := $06000400} 126 | 127 | {$DEFINE NTDDI_VISTA := NTDDI_WIN6} 128 | {$DEFINE NTDDI_VISTASP1:= NTDDI_WIN6SP1} 129 | {$DEFINE NTDDI_VISTASP2:= NTDDI_WIN6SP2} 130 | {$DEFINE NTDDI_VISTASP3:= NTDDI_WIN6SP3} 131 | {$DEFINE NTDDI_VISTASP4:= NTDDI_WIN6SP4} 132 | 133 | {$DEFINE NTDDI_LONGHORN:= NTDDI_VISTA} 134 | 135 | {$DEFINE NTDDI_WS08:= NTDDI_WIN6SP1} 136 | {$DEFINE NTDDI_WS08SP2:= NTDDI_WIN6SP2} 137 | {$DEFINE NTDDI_WS08SP3:= NTDDI_WIN6SP3} 138 | {$DEFINE NTDDI_WS08SP4:= NTDDI_WIN6SP4} 139 | 140 | {$DEFINE NTDDI_WIN7:= $06010000} 141 | {$DEFINE NTDDI_WIN8:= $06020000} 142 | {$DEFINE NTDDI_WINBLUE:= $06030000} 143 | {$DEFINE NTDDI_WINTHRESHOLD:= $0A000000 }(* ABRACADABRA_THRESHOLD *) 144 | {$DEFINE NTDDI_WIN10:= $0A000000 }(* ABRACADABRA_THRESHOLD *) 145 | {$DEFINE NTDDI_WIN10_TH2:= $0A000001}(* ABRACADABRA_WIN10_TH2 *) 146 | {$DEFINE NTDDI_WIN10_RS1:= $0A000002}(* ABRACADABRA_WIN10_RS1 *) 147 | {$DEFINE NTDDI_WIN10_RS2:= $0A000003}(* ABRACADABRA_WIN10_RS2 *) 148 | {$DEFINE NTDDI_WIN10_RS3:= $0A000004}(* ABRACADABRA_WIN10_RS3 *) 149 | {$DEFINE NTDDI_WIN10_RS4:= $0A000005}(* ABRACADABRA_WIN10_RS4 *) 150 | {$DEFINE NTDDI_WIN10_RS5:= $0A000006}(* ABRACADABRA_WIN10_RS5 *) 151 | 152 | {$DEFINE WDK_NTDDI_VERSION:= NTDDI_WIN10_RS5}(* ABRACADABRA_WIN10_RS5 *) 153 | 154 | 155 | 156 | // masks for version macros 157 | 158 | {$DEFINE OSVERSION_MASK:= $FFFF0000} 159 | {$DEFINE SPVERSION_MASK:= $0000FF00} 160 | {$DEFINE SUBVERSION_MASK:= $000000FF} 161 | 162 | 163 | 164 | {$IFNDEF _WIN32_WINNT AND NOT DEFINED(_CHICAGO_)} 165 | {$DEFINE _WIN32_WINNT := $0A00} 166 | {$ENDIF} 167 | 168 | implementation 169 | 170 | end. 171 | -------------------------------------------------------------------------------- /Units/Win32.SHTypes.pas: -------------------------------------------------------------------------------- 1 | unit Win32.SHTypes; 2 | { ************************************************************************** 3 | Copyright (C) 2017 CMC Development Team 4 | 5 | CMC is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | CMC is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with CMC. If not, see . 17 | ************************************************************************** } 18 | 19 | 20 | //+------------------------------------------------------------------------- 21 | // 22 | // Microsoft Windows 23 | // Copyright (c) Microsoft Corporation. All rights reserved. 24 | // 25 | //-------------------------------------------------------------------------- 26 | 27 | { Header Definition: 10.0.14393.0 } 28 | 29 | {$IFDEF FPC} 30 | {$mode delphiunicode}{$H+} 31 | {$ENDIF} 32 | 33 | {$I Win32.WinAPI.inc} 34 | 35 | 36 | interface 37 | 38 | uses 39 | Windows, Classes, SysUtils, 40 | Win32.WTypesBase, 41 | Win32.WTypes; 42 | 43 | type 44 | 45 | //=========================================================================== 46 | 47 | // Object identifiers in the explorer's name space (ItemID and IDList) 48 | 49 | // All the items that the user can browse with the explorer (such as files, 50 | // directories, servers, work-groups, etc.) has an identifier which is unique 51 | // among items within the parent folder. Those identifiers are called item 52 | // IDs (SHITEMID). Since all its parent folders have their own item IDs, 53 | // any items can be uniquely identified by a list of item IDs, which is called 54 | // an ID list (ITEMIDLIST). 55 | 56 | // ID lists are almost always allocated by the task allocator (see some 57 | // description below as well as OLE 2.0 SDK) and may be passed across 58 | // some of shell interfaces (such as IShellFolder). Each item ID in an ID list 59 | // is only meaningful to its parent folder (which has generated it), and all 60 | // the clients must treat it as an opaque binary data except the first two 61 | // bytes, which indicates the size of the item ID. 62 | 63 | // When a shell extension -- which implements the IShellFolder interace -- 64 | // generates an item ID, it may put any information in it, not only the data 65 | // with that it needs to identifies the item, but also some additional 66 | // information, which would help implementing some other functions efficiently. 67 | // For example, the shell's IShellFolder implementation of file system items 68 | // stores the primary (long) name of a file or a directory as the item 69 | // identifier, but it also stores its alternative (short) name, size and date 70 | // etc. 71 | 72 | // When an ID list is passed to one of shell APIs (such as SHGetPathFromIDList), 73 | // it is always an absolute path -- relative from the root of the name space, 74 | // which is the desktop folder. When an ID list is passed to one of IShellFolder 75 | // member function, it is always a relative path from the folder (unless it 76 | // is explicitly specified). 77 | 78 | //=========================================================================== 79 | 80 | // SHITEMID -- Item ID (mkid) 81 | // USHORT cb; // Size of the ID (including cb itself) 82 | // BYTE abID[]; // The item ID (variable length) 83 | 84 | 85 | //include 86 | {$A1} 87 | 88 | TSHITEMID = record 89 | cb: USHORT; 90 | abID: PByte; 91 | end; 92 | 93 | //include 94 | {$A4} 95 | 96 | 97 | LPSHITEMID = ^TSHITEMID; 98 | 99 | LPCSHITEMID = ^TSHITEMID; 100 | 101 | 102 | // ITEMIDLIST -- List if item IDs (combined with 0-terminator) 103 | 104 | //include 105 | {$A1} 106 | TITEMIDLIST = record 107 | mkid: TSHITEMID; 108 | end; 109 | 110 | TITEMIDLIST_RELATIVE = TITEMIDLIST; 111 | 112 | TITEMID_CHILD = TITEMIDLIST; 113 | 114 | TITEMIDLIST_ABSOLUTE = TITEMIDLIST; 115 | 116 | 117 | // include 118 | {$A4} 119 | 120 | wirePIDL = PBYTE_BLOB; 121 | 122 | LPITEMIDLIST = ^ITEMIDLIST; 123 | 124 | LPCITEMIDLIST = ^TITEMIDLIST; 125 | 126 | 127 | PIDLIST_ABSOLUTE = LPITEMIDLIST; 128 | PCIDLIST_ABSOLUTE = LPCITEMIDLIST; 129 | PCUIDLIST_ABSOLUTE = LPCITEMIDLIST; 130 | PIDLIST_RELATIVE = LPITEMIDLIST; 131 | PCIDLIST_RELATIVE = LPCITEMIDLIST; 132 | PUIDLIST_RELATIVE = LPITEMIDLIST; 133 | PCUIDLIST_RELATIVE = LPCITEMIDLIST; 134 | PITEMID_CHILD = LPITEMIDLIST; 135 | PCITEMID_CHILD = LPCITEMIDLIST; 136 | PUITEMID_CHILD = LPITEMIDLIST; 137 | PCUITEMID_CHILD = LPCITEMIDLIST; 138 | PCUITEMID_CHILD_ARRAY = LPCITEMIDLIST; 139 | PCUIDLIST_RELATIVE_ARRAY = LPCITEMIDLIST; 140 | PCIDLIST_ABSOLUTE_ARRAY = LPCITEMIDLIST; 141 | PCUIDLIST_ABSOLUTE_ARRAY = LPCITEMIDLIST; 142 | 143 | 144 | 145 | TWIN32_FIND_DATAA = record 146 | dwFileAttributes: DWORD; 147 | ftCreationTime: TFILETIME; 148 | ftLastAccessTime: TFILETIME; 149 | ftLastWriteTime: TFILETIME; 150 | nFileSizeHigh: DWORD; 151 | nFileSizeLow: DWORD; 152 | dwReserved0: DWORD; 153 | dwReserved1: DWORD; 154 | cFileName: array [0.. 259] of char; 155 | cAlternateFileName: array [0.. 13] of char; 156 | end; 157 | 158 | PWIN32_FIND_DATAA = ^TWIN32_FIND_DATAA; 159 | 160 | TWIN32_FIND_DATAW = record 161 | dwFileAttributes: DWORD; 162 | ftCreationTime: TFILETIME; 163 | ftLastAccessTime: TFILETIME; 164 | ftLastWriteTime: TFILETIME; 165 | nFileSizeHigh: DWORD; 166 | nFileSizeLow: DWORD; 167 | dwReserved0: DWORD; 168 | dwReserved1: DWORD; 169 | cFileName: array [0.. 259] of WCHAR; 170 | cAlternateFileName: array [0.. 13] of WCHAR; 171 | end; 172 | 173 | 174 | 175 | PWIN32_FIND_DATAW = ^TWIN32_FIND_DATAW; 176 | 177 | 178 | 179 | //------------------------------------------------------------------------- 180 | 181 | // struct STRRET 182 | 183 | // structure for returning strings from IShellFolder member functions 184 | 185 | //------------------------------------------------------------------------- 186 | 187 | // uType indicate which union member to use 188 | // STRRET_WSTR Use STRRET.pOleStr must be freed by caller of GetDisplayNameOf 189 | // STRRET_OFFSET Use STRRET.uOffset Offset into SHITEMID for ANSI string 190 | // STRRET_CSTR Use STRRET.cStr ANSI Buffer 191 | 192 | TSTRRET_TYPE = ( 193 | STRRET_WSTR = 0, 194 | STRRET_OFFSET = $1, 195 | STRRET_CSTR = $2 196 | ); 197 | 198 | 199 | //include 200 | {$A8} 201 | TSTRRET = record 202 | uType: UINT; 203 | 204 | case integer of 205 | 0: (pOleStr: LPWSTR); 206 | 1: (uOffset: UINT); 207 | 2: (cStr: array [0.. 259] of char); 208 | end; 209 | 210 | // include 211 | {$A4} 212 | 213 | PSTRRET = ^TSTRRET; 214 | 215 | //------------------------------------------------------------------------- 216 | 217 | // struct SHELLDETAILS 218 | 219 | // structure for returning strings from IShellDetails 220 | 221 | //------------------------------------------------------------------------- 222 | 223 | // fmt; // LVCFMT_* value (header only) 224 | // cxChar; // Number of 'average' characters (header only) 225 | // str; // String information 226 | 227 | //include 228 | {$A1} 229 | TSHELLDETAILS = record 230 | fmt: int32; 231 | cxChar: int32; 232 | str: TSTRRET; 233 | end; 234 | 235 | PSHELLDETAILS = ^TSHELLDETAILS; 236 | 237 | //include 238 | {$A4} 239 | 240 | {$IF (_WIN32_IE >= _WIN32_IE_IE60SP2)} 241 | type 242 | TPERCEIVED = ( 243 | PERCEIVED_TYPE_FIRST = -3, 244 | PERCEIVED_TYPE_CUSTOM = -3, 245 | PERCEIVED_TYPE_UNSPECIFIED = -2, 246 | PERCEIVED_TYPE_FOLDER = -1, 247 | PERCEIVED_TYPE_UNKNOWN = 0, 248 | PERCEIVED_TYPE_TEXT = 1, 249 | PERCEIVED_TYPE_IMAGE = 2, 250 | PERCEIVED_TYPE_AUDIO = 3, 251 | PERCEIVED_TYPE_VIDEO = 4, 252 | PERCEIVED_TYPE_COMPRESSED = 5, 253 | PERCEIVED_TYPE_DOCUMENT = 6, 254 | PERCEIVED_TYPE_SYSTEM = 7, 255 | PERCEIVED_TYPE_APPLICATION = 8, 256 | PERCEIVED_TYPE_GAMEMEDIA = 9, 257 | PERCEIVED_TYPE_CONTACTS = 10, 258 | PERCEIVED_TYPE_LAST = 10 259 | ); 260 | 261 | const 262 | PERCEIVEDFLAG_UNDEFINED = $0000; 263 | PERCEIVEDFLAG_SOFTCODED = $0001; 264 | PERCEIVEDFLAG_HARDCODED = $0002; 265 | PERCEIVEDFLAG_NATIVESUPPORT = $0004; 266 | PERCEIVEDFLAG_GDIPLUS = $0010; 267 | PERCEIVEDFLAG_WMSDK = $0020; 268 | PERCEIVEDFLAG_ZIPFOLDER = $0040; 269 | 270 | type 271 | TPERCEIVEDFLAG = DWORD; 272 | 273 | {$ENDIF}// _WIN32_IE_IE60SP2 274 | 275 | 276 | 277 | {$IF (NTDDI_VERSION >= NTDDI_VISTA)} 278 | TCOMDLG_FILTERSPEC = record 279 | pszName: LPCWSTR; 280 | pszSpec: LPCWSTR; 281 | end; 282 | 283 | PCOMDLG_FILTERSPEC = ^TCOMDLG_FILTERSPEC; 284 | 285 | {$ENDIF}// NTDDI_VISTA 286 | 287 | TKNOWNFOLDERID = TGUID; 288 | PKNOWNFOLDERID = ^TKNOWNFOLDERID; 289 | 290 | REFKNOWNFOLDERID = ^TKNOWNFOLDERID; 291 | 292 | 293 | TKF_REDIRECT_FLAGS = DWORD; 294 | TFOLDERTYPEID = TGUID; 295 | 296 | REFFOLDERTYPEID = ^TFOLDERTYPEID; 297 | 298 | TTASKOWNERID = TGUID; 299 | 300 | REFTASKOWNERID = ^TTASKOWNERID; 301 | 302 | TELEMENTID = TGUID; 303 | 304 | REFELEMENTID = ^TELEMENTID; 305 | 306 | 307 | TLOGFONTA = record 308 | lfHeight: LONG; 309 | lfWidth: LONG; 310 | lfEscapement: LONG; 311 | lfOrientation: LONG; 312 | lfWeight: LONG; 313 | lfItalic: byte; 314 | lfUnderline: byte; 315 | lfStrikeOut: byte; 316 | lfCharSet: byte; 317 | lfOutPrecision: byte; 318 | lfClipPrecision: byte; 319 | lfQuality: byte; 320 | lfPitchAndFamily: byte; 321 | lfFaceName: array [0.. 31] of char; 322 | end; 323 | 324 | 325 | TLOGFONTW = record 326 | lfHeight: LONG; 327 | lfWidth: LONG; 328 | lfEscapement: LONG; 329 | lfOrientation: LONG; 330 | lfWeight: LONG; 331 | lfItalic: byte; 332 | lfUnderline: byte; 333 | lfStrikeOut: byte; 334 | lfCharSet: byte; 335 | lfOutPrecision: byte; 336 | lfClipPrecision: byte; 337 | lfQuality: byte; 338 | lfPitchAndFamily: byte; 339 | lfFaceName: array[0.. 31] of WCHAR; 340 | end; 341 | 342 | TLOGFONT = TLOGFONTW; 343 | 344 | TSHCOLSTATE = ( 345 | SHCOLSTATE_DEFAULT = 0, 346 | SHCOLSTATE_TYPE_STR = $1, 347 | SHCOLSTATE_TYPE_INT = $2, 348 | SHCOLSTATE_TYPE_DATE = $3, 349 | SHCOLSTATE_TYPEMASK = $f, 350 | SHCOLSTATE_ONBYDEFAULT = $10, 351 | SHCOLSTATE_SLOW = $20, 352 | SHCOLSTATE_EXTENDED = $40, 353 | SHCOLSTATE_SECONDARYUI = $80, 354 | SHCOLSTATE_HIDDEN = $100, 355 | SHCOLSTATE_PREFER_VARCMP = $200, 356 | SHCOLSTATE_PREFER_FMTCMP = $400, 357 | SHCOLSTATE_NOSORTBYFOLDERNESS = $800, 358 | SHCOLSTATE_VIEWONLY = $10000, 359 | SHCOLSTATE_BATCHREAD = $20000, 360 | SHCOLSTATE_NO_GROUPBY = $40000, 361 | SHCOLSTATE_FIXED_WIDTH = $1000, 362 | SHCOLSTATE_NODPISCALE = $2000, 363 | SHCOLSTATE_FIXED_RATIO = $4000, 364 | SHCOLSTATE_DISPLAYMASK = $f000 365 | ); 366 | 367 | TSHCOLSTATEF = DWORD; 368 | 369 | TSHCOLUMNID = TPROPERTYKEY; 370 | 371 | LPCSHCOLUMNID = ^TSHCOLUMNID; 372 | 373 | TDEVICE_SCALE_FACTOR = ( 374 | DEVICE_SCALE_FACTOR_INVALID = 0, 375 | SCALE_100_PERCENT = 100, 376 | SCALE_120_PERCENT = 120, 377 | SCALE_125_PERCENT = 125, 378 | SCALE_140_PERCENT = 140, 379 | SCALE_150_PERCENT = 150, 380 | SCALE_160_PERCENT = 160, 381 | SCALE_175_PERCENT = 175, 382 | SCALE_180_PERCENT = 180, 383 | SCALE_200_PERCENT = 200, 384 | SCALE_225_PERCENT = 225, 385 | SCALE_250_PERCENT = 250, 386 | SCALE_300_PERCENT = 300, 387 | SCALE_350_PERCENT = 350, 388 | SCALE_400_PERCENT = 400, 389 | SCALE_450_PERCENT = 450, 390 | SCALE_500_PERCENT = 500 391 | ); 392 | 393 | 394 | 395 | implementation 396 | 397 | end. 398 | -------------------------------------------------------------------------------- /Units/Win32.ServProv.pas: -------------------------------------------------------------------------------- 1 | unit Win32.ServProv; 2 | 3 | //=--------------------------------------------------------------------------= 4 | // ServProv.h 5 | //=--------------------------------------------------------------------------= 6 | // (C) Copyright Microsoft Corporation. All Rights Reserved. 7 | 8 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 9 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 10 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 11 | // PARTICULAR PURPOSE. 12 | //=--------------------------------------------------------------------------= 13 | 14 | {$mode delphi} 15 | 16 | interface 17 | 18 | uses 19 | Classes, SysUtils; 20 | 21 | const 22 | IID_IServiceProvider: TGUID = '{6d5140c1-7436-11ce-8034-00aa006009fa}'; 23 | 24 | type 25 | IServiceProvider = interface(IUnknown) 26 | ['{6d5140c1-7436-11ce-8034-00aa006009fa}'] 27 | function QueryService(const guidService: TGUID; const riid: TGUID; out ppvObject): HResult; stdcall; 28 | end; 29 | 30 | implementation 31 | 32 | end. 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Units/Win32.ShlObj.pas: -------------------------------------------------------------------------------- 1 | (*=========================================================================== 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | File: shlobj.h 6 | 7 | ===========================================================================*) 8 | unit Win32.ShlObj; 9 | 10 | {$IFDEF FPC} 11 | {$mode delphiunicode}{$H+} 12 | {$ENDIF} 13 | 14 | {$I Win32.WinAPI.inc} 15 | 16 | interface 17 | 18 | uses 19 | Classes, SysUtils; 20 | 21 | const 22 | //-------------------------------------------------------------------------- 23 | // control IDs known to the view 24 | //-------------------------------------------------------------------------- 25 | 26 | FCIDM_TOOLBAR = (FCIDM_BROWSERFIRST + 0); 27 | FCIDM_STATUS = (FCIDM_BROWSERFIRST + 1); 28 | 29 | 30 | // The resource id of the offline cursor 31 | // This cursor is avaialble in shdocvw.dll 32 | IDC_OFFLINE_HAND = 103; 33 | {$IF (_WIN32_IE >= _WIN32_IE_IE70)} 34 | IDC_PANTOOL_HAND_OPEN = 104; 35 | IDC_PANTOOL_HAND_CLOSED = 105; 36 | {$ENDIF} 37 | 38 | 39 | // SBCMDID_GETPANE - not necessarily in order 40 | PANE_NONE = -1; 41 | PANE_ZONE = 1; 42 | PANE_OFFLINE = 2; 43 | PANE_PRINTER = 3; 44 | PANE_SSL = 4; 45 | PANE_NAVIGATION = 5; 46 | PANE_PROGRESS = 6; 47 | {$IF (_WIN32_IE >= _WIN32_IE_IE60)} 48 | PANE_PRIVACY = 7; 49 | {$ENDIF} 50 | 51 | // flags for RemoveToolbar 52 | DWFRF_NORMAL = $0000; 53 | DWFRF_DELETECONFIGDATA = $0001; 54 | 55 | 56 | // flags for AddToolbar 57 | DWFAF_HIDDEN = $0001; // add hidden 58 | DWFAF_GROUP1 = $0002; // insert at end of group 1 59 | DWFAF_GROUP2 = $0004; // insert at end of group 2 60 | DWFAF_AUTOHIDE = $0010; // The toolbar will be subject to AutoHide in Full Screen mode 61 | 62 | // flags used to determine the capabilities of the storage for the images 63 | SHIMSTCAPFLAG_LOCKABLE = $0001; // does the store require/support locking 64 | SHIMSTCAPFLAG_PURGEABLE = $0002; // does the store require dead items purging externally ? 65 | 66 | 67 | //// IShellFolderBand 68 | 69 | // Field mask 70 | ISFB_MASK_STATE = $00000001; // TRUE if dwStateMask and dwState is valid 71 | ISFB_MASK_BKCOLOR = $00000002; // TRUE if crBkgnd field is valid 72 | ISFB_MASK_VIEWMODE = $00000004; // TRUE if wViewMode field is valid 73 | ISFB_MASK_SHELLFOLDER = $00000008; 74 | ISFB_MASK_IDLIST = $00000010; 75 | ISFB_MASK_COLORS = $00000020;// TRUE if crXXXX fields are valid (except bkgnd) 76 | 77 | ISFB_STATE_DEFAULT = $00000000; 78 | ISFB_STATE_DEBOSSED = $00000001; 79 | ISFB_STATE_ALLOWRENAME = $00000002; 80 | ISFB_STATE_NOSHOWTEXT = $00000004; // TRUE if _fNoShowText 81 | ISFB_STATE_CHANNELBAR = $00000010;// TRUE if we want NavigateTarget support 82 | ISFB_STATE_QLINKSMODE = $00000020; // TRUE if we want to turn off drag & drop onto content items 83 | ISFB_STATE_FULLOPEN = $00000040; // TRUE if band should maximize when opened 84 | ISFB_STATE_NONAMESORT = $00000080; // TRUE if band should _not_ sort icons by name 85 | ISFB_STATE_BTNMINSIZE = $00000100; // TRUE if band should report min thickness of button 86 | 87 | ISFBVIEWMODE_SMALLICONS = $0001; 88 | ISFBVIEWMODE_LARGEICONS = $0002; 89 | {$IF (_WIN32_IE < _WIN32_IE_IE70)} 90 | ISFBVIEWMODE_LOGOS = $0003; 91 | {$ENDIF} 92 | 93 | DBC_GS_IDEAL = 0; // get the ideal size 94 | DBC_GS_SIZEDOWN = 1; // clip the height of a rect to a multiple of the rebar's integral size 95 | 96 | 97 | DBC_HIDE = 0; // Band is hidden (being destroyed) 98 | DBC_SHOW = 1;// Band is visible 99 | DBC_SHOWOBSCURE = 2; // Band is completely obscured 100 | 101 | 102 | DBCID_EMPTY = 0; // bandsite is empty 103 | DBCID_ONDRAG = 1; // (down)DragMoveEnter/Leave vaIn:I4:eDrag 104 | DBCID_CLSIDOFBAR = 2; // clsid of bar inside 105 | DBCID_RESIZE = 3; // resize from keyboard 106 | DBCID_GETBAR = 4; // returns vaOut:VT_UNKNOWN of hosting dockbar (IDeskBar) 107 | 108 | 109 | 110 | 111 | // Flags for SetSafeMode 112 | SSM_CLEAR = $0000; 113 | SSM_SET = $0001; 114 | SSM_REFRESH = $0002; 115 | SSM_UPDATE = $0004; 116 | 117 | // Flags for Set/GetScheme 118 | SCHEME_DISPLAY = $0001; 119 | SCHEME_EDIT = $0002; 120 | SCHEME_LOCAL = $0004; 121 | SCHEME_GLOBAL = $0008; 122 | SCHEME_REFRESH = $0010; 123 | SCHEME_UPDATE = $0020; 124 | SCHEME_DONOTUSE = $0040; // used to be SCHEME_ENUMERATE; no longer supported 125 | SCHEME_CREATE = $0080; 126 | 127 | 128 | implementation 129 | 130 | end. 131 | 132 | -------------------------------------------------------------------------------- /Units/Win32.StructuredQueryCondition.pas: -------------------------------------------------------------------------------- 1 | unit Win32.StructuredQueryCondition; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | windows,Classes, SysUtils; 9 | 10 | type 11 | 12 | ICondition = interface ({IPersistStream} IUnknown) // toDo 13 | ['{0FC988D4-C935-4b97-A973-46282EA175C8}'] 14 | end; 15 | 16 | implementation 17 | 18 | end. 19 | 20 | -------------------------------------------------------------------------------- /Units/Win32.Synchapi.pas: -------------------------------------------------------------------------------- 1 | (******************************************************************************** 2 | * * 3 | * synchapi.h -- ApiSet Contract for api-ms-win-core-synch-l1 * 4 | * * 5 | * Copyright (c) Microsoft Corporation. All rights reserved. * 6 | * * 7 | ********************************************************************************) 8 | unit Win32.Synchapi; 9 | 10 | {$IFDEF FPC} 11 | {$MODE delphi}{$H+} 12 | {$ENDIF} 13 | 14 | {$MACRO ON} 15 | 16 | 17 | // _WIN32_WINNT version constants 18 | 19 | {$DEFINE _WIN32_WINNT_NT4:=$0400} 20 | {$DEFINE _WIN32_WINNT_WIN2K := $0500} 21 | {$DEFINE _WIN32_WINNT_WINXP := $0501} 22 | {$DEFINE _WIN32_WINNT_WS03 := $0502} 23 | {$DEFINE _WIN32_WINNT_WIN6 := $0600} 24 | {$DEFINE _WIN32_WINNT_VISTA := $0600} 25 | {$DEFINE _WIN32_WINNT_WS08 := $0600} 26 | {$DEFINE _WIN32_WINNT_LONGHORN := $0600} 27 | {$DEFINE _WIN32_WINNT_WIN7 := $0601} 28 | {$DEFINE _WIN32_WINNT_WIN8 := $0602} 29 | {$DEFINE _WIN32_WINNT_WINBLUE := $0603} 30 | {$DEFINE _WIN32_WINNT_WINTHRESHOLD := $0A00}(* ABRACADABRA_THRESHOLD*) 31 | {$DEFINE _WIN32_WINNT_WIN10:=$0A00}(* ABRACADABRA_THRESHOLD*) 32 | 33 | {$DEFINE _NT_TARGET_VERSION_WIN10_RS4:=$0A05} 34 | 35 | {$DEFINE _WIN32_WINNT:=_WIN32_WINNT_WIN10} 36 | 37 | interface 38 | 39 | 40 | 41 | 42 | uses 43 | Windows, Classes, SysUtils, 44 | Win32.MinWinBase; 45 | 46 | const 47 | 48 | KERNEL32_DLL = 'Kernel32.dll'; 49 | 50 | // some definitions come form WinNT.h 51 | 52 | SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY = $01; 53 | SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY = $02; 54 | SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE = $04; 55 | 56 | 57 | CREATE_MUTEX_INITIAL_OWNER = $00000001; 58 | CREATE_EVENT_MANUAL_RESET = $00000001; 59 | CREATE_EVENT_INITIAL_SET = $00000002; 60 | 61 | CREATE_WAITABLE_TIMER_MANUAL_RESET = $00000001; 62 | {$IF (_WIN32_WINNT >= _NT_TARGET_VERSION_WIN10_RS4)} 63 | CREATE_WAITABLE_TIMER_HIGH_RESOLUTION = $00000002; 64 | {$ENDIF} 65 | // Run once flags 66 | RTL_RUN_ONCE_CHECK_ONLY = $00000001; 67 | RTL_RUN_ONCE_ASYNC = $00000002; 68 | RTL_RUN_ONCE_INIT_FAILED = $00000004; 69 | 70 | 71 | // The context stored in the run once structure must leave the following number 72 | // of low order bits unused. 73 | 74 | 75 | RTL_RUN_ONCE_CTX_RESERVED_BITS = 2; 76 | RTL_CONDITION_VARIABLE_LOCKMODE_SHARED = $1; 77 | 78 | type 79 | TRTL_RUN_ONCE = record 80 | Ptr: Pointer; 81 | end; 82 | PRTL_RUN_ONCE = ^TRTL_RUN_ONCE; 83 | 84 | TRTL_CONDITION_VARIABLE = record 85 | Ptr: Pointer; 86 | end; 87 | PRTL_CONDITION_VARIABLE = ^TRTL_CONDITION_VARIABLE; 88 | 89 | // Define one-time initialization primitive 90 | 91 | TINIT_ONCE = TRTL_RUN_ONCE; 92 | PINIT_ONCE = PRTL_RUN_ONCE; 93 | LPINIT_ONCE = PRTL_RUN_ONCE; 94 | 95 | // Run once 96 | 97 | const 98 | RTL_RUN_ONCE_INIT: TRTL_RUN_ONCE = (Ptr: nil); // Static initializer 99 | INIT_ONCE_STATIC_INIT: TRTL_RUN_ONCE = (Ptr: nil); 100 | 101 | RTL_CONDITION_VARIABLE_INIT: TRTL_CONDITION_VARIABLE = (Ptr: nil); 102 | 103 | // Run once flags 104 | INIT_ONCE_CHECK_ONLY = RTL_RUN_ONCE_CHECK_ONLY; 105 | INIT_ONCE_ASYNC = RTL_RUN_ONCE_ASYNC; 106 | INIT_ONCE_INIT_FAILED = RTL_RUN_ONCE_INIT_FAILED; 107 | 108 | 109 | // The context stored in the run once structure must leave the following number 110 | // of low order bits unused. 111 | INIT_ONCE_CTX_RESERVED_BITS = RTL_RUN_ONCE_CTX_RESERVED_BITS; 112 | 113 | // Mutant Specific Access Rights 114 | MUTANT_QUERY_STATE = $0001; 115 | MUTANT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or MUTANT_QUERY_STATE); 116 | 117 | SEMAPHORE_MODIFY_STATE = $0002; 118 | SEMAPHORE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3); 119 | 120 | // Timer Specific Access Rights. 121 | 122 | TIMER_QUERY_STATE = $0001; 123 | TIMER_MODIFY_STATE = $0002; 124 | TIMER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or TIMER_QUERY_STATE or TIMER_MODIFY_STATE); 125 | 126 | // begin_nthal 127 | TIME_ZONE_ID_UNKNOWN = 0; 128 | TIME_ZONE_ID_STANDARD = 1; 129 | TIME_ZONE_ID_DAYLIGHT = 2; 130 | 131 | // end_nthal 132 | 133 | 134 | // Define the slim R/W lock. 135 | 136 | 137 | type 138 | TRTL_SRWLOCK = record 139 | Ptr: pointer; 140 | end; 141 | PRTL_SRWLOCK = ^TRTL_SRWLOCK; 142 | 143 | TSRWLOCK = TRTL_SRWLOCK; 144 | 145 | // Define condition variable 146 | TCONDITION_VARIABLE = TRTL_CONDITION_VARIABLE; 147 | PCONDITION_VARIABLE = ^TCONDITION_VARIABLE; 148 | 149 | TRTL_BARRIER = record 150 | Reserved1: DWORD; 151 | Reserved2: DWORD; 152 | Reserved3: array [0..1] of ULONG_PTR; 153 | Reserved4: DWORD; 154 | Reserved5: DWORD; 155 | end; 156 | PRTL_BARRIER = ^TRTL_BARRIER; 157 | 158 | TSYNCHRONIZATION_BARRIER = TRTL_BARRIER; 159 | PSYNCHRONIZATION_BARRIER = PRTL_BARRIER; 160 | 161 | PINIT_ONCE_FN = function(var InitOnce: TINIT_ONCE; var Parameter: pointer; out Context: pointer): boolean; 162 | 163 | PTIMERAPCROUTINE = 164 | procedure(lpArgToCompletionRoutine: pointer; dwTimerLowValue: DWORD; dwTimerHighValue: DWORD); stdcall; 165 | 166 | const 167 | RTL_SRWLOCK_INIT: TRTL_SRWLOCK = (Ptr: nil); 168 | SRWLOCK_INIT: TRTL_SRWLOCK = (Ptr: nil); 169 | 170 | CONDITION_VARIABLE_INIT: TRTL_CONDITION_VARIABLE = (Ptr: nil); // Static initializer for the condition variable 171 | 172 | // Flags for condition variables 173 | 174 | CONDITION_VARIABLE_LOCKMODE_SHARED = RTL_CONDITION_VARIABLE_LOCKMODE_SHARED; 175 | 176 | // Synchronization APIs 177 | 178 | MUTEX_MODIFY_STATE = MUTANT_QUERY_STATE; 179 | MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS; 180 | 181 | {$IF (_WIN32_WINNT >= $0600)} 182 | procedure InitializeSRWLock(out SRWLock: TSRWLOCK); stdcall; external KERNEL32_DLL; 183 | procedure ReleaseSRWLockExclusive(var SRWLock: TSRWLOCK); stdcall; external KERNEL32_DLL; 184 | procedure ReleaseSRWLockShared(var SRWLock: TSRWLOCK); stdcall; external KERNEL32_DLL; 185 | procedure AcquireSRWLockExclusive(var SRWLock: TSRWLOCK); stdcall; external KERNEL32_DLL; 186 | procedure AcquireSRWLockShared(var SRWLock: TSRWLOCK); stdcall; external KERNEL32_DLL; 187 | function TryAcquireSRWLockExclusive(var SRWLock: TSRWLOCK): boolean; stdcall; external KERNEL32_DLL; 188 | function TryAcquireSRWLockShared(var SRWLock: TSRWLOCK): boolean; stdcall; external KERNEL32_DLL; 189 | {$ENDIF}// (_WIN32_WINNT >= $0600) 190 | 191 | {$IF (_WIN32_WINNT < $0600)} 192 | procedure InitializeCriticalSection(out lpCriticalSection: LPCRITICAL_SECTION); stdcall; external KERNEL32_DLL; 193 | {$ELSE} 194 | procedure InitializeCriticalSection(out lpCriticalSection: LPCRITICAL_SECTION); stdcall; external KERNEL32_DLL; 195 | {$ENDIF}// (_WIN32_WINNT < $0600) 196 | 197 | 198 | procedure EnterCriticalSection(var lpCriticalSection: LPCRITICAL_SECTION); stdcall; external KERNEL32_DLL; 199 | procedure LeaveCriticalSection(var lpCriticalSection: LPCRITICAL_SECTION); stdcall; external KERNEL32_DLL; 200 | function InitializeCriticalSectionAndSpinCount(out lpCriticalSection: LPCRITICAL_SECTION; dwSpinCount: DWORD): boolean; 201 | stdcall; external KERNEL32_DLL; 202 | 203 | {$IF (_WIN32_WINNT >= $0600)} 204 | function InitializeCriticalSectionEx(out lpCriticalSection: LPCRITICAL_SECTION; dwSpinCount: DWORD; Flags: DWORD): boolean; 205 | stdcall; external KERNEL32_DLL; 206 | {$ENDIF}// (_WIN32_WINNT >= $0600) 207 | 208 | function SetCriticalSectionSpinCount(var lpCriticalSection: LPCRITICAL_SECTION; dwSpinCount: DWORD): DWORD; stdcall; external KERNEL32_DLL; 209 | 210 | {$IF (_WIN32_WINNT >= $0400)} 211 | function TryEnterCriticalSection(var lpCriticalSection: LPCRITICAL_SECTION): boolean; stdcall; external KERNEL32_DLL; 212 | {$ENDIF}(* _WIN32_WINNT >= $0400 *) 213 | 214 | procedure DeleteCriticalSection(var lpCriticalSection: LPCRITICAL_SECTION); stdcall; external KERNEL32_DLL; 215 | 216 | {$IF (_WIN32_WINNT >= $0600)} 217 | procedure InitOnceInitialize(out InitOnce: PINIT_ONCE); stdcall; external KERNEL32_DLL; 218 | function InitOnceExecuteOnce(var InitOnce: TINIT_ONCE; InitFn: PINIT_ONCE_FN; {var} Parameter: pointer; out Context: pointer): boolean; 219 | stdcall; external KERNEL32_DLL; 220 | function InitOnceBeginInitialize(var lpInitOnce: LPINIT_ONCE; dwFlags: DWORD; out fPending: boolean; out lpContext: pointer): boolean; 221 | stdcall; external KERNEL32_DLL; 222 | function InitOnceComplete(var lpInitOnce: LPINIT_ONCE; dwFlags: DWORD; lpContext: LPVOID): boolean; stdcall; external KERNEL32_DLL; 223 | {$ENDIF}// (_WIN32_WINNT >= $0600) 224 | 225 | {$IF (_WIN32_WINNT >= $0600)} 226 | procedure InitializeConditionVariable(out ConditionVariable: TCONDITION_VARIABLE); stdcall; external KERNEL32_DLL; 227 | procedure WakeConditionVariable(var ConditionVariable: TCONDITION_VARIABLE); stdcall; external KERNEL32_DLL; 228 | procedure WakeAllConditionVariable(var ConditionVariable: TCONDITION_VARIABLE); stdcall; external KERNEL32_DLL; 229 | function SleepConditionVariableCS(var ConditionVariable: PCONDITION_VARIABLE; var CriticalSection: PCRITICAL_SECTION; 230 | dwMilliseconds: DWORD): boolean; stdcall; external KERNEL32_DLL; 231 | function SleepConditionVariableSRW(var ConditionVariable: TCONDITION_VARIABLE; var SRWLock: TSRWLOCK; dwMilliseconds: DWORD; 232 | Flags: ULONG): boolean; stdcall; external KERNEL32_DLL; 233 | {$ENDIF}// (_WIN32_WINNT >= $0600) 234 | 235 | function SetEvent(hEvent: THANDLE): boolean; stdcall; external KERNEL32_DLL; 236 | function ResetEvent(hEvent: THANDLE): boolean; stdcall; external KERNEL32_DLL; 237 | function ReleaseSemaphore(hSemaphore: THANDLE; lReleaseCount: LONG; out lpPreviousCount: LONG): boolean; stdcall; external KERNEL32_DLL; 238 | function ReleaseMutex(hMutex: THANDLE): boolean; stdcall; external KERNEL32_DLL; 239 | function WaitForSingleObject(hHandle: THANDLE; dwMilliseconds: DWORD): DWORD; stdcall; external KERNEL32_DLL; 240 | function SleepEx(dwMilliseconds: DWORD; bAlertable: boolean): DWORD; stdcall; external KERNEL32_DLL; 241 | function WaitForSingleObjectEx(hHandle: THANDLE; dwMilliseconds: DWORD; bAlertable: boolean): DWORD; stdcall; external KERNEL32_DLL; 242 | function WaitForMultipleObjectsEx(nCount: DWORD; const lpHandles: PHANDLE {nCount}; bWaitAll: boolean; dwMilliseconds: DWORD; 243 | bAlertable: boolean): DWORD; stdcall; external KERNEL32_DLL; 244 | 245 | // Synchronization APIs 246 | function CreateMutexA(lpMutexAttributes: LPSECURITY_ATTRIBUTES; bInitialOwner: boolean; lpName: LPCSTR): THANDLE; stdcall; 247 | external KERNEL32_DLL; 248 | function CreateMutexW(lpMutexAttributes: LPSECURITY_ATTRIBUTES; bInitialOwner: boolean; lpName: LPCWSTR): THANDLE; stdcall; 249 | external KERNEL32_DLL; 250 | function OpenMutexW(dwDesiredAccess: DWORD; bInheritHandle: boolean; lpName: LPCWSTR): THANDLE; stdcall; external KERNEL32_DLL; 251 | function CreateEventA(lpEventAttributes: LPSECURITY_ATTRIBUTES; bManualReset: boolean; bInitialState: boolean; lpName: LPCSTR): THANDLE; 252 | stdcall; external KERNEL32_DLL; 253 | function CreateEventW(lpEventAttributes: LPSECURITY_ATTRIBUTES; bManualReset: boolean; bInitialState: boolean; lpName: LPCWSTR): THANDLE; 254 | stdcall; external KERNEL32_DLL; 255 | function OpenEventA(dwDesiredAccess: DWORD; bInheritHandle: boolean; lpName: LPCSTR): THANDLE; stdcall; external KERNEL32_DLL; 256 | function OpenEventW(dwDesiredAccess: DWORD; bInheritHandle: boolean; lpName: LPCWSTR): THANDLE; stdcall; external KERNEL32_DLL; 257 | function OpenSemaphoreW(dwDesiredAccess: DWORD; bInheritHandle: boolean; lpName: LPCWSTR): THANDLE; stdcall; external KERNEL32_DLL; 258 | 259 | {$IF (_WIN32_WINNT >= $0400) OR (_WIN32_WINDOWS > $0400)} 260 | function OpenWaitableTimerW(dwDesiredAccess: DWORD; bInheritHandle: boolean; lpTimerName: LPCWSTR): THANDLE; stdcall; 261 | external KERNEL32_DLL; 262 | 263 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN7)} 264 | function SetWaitableTimerEx(hTimer: THANDLE; const lpDueTime: LARGE_INTEGER; lPeriod: LONG; pfnCompletionRoutine: PTIMERAPCROUTINE; 265 | lpArgToCompletionRoutine: LPVOID; WakeContext: PREASON_CONTEXT; TolerableDelay: ULONG): boolean; stdcall; external KERNEL32_DLL; 266 | {$ENDIF}// (_WIN32_WINNT >= _WIN32_WINNT_WIN7) 267 | 268 | function SetWaitableTimer(hTimer: THANDLE; const lpDueTime: LARGE_INTEGER; lPeriod: LONG; pfnCompletionRoutine: PTIMERAPCROUTINE; 269 | lpArgToCompletionRoutine: LPVOID; fResume: boolean): boolean; stdcall; external KERNEL32_DLL; 270 | function CancelWaitableTimer(hTimer: THANDLE): boolean; stdcall; external KERNEL32_DLL; 271 | 272 | {$IF (_WIN32_WINNT >= $0600)} 273 | function CreateMutexExA(lpMutexAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCSTR; dwFlags: DWORD; dwDesiredAccess: DWORD): THANDLE; 274 | stdcall; external KERNEL32_DLL; 275 | function CreateMutexExW(lpMutexAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCWSTR; dwFlags: DWORD; dwDesiredAccess: DWORD): THANDLE; 276 | stdcall; external KERNEL32_DLL; 277 | function CreateEventExA(lpEventAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCSTR; dwFlags: DWORD; dwDesiredAccess: DWORD): THANDLE; 278 | stdcall; external KERNEL32_DLL; 279 | function CreateEventExW(lpEventAttributes: LPSECURITY_ATTRIBUTES; lpName: LPCWSTR; dwFlags: DWORD; dwDesiredAccess: DWORD): THANDLE; 280 | stdcall; external KERNEL32_DLL; 281 | function CreateSemaphoreExW(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES; lInitialCount: LONG; lMaximumCount: LONG; 282 | lpName: LPCWSTR; dwFlags: DWORD; dwDesiredAccess: DWORD): THANDLE; stdcall; external KERNEL32_DLL; 283 | function CreateWaitableTimerExW(lpTimerAttributes: LPSECURITY_ATTRIBUTES; lpTimerName: LPCWSTR; dwFlags: DWORD; 284 | dwDesiredAccess: DWORD): THANDLE; stdcall; external KERNEL32_DLL; 285 | {$ENDIF}// (_WIN32_WINNT >= $0600) 286 | 287 | {$ENDIF}// (_WIN32_WINNT >= $0400) || (_WIN32_WINDOWS > $0400) 288 | 289 | function EnterSynchronizationBarrier(var lpBarrier: TSYNCHRONIZATION_BARRIER; dwFlags: DWORD): boolean; stdcall; external KERNEL32_DLL; 290 | function InitializeSynchronizationBarrier(out lpBarrier: TSYNCHRONIZATION_BARRIER; lTotalThreads: LONG; lSpinCount: LONG): boolean; 291 | stdcall; external KERNEL32_DLL; 292 | function DeleteSynchronizationBarrier(var lpBarrier: TSYNCHRONIZATION_BARRIER): boolean; stdcall; external KERNEL32_DLL; 293 | procedure Sleep(dwMilliseconds: DWORD); stdcall; external KERNEL32_DLL; 294 | function WaitOnAddress(Address: pointer {PByte: AddressSize}; CompareAddress: pointer; AddressSize: SIZE_T; dwMilliseconds: DWORD): boolean; 295 | stdcall; external KERNEL32_DLL; 296 | procedure WakeByAddressSingle(Address: pointer); stdcall; external KERNEL32_DLL; 297 | procedure WakeByAddressAll(Address: pointer); stdcall; external KERNEL32_DLL; 298 | function SignalObjectAndWait(hObjectToSignal: THANDLE; hObjectToWaitOn: THANDLE; dwMilliseconds: DWORD; bAlertable: boolean): DWORD; 299 | stdcall; external KERNEL32_DLL; 300 | function WaitForMultipleObjects(nCount: DWORD; const lpHandles: PHANDLE {nCount}; bWaitAll: boolean; dwMilliseconds: DWORD): DWORD; 301 | stdcall; external KERNEL32_DLL; 302 | function CreateSemaphoreW(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES; lInitialCount: LONG; lMaximumCount: LONG; 303 | lpName: LPCWSTR): THANDLE; stdcall; external KERNEL32_DLL; 304 | function CreateWaitableTimerW(lpTimerAttributes: LPSECURITY_ATTRIBUTES; bManualReset: boolean; lpTimerName: LPCWSTR): THANDLE; 305 | stdcall; external KERNEL32_DLL; 306 | 307 | implementation 308 | 309 | end. 310 | -------------------------------------------------------------------------------- /Units/Win32.SysInfoAPI.pas: -------------------------------------------------------------------------------- 1 | (******************************************************************************** 2 | * * 3 | * sysinfoapi.h -- ApiSet Contract for api-ms-win-core-sysinfo-l1 * 4 | * * 5 | * Copyright (c) Microsoft Corporation. All rights reserved. * 6 | * * 7 | ********************************************************************************) 8 | unit Win32.SysInfoAPI; 9 | 10 | {$mode delphi} 11 | 12 | interface 13 | 14 | uses 15 | Windows, Classes, SysUtils, 16 | Win32.WinNT; 17 | 18 | const 19 | KERNEL32_DLL = 'kernel32.dll'; 20 | 21 | const 22 | SCEX2_ALT_NETBIOS_NAME = $00000001; 23 | 24 | 25 | function GetVersionExA(var lpVersionInformation: TOSVERSIONINFOA): BOOL; stdcall; external KERNEL32_DLL; overload; 26 | function GetVersionExW(var lpVersionInformation: TOSVERSIONINFOW): BOOL; stdcall; external KERNEL32_DLL; overload; 27 | function GetVersionExA(var lpVersionInformation: TOSVERSIONINFOEXA): BOOL; stdcall; external KERNEL32_DLL; overload; 28 | function GetVersionExW(var lpVersionInformation: TOSVERSIONINFOEXW): BOOL; stdcall; external KERNEL32_DLL; overload; 29 | 30 | implementation 31 | 32 | end. 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Units/Win32.TCGuid.pas: -------------------------------------------------------------------------------- 1 | unit Win32.TCGuid; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | 20 | {++ 21 | 22 | Copyright (c) Microsoft Corporation. All rights reserved. 23 | 24 | Module Name: 25 | 26 | tcguid.h 27 | 28 | Abstract: 29 | 30 | This module contains QoS guid definitions for use by the 31 | Traffic Control users. 32 | 33 | --} 34 | 35 | 36 | { Header Definition: 10.0.14393.0 } 37 | 38 | {$IFDEF FPC} 39 | {$mode delphiunicode}{$H+} 40 | {$ENDIF} 41 | 42 | {$I Win32.WinAPI.inc} 43 | 44 | 45 | interface 46 | 47 | uses 48 | Windows, Classes, SysUtils; 49 | 50 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 51 | 52 | const 53 | // Remaining Bandwidth guid 54 | GUID_QOS_REMAINING_BANDWIDTH: TGUID = '{c4c51720-40ec-11d1-2c91-00aa00574915}'; 55 | // Best Effort Bandwidth guid 56 | GUID_QOS_BESTEFFORT_BANDWIDTH: TGUID = '{ed885290-40ec-11d1-2c91-00aa00574915}'; 57 | // Latency guid 58 | GUID_QOS_LATENCY: TGUID = '{fc408ef0-40ec-11d1-2c91-00aa00574915}'; 59 | // Flow Count guid 60 | GUID_QOS_FLOW_COUNT: TGUID = '{1147f880-40ed-11d1-2c91-00aa00574915}'; 61 | // Non Best Effort Limit guid 62 | GUID_QOS_NON_BESTEFFORT_LIMIT: TGUID = '{185c44e0-40ed-11d1-2c91-00aa00574915}'; 63 | // Maximum Outstanding Sends guid 64 | GUID_QOS_MAX_OUTSTANDING_SENDS: TGUID = '{161ffa86-6120-11d1-2c91-00aa00574915}'; 65 | // Packet scheduler statistics 66 | GUID_QOS_STATISTICS_BUFFER: TGUID = '{bb2c0980-e900-11d1-b07e-0080c71382bf}'; 67 | // Packet Scheduler Flow Mode 68 | GUID_QOS_FLOW_MODE: TGUID = '{5c82290a-515a-11d2-8e58-00c04fc9bfcb}'; 69 | // ISSLOW Flow 70 | GUID_QOS_ISSLOW_FLOW: TGUID = '{abf273a4-ee07-11d2-be1b-00a0c99ee63b}'; 71 | // Timer Resolution 72 | GUID_QOS_TIMER_RESOLUTION: TGUID = '{ba10cc88-f13e-11d2-be1b-00a0c99ee63b}'; 73 | // The conforming IP Precedence value for this flow. 74 | GUID_QOS_FLOW_IP_CONFORMING: TGUID = '{07f99a8b-fcd2-11d2-be1e-00a0c99ee63b}'; 75 | // The non-conforming IP Precedence value for this flow. 76 | GUID_QOS_FLOW_IP_NONCONFORMING: TGUID = '{087a5987-fcd2-11d2-be1e-00a0c99ee63b}'; 77 | // The conforming 802.1p value for this flow. 78 | GUID_QOS_FLOW_8021P_CONFORMING: TGUID = '{08c1e013-fcd2-11d2-be1e-00a0c99ee63b}'; 79 | // The non-conforming 802.1p value for this flow. 80 | GUID_QOS_FLOW_8021P_NONCONFORMING: TGUID = '{09023f91-fcd2-11d2-be1e-00a0c99ee63b}'; 81 | // This will enable the Averaging statistics in Packet scheduler. (eg: Avg. number of packets in shaper) 82 | GUID_QOS_ENABLE_AVG_STATS: TGUID = '{bafb6d11-27c4-4801-a46f-ef8080c188c8}'; 83 | 84 | GUID_QOS_ENABLE_WINDOW_ADJUSTMENT: TGUID = '{aa966725-d3e9-4c55-b335-2a00279a1e64}'; 85 | // This will enable Window size adjustment for TCP connections on a slow link-running ICS 86 | 87 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 88 | 89 | 90 | implementation 91 | 92 | end. 93 | -------------------------------------------------------------------------------- /Units/Win32.WS2BTH.pas: -------------------------------------------------------------------------------- 1 | unit Win32.WS2BTH; 2 | { ************************************************************************** 3 | Copyright (C) 2017 CMC Development Team 4 | 5 | CMC is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | CMC is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with CMC. If not, see . 17 | ************************************************************************** } 18 | {++ 19 | 20 | Copyright (c) 2000 Microsoft Corporation 21 | 22 | Module Name: 23 | 24 | ws2bth.h 25 | 26 | Abstract: 27 | 28 | Winsock 2 Bluetooth Annex definitions. 29 | 30 | Notes: 31 | 32 | Change BT_* to BTH_* 33 | 34 | --} 35 | 36 | { Header Definition: 10.0.14393.0 } 37 | 38 | {$IFDEF FPC} 39 | {$mode delphiunicode}{$H+} 40 | {$ENDIF} 41 | 42 | {$I Win32.WinAPI.inc} 43 | 44 | interface 45 | 46 | uses 47 | Windows, Classes, 48 | Win32.BTHDef, Win32.BthLEDef, 49 | Win32.BTHSDPDef; 50 | 51 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 52 | 53 | 54 | {$IF (NTDDI_VERSION >= NTDDI_WINXPSP2)} 55 | 56 | //include 57 | {$A1} 58 | 59 | const 60 | BT_PORT_ANY = ULONG(-1); 61 | BT_PORT_MIN = $1; 62 | BT_PORT_MAX = $ffff; 63 | BT_PORT_DYN_FIRST = $1001; 64 | 65 | // These three definitions are duplicated in winsock2.h to reserve ordinals 66 | AF_BTH = 32; 67 | PF_BTH = AF_BTH; 68 | NS_BTH = 16; 69 | 70 | type 71 | TSOCKADDR_BTH = record 72 | addressFamily: USHORT; // Always AF_BTH 73 | btAddr: TBTH_ADDR; // Bluetooth device address 74 | serviceClassId: TGUID; // [OPTIONAL] system will query SDP for port 75 | port: ULONG; // RFCOMM channel or L2CAP PSM 76 | end; 77 | PSOCKADDR_BTH = ^TSOCKADDR_BTH; 78 | 79 | 80 | const 81 | SVCID_BTH_PROVIDER: TGUID = '{06aa63e0-7d60-41ff-afb2-3ee6d2d9392d}'; 82 | BTH_ADDR_STRING_SIZE = 12; // max size from WSAAddressToString 83 | 84 | // Bluetooth protocol #s are assigned according to the Bluetooth 85 | // Assigned Numbers portion of the Bluetooth Specification 86 | 87 | BTHPROTO_RFCOMM = $0003; 88 | BTHPROTO_L2CAP = $0100; 89 | 90 | SOL_RFCOMM = BTHPROTO_RFCOMM; 91 | SOL_L2CAP = BTHPROTO_L2CAP; 92 | SOL_SDP = $0101; 93 | 94 | 95 | // SOCKET OPTIONS 96 | 97 | SO_BTH_AUTHENTICATE = $80000001; // optlen=sizeof(ULONG), optval = &(ULONG)TRUE/FALSE 98 | SO_BTH_ENCRYPT = $00000002; // optlen=sizeof(ULONG), optval = &(ULONG)TRUE/FALSE 99 | SO_BTH_MTU = $80000007; // optlen=sizeof(ULONG), optval = &mtu 100 | SO_BTH_MTU_MAX = $80000008; // optlen=sizeof(ULONG), optval = &max. mtu 101 | SO_BTH_MTU_MIN = $8000000a; // optlen=sizeof(ULONG), optval = &min. mtu 102 | 103 | 104 | // Socket option parameters 105 | 106 | // 3-DH5 => payload of 1021 => L2cap payload of 1017 => RFComm payload of 1011 107 | RFCOMM_MAX_MTU = $000003F3; // L2CAP MTU (1017) - RFCOMM header size (6) 108 | RFCOMM_MIN_MTU = $00000017; // RFCOMM spec sec 5.3 table 5.1 109 | 110 | 111 | // NAME SERVICE PROVIDER DEFINITIONS 112 | // For calling WSASetService 113 | // and WSALookupServiceBegin, WSALookupServiceNext, WSALookupServiceEnd 114 | // with Bluetooth-specific extensions 115 | 116 | BTH_SDP_VERSION = 1; 117 | 118 | 119 | // [OPTIONAL] passed in BLOB member of WSAQUERYSET 120 | // QUERYSET and its lpBlob member are copied & converted 121 | // to unicode in the system for non-unicode applications. 122 | // However, nothing is copied back upon return. In 123 | // order for the system to return data such as pRecordHandle, 124 | // it much have an extra level of indirection from lpBlob 125 | 126 | type 127 | TBTH_SET_SERVICE = record 128 | // This version number will change when/if the binary format of 129 | // SDP records change, affecting the format of pRecord. 130 | // Set to BTH_SDP_VERSION by client, and returned by system 131 | pSdpVersion: PULONG; 132 | // Handle to SDP record. When BTH_SET_SERVICE structure is later 133 | // passed to WSASetService RNRSERVICE_DELETE, this handle identifies the 134 | // record to delete. 135 | pRecordHandle: PHANDLE; 136 | // COD_SERVICE_* bit(s) associated with this SDP record, which will be 137 | // advertised when the local radio is found during device inquiry. 138 | // When the last SDP record associated with a bit is deleted, that 139 | // service bit is no longer reported in repsonse to inquiries 140 | fCodService: ULONG; // COD_SERVICE_* bits 141 | Reserved: array [0..4] of ULONG; // Reserved by system. Must be zero. 142 | ulRecordLength: ULONG; // length of pRecord which follows 143 | pRecord: PUCHAR; // SDP record as defined by bluetooth spec 144 | end; 145 | PBTH_SET_SERVICE = ^TBTH_SET_SERVICE; 146 | 147 | 148 | // Default device inquiry duration in seconds 149 | // The application thread will be blocked in WSALookupServiceBegin 150 | // for the duration of the device inquiry, so this value needs to 151 | // be balanced against the chance that a device that is actually 152 | // present might not being found by Bluetooth in this time 153 | // Paging improvements post-1.1 will cause devices to be 154 | // found generally uniformly in the 0-6 sec timeperiod 155 | 156 | const 157 | SDP_DEFAULT_INQUIRY_SECONDS = 6; 158 | SDP_MAX_INQUIRY_SECONDS = 60; 159 | // Default maximum number of devices to search for 160 | SDP_DEFAULT_INQUIRY_MAX_RESPONSES = 255; 161 | SDP_SERVICE_SEARCH_REQUEST = 1; 162 | SDP_SERVICE_ATTRIBUTE_REQUEST = 2; 163 | SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST = 3; 164 | 165 | 166 | // [OPTIONAL] input restrictions on device inquiry 167 | // Passed in BLOB of LUP_CONTAINERS (device) search 168 | 169 | type 170 | TBTH_QUERY_DEVICE = record 171 | LAP: ULONG; // reserved: must be 0 (GIAC inquiry only) 172 | length: UCHAR; // requested length of inquiry (seconds) 173 | end; 174 | PBTH_QUERY_DEVICE = ^TBTH_QUERY_DEVICE; 175 | 176 | 177 | // [OPTIONAL] Restrictions on searching for a particular service 178 | // Passed in BLOB of !LUP_CONTAINERS (service) search 179 | 180 | TBTH_QUERY_SERVICE = record 181 | AType: ULONG; // one of SDP_SERVICE_* 182 | serviceHandle: ULONG; 183 | uuids: array [0..MAX_UUIDS_IN_QUERY - 1] of TSdpQueryUuid; 184 | numRange: ULONG; 185 | pRange: PSdpAttributeRange; 186 | end; 187 | PBTH_QUERY_SERVICE = ^TBTH_QUERY_SERVICE; 188 | 189 | 190 | // BTHNS_RESULT_* 191 | 192 | // Bluetooth specific flags returned from WSALookupServiceNext 193 | // in WSAQUERYSET.dwOutputFlags in response to device inquiry 194 | 195 | // Local device is paired with remote device 196 | 197 | const 198 | BTHNS_RESULT_DEVICE_CONNECTED = $00010000; 199 | BTHNS_RESULT_DEVICE_REMEMBERED = $00020000; 200 | BTHNS_RESULT_DEVICE_AUTHENTICATED = $00040000; 201 | 202 | 203 | // SOCKET IOCTLs 204 | 205 | 206 | const 207 | IOC_OUT = $40000000; { copy out parameters } 208 | IOC_IN = $80000000; { copy in parameters } 209 | IOC_INOUT = (IOC_IN or IOC_OUT); 210 | IOC_VENDOR = $18000000; 211 | 212 | SIO_RFCOMM_SEND_COMMAND = (IOC_INOUT or (IOC_VENDOR) or (101)); 213 | SIO_RFCOMM_WAIT_COMMAND = (IOC_INOUT or (IOC_VENDOR) or (102)); 214 | 215 | 216 | // These IOCTLs are for test/validation/conformance and may only be 217 | // present in debug/checked builds of the system 218 | 219 | SIO_BTH_PING = (IOC_INOUT or (IOC_VENDOR) or (8)); 220 | SIO_BTH_INFO = (IOC_INOUT or (IOC_VENDOR) or (9)); 221 | SIO_RFCOMM_SESSION_FLOW_OFF = (IOC_INOUT or (IOC_VENDOR) or (103)); 222 | SIO_RFCOMM_TEST = (IOC_INOUT or (IOC_VENDOR) or (104)); 223 | SIO_RFCOMM_USECFC = (IOC_INOUT or (IOC_VENDOR) or (105)); 224 | { RESERVED (IOC_INOUT or (IOC_VENDOR) or (106));} 225 | 226 | // SOCKET IOCTL DEFINITIONS 227 | 228 | const 229 | // ToDo MSC_EA_BIT = EA_BIT; 230 | MSC_FC_BIT = (1 shl 1); // Flow control, clear if we can receive 231 | MSC_RTC_BIT = (1 shl 2); // Ready to communicate, set when ready 232 | MSC_RTR_BIT = (1 shl 3); // Ready to receive, set when ready 233 | MSC_RESERVED = ((1 shl 4) or (1 shl 5));// Reserved by spec, must be 0 234 | MSC_IC_BIT = (1 shl 6); // Incoming call 235 | MSC_DV_BIT = (1 shl 7); // Data valid 236 | MSC_BREAK_BIT = (1 shl 1); // Set if sending break 237 | 238 | procedure MSC_SET_BREAK_LENGTH(var b: uint; l: UINT); 239 | 240 | // Structure definition from Bluetooth RFCOMM spec, TS 07.10 5.4.6.3.7 241 | 242 | type 243 | TRFCOMM_MSC_DATA = record 244 | Signals: UCHAR; 245 | Break: UCHAR; 246 | end; 247 | PRFCOMM_MSC_DATA = ^TRFCOMM_MSC_DATA; 248 | 249 | 250 | // Structure definition from Bluetooth RFCOMM spec, TS 07.10 5.4.6.3.10 251 | 252 | const 253 | RLS_ERROR = $01; 254 | RLS_OVERRUN = $02; 255 | RLS_PARITY = $04; 256 | RLS_FRAMING = $08; 257 | 258 | type 259 | TRFCOMM_RLS_DATA = record 260 | LineStatus: UCHAR; 261 | end; 262 | PRFCOMM_RLS_DATA = ^TRFCOMM_RLS_DATA; 263 | 264 | // Structure definition from Bluetooth RFCOMM spec, TS 07.10 5.4.6.3.9 265 | 266 | const 267 | RPN_BAUD_2400 = 0; 268 | RPN_BAUD_4800 = 1; 269 | RPN_BAUD_7200 = 2; 270 | RPN_BAUD_9600 = 3; 271 | RPN_BAUD_19200 = 4; 272 | RPN_BAUD_38400 = 5; 273 | RPN_BAUD_57600 = 6; 274 | RPN_BAUD_115200 = 7; 275 | RPN_BAUD_230400 = 8; 276 | 277 | RPN_DATA_5 = $0; 278 | RPN_DATA_6 = $1; 279 | RPN_DATA_7 = $2; 280 | RPN_DATA_8 = $3; 281 | 282 | RPN_STOP_1 = $0; 283 | RPN_STOP_1_5 = $4; 284 | 285 | RPN_PARITY_NONE = $00; 286 | RPN_PARITY_ODD = $08; 287 | RPN_PARITY_EVEN = $18; 288 | RPN_PARITY_MARK = $28; 289 | RPN_PARITY_SPACE = $38; 290 | 291 | 292 | RPN_FLOW_X_OUT = $02; 293 | RPN_FLOW_RTR_IN = $04; 294 | RPN_FLOW_RTR_OUT = $08; 295 | RPN_FLOW_RTC_IN = $10; 296 | RPN_FLOW_RTC_OUT = $20; 297 | 298 | 299 | RPN_FLOW_X_IN = $01; 300 | 301 | RPN_PARAM_BAUD = $01; 302 | RPN_PARAM_DATA = $02; 303 | RPN_PARAM_STOP = $04; 304 | RPN_PARAM_PARITY = $08; 305 | RPN_PARAM_P_TYPE = $10; 306 | RPN_PARAM_XON = $20; 307 | RPN_PARAM_XOFF = $40; 308 | 309 | 310 | RPN_PARAM_X_IN = $01; 311 | RPN_PARAM_X_OUT = $02; 312 | RPN_PARAM_RTR_IN = $04; 313 | RPN_PARAM_RTR_OUT = $08; 314 | RPN_PARAM_RTC_IN = $10; 315 | RPN_PARAM_RTC_OUT = $20; 316 | 317 | 318 | type 319 | TRFCOMM_RPN_DATA = record 320 | Baud: UCHAR; 321 | Data: UCHAR; 322 | FlowControl: UCHAR; 323 | XonChar: UCHAR; 324 | XoffChar: UCHAR; 325 | ParameterMask1: UCHAR; 326 | ParameterMask2: UCHAR; 327 | end; 328 | PRFCOMM_RPN_DATA = ^TRFCOMM_RPN_DATA; 329 | 330 | const 331 | RFCOMM_CMD_NONE = 0; 332 | RFCOMM_CMD_MSC = 1; 333 | RFCOMM_CMD_RLS = 2; 334 | RFCOMM_CMD_RPN = 3; 335 | RFCOMM_CMD_RPN_REQUEST = 4; 336 | RFCOMM_CMD_RPN_RESPONSE = 5; 337 | { RESERVED_CMD = 6 } 338 | 339 | type 340 | TRFCOMM_COMMAND = record 341 | CmdType: ULONG; // one of RFCOMM_CMD_* 342 | case integer of 343 | 0: (MSC: TRFCOMM_MSC_DATA); 344 | 1: (RLS: TRFCOMM_RLS_DATA); 345 | 2: (RPN: TRFCOMM_RPN_DATA); 346 | end; 347 | PRFCOMM_COMMAND = ^TRFCOMM_COMMAND; 348 | 349 | 350 | // These structures are for test/validation/conformance and may only be 351 | // present in debug/checked builds of the system 352 | 353 | TBTH_PING_REQ = record 354 | btAddr: TBTH_ADDR; 355 | dataLen: UCHAR; 356 | Data: array [0..MAX_L2CAP_PING_DATA_LENGTH - 1] of UCHAR; 357 | end; 358 | PBTH_PING_REQ = ^TBTH_PING_REQ; 359 | 360 | TBTH_PING_RSP = record 361 | dataLen: UCHAR; 362 | Data: array [0..MAX_L2CAP_PING_DATA_LENGTH - 1] of UCHAR; 363 | end; 364 | PBTH_PING_RSP = ^TBTH_PING_RSP; 365 | 366 | TBTH_INFO_REQ = record 367 | btAddr: TBTH_ADDR; 368 | infoType: USHORT; 369 | end; 370 | PBTH_INFO_REQ = ^TBTH_INFO_REQ; 371 | 372 | TBTH_INFO_RSP = record 373 | Result: USHORT; 374 | dataLen: UCHAR; 375 | case integer of 376 | 0: (connectionlessMTU: USHORT); 377 | 1: (Data: array [0..MAX_L2CAP_INFO_DATA_LENGTH - 1] of UCHAR); 378 | end; 379 | PBTH_INFO_RSP = ^TBTH_INFO_RSP; 380 | 381 | 382 | // WinCE compatible struct names 383 | 384 | TBTHNS_SETBLOB = TBTH_SET_SERVICE; 385 | PBTHNS_SETBLOB = ^TBTHNS_SETBLOB; 386 | TBTHNS_INQUIRYBLOB = TBTH_QUERY_DEVICE; 387 | PBTHNS_INQUIRYBLOB = ^TBTHNS_INQUIRYBLOB; 388 | TBTHNS_RESTRICTIONBLOB = TBTH_QUERY_SERVICE; 389 | PBTHNS_RESTRICTIONBLOB = ^TBTHNS_RESTRICTIONBLOB; 390 | 391 | //include 392 | {$A4} 393 | 394 | {$ENDIF}// (NTDDI_VERSION >= NTDDI_WINXPSP2) 395 | 396 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 397 | 398 | 399 | implementation 400 | 401 | procedure MSC_SET_BREAK_LENGTH(var b: uint; l: UINT); 402 | begin 403 | b := (b and $3) or ((l and $f) shl 4); 404 | end; 405 | 406 | end. 407 | -------------------------------------------------------------------------------- /Units/Win32.WinNT.pas: -------------------------------------------------------------------------------- 1 | unit Win32.WinNT; 2 | 3 | {$mode delphi} 4 | 5 | interface 6 | 7 | uses 8 | Windows, Classes, SysUtils; 9 | 10 | const 11 | // Zeile 8875 12 | 13 | 14 | // begin_wdm 15 | 16 | // The following are masks for the predefined standard access types 17 | 18 | 19 | Delete = ($00010000); 20 | READ_CONTROL = ($00020000); 21 | WRITE_DAC = ($00040000); 22 | WRITE_OWNER = ($00080000); 23 | SYNCHRONIZE = ($00100000); 24 | 25 | STANDARD_RIGHTS_REQUIRED = ($000F0000); 26 | 27 | STANDARD_RIGHTS_READ = (READ_CONTROL); 28 | STANDARD_RIGHTS_WRITE = (READ_CONTROL); 29 | STANDARD_RIGHTS_EXECUTE = (READ_CONTROL); 30 | 31 | STANDARD_RIGHTS_ALL = ($001F0000); 32 | 33 | SPECIFIC_RIGHTS_ALL = ($0000FFFF); 34 | 35 | 36 | // AccessSystemAcl access type 37 | 38 | 39 | ACCESS_SYSTEM_SECURITY = ($01000000); 40 | 41 | 42 | // MaximumAllowed access type 43 | 44 | 45 | MAXIMUM_ALLOWED = ($02000000); 46 | 47 | 48 | // These are the generic rights. 49 | 50 | 51 | GENERIC_READ = ($80000000); 52 | GENERIC_WRITE = ($40000000); 53 | GENERIC_EXECUTE = ($20000000); 54 | GENERIC_ALL = ($10000000); 55 | 56 | 57 | // Define the generic mapping array. This is used to denote the 58 | // mapping of each generic access right to a specific access mask. 59 | 60 | // Zeile 12817 61 | 62 | // begin_access 63 | 64 | 65 | // Define access rights to files and directories 66 | 67 | 68 | 69 | // The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in 70 | // devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these 71 | // constants *MUST* always be in sync. 72 | // The values are redefined in devioctl.h because they must be available to 73 | // both DOS and NT. 74 | 75 | 76 | FILE_READ_DATA = ($0001); // file & pipe 77 | FILE_LIST_DIRECTORY = ($0001); // directory 78 | 79 | FILE_WRITE_DATA = ($0002); // file & pipe 80 | FILE_ADD_FILE = ($0002); // directory 81 | 82 | FILE_APPEND_DATA = ($0004); // file 83 | FILE_ADD_SUBDIRECTORY = ($0004); // directory 84 | FILE_CREATE_PIPE_INSTANCE = ($0004); // named pipe 85 | 86 | 87 | FILE_READ_EA = ($0008); // file & directory 88 | 89 | FILE_WRITE_EA = ($0010); // file & directory 90 | 91 | FILE_EXECUTE = ($0020); // file 92 | FILE_TRAVERSE = ($0020); // directory 93 | 94 | FILE_DELETE_CHILD = ($0040); // directory 95 | 96 | FILE_READ_ATTRIBUTES = ($0080); // all 97 | 98 | FILE_WRITE_ATTRIBUTES = ($0100); // all 99 | 100 | FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $1FF); 101 | 102 | FILE_GENERIC_READ = (STANDARD_RIGHTS_READ or FILE_READ_DATA or FILE_READ_ATTRIBUTES or FILE_READ_EA or SYNCHRONIZE); 103 | 104 | 105 | FILE_GENERIC_WRITE = (STANDARD_RIGHTS_WRITE or FILE_WRITE_DATA or FILE_WRITE_ATTRIBUTES or FILE_WRITE_EA or 106 | FILE_APPEND_DATA or SYNCHRONIZE); 107 | 108 | 109 | FILE_GENERIC_EXECUTE = (STANDARD_RIGHTS_EXECUTE or FILE_READ_ATTRIBUTES or FILE_EXECUTE or SYNCHRONIZE); 110 | 111 | // end_access 112 | FILE_SHARE_READ = $00000001; 113 | FILE_SHARE_WRITE = $00000002; 114 | FILE_SHARE_DELETE = $00000004; 115 | FILE_ATTRIBUTE_READONLY = $00000001; 116 | FILE_ATTRIBUTE_HIDDEN = $00000002; 117 | FILE_ATTRIBUTE_SYSTEM = $00000004; 118 | FILE_ATTRIBUTE_DIRECTORY = $00000010; 119 | FILE_ATTRIBUTE_ARCHIVE = $00000020; 120 | FILE_ATTRIBUTE_DEVICE = $00000040; 121 | FILE_ATTRIBUTE_NORMAL = $00000080; 122 | FILE_ATTRIBUTE_TEMPORARY = $00000100; 123 | FILE_ATTRIBUTE_SPARSE_FILE = $00000200; 124 | FILE_ATTRIBUTE_REPARSE_POINT = $00000400; 125 | FILE_ATTRIBUTE_COMPRESSED = $00000800; 126 | FILE_ATTRIBUTE_OFFLINE = $00001000; 127 | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = $00002000; 128 | FILE_ATTRIBUTE_ENCRYPTED = $00004000; 129 | FILE_ATTRIBUTE_INTEGRITY_STREAM = $00008000; 130 | FILE_ATTRIBUTE_VIRTUAL = $00010000; 131 | FILE_ATTRIBUTE_NO_SCRUB_DATA = $00020000; 132 | FILE_ATTRIBUTE_EA = $00040000; 133 | FILE_ATTRIBUTE_PINNED = $00080000; 134 | FILE_ATTRIBUTE_UNPINNED = $00100000; 135 | FILE_ATTRIBUTE_RECALL_ON_OPEN = $00040000; 136 | FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = $00400000; 137 | TREE_CONNECT_ATTRIBUTE_PRIVACY = $00004000; 138 | TREE_CONNECT_ATTRIBUTE_INTEGRITY = $00008000; 139 | TREE_CONNECT_ATTRIBUTE_GLOBAL = $00000004; 140 | FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL = $20000000; 141 | FILE_NOTIFY_CHANGE_FILE_NAME = $00000001; 142 | FILE_NOTIFY_CHANGE_DIR_NAME = $00000002; 143 | FILE_NOTIFY_CHANGE_ATTRIBUTES = $00000004; 144 | FILE_NOTIFY_CHANGE_SIZE = $00000008; 145 | FILE_NOTIFY_CHANGE_LAST_WRITE = $00000010; 146 | FILE_NOTIFY_CHANGE_LAST_ACCESS = $00000020; 147 | FILE_NOTIFY_CHANGE_CREATION = $00000040; 148 | FILE_NOTIFY_CHANGE_SECURITY = $00000100; 149 | FILE_ACTION_ADDED = $00000001; 150 | FILE_ACTION_REMOVED = $00000002; 151 | FILE_ACTION_MODIFIED = $00000003; 152 | FILE_ACTION_RENAMED_OLD_NAME = $00000004; 153 | FILE_ACTION_RENAMED_NEW_NAME = $00000005; 154 | MAILSLOT_NO_MESSAGE: DWORD = -1; 155 | MAILSLOT_WAIT_FOREVER: DWORD = -1; 156 | FILE_CASE_SENSITIVE_SEARCH = $00000001; 157 | FILE_CASE_PRESERVED_NAMES = $00000002; 158 | FILE_UNICODE_ON_DISK = $00000004; 159 | FILE_PERSISTENT_ACLS = $00000008; 160 | FILE_FILE_COMPRESSION = $00000010; 161 | FILE_VOLUME_QUOTAS = $00000020; 162 | FILE_SUPPORTS_SPARSE_FILES = $00000040; 163 | FILE_SUPPORTS_REPARSE_POINTS = $00000080; 164 | FILE_SUPPORTS_REMOTE_STORAGE = $00000100; 165 | FILE_RETURNS_CLEANUP_RESULT_INFO = $00000200; 166 | FILE_SUPPORTS_POSIX_UNLINK_RENAME = $00000400; 167 | 168 | 169 | 170 | 171 | FILE_VOLUME_IS_COMPRESSED = $00008000; 172 | FILE_SUPPORTS_OBJECT_IDS = $00010000; 173 | FILE_SUPPORTS_ENCRYPTION = $00020000; 174 | FILE_NAMED_STREAMS = $00040000; 175 | FILE_READ_ONLY_VOLUME = $00080000; 176 | FILE_SEQUENTIAL_WRITE_ONCE = $00100000; 177 | FILE_SUPPORTS_TRANSACTIONS = $00200000; 178 | FILE_SUPPORTS_HARD_LINKS = $00400000; 179 | FILE_SUPPORTS_EXTENDED_ATTRIBUTES = $00800000; 180 | FILE_SUPPORTS_OPEN_BY_FILE_ID = $01000000; 181 | FILE_SUPPORTS_USN_JOURNAL = $02000000; 182 | FILE_SUPPORTS_INTEGRITY_STREAMS = $04000000; 183 | FILE_SUPPORTS_BLOCK_REFCOUNTING = $08000000; 184 | FILE_SUPPORTS_SPARSE_VDL = $10000000; 185 | FILE_DAX_VOLUME = $20000000; 186 | FILE_SUPPORTS_GHOSTING = $40000000; 187 | 188 | FILE_INVALID_FILE_ID: LONGLONG = -1; 189 | 190 | ES_SYSTEM_REQUIRED: DWORD = $00000001; 191 | ES_DISPLAY_REQUIRED: DWORD = $00000002; 192 | ES_USER_PRESENT: DWORD = $00000004; 193 | ES_AWAYMODE_REQUIRED: DWORD = $00000040; 194 | ES_CONTINUOUS: DWORD = $80000000; 195 | 196 | type 197 | NWPSTR = ^WCHAR; 198 | LPWSTR = ^WCHAR; 199 | PWSTR = ^WCHAR; 200 | 201 | TACCESS_MASK = DWORD; 202 | PACCESS_MASK = ^TACCESS_MASK; 203 | 204 | TATOM = WORD; 205 | 206 | // ToDo 207 | wchar_t = WCHAR; // ushort; // is in rpcndr 208 | Pwchar_t = ^wchar_t; 209 | 210 | TOBJECT_TYPE_LIST = record 211 | Level: word; 212 | Sbz: word; 213 | ObjectType: PGUID; 214 | end; 215 | POBJECT_TYPE_LIST = ^TOBJECT_TYPE_LIST; 216 | 217 | 218 | TOSVERSIONINFOEXA = record 219 | dwOSVersionInfoSize: DWORD; 220 | dwMajorVersion: DWORD; 221 | dwMinorVersion: DWORD; 222 | dwBuildNumber: DWORD; 223 | dwPlatformId: DWORD; 224 | szCSDVersion: array[0.. 127] of char; // Maintenance string for PSS usage 225 | wServicePackMajor: word; 226 | wServicePackMinor: word; 227 | wSuiteMask: word; 228 | wProductType: byte; 229 | wReserved: byte; 230 | end; 231 | POSVERSIONINFOEXA = ^TOSVERSIONINFOEXA; 232 | 233 | TOSVERSIONINFOEXW = record 234 | dwOSVersionInfoSize: DWORD; 235 | dwMajorVersion: DWORD; 236 | dwMinorVersion: DWORD; 237 | dwBuildNumber: DWORD; 238 | dwPlatformId: DWORD; 239 | szCSDVersion: array[0.. 127] of WCHAR; // Maintenance string for PSS usage 240 | wServicePackMajor: word; 241 | wServicePackMinor: word; 242 | wSuiteMask: word; 243 | wProductType: byte; 244 | wReserved: byte; 245 | end; 246 | POSVERSIONINFOEXW = ^TOSVERSIONINFOEXW; 247 | TRTL_OSVERSIONINFOEXW = TOSVERSIONINFOEXW; 248 | PRTL_OSVERSIONINFOEXW = ^TRTL_OSVERSIONINFOEXW; 249 | 250 | 251 | TEXECUTION_STATE = DWORD; 252 | PEXECUTION_STATE = ^TEXECUTION_STATE; 253 | 254 | 255 | 256 | // Exception record definition. 257 | 258 | 259 | TEXCEPTION_RECORD = record 260 | ExceptionCode: DWORD; 261 | ExceptionFlags: DWORD; 262 | ExceptionRecord: PEXCEPTION_RECORD; 263 | ExceptionAddress: pointer; 264 | NumberParameters: DWORD; 265 | ExceptionInformation: array [0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of ULONG_PTR; 266 | end; 267 | 268 | 269 | PEXCEPTION_RECORD = ^TEXCEPTION_RECORD; 270 | 271 | TEXCEPTION_RECORD32 = record 272 | ExceptionCode: DWORD; 273 | ExceptionFlags: DWORD; 274 | ExceptionRecord: DWORD; 275 | ExceptionAddress: DWORD; 276 | NumberParameters: DWORD; 277 | ExceptionInformation: array [0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of DWORD; 278 | end; 279 | PEXCEPTION_RECORD32 = ^EXCEPTION_RECORD32; 280 | 281 | TEXCEPTION_RECORD64 = record 282 | ExceptionCode: DWORD; 283 | ExceptionFlags: DWORD; 284 | ExceptionRecord: DWORD64; 285 | ExceptionAddress: DWORD64; 286 | NumberParameters: DWORD; 287 | __unusedAlignment: DWORD; 288 | ExceptionInformation: array [0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of DWORD64; 289 | end; 290 | PEXCEPTION_RECORD64 = ^TEXCEPTION_RECORD64; 291 | 292 | 293 | implementation 294 | 295 | end. 296 | 297 | -------------------------------------------------------------------------------- /Units/Win32.XAPOFx.pas: -------------------------------------------------------------------------------- 1 | unit Win32.XAPOFx; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | {-========================================================================-_ 20 | | - XAPOFX - | 21 | | Copyright (c) Microsoft Corporation. All rights reserved. | 22 | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 23 | |PROJECT: XAPOFX MODEL: Unmanaged User-mode | 24 | |VERSION: 1.3 EXCEPT: No Exceptions | 25 | |CLASS: N / A MINREQ: WinXP, Xbox360 | 26 | |BASE: N / A DIALECT: MSC++ 14.00 | 27 | |>------------------------------------------------------------------------<| 28 | | DUTY: Cross-platform Audio Processing Objects | 29 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 30 | } 31 | 32 | 33 | 34 | { Header Definition: 10.0.14393.0 } 35 | 36 | {$IFDEF FPC} 37 | {$mode delphiunicode}{$H+} 38 | {$ENDIF} 39 | 40 | {$I Win32.WinAPI.inc} 41 | 42 | interface 43 | 44 | uses 45 | Windows, Classes; 46 | 47 | {$IF (_WIN32_WINNT < _WIN32_WINNT_WIN8)} 48 | {$error This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions.} 49 | {$ENDIF}// (_WIN32_WINNT < _WIN32_WINNT_WIN8) 50 | 51 | // Current name of the DLL shipped in the same SDK as this header. 52 | // The name reflects the current version 53 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN10)} 54 | const 55 | XAudio2_DLL = 'xaudio2_9.dll'; 56 | XAudio2D_DLL = 'xaudio2_9d.dll'; 57 | {$ELSE} 58 | XAudio2_DLL = 'xaudio2_8.dll'; 59 | XAudio2D_DLL = 'xaudio2_8.dll'; 60 | {$ENDIF} 61 | 62 | {$IF (DEFINED(WINAPI_PARTITION_APP ) or DEFINED( WINAPI_PARTITION_TV_APP) or DEFINED( WINAPI_PARTITION_TV_TITLE))} 63 | 64 | //---------------------------------------------------// 65 | 66 | const 67 | // FX class IDs 68 | CLSID_FXEQ: TGUID = '{F5E01117-D6C4-485A-A3F5-695196F3DBFA}'; 69 | CLSID_FXMasteringLimiter: TGUID = '{C4137916-2BE1-46FD-8599-441536F49856}'; 70 | CLSID_FXReverb: TGUID = '{7D9ACA56-CB68-4807-B632-B137352E8596}'; 71 | CLSID_FXEcho: TGUID = '{5039D740-F736-449A-84D3-A56202557B87}'; 72 | 73 | 74 | //include 75 | //include 76 | //include // single bounds 77 | 78 | 79 | // EQ parameter bounds (inclusive), used with FXEQ: 80 | const 81 | FXEQ_MIN_FRAMERATE = 22000; 82 | FXEQ_MAX_FRAMERATE = 48000; 83 | 84 | FXEQ_MIN_FREQUENCY_CENTER = 20.0; 85 | FXEQ_MAX_FREQUENCY_CENTER = 20000.0; 86 | FXEQ_DEFAULT_FREQUENCY_CENTER_0 = 100.0; // band 0 87 | FXEQ_DEFAULT_FREQUENCY_CENTER_1 = 800.0; // band 1 88 | FXEQ_DEFAULT_FREQUENCY_CENTER_2 = 2000.0; // band 2 89 | FXEQ_DEFAULT_FREQUENCY_CENTER_3 = 10000.0; // band 3 90 | 91 | FXEQ_MIN_GAIN = 0.126; // -18dB 92 | FXEQ_MAX_GAIN = 7.94; // +18dB 93 | FXEQ_DEFAULT_GAIN = 1.0; // 0dB change, all bands 94 | 95 | FXEQ_MIN_BANDWIDTH = 0.1; 96 | FXEQ_MAX_BANDWIDTH = 2.0; 97 | FXEQ_DEFAULT_BANDWIDTH = 1.0; // all bands 98 | 99 | 100 | // Mastering limiter parameter bounds (inclusive), used with FXMasteringLimiter: 101 | FXMASTERINGLIMITER_MIN_RELEASE = 1; 102 | FXMASTERINGLIMITER_MAX_RELEASE = 20; 103 | FXMASTERINGLIMITER_DEFAULT_RELEASE = 6; 104 | 105 | FXMASTERINGLIMITER_MIN_LOUDNESS = 1; 106 | FXMASTERINGLIMITER_MAX_LOUDNESS = 1800; 107 | FXMASTERINGLIMITER_DEFAULT_LOUDNESS = 1000; 108 | 109 | 110 | // Reverb parameter bounds (inclusive), used with FXReverb: 111 | FXREVERB_MIN_DIFFUSION = 0.0; 112 | FXREVERB_MAX_DIFFUSION = 1.0; 113 | FXREVERB_DEFAULT_DIFFUSION = 0.9; 114 | 115 | FXREVERB_MIN_ROOMSIZE = 0.0001; 116 | FXREVERB_MAX_ROOMSIZE = 1.0; 117 | FXREVERB_DEFAULT_ROOMSIZE = 0.6; 118 | 119 | 120 | // Echo initialization data/parameter bounds (inclusive), used with FXEcho: 121 | FXECHO_MIN_WETDRYMIX = 0.0; 122 | FXECHO_MAX_WETDRYMIX = 1.0; 123 | FXECHO_DEFAULT_WETDRYMIX = 0.5; 124 | 125 | FXECHO_MIN_FEEDBACK = 0.0; 126 | FXECHO_MAX_FEEDBACK = 1.0; 127 | FXECHO_DEFAULT_FEEDBACK = 0.5; 128 | 129 | FXECHO_MIN_DELAY = 1.0; 130 | FXECHO_MAX_DELAY = 2000.0; 131 | FXECHO_DEFAULT_DELAY = 500.0; 132 | 133 | 134 | //-----------------------------------------------------// 135 | //pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments 136 | {$A1} 137 | 138 | 139 | // EQ parameters (4 bands), used with IXAPOParameters::SetParameters: 140 | // The EQ supports only FLOAT32 audio foramts. 141 | // The framerate must be within [22000, 48000] Hz. 142 | type 143 | TFXEQ_PARAMETERS = record 144 | FrequencyCenter0: single; // center frequency in Hz, band 0 145 | Gain0: single; // boost/cut 146 | Bandwidth0: single; // bandwidth, region of EQ is center frequency +/- bandwidth/2 147 | FrequencyCenter1: single; // band 1 148 | Gain1: single; 149 | Bandwidth1: single; 150 | FrequencyCenter2: single; // band 2 151 | Gain2: single; 152 | Bandwidth2: single; 153 | FrequencyCenter3: single; // band 3 154 | Gain3: single; 155 | Bandwidth3: single; 156 | end; 157 | PFXEQ_PARAMETERS = ^TFXEQ_PARAMETERS; 158 | 159 | 160 | // Mastering limiter parameters, used with IXAPOParameters::SetParameters: 161 | // The mastering limiter supports only FLOAT32 audio formats. 162 | TFXMASTERINGLIMITER_PARAMETERS = record 163 | Release: UINT32; // release time (tuning factor with no specific units) 164 | Loudness: UINT32; // loudness target (threshold) 165 | end; 166 | PFXMASTERINGLIMITER_PARAMETERS = ^TFXMASTERINGLIMITER_PARAMETERS; 167 | 168 | 169 | // Reverb parameters, used with IXAPOParameters::SetParameters: 170 | // The reverb supports only FLOAT32 audio formats with the following 171 | // channel configurations: 172 | // Input: Mono Output: Mono 173 | // Input: Stereo Output: Stereo 174 | TFXREVERB_PARAMETERS = record 175 | Diffusion: single; // diffusion 176 | RoomSize: single; // room size 177 | end; 178 | PFXREVERB_PARAMETERS = ^TFXREVERB_PARAMETERS; 179 | 180 | 181 | // Echo initialization data, used with CreateFX: 182 | // Use of this structure is optional, the default MaxDelay is FXECHO_DEFAULT_DELAY. 183 | TFXECHO_INITDATA = record 184 | MaxDelay: single; // maximum delay (all channels) in milliseconds, must be within [FXECHO_MIN_DELAY, FXECHO_MAX_DELAY] 185 | end; 186 | PFXECHO_INITDATA = ^TFXECHO_INITDATA; 187 | 188 | // Echo parameters, used with IXAPOParameters::SetParameters: 189 | // The echo supports only FLOAT32 audio formats. 190 | TFXECHO_PARAMETERS = record 191 | WetDryMix: single; // ratio of wet (processed) signal to dry (original) signal 192 | Feedback: single; // amount of output fed back into input 193 | Delay: single; // delay (all channels) in milliseconds, must be within [FXECHO_MIN_DELAY, FXECHO_PARAMETERS.MaxDelay] 194 | end; 195 | PFXECHO_PARAMETERS = ^TFXECHO_PARAMETERS; 196 | 197 | 198 | 199 | //-------------------------------------------------------// 200 | // creates instance of requested XAPO, use Release to free instance 201 | // pInitData - [in] effect-specific initialization parameters, may be NULL if InitDataByteSize == 0 202 | // InitDataByteSize - [in] size of pInitData in bytes, may be 0 if pInitData is NULL 203 | function CreateFX(const clsid: TGUID; out pEffect: IUnknown; pInitData: PByte = nil; InitDataByteSize: UINT32 = 0): HResult; stdcall; external XAudio2_DLL; 204 | 205 | 206 | //pragma pack(pop) // revert packing alignment 207 | {$A4} 208 | 209 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_TV_APP | WINAPI_PARTITION_TV_TITLE) } 210 | 211 | implementation 212 | 213 | end. 214 | -------------------------------------------------------------------------------- /Units/Win32.Xinput.pas: -------------------------------------------------------------------------------- 1 | unit Win32.XInput; 2 | 3 | { ************************************************************************** 4 | Copyright (C) 2017 CMC Development Team 5 | 6 | CMC is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | CMC is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with CMC. If not, see . 18 | ************************************************************************** } 19 | {************************************************************************** 20 | * * 21 | * XInput.h -- This module defines Xbox 360 Common Controller APIs * 22 | * and constants for the Windows platform. * 23 | * * 24 | * Copyright (c) Microsoft Corp. All rights reserved. * 25 | * * 26 | **************************************************************************} 27 | 28 | 29 | { Header Definition: 10.0.14393.0 } 30 | 31 | {$IFDEF FPC} 32 | {$mode delphiunicode}{$H+} 33 | {$ENDIF} 34 | 35 | {$I Win32.WinAPI.inc} 36 | 37 | interface 38 | 39 | uses 40 | Windows, Classes; 41 | 42 | {$if DEFINED(WINAPI_PARTITION_APP)} 43 | 44 | // Current name of the DLL shipped in the same SDK as this header. 45 | // The name reflects the current version 46 | const 47 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 48 | XInput_DLL = 'xinput1_4.dll'; 49 | {$ELSE} 50 | XInput_DLL = 'xinput9_1_0.dll'; 51 | {$ENDIF} 52 | 53 | // Device types available in XINPUT_CAPABILITIES 54 | XINPUT_DEVTYPE_GAMEPAD = $01; 55 | // Device subtypes available in XINPUT_CAPABILITIES 56 | XINPUT_DEVSUBTYPE_GAMEPAD = $01; 57 | 58 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 59 | 60 | XINPUT_DEVSUBTYPE_UNKNOWN = $00; 61 | XINPUT_DEVSUBTYPE_WHEEL = $02; 62 | XINPUT_DEVSUBTYPE_ARCADE_STICK = $03; 63 | XINPUT_DEVSUBTYPE_FLIGHT_STICK = $04; 64 | XINPUT_DEVSUBTYPE_DANCE_PAD = $05; 65 | XINPUT_DEVSUBTYPE_GUITAR = $06; 66 | XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE = $07; 67 | XINPUT_DEVSUBTYPE_DRUM_KIT = $08; 68 | XINPUT_DEVSUBTYPE_GUITAR_BASS = $0B; 69 | XINPUT_DEVSUBTYPE_ARCADE_PAD = $13; 70 | 71 | {$ENDIF}//(_WIN32_WINNT >= _WIN32_WINNT_WIN8) 72 | 73 | 74 | // Flags for XINPUT_CAPABILITIES 75 | 76 | 77 | XINPUT_CAPS_VOICE_SUPPORTED = $0004; 78 | 79 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 80 | 81 | XINPUT_CAPS_FFB_SUPPORTED = $0001; 82 | XINPUT_CAPS_WIRELESS = $0002; 83 | XINPUT_CAPS_PMD_SUPPORTED = $0008; 84 | XINPUT_CAPS_NO_NAVIGATION = $0010; 85 | 86 | {$ENDIF}//(_WIN32_WINNT >= _WIN32_WINNT_WIN8) 87 | 88 | 89 | // Constants for gamepad buttons 90 | 91 | XINPUT_GAMEPAD_DPAD_UP = $0001; 92 | XINPUT_GAMEPAD_DPAD_DOWN = $0002; 93 | XINPUT_GAMEPAD_DPAD_LEFT = $0004; 94 | XINPUT_GAMEPAD_DPAD_RIGHT = $0008; 95 | XINPUT_GAMEPAD_START = $0010; 96 | XINPUT_GAMEPAD_BACK = $0020; 97 | XINPUT_GAMEPAD_LEFT_THUMB = $0040; 98 | XINPUT_GAMEPAD_RIGHT_THUMB = $0080; 99 | XINPUT_GAMEPAD_LEFT_SHOULDER = $0100; 100 | XINPUT_GAMEPAD_RIGHT_SHOULDER = $0200; 101 | XINPUT_GAMEPAD_A = $1000; 102 | XINPUT_GAMEPAD_B = $2000; 103 | XINPUT_GAMEPAD_X = $4000; 104 | XINPUT_GAMEPAD_Y = $8000; 105 | 106 | 107 | 108 | // Gamepad thresholds 109 | 110 | XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE = 7849; 111 | XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE = 8689; 112 | XINPUT_GAMEPAD_TRIGGER_THRESHOLD = 30; 113 | 114 | 115 | // Flags to pass to XInputGetCapabilities 116 | 117 | XINPUT_FLAG_GAMEPAD = $00000001; 118 | 119 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 120 | 121 | 122 | // Devices that support batteries 123 | 124 | BATTERY_DEVTYPE_GAMEPAD = $00; 125 | BATTERY_DEVTYPE_HEADSET = $01; 126 | 127 | 128 | // Flags for battery status level 129 | 130 | BATTERY_TYPE_DISCONNECTED = $00; // This device is not connected 131 | BATTERY_TYPE_WIRED = $01; // Wired device, no battery 132 | BATTERY_TYPE_ALKALINE = $02; // Alkaline battery source 133 | BATTERY_TYPE_NIMH = $03; // Nickel Metal Hydride battery source 134 | BATTERY_TYPE_UNKNOWN = $FF; // Cannot determine the battery type 135 | 136 | // These are only valid for wireless, connected devices, with known battery types 137 | // The amount of use time remaining depends on the type of device. 138 | BATTERY_LEVEL_EMPTY = $00; 139 | BATTERY_LEVEL_LOW = $01; 140 | BATTERY_LEVEL_MEDIUM = $02; 141 | BATTERY_LEVEL_FULL = $03; 142 | 143 | {$ENDIF}//(_WIN32_WINNT >= _WIN32_WINNT_WIN8) 144 | 145 | // User index definitions 146 | XUSER_MAX_COUNT = 4; 147 | 148 | XUSER_INDEX_ANY = $000000FF; 149 | 150 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 151 | 152 | 153 | // Codes returned for the gamepad keystroke 154 | 155 | 156 | VK_PAD_A = $5800; 157 | VK_PAD_B = $5801; 158 | VK_PAD_X = $5802; 159 | VK_PAD_Y = $5803; 160 | VK_PAD_RSHOULDER = $5804; 161 | VK_PAD_LSHOULDER = $5805; 162 | VK_PAD_LTRIGGER = $5806; 163 | VK_PAD_RTRIGGER = $5807; 164 | 165 | VK_PAD_DPAD_UP = $5810; 166 | VK_PAD_DPAD_DOWN = $5811; 167 | VK_PAD_DPAD_LEFT = $5812; 168 | VK_PAD_DPAD_RIGHT = $5813; 169 | VK_PAD_START = $5814; 170 | VK_PAD_BACK = $5815; 171 | VK_PAD_LTHUMB_PRESS = $5816; 172 | VK_PAD_RTHUMB_PRESS = $5817; 173 | 174 | VK_PAD_LTHUMB_UP = $5820; 175 | VK_PAD_LTHUMB_DOWN = $5821; 176 | VK_PAD_LTHUMB_RIGHT = $5822; 177 | VK_PAD_LTHUMB_LEFT = $5823; 178 | VK_PAD_LTHUMB_UPLEFT = $5824; 179 | VK_PAD_LTHUMB_UPRIGHT = $5825; 180 | VK_PAD_LTHUMB_DOWNRIGHT = $5826; 181 | VK_PAD_LTHUMB_DOWNLEFT = $5827; 182 | 183 | VK_PAD_RTHUMB_UP = $5830; 184 | VK_PAD_RTHUMB_DOWN = $5831; 185 | VK_PAD_RTHUMB_RIGHT = $5832; 186 | VK_PAD_RTHUMB_LEFT = $5833; 187 | VK_PAD_RTHUMB_UPLEFT = $5834; 188 | VK_PAD_RTHUMB_UPRIGHT = $5835; 189 | VK_PAD_RTHUMB_DOWNRIGHT = $5836; 190 | VK_PAD_RTHUMB_DOWNLEFT = $5837; 191 | 192 | 193 | // Flags used in XINPUT_KEYSTROKE 194 | 195 | XINPUT_KEYSTROKE_KEYDOWN = $0001; 196 | XINPUT_KEYSTROKE_KEYUP = $0002; 197 | XINPUT_KEYSTROKE_REPEAT = $0004; 198 | 199 | {$ENDIF}//(_WIN32_WINNT >= _WIN32_WINNT_WIN8) 200 | 201 | 202 | // Structures used by XInput APIs 203 | 204 | type 205 | TXINPUT_GAMEPAD = record 206 | wButtons: word; 207 | bLeftTrigger: byte; 208 | bRightTrigger: byte; 209 | sThumbLX: SHORT; 210 | sThumbLY: SHORT; 211 | sThumbRX: SHORT; 212 | sThumbRY: SHORT; 213 | end; 214 | PXINPUT_GAMEPAD = ^TXINPUT_GAMEPAD; 215 | 216 | TXINPUT_STATE = record 217 | dwPacketNumber: DWORD; 218 | Gamepad: TXINPUT_GAMEPAD; 219 | end; 220 | PXINPUT_STATE = ^TXINPUT_STATE; 221 | 222 | TXINPUT_VIBRATION = record 223 | wLeftMotorSpeed: word; 224 | wRightMotorSpeed: word; 225 | end; 226 | PXINPUT_VIBRATION = ^TXINPUT_VIBRATION; 227 | 228 | TXINPUT_CAPABILITIES = record 229 | AType: byte; 230 | SubType: byte; 231 | Flags: word; 232 | Gamepad: TXINPUT_GAMEPAD; 233 | Vibration: TXINPUT_VIBRATION; 234 | end; 235 | PXINPUT_CAPABILITIES = ^TXINPUT_CAPABILITIES; 236 | 237 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 238 | 239 | TXINPUT_BATTERY_INFORMATION = record 240 | BatteryType: byte; 241 | BatteryLevel: byte; 242 | end; 243 | PXINPUT_BATTERY_INFORMATION = ^TXINPUT_BATTERY_INFORMATION; 244 | 245 | TXINPUT_KEYSTROKE = record 246 | VirtualKey: word; 247 | Unicode: WCHAR; 248 | Flags: word; 249 | UserIndex: byte; 250 | HidCode: byte; 251 | end; 252 | PXINPUT_KEYSTROKE = ^TXINPUT_KEYSTROKE; 253 | 254 | {$ENDIF}//(_WIN32_WINNT >= _WIN32_WINNT_WIN8) 255 | 256 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) } 257 | 258 | 259 | 260 | // XInput APIs 261 | 262 | 263 | {$IF DEFINED(WINAPI_PARTITION_APP)} 264 | 265 | function XInputGetState(dwUserIndex: DWORD; // Index of the gamer associated with the device 266 | out pState: TXINPUT_STATE // Receives the current state 267 | ): DWORD; stdcall; external XInput_DLL; 268 | 269 | function XInputSetState(dwUserIndex: DWORD; // Index of the gamer associated with the device 270 | const pVibration: TXINPUT_VIBRATION // The vibration information to send to the controller 271 | ): DWORD; stdcall; external XInput_DLL; 272 | 273 | function XInputGetCapabilities(dwUserIndex: DWORD; // Index of the gamer associated with the device 274 | dwFlags: DWORD; // Input flags that identify the device type 275 | out pCapabilities: TXINPUT_CAPABILITIES // Receives the capabilities 276 | ): DWORD; stdcall; external XInput_DLL; 277 | 278 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN8)} 279 | 280 | procedure XInputEnable(enable: boolean // [in] Indicates whether xinput is enabled or disabled. 281 | ); stdcall; external XInput_DLL; 282 | 283 | {$IF (_WIN32_WINNT >= _WIN32_WINNT_WIN10)} 284 | //#pragma deprecated(XInputEnable) 285 | {$ENDIF} 286 | 287 | function XInputGetAudioDeviceIds(dwUserIndex: DWORD; // Index of the gamer associated with the device 288 | out pRenderDeviceId: LPWSTR; // Windows Core Audio device ID string for render (speakers) 289 | var pRenderCount: UINT; // Size of render device ID string buffer (in wide-chars) 290 | out pCaptureDeviceId: LPWSTR; // Windows Core Audio device ID string for capture (microphone) 291 | var pCaptureCount: UINT // Size of capture device ID string buffer (in wide-chars) 292 | ): DWORD; stdcall; external XInput_DLL; 293 | 294 | function XInputGetBatteryInformation(dwUserIndex: DWORD; // Index of the gamer associated with the device 295 | devType: byte; // Which device on this user index 296 | out pBatteryInformation: TXINPUT_BATTERY_INFORMATION // Contains the level and types of batteries 297 | ): DWORD; stdcall; external XInput_DLL; 298 | 299 | function XInputGetKeystroke(dwUserIndex: DWORD; // Index of the gamer associated with the device 300 | dwReserved: DWORD; // Reserved for future use 301 | out pKeystroke: TXINPUT_KEYSTROKE // Pointer to an XINPUT_KEYSTROKE structure that receives an input event. 302 | ): DWORD; stdcall; external XInput_DLL; 303 | 304 | {$ENDIF}//(_WIN32_WINNT >= _WIN32_WINNT_WIN8) 305 | 306 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) } 307 | 308 | 309 | 310 | {$IF DEFINED(WINAPI_PARTITION_DESKTOP)} 311 | 312 | {$IF (_WIN32_WINNT < _WIN32_WINNT_WIN8)} 313 | 314 | function XInputGetDSoundAudioDeviceGuids(dwUserIndex: DWORD; // Index of the gamer associated with the device 315 | out pDSoundRenderGuid: TGUID; // DSound device ID for render (speakers) 316 | out pDSoundCaptureGuid: TGUID // DSound device ID for capture (microphone) 317 | ): DWORD; stdcall; external XInput_DLL; 318 | 319 | {$ENDIF}//(_WIN32_WINNT < _WIN32_WINNT_WIN8) 320 | 321 | {$ENDIF}{ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) } 322 | 323 | implementation 324 | 325 | end. 326 | -------------------------------------------------------------------------------- /Units/win32.WTypesBase.pas: -------------------------------------------------------------------------------- 1 | unit Win32.WTypesBase; 2 | 3 | {$IFDEF FPC} 4 | {$mode delphiunicode}{$H+} 5 | {$ENDIF} 6 | 7 | {$I Win32.WinAPI.inc} 8 | 9 | interface 10 | 11 | uses 12 | Windows, Classes, SysUtils, 13 | Win32.RPCNDR; 14 | 15 | type 16 | 17 | {$IF 0} 18 | // byte = BYTE; 19 | // unsigned short WORD ; 20 | // unsigned int UINT; 21 | // int INT; 22 | // long BOOL; 23 | // long LONG; 24 | // unsigned long DWORD; 25 | HANDLE = pointer; 26 | PWORD = ^word; 27 | PDWORD = ^DWORD; 28 | // char CHAR; 29 | PSTR = ^char; 30 | PCSTR = ^char; 31 | // wchar_t WCHAR; 32 | TCHAR = WCHAR; 33 | PWSTR = ^WCHAR; 34 | PTSTR = ^TCHAR; 35 | PCWSTR = ^WCHAR; 36 | PCTSTR = ^TCHAR; 37 | PHANDLE = ^HANDLE; 38 | {$ENDIF}// 0 39 | 40 | 41 | 42 | {$IF defined(_WIN32) AND NOT defined(OLE2ANSI)} 43 | OLECHAR = WCHAR; 44 | POLESTR = ^OLECHAR; 45 | PCOLESTR = ^OLECHAR; 46 | {$ELSE} 47 | OLECHAR = char; 48 | POLESTR = PSTR; 49 | PCOLESTR = PCSTR; 50 | {$ENDIF} 51 | 52 | 53 | 54 | 55 | {$IFNDEF _WINDEF_} 56 | {$IFNDEF _MINWINDEF_} 57 | PVOID = pointer; 58 | {$ENDIF}//_MINWINDEF_ 59 | {$ENDIF}//_WINDEF_ 60 | 61 | type 62 | __int64 = int64; 63 | ULONG = DWORD; 64 | DWORDLONG = __int64; 65 | PDWORDLONG = ^DWORDLONG; 66 | LONGLONG = __int64; 67 | ULONGLONG = UINT64; 68 | PLONGLONG = ^LONGLONG; 69 | PULONGLONG = ^ULONGLONG; 70 | 71 | {$IF 0} 72 | TLARGE_INTEGER = record 73 | QuadPart: LONGLONG; 74 | end; 75 | PLARGE_INTEGER = ^TLARGE_INTEGER; 76 | 77 | TULARGE_INTEGER = record 78 | QuadPart: ULONGLONG; 79 | end; 80 | 81 | {$ENDIF}// 0 82 | 83 | TFILETIME = record 84 | dwLowDateTime: DWORD; 85 | dwHighDateTime: DWORD; 86 | end; 87 | 88 | PFILETIME = ^TFILETIME; 89 | 90 | 91 | TSYSTEMTIME = record 92 | wYear: word; 93 | wMonth: word; 94 | wDayOfWeek: word; 95 | wDay: word; 96 | wHour: word; 97 | wMinute: word; 98 | wSecond: word; 99 | wMilliseconds: word; 100 | end; 101 | 102 | PSYSTEMTIME = ^TSYSTEMTIME; 103 | 104 | 105 | TSECURITY_ATTRIBUTES = record 106 | nLength: DWORD; 107 | lpSecurityDescriptor: Pointer; 108 | bInheritHandle: longbool; 109 | end; 110 | PSECURITY_ATTRIBUTES = ^TSECURITY_ATTRIBUTES; 111 | 112 | 113 | TSECURITY_DESCRIPTOR_CONTROL = USHORT; 114 | PSECURITY_DESCRIPTOR_CONTROL = ^TSECURITY_DESCRIPTOR_CONTROL; 115 | // PSID = pointer; 116 | 117 | TACL = record 118 | AclRevision: UCHAR; 119 | Sbz1: UCHAR; 120 | AclSize: USHORT; 121 | AceCount: USHORT; 122 | Sbz2: USHORT; 123 | end; 124 | 125 | PACL = ^TACL; 126 | 127 | 128 | TSECURITY_DESCRIPTOR = record 129 | Revision: UCHAR; 130 | Sbz1: UCHAR; 131 | Control: TSECURITY_DESCRIPTOR_CONTROL; 132 | Owner: PSID; 133 | Group: PSID; 134 | Sacl: PACL; 135 | Dacl: PACL; 136 | end; 137 | 138 | PISECURITY_DESCRIPTOR = ^TSECURITY_DESCRIPTOR; 139 | 140 | 141 | 142 | TCOAUTHIDENTITY = record 143 | User: PUSHORT; 144 | UserLength: ULONG; 145 | Domain: PUSHORT; 146 | DomainLength: ULONG; 147 | Password: PUSHORT; 148 | PasswordLength: ULONG; 149 | Flags: ULONG; 150 | end; 151 | 152 | PCOAUTHIDENTITY = ^TCOAUTHIDENTITY; 153 | 154 | TCOAUTHINFO = record 155 | dwAuthnSvc: DWORD; 156 | dwAuthzSvc: DWORD; 157 | pwszServerPrincName: LPWSTR; 158 | dwAuthnLevel: DWORD; 159 | dwImpersonationLevel: DWORD; 160 | pAuthIdentityData: PCOAUTHIDENTITY; 161 | dwCapabilities: DWORD; 162 | end; 163 | 164 | PCOAUTHINFO = ^TCOAUTHINFO; 165 | 166 | TSCODE = LONG; 167 | PSCODE = ^TSCODE; 168 | 169 | 170 | 171 | type 172 | HRESULT = LONG; 173 | 174 | TOBJECTID = record 175 | Lineage: TGUID; 176 | Uniquifier: ULONG; 177 | end; 178 | 179 | 180 | {$IF 0} 181 | TREFGUID = ^TGUID; 182 | TREFIID = ^TIID; 183 | TREFCLSID = ^TCLSID; 184 | {$ENDIF}// 0 185 | 186 | TMEMCTX = ( 187 | MEMCTX_TASK = 1, 188 | MEMCTX_SHARED = 2, 189 | MEMCTX_MACSYSTEM = 3, 190 | MEMCTX_UNKNOWN = -1, 191 | MEMCTX_SAME = -2 192 | ); 193 | 194 | 195 | const 196 | ROTREGFLAGS_ALLOWANYCLIENT = $1; 197 | 198 | APPIDREGFLAGS_ACTIVATE_IUSERVER_INDESKTOP = $1; 199 | APPIDREGFLAGS_SECURE_SERVER_PROCESS_SD_AND_BIND = $2; 200 | APPIDREGFLAGS_ISSUE_ACTIVATION_RPC_AT_IDENTIFY = $4; 201 | APPIDREGFLAGS_IUSERVER_UNMODIFIED_LOGON_TOKEN = $8; 202 | APPIDREGFLAGS_IUSERVER_SELF_SID_IN_LAUNCH_PERMISSION = $10; 203 | APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY = $20; 204 | APPIDREGFLAGS_RESERVED1 = $40; 205 | APPIDREGFLAGS_RESERVED2 = $80; 206 | APPIDREGFLAGS_RESERVED3 = $100; 207 | APPIDREGFLAGS_RESERVED4 = $200; 208 | APPIDREGFLAGS_RESERVED5 = $400; 209 | APPIDREGFLAGS_RESERVED6 = $800; 210 | 211 | DCOMSCM_ACTIVATION_USE_ALL_AUTHNSERVICES = $1; 212 | DCOMSCM_ACTIVATION_DISALLOW_UNSECURE_CALL = $2; 213 | DCOMSCM_RESOLVE_USE_ALL_AUTHNSERVICES = $4; 214 | DCOMSCM_RESOLVE_DISALLOW_UNSECURE_CALL = $8; 215 | DCOMSCM_PING_USE_MID_AUTHNSERVICE = $10; 216 | DCOMSCM_PING_DISALLOW_UNSECURE_CALL = $20; 217 | 218 | type 219 | TCLSCTX = ( 220 | CLSCTX_INPROC_SERVER = $1, 221 | CLSCTX_INPROC_HANDLER = $2, 222 | CLSCTX_LOCAL_SERVER = $4, 223 | CLSCTX_INPROC_SERVER16 = $8, 224 | CLSCTX_REMOTE_SERVER = $10, 225 | CLSCTX_INPROC_HANDLER16 = $20, 226 | CLSCTX_RESERVED1 = $40, 227 | CLSCTX_RESERVED2 = $80, 228 | CLSCTX_RESERVED3 = $100, 229 | CLSCTX_RESERVED4 = $200, 230 | CLSCTX_NO_CODE_DOWNLOAD = $400, 231 | CLSCTX_RESERVED5 = $800, 232 | CLSCTX_NO_CUSTOM_MARSHAL = $1000, 233 | CLSCTX_ENABLE_CODE_DOWNLOAD = $2000, 234 | CLSCTX_NO_FAILURE_LOG = $4000, 235 | CLSCTX_DISABLE_AAA = $8000, 236 | CLSCTX_ENABLE_AAA = $10000, 237 | CLSCTX_FROM_DEFAULT_CONTEXT = $20000, 238 | CLSCTX_ACTIVATE_32_BIT_SERVER = $40000, 239 | CLSCTX_ACTIVATE_64_BIT_SERVER = $80000, 240 | CLSCTX_ENABLE_CLOAKING = $100000, 241 | CLSCTX_APPCONTAINER = $400000, 242 | CLSCTX_ACTIVATE_AAA_AS_IU = $800000, 243 | CLSCTX_PS_DLL = int32($80000000) 244 | ); 245 | 246 | const 247 | CLSCTX_VALID_MASK = 248 | (ord(CLSCTX_INPROC_SERVER) or ord(CLSCTX_INPROC_HANDLER) or ord(CLSCTX_LOCAL_SERVER) or ord(CLSCTX_INPROC_SERVER16) or 249 | ord(CLSCTX_REMOTE_SERVER) or ord(CLSCTX_NO_CODE_DOWNLOAD) or ord(CLSCTX_NO_CUSTOM_MARSHAL) or ord(CLSCTX_ENABLE_CODE_DOWNLOAD) or 250 | ord(CLSCTX_NO_FAILURE_LOG) or ord(CLSCTX_DISABLE_AAA) or ord(CLSCTX_ENABLE_AAA) or ord(CLSCTX_FROM_DEFAULT_CONTEXT) or 251 | ord(CLSCTX_ACTIVATE_32_BIT_SERVER) or ord(CLSCTX_ACTIVATE_64_BIT_SERVER) or ord(CLSCTX_ENABLE_CLOAKING) or ord(CLSCTX_APPCONTAINER) or 252 | ord(CLSCTX_ACTIVATE_AAA_AS_IU) or ord(CLSCTX_PS_DLL)); 253 | 254 | type 255 | TMSHLFLAGS = ( 256 | MSHLFLAGS_NORMAL = 0, 257 | MSHLFLAGS_TABLESTRONG = 1, 258 | MSHLFLAGS_TABLEWEAK = 2, 259 | MSHLFLAGS_NOPING = 4, 260 | MSHLFLAGS_RESERVED1 = 8, 261 | MSHLFLAGS_RESERVED2 = 16, 262 | MSHLFLAGS_RESERVED3 = 32, 263 | MSHLFLAGS_RESERVED4 = 64 264 | ); 265 | 266 | TMSHCTX = ( 267 | MSHCTX_LOCAL = 0, 268 | MSHCTX_NOSHAREDMEM = 1, 269 | MSHCTX_DIFFERENTMACHINE = 2, 270 | MSHCTX_INPROC = 3, 271 | MSHCTX_CROSSCTX = 4 272 | ); 273 | 274 | TBYTE_BLOB = record 275 | clSize: ULONG; 276 | abData: Pbyte; 277 | end; 278 | UP_BYTE_BLOB = ^TBYTE_BLOB; 279 | PBYTE_BLOB = ^TBYTE_BLOB; 280 | 281 | 282 | 283 | TWORD_BLOB = record 284 | clSize: ULONG; 285 | asData: PUSHORT; 286 | end; 287 | UP_WORD_BLOB = ^TWORD_BLOB; 288 | 289 | 290 | TDWORD_BLOB = record 291 | clSize: ULONG; 292 | alData: PULONG; 293 | end; 294 | UP_DWORD_BLOB = ^TDWORD_BLOB; 295 | PDWORD_BLOB = ^TDWORD_BLOB; 296 | 297 | 298 | TFLAGGED_BYTE_BLOB = record 299 | fFlags: ULONG; 300 | clSize: ULONG; 301 | abData: PByte; 302 | end; 303 | 304 | UP_FLAGGED_BYTE_BLOB = ^TFLAGGED_BYTE_BLOB; 305 | PFLAGGED_BYTE_BLOB = ^TFLAGGED_BYTE_BLOB; 306 | 307 | 308 | 309 | TFLAGGED_WORD_BLOB = record 310 | fFlags: ULONG; 311 | clSize: ULONG; 312 | asData: PUSHORT; 313 | end; 314 | 315 | UP_FLAGGED_WORD_BLOB = ^TFLAGGED_WORD_BLOB; 316 | 317 | 318 | TBYTE_SIZEDARR = record 319 | clSize: ULONG; 320 | pData: Pbyte; 321 | end; 322 | 323 | TSHORT_SIZEDARR = record 324 | clSize: ULONG; 325 | pData: PUSHORT; 326 | end; 327 | TWORD_SIZEDARR = TSHORT_SIZEDARR; 328 | 329 | TLONG_SIZEDARR = record 330 | clSize: ULONG; 331 | pData: PULONG; 332 | end; 333 | TDWORD_SIZEDARR = TLONG_SIZEDARR; 334 | 335 | THYPER_SIZEDARR = record 336 | clSize: ULONG; 337 | pData: Phyper; 338 | end; 339 | 340 | 341 | 342 | TBLOB = record 343 | cbSize: ULONG; 344 | pBlobData: PBYTE; 345 | end; 346 | PBLOB = ^TBLOB; 347 | 348 | 349 | TSID_IDENTIFIER_AUTHORITY = record 350 | Value: array [0..5] of UCHAR; 351 | end; 352 | 353 | PSID_IDENTIFIER_AUTHORITY = ^TSID_IDENTIFIER_AUTHORITY; 354 | 355 | 356 | TSID = record 357 | Revision: byte; 358 | SubAuthorityCount: byte; 359 | IdentifierAuthority: TSID_IDENTIFIER_AUTHORITY; 360 | SubAuthority: PULONG; 361 | end; 362 | 363 | PSID = ^TSID; 364 | 365 | 366 | TSID_AND_ATTRIBUTES = record 367 | Sid: PSID; 368 | Attributes: DWORD; 369 | end; 370 | PSID_AND_ATTRIBUTES = ^TSID_AND_ATTRIBUTES; 371 | 372 | 373 | 374 | 375 | { old } 376 | (* 377 | PChar = ^char; 378 | pWChar = ^WChar; 379 | LPSTR = ^char; 380 | LPWSTR = ^WChar; 381 | 382 | PSID = pointer; 383 | 384 | PWSTR = ^WChar; 385 | 386 | Pwchar_t = PWchar; // ??? 387 | 388 | PDWORD_BLOB = PByte; // ??? 389 | PFLAGGED_BYTE_BLOB = PByte; // ??? 390 | 391 | __int64 = int64; // ??? 392 | 393 | PBYTE_BLOB = PByte; // ??? 394 | 395 | FLAGGED_WORD_BLOB = byte; 396 | 397 | OLECHAR = char; 398 | POLESTR = PChar; *) 399 | 400 | implementation 401 | 402 | end. 403 | 404 | --------------------------------------------------------------------------------