├── .gitignore ├── JEXTRACT_WARNINGS.txt ├── LICENSE ├── LICENSE.LESSER ├── README.MD ├── banned_structs ├── build_install.bat ├── build_package.bat ├── buildscript └── generate.bat ├── c ├── config.h ├── d3d │ ├── d3d.h │ ├── d3d10.h │ ├── d3d11.h │ ├── d3d12.h │ └── d3d9.h └── native.h ├── cs_guid_definitions ├── .gitignore ├── LICENSE.md ├── NOTICE.md ├── THIRD-PARTY-NOTICES.md └── sources │ └── Interop │ └── Windows │ ├── DirectX │ ├── other │ │ └── D3D12Downlevel │ │ │ └── IID.cs │ ├── shared │ │ ├── dxgi │ │ │ └── IID.cs │ │ ├── dxgi1_2 │ │ │ └── IID.cs │ │ ├── dxgi1_3 │ │ │ └── IID.cs │ │ ├── dxgi1_4 │ │ │ └── IID.cs │ │ ├── dxgi1_5 │ │ │ └── IID.cs │ │ └── dxgi1_6 │ │ │ └── IID.cs │ └── um │ │ ├── d2d1effects │ │ └── CLSID.cs │ │ ├── d2d1effects_1 │ │ └── CLSID.cs │ │ ├── d2d1effects_2 │ │ └── CLSID.cs │ │ ├── d3d10 │ │ └── IID.cs │ │ ├── d3d10_1 │ │ └── IID.cs │ │ ├── d3d10_1shader │ │ └── IID.cs │ │ ├── d3d10effect │ │ └── IID.cs │ │ ├── d3d10misc │ │ └── GUID.cs │ │ ├── d3d10sdklayers │ │ ├── DXGI.cs │ │ └── IID.cs │ │ ├── d3d10shader │ │ └── IID.cs │ │ ├── d3d11 │ │ ├── D3D11.cs │ │ └── IID.cs │ │ ├── d3d11_1 │ │ └── IID.cs │ │ ├── d3d11_2 │ │ └── IID.cs │ │ ├── d3d11_3 │ │ └── IID.cs │ │ ├── d3d11_4 │ │ └── IID.cs │ │ ├── d3d11on12 │ │ └── IID.cs │ │ ├── d3d11sdklayers │ │ ├── DXGI.cs │ │ └── IID.cs │ │ ├── d3d11shader │ │ └── IID.cs │ │ ├── d3d12 │ │ ├── CLSID.cs │ │ ├── D3D12.cs │ │ └── IID.cs │ │ ├── d3d12sdklayers │ │ ├── DXGI.cs │ │ ├── DirectX.cs │ │ └── IID.cs │ │ ├── d3d12shader │ │ └── IID.cs │ │ ├── d3d12video │ │ ├── D3D12.cs │ │ └── IID.cs │ │ ├── d3dcommon │ │ ├── D3D.cs │ │ ├── DirectX.cs │ │ └── IID.cs │ │ ├── ddraw │ │ ├── CLSID.cs │ │ └── IID.cs │ │ ├── directmanipulation │ │ └── CLSID.cs │ │ ├── dxcapi │ │ └── CLSID.cs │ │ ├── dxcore_interface │ │ ├── DirectX.cs │ │ └── IID.cs │ │ ├── dxdiag │ │ ├── CLSID.cs │ │ └── IID.cs │ │ └── dxgidebug │ │ ├── DXGI.cs │ │ └── IID.cs │ └── Windows │ ├── shared │ ├── hidclass │ │ └── GUID.cs │ └── uuids │ │ ├── CLSID.cs │ │ ├── EVRConfig.cs │ │ ├── FORMAT.cs │ │ ├── IID.cs │ │ ├── MEDIASUBTYPE.cs │ │ ├── MEDIATYPE.cs │ │ ├── PIN.cs │ │ ├── TIME.cs │ │ └── Windows.cs │ └── um │ ├── DocumentTarget │ └── ID.cs │ ├── InputScope │ ├── GUID.cs │ └── IID.cs │ ├── MSAAText │ ├── CLSID.cs │ ├── IID.cs │ └── LIBID.cs │ ├── MsHTML │ ├── SID.cs │ └── Windows.cs │ ├── ShObjIdl │ └── SID.cs │ ├── ShObjIdl_core │ └── SID.cs │ ├── ShlGuid │ ├── BHID.cs │ ├── CATID.cs │ ├── CLSID.cs │ ├── EP.cs │ ├── FMTID.cs │ ├── FOLDERTYPEID.cs │ ├── IID.cs │ ├── SID.cs │ ├── SYNCMGR.cs │ └── Windows.cs │ ├── TextStor │ └── GUID.cs │ ├── control │ ├── CLSID.cs │ ├── IID.cs │ └── LIBID.cs │ ├── credentialprovider │ └── Windows.cs │ ├── ctffunc │ └── GUID.cs │ ├── ctfspui │ └── IID.cs │ ├── devicetopology │ └── Windows.cs │ ├── mfapi │ ├── AM.cs │ ├── CLSID.cs │ ├── FORMAT.cs │ ├── MF.cs │ ├── MFAudioFormat.cs │ ├── MFT.cs │ ├── MFVideoFormat.cs │ └── Windows.cs │ ├── mfidl │ ├── CLSID.cs │ ├── MF.cs │ └── Windows.cs │ ├── mfsharingengine │ └── MF.cs │ ├── mftransform │ ├── MF.cs │ └── MFT.cs │ ├── mmdeviceapi │ └── Windows.cs │ ├── msctf │ └── TF.cs │ ├── ntsecapi │ └── Windows.cs │ ├── wincodec │ ├── CATID.cs │ ├── CLSID.cs │ └── GUID.cs │ ├── wincodecsdk │ ├── CLSID.cs │ └── GUID.cs │ └── winnt │ ├── GUID.cs │ ├── PPM.cs │ └── Windows.cs ├── pom.xml └── src └── main └── java └── com └── falsepattern └── jwin32 ├── Macros.java ├── internal ├── conversion │ ├── COMGenerator.java │ ├── ConstMapper.java │ ├── Struct.java │ ├── Translator.java │ ├── common │ │ ├── AccessSpecifier.java │ │ ├── CClass.java │ │ ├── CConstructor.java │ │ ├── CField.java │ │ ├── CMethod.java │ │ ├── CParamList.java │ │ ├── CParameter.java │ │ ├── CType.java │ │ └── TypeCarrier.java │ └── special │ │ ├── SpecialBehaviour.java │ │ └── StructGUID.java └── guid │ ├── FileTreeIterator.java │ └── GUIDHunter.java └── memory ├── MemoryAllocator.java ├── MemoryStack.java └── MemoryUtil.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Autogenerated files 2 | src/main/java/win32 3 | src/main/java/module-info.java 4 | 5 | # Created by https://www.toptal.com/developers/gitignore/api/eclipse,maven,java,intellij+all 6 | # Edit at https://www.toptal.com/developers/gitignore?templates=eclipse,maven,java,intellij+all 7 | 8 | ### Eclipse ### 9 | .metadata 10 | bin/ 11 | tmp/ 12 | *.tmp 13 | *.bak 14 | *.swp 15 | *~.nib 16 | local.properties 17 | .settings/ 18 | .loadpath 19 | .recommenders 20 | 21 | # External tool builders 22 | .externalToolBuilders/ 23 | 24 | # Locally stored "Eclipse launch configurations" 25 | *.launch 26 | 27 | # PyDev specific (Python IDE for Eclipse) 28 | *.pydevproject 29 | 30 | # CDT-specific (C/C++ Development Tooling) 31 | .cproject 32 | 33 | # CDT- autotools 34 | .autotools 35 | 36 | # Java annotation processor (APT) 37 | .factorypath 38 | 39 | # PDT-specific (PHP Development Tools) 40 | .buildpath 41 | 42 | # sbteclipse plugin 43 | .target 44 | 45 | # Tern plugin 46 | .tern-project 47 | 48 | # TeXlipse plugin 49 | .texlipse 50 | 51 | # STS (Spring Tool Suite) 52 | .springBeans 53 | 54 | # Code Recommenders 55 | .recommenders/ 56 | 57 | # Annotation Processing 58 | .apt_generated/ 59 | .apt_generated_test/ 60 | 61 | # Scala IDE specific (Scala & Java development for Eclipse) 62 | .cache-main 63 | .scala_dependencies 64 | .worksheet 65 | 66 | # Uncomment this line if you wish to ignore the project description file. 67 | # Typically, this file would be tracked if it contains build/dependency configurations: 68 | #.project 69 | 70 | ### Eclipse Patch ### 71 | # Spring Boot Tooling 72 | .sts4-cache/ 73 | 74 | ### Intellij+all ### 75 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 76 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 77 | 78 | # User-specific stuff 79 | .idea/**/workspace.xml 80 | .idea/**/tasks.xml 81 | .idea/**/usage.statistics.xml 82 | .idea/**/dictionaries 83 | .idea/**/shelf 84 | 85 | # AWS User-specific 86 | .idea/**/aws.xml 87 | 88 | # Generated files 89 | .idea/**/contentModel.xml 90 | 91 | # Sensitive or high-churn files 92 | .idea/**/dataSources/ 93 | .idea/**/dataSources.ids 94 | .idea/**/dataSources.local.xml 95 | .idea/**/sqlDataSources.xml 96 | .idea/**/dynamic.xml 97 | .idea/**/uiDesigner.xml 98 | .idea/**/dbnavigator.xml 99 | 100 | # Gradle 101 | .idea/**/gradle.xml 102 | .idea/**/libraries 103 | 104 | # Gradle and Maven with auto-import 105 | # When using Gradle or Maven with auto-import, you should exclude module files, 106 | # since they will be recreated, and may cause churn. Uncomment if using 107 | # auto-import. 108 | # .idea/artifacts 109 | # .idea/compiler.xml 110 | # .idea/jarRepositories.xml 111 | # .idea/modules.xml 112 | # .idea/*.iml 113 | # .idea/modules 114 | # *.iml 115 | # *.ipr 116 | 117 | # CMake 118 | cmake-build-*/ 119 | 120 | # Mongo Explorer plugin 121 | .idea/**/mongoSettings.xml 122 | 123 | # File-based project format 124 | *.iws 125 | 126 | # IntelliJ 127 | out/ 128 | 129 | # mpeltonen/sbt-idea plugin 130 | .idea_modules/ 131 | 132 | # JIRA plugin 133 | atlassian-ide-plugin.xml 134 | 135 | # Cursive Clojure plugin 136 | .idea/replstate.xml 137 | 138 | # Crashlytics plugin (for Android Studio and IntelliJ) 139 | com_crashlytics_export_strings.xml 140 | crashlytics.properties 141 | crashlytics-build.properties 142 | fabric.properties 143 | 144 | # Editor-based Rest Client 145 | .idea/httpRequests 146 | 147 | # Android studio 3.1+ serialized cache file 148 | .idea/caches/build_file_checksums.ser 149 | 150 | ### Intellij+all Patch ### 151 | # Ignores the whole .idea folder and all .iml files 152 | # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 153 | 154 | .idea/ 155 | 156 | # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 157 | 158 | *.iml 159 | modules.xml 160 | .idea/misc.xml 161 | *.ipr 162 | 163 | # Sonarlint plugin 164 | .idea/sonarlint 165 | 166 | ### Java ### 167 | # Compiled class file 168 | *.class 169 | 170 | # Log file 171 | *.log 172 | 173 | # BlueJ files 174 | *.ctxt 175 | 176 | # Mobile Tools for Java (J2ME) 177 | .mtj.tmp/ 178 | 179 | # Package Files # 180 | *.jar 181 | *.war 182 | *.nar 183 | *.ear 184 | *.zip 185 | *.tar.gz 186 | *.rar 187 | 188 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 189 | hs_err_pid* 190 | 191 | ### Maven ### 192 | target/ 193 | pom.xml.tag 194 | pom.xml.releaseBackup 195 | pom.xml.versionsBackup 196 | pom.xml.next 197 | release.properties 198 | dependency-reduced-pom.xml 199 | buildNumber.properties 200 | .mvn/timing.properties 201 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 202 | .mvn/wrapper/maven-wrapper.jar 203 | 204 | ### Maven Patch ### 205 | # Eclipse m2e generated files 206 | # Eclipse Core 207 | .project 208 | # JDT-specific (Eclipse Java Development Tools) 209 | .classpath 210 | 211 | # End of https://www.toptal.com/developers/gitignore/api/eclipse,maven,java,intellij+all 212 | guidlog.txt -------------------------------------------------------------------------------- /JEXTRACT_WARNINGS.txt: -------------------------------------------------------------------------------- 1 | WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.jextract 2 | WARNING: Layout size not available for Policies 3 | WARNING: Layout size not available for Elements 4 | WARNING: Layout size not available for pEventLogRecords 5 | WARNING: Layout size not available for ulOffsets 6 | WARNING: Layout size not available for Format 7 | WARNING: Layout size not available for Lev1Depends 8 | WARNING: Layout size not available for Lev2Depends 9 | WARNING: skipping wcstold because of unsupported type usage: long double 10 | WARNING: skipping _wcstold_l because of unsupported type usage: long double 11 | WARNING: skipping .x because of unsupported type usage: long double 12 | WARNING: skipping strtold because of unsupported type usage: long double 13 | WARNING: skipping _strtold_l because of unsupported type usage: long double 14 | -------------------------------------------------------------------------------- /banned_structs: -------------------------------------------------------------------------------- 1 | _MMIOINFO 2 | DRVCONFIGINFOEX 3 | IMAGE_AUX_SYMBOL_TOKEN_DEF 4 | tagDRVCONFIGINFO 5 | midihdr_tag 6 | tagMCI_ANIM_OPEN_PARMSA 7 | tagMCI_ANIM_OPEN_PARMSW 8 | tagMCI_ANIM_WINDOW_PARMSA 9 | tagMCI_ANIM_WINDOW_PARMSW 10 | tagMCI_BREAK_PARMS 11 | tagMCI_OPEN_PARMSA 12 | tagMCI_OPEN_PARMSW 13 | tagMCI_OVLY_OPEN_PARMSA 14 | tagMCI_OVLY_OPEN_PARMSW 15 | tagMCI_OVLY_WINDOW_PARMSA 16 | tagMCI_OVLY_WINDOW_PARMSW 17 | tagMCI_WAVE_OPEN_PARMSA 18 | tagMCI_WAVE_OPEN_PARMSW 19 | tagMETAHEADER 20 | tagMIXERLINEA 21 | tagMIXERLINECONTROLSA 22 | tagMIXERLINECONTROLSW 23 | tagMIXERLINEW 24 | tagBITMAPFILEHEADER 25 | tMIXERCONTROLDETAILS -------------------------------------------------------------------------------- /build_install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Copyright (c) 2021 FalsePattern 3 | REM 4 | REM Permission is hereby granted, free of charge, to any person obtaining a copy 5 | REM of this software and associated documentation files (the "Software"), to deal 6 | REM in the Software without restriction, including without limitation the rights 7 | REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | REM copies of the Software, and to permit persons to whom the Software is 9 | REM furnished to do so, subject to the following conditions: 10 | REM 11 | REM The above copyright notice and this permission notice shall be included in all 12 | REM copies or substantial portions of the Software. 13 | REM 14 | REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | REM SOFTWARE. 21 | echo Starting maven build 22 | mvn clean compile exec:exec compile install 23 | echo Build complete -------------------------------------------------------------------------------- /build_package.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Copyright (c) 2021 FalsePattern 3 | REM 4 | REM Permission is hereby granted, free of charge, to any person obtaining a copy 5 | REM of this software and associated documentation files (the "Software"), to deal 6 | REM in the Software without restriction, including without limitation the rights 7 | REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | REM copies of the Software, and to permit persons to whom the Software is 9 | REM furnished to do so, subject to the following conditions: 10 | REM 11 | REM The above copyright notice and this permission notice shall be included in all 12 | REM copies or substantial portions of the Software. 13 | REM 14 | REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | REM SOFTWARE. 21 | echo Starting maven build 22 | mvn clean compile exec:exec compile package 23 | echo Build complete -------------------------------------------------------------------------------- /buildscript/generate.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Copyright (c) 2021 FalsePattern 3 | REM 4 | REM Permission is hereby granted, free of charge, to any person obtaining a copy 5 | REM of this software and associated documentation files (the "Software"), to deal 6 | REM in the Software without restriction, including without limitation the rights 7 | REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | REM copies of the Software, and to permit persons to whom the Software is 9 | REM furnished to do so, subject to the following conditions: 10 | REM 11 | REM The above copyright notice and this permission notice shall be included in all 12 | REM copies or substantial portions of the Software. 13 | REM 14 | REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | REM SOFTWARE. 21 | echo Cleaning up folders... 22 | rmdir /S /Q .\src\main\java\win32 > nul 23 | del .\src\main\java\module-info.java > nul 24 | echo Creating empty folders... 25 | mkdir .\src\main\java\win32 26 | mkdir .\src\main\java\win32\pure 27 | mkdir .\src\main\java\win32\mapped 28 | mkdir .\src\main\java\win32\mapped\com 29 | mkdir .\src\main\java\win32\mapped\struct 30 | mkdir .\src\main\java\win32\mapped\constants 31 | echo Cleanup finished! 32 | echo Generating panama mappings... 33 | REM Edit this line if you want to make custom mappings: 34 | jextract --source --header-class-name Win32 -d .\src\main\java -t win32.pure .\c\native.h 35 | 36 | echo Generation finished! -------------------------------------------------------------------------------- /c/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | //This file is used for selecting the libraries you want to use. 24 | 25 | //Windows.h 26 | // 27 | //The default defines have just enough functionality to allow for basic window management and input handling. 28 | //Comment out the following line to include the full Windows.h header (slows down compilation). 29 | #define JWIN32_REDUCE_WINDOWS_H 30 | 31 | #ifdef JWIN32_REDUCE_WINDOWS_H 32 | #define WIN32_LEAN_AND_MEAN 33 | #define VC_EXTRALEAN //Probably don't need this one, but better safe than sorry 34 | #define NOGDICAPMASKS 35 | //#define NOVIRTUALKEYCODES 36 | //#define NOWINMESSAGES 37 | //#define NOWINSTYLES 38 | #define NOSYSMETRICS 39 | #define NOMENUS 40 | #define NOICONS 41 | //#define NOKEYSTATES 42 | #define NOSYSCOMMANDS 43 | #define NORASTEROPS 44 | //#define NOSHOWWINDOW 45 | #define OEMRESOURCE 46 | #define NOATOM 47 | #define NOCLIPBOARD 48 | #define NOCOLOR 49 | #define NOCTLMGR 50 | #define NODRAEXT 51 | //#define NOGDI 52 | //#define NOKERNEL 53 | //#define NOUSER 54 | #define NONLS 55 | //#define NOMB 56 | #define NOMEMMGR 57 | #define NOMETAFILE 58 | #define NOMINMAX 59 | //#define NOMSG 60 | #define NOOPENFILE 61 | #define NOSCROLL 62 | #define NOSERVICE 63 | #define NOSOUND 64 | #define NOTEXTMETRIC 65 | #define NOWH 66 | //#define NOWINOFFSETS 67 | #define NOCOMM 68 | #define NOKANJI 69 | #define NOHELP 70 | #define NOPROFILER 71 | #define NODEFERWINDOWPOS 72 | #define NOMCX 73 | #endif 74 | 75 | 76 | //DXGI 77 | // 78 | //Uncomment if you want to use the DXGI library. 79 | 80 | //#define JWIN32_DXGI 81 | 82 | 83 | //Direct3D 84 | // 85 | //Uncomment to select your desired Direct3D version. You can select any combination of these. 86 | //Inspect the headers inside the d3d folder if you want to know what each of them actually imports. 87 | //NOTE: enabling d3d11on12 also force-enables d3d11 and d3d12. 88 | 89 | //#define JWIN32_D3D_9 90 | //#define JWIN32_D3D_10 91 | //#define JWIN32_D3D_11 92 | //#define JWIN32_D3D_12 93 | //#define JWIN32_D3D11ON12 -------------------------------------------------------------------------------- /c/d3d/d3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | #ifndef _JWIN32_D3D_H_ 23 | #define _JWIN32_D3D_H_ 24 | #include 25 | #include 26 | #endif -------------------------------------------------------------------------------- /c/d3d/d3d10.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | #ifndef _JWIN32_D3D10_H_ 23 | #define _JWIN32_D3D10_H_ 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #endif -------------------------------------------------------------------------------- /c/d3d/d3d11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | #ifndef _JWIN32_D3D11_H_ 23 | #define _JWIN32_D3D11_H_ 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #endif -------------------------------------------------------------------------------- /c/d3d/d3d12.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | #ifndef _JWIN32_D3D12_H_ 23 | #define _JWIN32_D3D12_H_ 24 | #include 25 | #include 26 | #include 27 | #endif -------------------------------------------------------------------------------- /c/d3d/d3d9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | #ifndef _JWIN32_D3D9_H_ 23 | #define _JWIN32_D3D9_H_ 24 | #include 25 | #include 26 | #include 27 | #endif -------------------------------------------------------------------------------- /c/native.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | #ifndef _JWIN32_ 23 | #define _JWIN32_ 24 | #include "config.h" 25 | //Config post-processing 26 | #ifdef JWIN32_D3D11ON12 27 | #define JWIN32_D3D_11 28 | #define JWIN32_D3D_12 29 | #endif 30 | #ifdef JWIN32_D3D_9 31 | #define JWIN32_D3D 32 | #endif 33 | #ifdef JWIN32_D3D_10 34 | #define JWIN32_D3D 35 | #endif 36 | #ifdef JWIN32_D3D_11 37 | #define JWIN32_D3D 38 | #endif 39 | #ifdef JWIN32_D3D_12 40 | #define JWIN32_D3D 41 | #endif 42 | 43 | #include 44 | 45 | //GUID support 46 | #include 47 | 48 | //DXGI 49 | #ifdef JWIN32_DXGI 50 | #include 51 | #endif 52 | 53 | //Direct3D 54 | #ifdef JWIN32_D3D 55 | #include "d3d/d3d.h" 56 | #ifdef JWIN32_D3D_9 57 | #include "d3d/d3d9.h" 58 | #endif 59 | #ifdef JWIN32_D3D_10 60 | #include "d3d/d3d10.h" 61 | #endif 62 | #ifdef JWIN32_D3D_11 63 | #include "d3d/d3d11.h" 64 | #endif 65 | #ifdef JWIN32_D3D_12 66 | #include "d3d/d3d12.h" 67 | #endif 68 | #ifdef JWIN32_D3D11ON12 69 | #include 70 | #endif 71 | #endif 72 | #endif -------------------------------------------------------------------------------- /cs_guid_definitions/.gitignore: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Build Artifacts 3 | ############################################################################### 4 | artifacts/ 5 | *.binlog 6 | 7 | ############################################################################### 8 | # Default Artifacts 9 | ############################################################################### 10 | bin/ 11 | obj/ 12 | 13 | ############################################################################### 14 | # Test Artifacts 15 | ############################################################################### 16 | TestResult.xml 17 | 18 | ############################################################################### 19 | # Visual Studio and Visual Studio Code 20 | ############################################################################### 21 | .vs/ 22 | .vscode/ 23 | 24 | ############################################################################### 25 | # User Specific Settings 26 | ############################################################################### 27 | *.user 28 | 29 | ############################################################################### 30 | # Asset Files 31 | ############################################################################### 32 | *.bmp 33 | *.gif 34 | *.jpg 35 | *.png 36 | *.wav 37 | .idea/ -------------------------------------------------------------------------------- /cs_guid_definitions/LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright © Tanner Gooding and Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /cs_guid_definitions/NOTICE.md: -------------------------------------------------------------------------------- 1 | These sources were taken from [terrafx-interop-windows](https://github.com/terrafx/terrafx.interop.windows) -------------------------------------------------------------------------------- /cs_guid_definitions/THIRD-PARTY-NOTICES.md: -------------------------------------------------------------------------------- 1 | TerraFX uses third-party library or other resources that may be distributed 2 | under a license difference than that of TerraFX. 3 | 4 | In the event we accidentally failed to list a required notice, please bring 5 | it to our attention by posting ann issue or contacting us: admin@terrafx.dev 6 | 7 | The attached notices are provided for informational purposes only. 8 | 9 | # License notice for Microsoft/DirectX-Graphics-Samples 10 | 11 | The MIT License (MIT) 12 | 13 | Copyright (c) 2015 Microsoft 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | 33 | # License notice for Microsoft/DirectXShaderCompiler 34 | 35 | ============================================================================== 36 | LLVM Release License 37 | ============================================================================== 38 | University of Illinois/NCSA 39 | Open Source License 40 | 41 | Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign. 42 | All rights reserved. 43 | 44 | Developed by: 45 | 46 | LLVM Team 47 | 48 | University of Illinois at Urbana-Champaign 49 | 50 | http://llvm.org 51 | 52 | Permission is hereby granted, free of charge, to any person obtaining a copy of 53 | this software and associated documentation files (the "Software"), to deal with 54 | the Software without restriction, including without limitation the rights to 55 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 56 | of the Software, and to permit persons to whom the Software is furnished to do 57 | so, subject to the following conditions: 58 | 59 | * Redistributions of source code must retain the above copyright notice, 60 | this list of conditions and the following disclaimers. 61 | 62 | * Redistributions in binary form must reproduce the above copyright notice, 63 | this list of conditions and the following disclaimers in the 64 | documentation and/or other materials provided with the distribution. 65 | 66 | * Neither the names of the LLVM Team, University of Illinois at 67 | Urbana-Champaign, nor the names of its contributors may be used to 68 | endorse or promote products derived from this Software without specific 69 | prior written permission. 70 | 71 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 72 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 73 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 74 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 75 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 76 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE 77 | SOFTWARE. 78 | 79 | ============================================================================== 80 | Copyrights and Licenses for Third Party Software Distributed with LLVM: 81 | ============================================================================== 82 | The LLVM software contains code written by third parties. Such software will 83 | have its own individual LICENSE.TXT file in the directory in which it appears. 84 | This file will describe the copyrights, license, and restrictions which apply 85 | to that code. 86 | 87 | The disclaimer of warranty in the University of Illinois Open Source License 88 | applies to all code in the LLVM Distribution, and nothing in any of the 89 | other licenses gives permission to use the names of the LLVM Team or the 90 | University of Illinois to endorse or promote products derived from this 91 | Software. 92 | 93 | The following pieces of software have additional or alternate copyrights, 94 | licenses, and/or restrictions: 95 | 96 | Program Directory 97 | ------- --------- 98 | Autoconf llvm/autoconf 99 | llvm/projects/ModuleMaker/autoconf 100 | Google Test llvm/utils/unittest/googletest 101 | OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} 102 | pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} 103 | ARM contributions llvm/lib/Target/ARM/LICENSE.TXT 104 | md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h 105 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/other/D3D12Downlevel/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from D3D12Downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 4 | // Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D12CommandQueueDownlevel 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xEF, 0xC5, 0xA8, 0x38, 24 | 0xCB, 0x7C, 25 | 0x81, 0x4E, 26 | 0x91, 27 | 0x4F, 28 | 0xA6, 29 | 0xE9, 30 | 0xD0, 31 | 0x72, 32 | 0xC4, 33 | 0x94 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D12DeviceDownlevel 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x3F, 0xEE, 0xEA, 0x74, 49 | 0x4B, 0x2F, 50 | 0x6D, 0x47, 51 | 0x82, 52 | 0xBA, 53 | 0x2B, 54 | 0x85, 55 | 0xCB, 56 | 0x49, 57 | 0xE3, 58 | 0x10 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/shared/dxgi1_4/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from shared/dxgi1_4.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_IDXGISwapChain3 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xDB, 0x9B, 0xD9, 0x94, 24 | 0xF8, 0xF1, 25 | 0xB0, 0x4A, 26 | 0xB2, 27 | 0x36, 28 | 0x7D, 29 | 0xA0, 30 | 0x17, 31 | 0x0E, 32 | 0xDA, 33 | 0xB1 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_IDXGIOutput4 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x35, 0xCA, 0x7D, 0xDC, 49 | 0x96, 0x21, 50 | 0x4D, 0x41, 51 | 0x9F, 52 | 0x53, 53 | 0x61, 54 | 0x78, 55 | 0x84, 56 | 0x03, 57 | 0x2A, 58 | 0x60 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_IDXGIFactory4 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x02, 0xEA, 0xC6, 0x1B, 74 | 0x36, 0xEF, 75 | 0x4F, 0x46, 76 | 0xBF, 77 | 0x0C, 78 | 0x21, 79 | 0xCA, 80 | 0x39, 81 | 0xE5, 82 | 0x16, 83 | 0x8A 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_IDXGIAdapter3 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0xA4, 0x67, 0x59, 0x64, 99 | 0x92, 0x13, 100 | 0x10, 0x43, 101 | 0xA7, 102 | 0x98, 103 | 0x80, 104 | 0x53, 105 | 0xCE, 106 | 0x3E, 107 | 0x93, 108 | 0xFD 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/shared/dxgi1_5/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from shared/dxgi1_5.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_IDXGIOutput5 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x24, 0x74, 0xA0, 0x80, 24 | 0x52, 0xAB, 25 | 0xEB, 0x42, 26 | 0x83, 27 | 0x3C, 28 | 0x0C, 29 | 0x42, 30 | 0xFD, 31 | 0x28, 32 | 0x2D, 33 | 0x98 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_IDXGISwapChain4 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x5A, 0x5D, 0x58, 0x3D, 49 | 0x4A, 0xBD, 50 | 0x9E, 0x48, 51 | 0xB1, 52 | 0xF4, 53 | 0x3D, 54 | 0xBC, 55 | 0xB6, 56 | 0x45, 57 | 0x2F, 58 | 0xFB 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_IDXGIDevice4 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x5F, 0xF9, 0xB4, 0x95, 74 | 0xDA, 0xD8, 75 | 0xA4, 0x4C, 76 | 0x9E, 77 | 0xE6, 78 | 0x3B, 79 | 0x76, 80 | 0xD5, 81 | 0x96, 82 | 0x8A, 83 | 0x10 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_IDXGIFactory5 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0xF5, 0xE1, 0x32, 0x76, 99 | 0x65, 0xEE, 100 | 0xCA, 0x4D, 101 | 0x87, 102 | 0xFD, 103 | 0x84, 104 | 0xCD, 105 | 0x75, 106 | 0xF8, 107 | 0x83, 108 | 0x8D 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/shared/dxgi1_6/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from shared/dxgi1_6.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_IDXGIAdapter4 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xD1, 0x99, 0x8D, 0x3C, 24 | 0xBF, 0x4F, 25 | 0x81, 0x41, 26 | 0xA8, 27 | 0x2C, 28 | 0xAF, 29 | 0x66, 30 | 0xBF, 31 | 0x7B, 32 | 0xD2, 33 | 0x4E 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_IDXGIOutput6 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xE8, 0x46, 0x83, 0x06, 49 | 0xEC, 0xAA, 50 | 0x84, 0x4B, 51 | 0xAD, 52 | 0xD7, 53 | 0x13, 54 | 0x7F, 55 | 0x51, 56 | 0x3F, 57 | 0x77, 58 | 0xA1 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_IDXGIFactory6 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x4F, 0x69, 0xB6, 0xC1, 74 | 0x09, 0xFF, 75 | 0xA9, 0x44, 76 | 0xB0, 77 | 0x3C, 78 | 0x77, 79 | 0x90, 80 | 0x0A, 81 | 0x0A, 82 | 0x1D, 83 | 0x17 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_IDXGIFactory7 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0xED, 0x6E, 0x96, 0xA4, 99 | 0xDB, 0x76, 100 | 0xDA, 0x44, 101 | 0x84, 102 | 0xC1, 103 | 0xEE, 104 | 0x9A, 105 | 0x7A, 106 | 0xFB, 107 | 0x20, 108 | 0xA8 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d2d1effects_1/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d2d1effects_1.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class CLSID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid CLSID_D2D1YCbCr 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xC1, 0x3C, 0x50, 0x99, 24 | 0xC7, 0x66, 25 | 0xC9, 0x45, 26 | 0xA8, 27 | 0x75, 28 | 0x8A, 29 | 0xD8, 30 | 0xA7, 31 | 0x91, 32 | 0x44, 33 | 0x01 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d10_1/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d10_1.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D10BlendState1 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x99, 0x8D, 0xAD, 0xED, 24 | 0x35, 0x8A, 25 | 0x6D, 0x4D, 26 | 0x85, 27 | 0x66, 28 | 0x2E, 29 | 0xA2, 30 | 0x76, 31 | 0xCD, 32 | 0xE1, 33 | 0x61 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D10ShaderResourceView1 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x87, 0x4C, 0x7E, 0x9B, 49 | 0x2C, 0x34, 50 | 0x06, 0x41, 51 | 0xA1, 52 | 0x9F, 53 | 0x4F, 54 | 0x27, 55 | 0x04, 56 | 0xF6, 57 | 0x89, 58 | 0xF0 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D10Device1 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x8F, 0x4C, 0x7E, 0x9B, 74 | 0x2C, 0x34, 75 | 0x06, 0x41, 76 | 0xA1, 77 | 0x9F, 78 | 0x4F, 79 | 0x27, 80 | 0x04, 81 | 0xF6, 82 | 0x89, 83 | 0xF0 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d10_1shader/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d10_1shader.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D10ShaderReflection1 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x83, 0x77, 0x45, 0xC3, 24 | 0x46, 0xA8, 25 | 0xCE, 0x47, 26 | 0x95, 27 | 0x20, 28 | 0xCE, 29 | 0xA6, 30 | 0xF6, 31 | 0x6E, 32 | 0x74, 33 | 0x47 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d10misc/GUID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d10misc.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class GUID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid GUID_DeviceType 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x4D, 0xFB, 0x22, 0xD7, 24 | 0x68, 0x7A, 25 | 0x7A, 0x43, 26 | 0xB2, 27 | 0x0C, 28 | 0x58, 29 | 0x04, 30 | 0xEE, 31 | 0x24, 32 | 0x94, 33 | 0xA6 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d10sdklayers/DXGI.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d10sdklayers.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DXGI 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid DXGI_DEBUG_D3D10 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x52, 0x4C, 0x3B, 0x24, 23 | 0x06, 0x36, 24 | 0x3A, 0x4D, 25 | 0x99, 26 | 0xD7, 27 | 0xA7, 28 | 0xE7, 29 | 0xB3, 30 | 0x3E, 31 | 0xD7, 32 | 0x06 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d10sdklayers/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d10sdklayers.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D10Debug 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x01, 0x4E, 0x7E, 0x9B, 24 | 0x2C, 0x34, 25 | 0x06, 0x41, 26 | 0xA1, 27 | 0x9F, 28 | 0x4F, 29 | 0x27, 30 | 0x04, 31 | 0xF6, 32 | 0x89, 33 | 0xF0 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D10SwitchToRef 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x02, 0x4E, 0x7E, 0x9B, 49 | 0x2C, 0x34, 50 | 0x06, 0x41, 51 | 0xA1, 52 | 0x9F, 53 | 0x4F, 54 | 0x27, 55 | 0x04, 56 | 0xF6, 57 | 0x89, 58 | 0xF0 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D10InfoQueue 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x17, 0x0B, 0x94, 0x1B, 74 | 0x42, 0x26, 75 | 0x1F, 0x4D, 76 | 0xAB, 77 | 0x1F, 78 | 0xB9, 79 | 0x9B, 80 | 0xAD, 81 | 0x0C, 82 | 0x39, 83 | 0x5F 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d10shader/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d10shader.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D10ShaderReflectionType 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x7D, 0xAD, 0x30, 0xC5, 24 | 0x16, 0x9B, 25 | 0x95, 0x43, 26 | 0xA9, 27 | 0x79, 28 | 0xBA, 29 | 0x2E, 30 | 0xCF, 31 | 0xF8, 32 | 0x3A, 33 | 0xDD 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D10ShaderReflectionVariable 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x95, 0x3C, 0xF6, 0x1B, 49 | 0x50, 0x26, 50 | 0x5D, 0x40, 51 | 0x99, 52 | 0xC1, 53 | 0x36, 54 | 0x36, 55 | 0xBD, 56 | 0x1D, 57 | 0xA0, 58 | 0xA1 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D10ShaderReflectionConstantBuffer 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x94, 0x6A, 0xC6, 0x66, 74 | 0xDD, 0xDD, 75 | 0x62, 0x4B, 76 | 0xA6, 77 | 0x6A, 78 | 0xF0, 79 | 0xDA, 80 | 0x33, 81 | 0xC2, 82 | 0xB4, 83 | 0xD0 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_ID3D10ShaderReflection 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0xB6, 0x20, 0x0E, 0xD4, 99 | 0xF7, 0xF8, 100 | 0xAD, 0x42, 101 | 0xAB, 102 | 0x20, 103 | 0x4B, 104 | 0xAF, 105 | 0x8F, 106 | 0x15, 107 | 0xDF, 108 | 0xAA 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d11_2/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d11_2.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D11DeviceContext2 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x32, 0x5B, 0x0D, 0x42, 24 | 0x0C, 0xB9, 25 | 0xA4, 0x4D, 26 | 0xBE, 27 | 0xF0, 28 | 0x35, 29 | 0x9F, 30 | 0x6A, 31 | 0x24, 32 | 0xA8, 33 | 0x3A 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D11Device2 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xFA, 0xDF, 0x06, 0x9D, 49 | 0xE5, 0xD1, 50 | 0x07, 0x4D, 51 | 0x83, 52 | 0xA8, 53 | 0x1B, 54 | 0xB1, 55 | 0x23, 56 | 0xF2, 57 | 0xF8, 58 | 0x41 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d11_4/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d11_4.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D11Device4 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x71, 0xAB, 0x92, 0x89, 24 | 0xE6, 0x02, 25 | 0x8D, 0x4B, 26 | 0xBA, 27 | 0x48, 28 | 0xB0, 29 | 0x56, 30 | 0xDC, 31 | 0xDA, 32 | 0x42, 33 | 0xC4 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D11Device5 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x02, 0xE2, 0xFD, 0x8F, 49 | 0xE7, 0xA0, 50 | 0xDF, 0x45, 51 | 0x9E, 52 | 0x01, 53 | 0xE8, 54 | 0x37, 55 | 0x80, 56 | 0x1B, 57 | 0x5E, 58 | 0xA0 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D11Multithread 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x00, 0x4E, 0x7E, 0x9B, 74 | 0x2C, 0x34, 75 | 0x06, 0x41, 76 | 0xA1, 77 | 0x9F, 78 | 0x4F, 79 | 0x27, 80 | 0x04, 81 | 0xF6, 82 | 0x89, 83 | 0xF0 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_ID3D11VideoContext2 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0x4C, 0x37, 0xE7, 0xC4, 99 | 0x43, 0x62, 100 | 0x1B, 0x4D, 101 | 0xAE, 102 | 0x87, 103 | 0x52, 104 | 0xB4, 105 | 0xF7, 106 | 0x40, 107 | 0xE2, 108 | 0x61 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | 116 | [NativeTypeName("const GUID")] 117 | public static ref readonly Guid IID_ID3D11VideoDevice2 118 | { 119 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 120 | get 121 | { 122 | ReadOnlySpan data = new byte[] { 123 | 0x01, 0xCB, 0xC0, 0x59, 124 | 0xF0, 0x35, 125 | 0x70, 0x4A, 126 | 0x8F, 127 | 0x67, 128 | 0x87, 129 | 0x90, 130 | 0x5C, 131 | 0x90, 132 | 0x6A, 133 | 0x53 134 | }; 135 | 136 | Debug.Assert(data.Length == Unsafe.SizeOf()); 137 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 138 | } 139 | } 140 | 141 | [NativeTypeName("const GUID")] 142 | public static ref readonly Guid IID_ID3D11VideoContext3 143 | { 144 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 145 | get 146 | { 147 | ReadOnlySpan data = new byte[] { 148 | 0xA0, 0xFA, 0xE2, 0xA9, 149 | 0x39, 0xCB, 150 | 0x8F, 0x41, 151 | 0xA0, 152 | 0xB7, 153 | 0xD8, 154 | 0xAA, 155 | 0xD4, 156 | 0xDE, 157 | 0x67, 158 | 0x2E 159 | }; 160 | 161 | Debug.Assert(data.Length == Unsafe.SizeOf()); 162 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d11on12/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d11on12.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D11On12Device 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x73, 0x1E, 0x61, 0x85, 24 | 0xA9, 0x70, 25 | 0x0E, 0x49, 26 | 0x96, 27 | 0x14, 28 | 0xA9, 29 | 0xE3, 30 | 0x02, 31 | 0x77, 32 | 0x79, 33 | 0x04 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D11On12Device1 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xF4, 0x4D, 0xB6, 0xBD, 49 | 0x2F, 0xEA, 50 | 0x70, 0x4C, 51 | 0xB8, 52 | 0x61, 53 | 0xAA, 54 | 0xAB, 55 | 0x12, 56 | 0x58, 57 | 0xBB, 58 | 0x5D 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D11On12Device2 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x31, 0xF3, 0x90, 0xDC, 74 | 0x40, 0x47, 75 | 0xFA, 0x43, 76 | 0x86, 77 | 0x6E, 78 | 0x67, 79 | 0xF1, 80 | 0x2C, 81 | 0xB5, 82 | 0x82, 83 | 0x23 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d11sdklayers/DXGI.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d11sdklayers.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DXGI 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid DXGI_DEBUG_D3D11 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x7B, 0x31, 0x99, 0x4B, 23 | 0x39, 0xAC, 24 | 0xA6, 0x4A, 25 | 0xBB, 26 | 0x0B, 27 | 0xBA, 28 | 0xA0, 29 | 0x47, 30 | 0x84, 31 | 0x79, 32 | 0x8F 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d11sdklayers/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d11sdklayers.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D11Debug 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x33, 0x22, 0xCF, 0x79, 24 | 0x36, 0x75, 25 | 0x48, 0x49, 26 | 0x9D, 27 | 0x36, 28 | 0x1E, 29 | 0x46, 30 | 0x92, 31 | 0xDC, 32 | 0x57, 33 | 0x60 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D11SwitchToRef 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xE3, 0x37, 0xF3, 0x1E, 49 | 0xE7, 0x58, 50 | 0x83, 0x4F, 51 | 0xA6, 52 | 0x92, 53 | 0xDB, 54 | 0x22, 55 | 0x1F, 56 | 0x5E, 57 | 0xD4, 58 | 0x7E 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D11TracingDevice 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x71, 0xC7, 0x11, 0x19, 74 | 0x87, 0x15, 75 | 0x3E, 0x41, 76 | 0xA7, 77 | 0xE0, 78 | 0xFB, 79 | 0x26, 80 | 0xC3, 81 | 0xDE, 82 | 0x02, 83 | 0x68 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_ID3D11RefTrackingOptions 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0xDF, 0xAC, 0x3D, 0x19, 99 | 0xB2, 0x0D, 100 | 0x05, 0x4C, 101 | 0xA5, 102 | 0x5C, 103 | 0xEF, 104 | 0x06, 105 | 0xCA, 106 | 0xC5, 107 | 0x6F, 108 | 0xD9 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | 116 | [NativeTypeName("const GUID")] 117 | public static ref readonly Guid IID_ID3D11RefDefaultTrackingOptions 118 | { 119 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 120 | get 121 | { 122 | ReadOnlySpan data = new byte[] { 123 | 0x15, 0x66, 0x91, 0x03, 124 | 0x44, 0xC6, 125 | 0x8C, 0x41, 126 | 0x9B, 127 | 0xF4, 128 | 0x75, 129 | 0xDB, 130 | 0x5B, 131 | 0xE6, 132 | 0x3C, 133 | 0xA0 134 | }; 135 | 136 | Debug.Assert(data.Length == Unsafe.SizeOf()); 137 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 138 | } 139 | } 140 | 141 | [NativeTypeName("const GUID")] 142 | public static ref readonly Guid IID_ID3D11InfoQueue 143 | { 144 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 145 | get 146 | { 147 | ReadOnlySpan data = new byte[] { 148 | 0xB6, 0xDB, 0x43, 0x65, 149 | 0x48, 0x1B, 150 | 0xF5, 0x42, 151 | 0xAB, 152 | 0x82, 153 | 0xE9, 154 | 0x7E, 155 | 0xC7, 156 | 0x43, 157 | 0x26, 158 | 0xF6 159 | }; 160 | 161 | Debug.Assert(data.Length == Unsafe.SizeOf()); 162 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d12/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d12.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class CLSID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid CLSID_D3D12Debug 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xEB, 0x2A, 0x35, 0xF2, 24 | 0x84, 0xDD, 25 | 0xFE, 0x49, 26 | 0xB9, 27 | 0x7B, 28 | 0xA9, 29 | 0xDC, 30 | 0xFD, 31 | 0xCC, 32 | 0x1B, 33 | 0x4F 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid CLSID_D3D12Tools 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xB1, 0x16, 0x82, 0xE3, 49 | 0x8C, 0x3C, 50 | 0x33, 0x48, 51 | 0xAA, 52 | 0x09, 53 | 0x0A, 54 | 0x06, 55 | 0xB6, 56 | 0x5D, 57 | 0x96, 58 | 0xC8 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid CLSID_D3D12DeviceRemovedExtendedData 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0xC4, 0xBB, 0x75, 0x4A, 74 | 0xF4, 0x9F, 75 | 0xD8, 0x4A, 76 | 0x9F, 77 | 0x18, 78 | 0xAB, 79 | 0xAE, 80 | 0x84, 81 | 0xDC, 82 | 0x5F, 83 | 0xF2 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid CLSID_D3D12SDKConfiguration 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0xCA, 0x6A, 0xDA, 0x7C, 99 | 0x3E, 0xA0, 100 | 0xC8, 0x49, 101 | 0x94, 102 | 0x58, 103 | 0x03, 104 | 0x34, 105 | 0xD2, 106 | 0x0E, 107 | 0x07, 108 | 0xCE 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d12sdklayers/DXGI.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d12sdklayers.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DXGI 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid DXGI_DEBUG_D3D12 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x8C, 0xA9, 0x59, 0xCF, 23 | 0x50, 0xA9, 24 | 0x26, 0x43, 25 | 0x91, 26 | 0xEF, 27 | 0x9B, 28 | 0xBA, 29 | 0xA1, 30 | 0x7B, 31 | 0xFD, 32 | 0x95 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d12sdklayers/DirectX.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d12sdklayers.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DirectX 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid WKPDID_D3DAutoDebugObjectNameW 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x36, 0x2E, 0x90, 0xD4, 23 | 0x7A, 0x75, 24 | 0x42, 0x49, 25 | 0x95, 26 | 0x94, 27 | 0xB6, 28 | 0x76, 29 | 0x9A, 30 | 0xFA, 31 | 0x43, 32 | 0xCD 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3d12shader/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3d12shader.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D12ShaderReflectionType 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x51, 0xC3, 0x13, 0xE9, 24 | 0x3D, 0x78, 25 | 0xCA, 0x48, 26 | 0xA1, 27 | 0xD1, 28 | 0x4F, 29 | 0x30, 30 | 0x62, 31 | 0x84, 32 | 0xAD, 33 | 0x56 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_ID3D12ShaderReflectionVariable 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xA6, 0xA8, 0x37, 0x83, 49 | 0x16, 0xA2, 50 | 0x4A, 0x44, 51 | 0xB2, 52 | 0xF4, 53 | 0x31, 54 | 0x47, 55 | 0x33, 56 | 0xA7, 57 | 0x3A, 58 | 0xEA 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_ID3D12ShaderReflectionConstantBuffer 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0xB4, 0x98, 0x95, 0xC5, 74 | 0xB3, 0x48, 75 | 0x69, 0x48, 76 | 0xB9, 77 | 0xB1, 78 | 0xB1, 79 | 0x61, 80 | 0x8B, 81 | 0x14, 82 | 0xA8, 83 | 0xB7 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("const GUID")] 92 | public static ref readonly Guid IID_ID3D12ShaderReflection 93 | { 94 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 95 | get 96 | { 97 | ReadOnlySpan data = new byte[] { 98 | 0x7D, 0x79, 0x58, 0x5A, 99 | 0x2C, 0xA7, 100 | 0x8D, 0x47, 101 | 0x8B, 102 | 0xA2, 103 | 0xEF, 104 | 0xC6, 105 | 0xB0, 106 | 0xEF, 107 | 0xE8, 108 | 0x8E 109 | }; 110 | 111 | Debug.Assert(data.Length == Unsafe.SizeOf()); 112 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 113 | } 114 | } 115 | 116 | [NativeTypeName("const GUID")] 117 | public static ref readonly Guid IID_ID3D12LibraryReflection 118 | { 119 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 120 | get 121 | { 122 | ReadOnlySpan data = new byte[] { 123 | 0x19, 0x9D, 0x34, 0x8E, 124 | 0xDB, 0x54, 125 | 0x56, 0x4A, 126 | 0x9D, 127 | 0xC9, 128 | 0x11, 129 | 0x9D, 130 | 0x87, 131 | 0xBD, 132 | 0xB8, 133 | 0x04 134 | }; 135 | 136 | Debug.Assert(data.Length == Unsafe.SizeOf()); 137 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 138 | } 139 | } 140 | 141 | [NativeTypeName("const GUID")] 142 | public static ref readonly Guid IID_ID3D12FunctionReflection 143 | { 144 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 145 | get 146 | { 147 | ReadOnlySpan data = new byte[] { 148 | 0x5C, 0x79, 0x08, 0x11, 149 | 0x72, 0x27, 150 | 0xA9, 0x4B, 151 | 0xB2, 152 | 0xA8, 153 | 0xD4, 154 | 0x64, 155 | 0xDC, 156 | 0x7E, 157 | 0x27, 158 | 0x99 159 | }; 160 | 161 | Debug.Assert(data.Length == Unsafe.SizeOf()); 162 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 163 | } 164 | } 165 | 166 | [NativeTypeName("const GUID")] 167 | public static ref readonly Guid IID_ID3D12FunctionParameterReflection 168 | { 169 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 170 | get 171 | { 172 | ReadOnlySpan data = new byte[] { 173 | 0x2D, 0xF4, 0x25, 0xEC, 174 | 0x06, 0x70, 175 | 0x2B, 0x4F, 176 | 0xB3, 177 | 0x3E, 178 | 0x02, 179 | 0xCC, 180 | 0x33, 181 | 0x75, 182 | 0x73, 183 | 0x3F 184 | }; 185 | 186 | Debug.Assert(data.Length == Unsafe.SizeOf()); 187 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 188 | } 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3dcommon/DirectX.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3dcommon.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DirectX 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid WKPDID_D3DDebugObjectName 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x22, 0x8C, 0x9B, 0x42, 23 | 0x88, 0x91, 24 | 0x0C, 0x4B, 25 | 0x87, 26 | 0x42, 27 | 0xAC, 28 | 0xB0, 29 | 0xBF, 30 | 0x85, 31 | 0xC2, 32 | 0x00 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid WKPDID_D3DDebugObjectNameW 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0xD8, 0x5F, 0xCA, 0x4C, 48 | 0x1F, 0x92, 49 | 0xC8, 0x42, 50 | 0x85, 51 | 0x66, 52 | 0x70, 53 | 0xCA, 54 | 0xF2, 55 | 0xA9, 56 | 0xB7, 57 | 0x41 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid WKPDID_CommentStringW 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0xC0, 0x9D, 0x14, 0xD0, 73 | 0xE8, 0x90, 74 | 0xC8, 0x4E, 75 | 0x81, 76 | 0x44, 77 | 0xE9, 78 | 0x00, 79 | 0xAD, 80 | 0x26, 81 | 0x6B, 82 | 0xB2 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("const GUID")] 91 | public static ref readonly Guid WKPDID_D3D12UniqueObjectId 92 | { 93 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 94 | get 95 | { 96 | ReadOnlySpan data = new byte[] { 97 | 0x15, 0xDE, 0x39, 0x1B, 98 | 0x04, 0xEC, 99 | 0xAE, 0x4B, 100 | 0xBA, 101 | 0x4D, 102 | 0x8C, 103 | 0xEF, 104 | 0x79, 105 | 0xFC, 106 | 0x04, 107 | 0xC1 108 | }; 109 | 110 | Debug.Assert(data.Length == Unsafe.SizeOf()); 111 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/d3dcommon/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/d3dcommon.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_ID3D10Blob 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x08, 0xFB, 0xA5, 0x8B, 24 | 0x95, 0x51, 25 | 0xE2, 0x40, 26 | 0xAC, 27 | 0x58, 28 | 0x0D, 29 | 0x98, 30 | 0x9C, 31 | 0x3A, 32 | 0x01, 33 | 0x02 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("#define IID_ID3DBlob IID_ID3D10Blob")] 42 | public static ref readonly Guid IID_ID3DBlob => ref IID_ID3D10Blob; 43 | 44 | public static ref readonly Guid IID_ID3DDestructionNotifier 45 | { 46 | get 47 | { 48 | ReadOnlySpan data = new byte[] { 49 | 0x9A, 0xB3, 0x6E, 0xA0, 50 | 0xDA, 0x50, 51 | 0x5B, 0x42, 52 | 0x8C, 53 | 0x31, 54 | 0x4E, 55 | 0xEC, 56 | 0xD6, 57 | 0xC2, 58 | 0x70, 59 | 0xF3 60 | }; 61 | 62 | Debug.Assert(data.Length == Unsafe.SizeOf()); 63 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/ddraw/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/ddraw.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class CLSID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid CLSID_DirectDraw 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xE0, 0x0E, 0xB7, 0xD7, 24 | 0x40, 0x43, 25 | 0xCF, 0x11, 26 | 0xB0, 27 | 0x63, 28 | 0x00, 29 | 0x20, 30 | 0xAF, 31 | 0xC2, 32 | 0xCD, 33 | 0x35 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid CLSID_DirectDraw7 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x96, 0x51, 0x30, 0x3C, 49 | 0xDB, 0x50, 50 | 0xD3, 0x11, 51 | 0x9C, 52 | 0xFE, 53 | 0x00, 54 | 0xC0, 55 | 0x4F, 56 | 0xD9, 57 | 0x30, 58 | 0xC5 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid CLSID_DirectDrawClipper 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0xA0, 0x17, 0x38, 0x59, 74 | 0xB3, 0x7D, 75 | 0xCF, 0x11, 76 | 0xA2, 77 | 0xDE, 78 | 0x00, 79 | 0xAA, 80 | 0x00, 81 | 0xB9, 82 | 0x33, 83 | 0x56 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/dxcore_interface/DirectX.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/dxcore_interface.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DirectX 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x6B, 0x86, 0x47, 0x8C, 23 | 0x83, 0x75, 24 | 0x0D, 0x45, 25 | 0xF0, 26 | 0xF0, 27 | 0x6B, 28 | 0xAD, 29 | 0xA8, 30 | 0x95, 31 | 0xAF, 32 | 0x4B 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x4D, 0xCE, 0x9E, 0x0C, 48 | 0x6E, 0x2F, 49 | 0x01, 0x4F, 50 | 0x8C, 51 | 0x96, 52 | 0xE8, 53 | 0x9E, 54 | 0x33, 55 | 0x1B, 56 | 0x47, 57 | 0xB1 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0x00, 0x28, 0x8E, 0x24, 73 | 0x93, 0xA7, 74 | 0x24, 0x47, 75 | 0xAB, 76 | 0xAA, 77 | 0x23, 78 | 0xA6, 79 | 0xDE, 80 | 0x1B, 81 | 0xE0, 82 | 0x90 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("#define _FACDXCORE 0x880")] 91 | public const int _FACDXCORE = 0x880; 92 | } 93 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/dxcore_interface/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/dxcore_interface.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_IDXCoreAdapterFactory 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x45, 0x59, 0xEE, 0x78, 24 | 0x6E, 0xC3, 25 | 0x13, 0x4B, 26 | 0xA6, 27 | 0x69, 28 | 0x00, 29 | 0x5D, 30 | 0xD1, 31 | 0x1C, 32 | 0x0F, 33 | 0x06 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_IDXCoreAdapterList 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x76, 0x77, 0x6C, 0x52, 49 | 0xE9, 0x40, 50 | 0x9B, 0x45, 51 | 0xB7, 52 | 0x11, 53 | 0xF3, 54 | 0x2A, 55 | 0xD7, 56 | 0x6D, 57 | 0xFC, 58 | 0x28 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_IDXCoreAdapter 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x7F, 0x4C, 0xDB, 0xF0, 74 | 0x5A, 0xFE, 75 | 0xA2, 0x42, 76 | 0xBD, 77 | 0x62, 78 | 0xF2, 79 | 0xA6, 80 | 0xCF, 81 | 0x6F, 82 | 0xC8, 83 | 0x3E 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/dxdiag/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/dxdiag.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class CLSID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid CLSID_DxDiagProvider 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0x71, 0x80, 0x5B, 0xA6, 24 | 0xFE, 0x3B, 25 | 0x13, 0x42, 26 | 0x9A, 27 | 0x5B, 28 | 0x49, 29 | 0x1D, 30 | 0xA4, 31 | 0x46, 32 | 0x1C, 33 | 0xA7 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/dxdiag/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/dxdiag.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_IDxDiagProvider 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xB0, 0x4C, 0x6B, 0x9C, 24 | 0xF8, 0x23, 25 | 0xCC, 0x49, 26 | 0xA3, 27 | 0xED, 28 | 0x45, 29 | 0xA5, 30 | 0x50, 31 | 0x00, 32 | 0xA6, 33 | 0xD2 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_IDxDiagContainer 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x2F, 0x46, 0x0F, 0x7D, 49 | 0x64, 0x40, 50 | 0x62, 0x48, 51 | 0xBC, 52 | 0x7F, 53 | 0x93, 54 | 0x3E, 55 | 0x50, 56 | 0x58, 57 | 0xC1, 58 | 0x0F 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/dxgidebug/DXGI.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/dxgidebug.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.DirectX; 12 | 13 | public static partial class DXGI 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid DXGI_DEBUG_ALL 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x83, 0xE2, 0x8A, 0xE4, 23 | 0x80, 0xDA, 24 | 0x0B, 0x49, 25 | 0x87, 26 | 0xE6, 27 | 0x43, 28 | 0xE9, 29 | 0xA9, 30 | 0xCF, 31 | 0xDA, 32 | 0x08 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid DXGI_DEBUG_DX 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0xFC, 0xD7, 0xCD, 0x35, 48 | 0xB2, 0x13, 49 | 0x1D, 0x42, 50 | 0xA5, 51 | 0xD7, 52 | 0x7E, 53 | 0x44, 54 | 0x51, 55 | 0x28, 56 | 0x7D, 57 | 0x64 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid DXGI_DEBUG_DXGI 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0xA4, 0xDA, 0xCD, 0x25, 73 | 0xC6, 0xB1, 74 | 0xE1, 0x47, 75 | 0xAC, 76 | 0x3E, 77 | 0x98, 78 | 0x87, 79 | 0x5B, 80 | 0x5A, 81 | 0x2E, 82 | 0x2A 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("const GUID")] 91 | public static ref readonly Guid DXGI_DEBUG_APP 92 | { 93 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 94 | get 95 | { 96 | ReadOnlySpan data = new byte[] { 97 | 0x01, 0x6E, 0xCD, 0x06, 98 | 0x19, 0x42, 99 | 0xBD, 0x4E, 100 | 0x87, 101 | 0x09, 102 | 0x27, 103 | 0xED, 104 | 0x23, 105 | 0x36, 106 | 0x0C, 107 | 0x62 108 | }; 109 | 110 | Debug.Assert(data.Length == Unsafe.SizeOf()); 111 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 112 | } 113 | } 114 | 115 | [NativeTypeName("#define DXGI_DEBUG_BINARY_VERSION ( 1 )")] 116 | public const int DXGI_DEBUG_BINARY_VERSION = (1); 117 | 118 | [NativeTypeName("#define DXGI_INFO_QUEUE_MESSAGE_ID_STRING_FROM_APPLICATION 0")] 119 | public const int DXGI_INFO_QUEUE_MESSAGE_ID_STRING_FROM_APPLICATION = 0; 120 | 121 | [NativeTypeName("#define DXGI_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024")] 122 | public const int DXGI_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT = 1024; 123 | } 124 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/DirectX/um/dxgidebug/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/dxgidebug.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using TerraFX.Interop.DirectX; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public static partial class IID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid IID_IDXGIInfoQueue 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xC7, 0x41, 0x74, 0xD6, 24 | 0x2A, 0x67, 25 | 0x6F, 0x47, 26 | 0x9E, 27 | 0x82, 28 | 0xCD, 29 | 0x55, 30 | 0xB4, 31 | 0x49, 32 | 0x49, 33 | 0xCE 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid IID_IDXGIDebug 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0x52, 0x74, 0x9E, 0x11, 49 | 0x9E, 0xDE, 50 | 0xFE, 0x40, 51 | 0x88, 52 | 0x06, 53 | 0x88, 54 | 0xF9, 55 | 0x0C, 56 | 0x12, 57 | 0xB4, 58 | 0x41 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid IID_IDXGIDebug1 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0x0C, 0x5F, 0xA0, 0xC5, 74 | 0xF2, 0x16, 75 | 0xDF, 0x4A, 76 | 0x9F, 77 | 0x4D, 78 | 0xA8, 79 | 0xC4, 80 | 0xD5, 81 | 0x8A, 82 | 0xC5, 83 | 0x50 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/shared/hidclass/GUID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from shared/hidclass.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class GUID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid GUID_DEVINTERFACE_HID 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xB2, 0x55, 0x1E, 0x4D, 23 | 0x6F, 0xF1, 24 | 0xCF, 0x11, 25 | 0x88, 26 | 0xCB, 27 | 0x00, 28 | 0x11, 29 | 0x11, 30 | 0x00, 31 | 0x00, 32 | 0x30 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid GUID_HID_INTERFACE_NOTIFY 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x88, 0x2E, 0x4E, 0x2C, 48 | 0xE6, 0x25, 49 | 0x33, 0x4C, 50 | 0x88, 51 | 0x2F, 52 | 0x3D, 53 | 0x82, 54 | 0xE6, 55 | 0x07, 56 | 0x36, 57 | 0x81 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid GUID_HID_INTERFACE_HIDPARSE 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0xA5, 0x15, 0xC3, 0xF5, 73 | 0xAC, 0x69, 74 | 0xC2, 0x4B, 75 | 0x92, 76 | 0x79, 77 | 0xD0, 78 | 0xB6, 79 | 0x45, 80 | 0x76, 81 | 0xF4, 82 | 0x4B 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("#define GUID_CLASS_INPUT GUID_DEVINTERFACE_HID")] 91 | public static ref readonly Guid GUID_CLASS_INPUT => ref GUID_DEVINTERFACE_HID; 92 | } 93 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/shared/uuids/TIME.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from shared/uuids.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class TIME 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid TIME_FORMAT_NONE 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 24 | 0x00, 0x00, 25 | 0x00, 26 | 0x00, 27 | 0x00, 28 | 0x00, 29 | 0x00, 30 | 0x00, 31 | 0x00, 32 | 0x00 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid TIME_FORMAT_FRAME 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x70, 0x55, 0x78, 0x7B, 48 | 0x82, 0x8C, 49 | 0xCF, 0x11, 50 | 0xBC, 51 | 0x0C, 52 | 0x00, 53 | 0xAA, 54 | 0x00, 55 | 0xAC, 56 | 0x74, 57 | 0xF6 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid TIME_FORMAT_BYTE 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0x71, 0x55, 0x78, 0x7B, 73 | 0x82, 0x8C, 74 | 0xCF, 0x11, 75 | 0xBC, 76 | 0x0C, 77 | 0x00, 78 | 0xAA, 79 | 0x00, 80 | 0xAC, 81 | 0x74, 82 | 0xF6 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("const GUID")] 91 | public static ref readonly Guid TIME_FORMAT_SAMPLE 92 | { 93 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 94 | get 95 | { 96 | ReadOnlySpan data = new byte[] { 97 | 0x72, 0x55, 0x78, 0x7B, 98 | 0x82, 0x8C, 99 | 0xCF, 0x11, 100 | 0xBC, 101 | 0x0C, 102 | 0x00, 103 | 0xAA, 104 | 0x00, 105 | 0xAC, 106 | 0x74, 107 | 0xF6 108 | }; 109 | 110 | Debug.Assert(data.Length == Unsafe.SizeOf()); 111 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 112 | } 113 | } 114 | 115 | [NativeTypeName("const GUID")] 116 | public static ref readonly Guid TIME_FORMAT_FIELD 117 | { 118 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 119 | get 120 | { 121 | ReadOnlySpan data = new byte[] { 122 | 0x73, 0x55, 0x78, 0x7B, 123 | 0x82, 0x8C, 124 | 0xCF, 0x11, 125 | 0xBC, 126 | 0x0C, 127 | 0x00, 128 | 0xAA, 129 | 0x00, 130 | 0xAC, 131 | 0x74, 132 | 0xF6 133 | }; 134 | 135 | Debug.Assert(data.Length == Unsafe.SizeOf()); 136 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 137 | } 138 | } 139 | 140 | [NativeTypeName("const GUID")] 141 | public static ref readonly Guid TIME_FORMAT_MEDIA_TIME 142 | { 143 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 144 | get 145 | { 146 | ReadOnlySpan data = new byte[] { 147 | 0x74, 0x55, 0x78, 0x7B, 148 | 0x82, 0x8C, 149 | 0xCF, 0x11, 150 | 0xBC, 151 | 0x0C, 152 | 0x00, 153 | 0xAA, 154 | 0x00, 155 | 0xAC, 156 | 0x74, 157 | 0xF6 158 | }; 159 | 160 | Debug.Assert(data.Length == Unsafe.SizeOf()); 161 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/DocumentTarget/ID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/DocumentTarget.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class ID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid ID_DOCUMENTPACKAGETARGET_MSXPS 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xA8, 0x40, 0xAE, 0x9C, 23 | 0xD1, 0xDE, 24 | 0xC9, 0x41, 25 | 0xA9, 26 | 0xFD, 27 | 0xD7, 28 | 0x35, 29 | 0xEF, 30 | 0x33, 31 | 0xAE, 32 | 0xDA 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid ID_DOCUMENTPACKAGETARGET_OPENXPS 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x72, 0xBB, 0x56, 0x00, 48 | 0x9C, 0x8C, 49 | 0x12, 0x46, 50 | 0xBD, 51 | 0x0F, 52 | 0x93, 53 | 0x01, 54 | 0x2A, 55 | 0x87, 56 | 0x09, 57 | 0x9D 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid ID_DOCUMENTPACKAGETARGET_OPENXPS_WITH_3D 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0x20, 0xD7, 0xDB, 0x63, 73 | 0x14, 0x8B, 74 | 0x77, 0x45, 75 | 0xB0, 76 | 0x74, 77 | 0x7B, 78 | 0xB1, 79 | 0x1B, 80 | 0x59, 81 | 0x6D, 82 | 0x28 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/InputScope/GUID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/InputScope.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class GUID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid GUID_PROP_INPUTSCOPE 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x5A, 0xDD, 0x13, 0x17, 23 | 0xE7, 0x68, 24 | 0x5B, 0x4A, 25 | 0x9A, 26 | 0xF6, 27 | 0x59, 28 | 0x2A, 29 | 0x59, 30 | 0x5C, 31 | 0x77, 32 | 0x8D 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/InputScope/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/InputScope.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class IID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid IID_ITfInputScope 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xEE, 0xEA, 0xE1, 0xFD, 23 | 0x24, 0x69, 24 | 0xDF, 0x4C, 25 | 0x91, 26 | 0xE7, 27 | 0xDA, 28 | 0x38, 29 | 0xCF, 30 | 0xF5, 31 | 0x55, 32 | 0x9D 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid IID_ITfInputScope2 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0xA0, 0xEA, 0x31, 0x57, 48 | 0xC2, 0x6B, 49 | 0x81, 0x46, 50 | 0xA5, 51 | 0x32, 52 | 0x92, 53 | 0xFB, 54 | 0xB7, 55 | 0x4D, 56 | 0x7C, 57 | 0x41 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/MSAAText/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/MSAAText.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class CLSID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid CLSID_MSAAControl 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x3F, 0x96, 0xCD, 0x08, 23 | 0x3E, 0x7A, 24 | 0x5C, 0x4F, 25 | 0x9B, 26 | 0xD8, 27 | 0xD6, 28 | 0x92, 29 | 0xBB, 30 | 0x04, 31 | 0x3C, 32 | 0x5B 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid CLSID_AccStore 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x7F, 0x83, 0x40, 0x54, 48 | 0xFF, 0x4B, 49 | 0xE5, 0x4A, 50 | 0xA1, 51 | 0xB1, 52 | 0x77, 53 | 0x22, 54 | 0xEC, 55 | 0xC6, 56 | 0x33, 57 | 0x2A 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid CLSID_AccDictionary 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0x16, 0xEE, 0x72, 0x65, 73 | 0xE5, 0x5F, 74 | 0x31, 0x43, 75 | 0xBB, 76 | 0x6D, 77 | 0x76, 78 | 0xA4, 79 | 0x9C, 80 | 0x56, 81 | 0xE4, 82 | 0x23 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("const GUID")] 91 | public static ref readonly Guid CLSID_AccServerDocMgr 92 | { 93 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 94 | get 95 | { 96 | ReadOnlySpan data = new byte[] { 97 | 0x7E, 0xA3, 0x89, 0x60, 98 | 0x8A, 0xEB, 99 | 0x2D, 0x48, 100 | 0xBD, 101 | 0x6F, 102 | 0xF9, 103 | 0xF4, 104 | 0x69, 105 | 0x04, 106 | 0xD1, 107 | 0x6D 108 | }; 109 | 110 | Debug.Assert(data.Length == Unsafe.SizeOf()); 111 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 112 | } 113 | } 114 | 115 | [NativeTypeName("const GUID")] 116 | public static ref readonly Guid CLSID_AccClientDocMgr 117 | { 118 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 119 | get 120 | { 121 | ReadOnlySpan data = new byte[] { 122 | 0x30, 0xCC, 0x48, 0xFC, 123 | 0x3E, 0x4F, 124 | 0xA1, 0x4F, 125 | 0x80, 126 | 0x3B, 127 | 0xAD, 128 | 0x0E, 129 | 0x19, 130 | 0x6A, 131 | 0x83, 132 | 0xB1 133 | }; 134 | 135 | Debug.Assert(data.Length == Unsafe.SizeOf()); 136 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 137 | } 138 | } 139 | 140 | [NativeTypeName("const GUID")] 141 | public static ref readonly Guid CLSID_DocWrap 142 | { 143 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 144 | get 145 | { 146 | ReadOnlySpan data = new byte[] { 147 | 0x7E, 0x6F, 0x42, 0xBF, 148 | 0x5E, 0x7A, 149 | 0xD6, 0x44, 150 | 0x83, 151 | 0x0C, 152 | 0xA3, 153 | 0x90, 154 | 0xEA, 155 | 0x94, 156 | 0x62, 157 | 0xA3 158 | }; 159 | 160 | Debug.Assert(data.Length == Unsafe.SizeOf()); 161 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/MSAAText/LIBID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/MSAAText.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class LIBID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid LIBID_MSAATEXTLib 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x7A, 0x2D, 0x0E, 0x15, 23 | 0xC1, 0xDA, 24 | 0x82, 0x45, 25 | 0x94, 26 | 0x7D, 27 | 0x2A, 28 | 0x8F, 29 | 0xD7, 30 | 0x8B, 31 | 0x82, 32 | 0xCD 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/MsHTML/SID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/MsHTML.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using static TerraFX.Interop.Windows.IID; 11 | 12 | namespace TerraFX.Interop.Windows; 13 | 14 | public partial struct SID 15 | { 16 | [NativeTypeName("const GUID")] 17 | public static ref readonly Guid SID_SEditCommandTarget 18 | { 19 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 20 | get 21 | { 22 | ReadOnlySpan data = new byte[] { 23 | 0xB5, 0xF4, 0x50, 0x30, 24 | 0xB5, 0x98, 25 | 0xCF, 0x11, 26 | 0xBB, 27 | 0x82, 28 | 0x00, 29 | 0xAA, 30 | 0x00, 31 | 0xBD, 32 | 0xCE, 33 | 0x0B 34 | }; 35 | 36 | Debug.Assert(data.Length == Unsafe.SizeOf()); 37 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 38 | } 39 | } 40 | 41 | [NativeTypeName("const GUID")] 42 | public static ref readonly Guid SID_SHTMLEditHost 43 | { 44 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 | get 46 | { 47 | ReadOnlySpan data = new byte[] { 48 | 0xA0, 0xF6, 0x50, 0x30, 49 | 0xB5, 0x98, 50 | 0xCF, 0x11, 51 | 0xBB, 52 | 0x82, 53 | 0x00, 54 | 0xAA, 55 | 0x00, 56 | 0xBD, 57 | 0xCE, 58 | 0x0B 59 | }; 60 | 61 | Debug.Assert(data.Length == Unsafe.SizeOf()); 62 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 63 | } 64 | } 65 | 66 | [NativeTypeName("const GUID")] 67 | public static ref readonly Guid SID_SHTMLEditServices 68 | { 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | get 71 | { 72 | ReadOnlySpan data = new byte[] { 73 | 0xF9, 0xF7, 0x50, 0x30, 74 | 0xB5, 0x98, 75 | 0xCF, 0x11, 76 | 0xBB, 77 | 0x82, 78 | 0x00, 79 | 0xAA, 80 | 0x00, 81 | 0xBD, 82 | 0xCE, 83 | 0x0B 84 | }; 85 | 86 | Debug.Assert(data.Length == Unsafe.SizeOf()); 87 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 88 | } 89 | } 90 | 91 | [NativeTypeName("#define SID_SHTMLWindow IID_IHTMLWindow2")] 92 | public static ref readonly Guid SID_SHTMLWindow => ref IID_IHTMLWindow2; 93 | 94 | [NativeTypeName("#define SID_SElementBehaviorFactory IID_IElementBehaviorFactory")] 95 | public static ref readonly Guid SID_SElementBehaviorFactory => ref IID_IElementBehaviorFactory; 96 | 97 | [NativeTypeName("#define SID_STrackingProtection IID_ITrackingProtection")] 98 | public static ref readonly Guid SID_STrackingProtection => ref IID_ITrackingProtection; 99 | } 100 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/MsHTML/Windows.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/MsHTML.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class Windows 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid CGID_EditStateCommands 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xB6, 0xF4, 0x50, 0x30, 23 | 0xB5, 0x98, 24 | 0xCF, 0x11, 25 | 0xBB, 26 | 0x82, 27 | 0x00, 28 | 0xAA, 29 | 0x00, 30 | 0xBD, 31 | 0xCE, 32 | 0x0B 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("#define COOKIEACTION_NONE 0x00000000")] 41 | public const int COOKIEACTION_NONE = 0x00000000; 42 | 43 | [NativeTypeName("#define COOKIEACTION_ACCEPT 0x00000001")] 44 | public const int COOKIEACTION_ACCEPT = 0x00000001; 45 | 46 | [NativeTypeName("#define COOKIEACTION_REJECT 0x00000002")] 47 | public const int COOKIEACTION_REJECT = 0x00000002; 48 | 49 | [NativeTypeName("#define COOKIEACTION_DOWNGRADE 0x00000004")] 50 | public const int COOKIEACTION_DOWNGRADE = 0x00000004; 51 | 52 | [NativeTypeName("#define COOKIEACTION_LEASH 0x00000008")] 53 | public const int COOKIEACTION_LEASH = 0x00000008; 54 | 55 | [NativeTypeName("#define COOKIEACTION_SUPPRESS 0x00000010")] 56 | public const int COOKIEACTION_SUPPRESS = 0x00000010; 57 | 58 | [NativeTypeName("#define COOKIEACTION_READ 0x00000020")] 59 | public const int COOKIEACTION_READ = 0x00000020; 60 | 61 | [NativeTypeName("#define PRIVACY_URLISTOPLEVEL 0x00010000")] 62 | public const int PRIVACY_URLISTOPLEVEL = 0x00010000; 63 | 64 | [NativeTypeName("#define PRIVACY_URLHASCOMPACTPOLICY 0x00020000")] 65 | public const int PRIVACY_URLHASCOMPACTPOLICY = 0x00020000; 66 | 67 | [NativeTypeName("#define PRIVACY_URLHASPOSTDATA 0x00080000")] 68 | public const int PRIVACY_URLHASPOSTDATA = 0x00080000; 69 | 70 | [NativeTypeName("#define PRIVACY_URLHASPOLICYREFLINK 0x00100000")] 71 | public const int PRIVACY_URLHASPOLICYREFLINK = 0x00100000; 72 | 73 | [NativeTypeName("#define PRIVACY_URLHASPOLICYREFHEADER 0x00200000")] 74 | public const int PRIVACY_URLHASPOLICYREFHEADER = 0x00200000; 75 | 76 | [NativeTypeName("#define PRIVACY_URLHASP3PHEADER 0x00400000")] 77 | public const int PRIVACY_URLHASP3PHEADER = 0x00400000; 78 | 79 | [NativeTypeName("#define DEBUGCALLBACKNOTIFICATION_TIMEOUT 0x00000001")] 80 | public const int DEBUGCALLBACKNOTIFICATION_TIMEOUT = 0x00000001; 81 | 82 | [NativeTypeName("#define DEBUGCALLBACKNOTIFICATION_INTERVAL 0x00000002")] 83 | public const int DEBUGCALLBACKNOTIFICATION_INTERVAL = 0x00000002; 84 | 85 | [NativeTypeName("#define DEBUGCALLBACKNOTIFICATION_IMMEDIATE 0x00000004")] 86 | public const int DEBUGCALLBACKNOTIFICATION_IMMEDIATE = 0x00000004; 87 | 88 | [NativeTypeName("#define DEBUGCALLBACKNOTIFICATION_ANIMATIONFRAME 0x00000008")] 89 | public const int DEBUGCALLBACKNOTIFICATION_ANIMATIONFRAME = 0x00000008; 90 | 91 | [NativeTypeName("#define DEBUGCALLBACKNOTIFICATION_DOMEVENT 0x00000010")] 92 | public const int DEBUGCALLBACKNOTIFICATION_DOMEVENT = 0x00000010; 93 | 94 | [NativeTypeName("#define DEBUGDOMEVENTPROPAGATIONSTATUS_DEFAULTCANCELED 0x00000001")] 95 | public const int DEBUGDOMEVENTPROPAGATIONSTATUS_DEFAULTCANCELED = 0x00000001; 96 | 97 | [NativeTypeName("#define DEBUGDOMEVENTPROPAGATIONSTATUS_STOPIMMEDIATEPROPAGATION 0x00000002")] 98 | public const int DEBUGDOMEVENTPROPAGATIONSTATUS_STOPIMMEDIATEPROPAGATION = 0x00000002; 99 | 100 | [NativeTypeName("#define DEBUGDOMEVENTPROPAGATIONSTATUS_STOPPROPAGATION 0x00000004")] 101 | public const int DEBUGDOMEVENTPROPAGATIONSTATUS_STOPPROPAGATION = 0x00000004; 102 | } 103 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/ShObjIdl/SID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/ShObjIdl.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using static TerraFX.Interop.Windows.CLSID; 11 | using static TerraFX.Interop.Windows.IID; 12 | 13 | namespace TerraFX.Interop.Windows; 14 | 15 | public partial struct SID 16 | { 17 | [NativeTypeName("const GUID")] 18 | public static ref readonly Guid SID_SCommandBarState 19 | { 20 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 21 | get 22 | { 23 | ReadOnlySpan data = new byte[] { 24 | 0x5C, 0xAA, 0x9E, 0xB9, 25 | 0x50, 0x38, 26 | 0x00, 0x44, 27 | 0xBC, 28 | 0x33, 29 | 0x2C, 30 | 0xE5, 31 | 0x34, 32 | 0x04, 33 | 0x8B, 34 | 0xF8 35 | }; 36 | 37 | Debug.Assert(data.Length == Unsafe.SizeOf()); 38 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 39 | } 40 | } 41 | 42 | [NativeTypeName("#define SID_WizardSite IID_IWizardSite")] 43 | public static ref readonly Guid SID_WizardSite => ref IID_IWizardSite; 44 | 45 | [NativeTypeName("#define SID_WebWizardHost IID_IWebWizardExtension")] 46 | public static ref readonly Guid SID_WebWizardHost => ref IID_IWebWizardExtension; 47 | 48 | [NativeTypeName("#define SID_CDWizardHost IID_ICDBurnExt")] 49 | public static ref readonly Guid SID_CDWizardHost => ref IID_ICDBurnExt; 50 | 51 | [NativeTypeName("#define SID_EnumerableView IID_IEnumerableView")] 52 | public static ref readonly Guid SID_EnumerableView => ref IID_IEnumerableView; 53 | 54 | [NativeTypeName("#define SID_SBandHost IID_IBandHost")] 55 | public static ref readonly Guid SID_SBandHost => ref IID_IBandHost; 56 | 57 | [NativeTypeName("#define SID_PublishingWizard CLSID_PublishingWizard")] 58 | public static ref readonly Guid SID_PublishingWizard => ref CLSID_PublishingWizard; 59 | } 60 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/TextStor/GUID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/TextStor.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class GUID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid GUID_TS_SERVICE_DATAOBJECT 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xB5, 0xFB, 0x86, 0x60, 23 | 0x25, 0xE2, 24 | 0xCE, 0x46, 25 | 0xA7, 26 | 0x70, 27 | 0xC1, 28 | 0xBB, 29 | 0xD3, 30 | 0xE0, 31 | 0x5D, 32 | 0x7B 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid GUID_TS_SERVICE_ACCESSIBLE 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x00, 0x62, 0x78, 0xF9, 48 | 0xBF, 0xA5, 49 | 0x0F, 0x4A, 50 | 0x8C, 51 | 0x24, 52 | 0xFB, 53 | 0x16, 54 | 0xF5, 55 | 0xD1, 56 | 0xAA, 57 | 0xBB 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid GUID_TS_SERVICE_ACTIVEX 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0x50, 0x7A, 0x93, 0xEA, 73 | 0xA6, 0xC9, 74 | 0x7D, 0x4B, 75 | 0x89, 76 | 0x4A, 77 | 0x49, 78 | 0xD9, 79 | 0x9B, 80 | 0x78, 81 | 0x48, 82 | 0x34 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/control/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/control.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class CLSID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid CLSID_FilgraphManager 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xB3, 0xEB, 0x36, 0xE4, 23 | 0x4F, 0x52, 24 | 0xCE, 0x11, 25 | 0x9F, 26 | 0x53, 27 | 0x00, 28 | 0x20, 29 | 0xAF, 30 | 0x0B, 31 | 0xA7, 32 | 0x70 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/control/LIBID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/control.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class LIBID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid LIBID_QuartzTypeLib 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xB0, 0x68, 0xA8, 0x56, 23 | 0xD4, 0x0A, 24 | 0xCE, 0x11, 25 | 0xB0, 26 | 0x3A, 27 | 0x00, 28 | 0x20, 29 | 0xAF, 30 | 0x0B, 31 | 0xA7, 32 | 0x70 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/credentialprovider/Windows.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/credentialprovider.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class Windows 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid Identity_LocalUserProvider 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x9B, 0x52, 0x98, 0xA1, 23 | 0x0F, 0x73, 24 | 0x89, 0x40, 25 | 0xB6, 26 | 0x46, 27 | 0xA1, 28 | 0x25, 29 | 0x57, 30 | 0xF5, 31 | 0x66, 32 | 0x5E 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("#define CREDENTIAL_PROVIDER_NO_DEFAULT ((DWORD)-1)")] 41 | public const uint CREDENTIAL_PROVIDER_NO_DEFAULT = unchecked((uint)(-1)); 42 | } 43 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/ctffunc/GUID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/ctffunc.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class GUID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid GUID_INTEGRATIONSTYLE_SEARCHBOX 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x11, 0xBD, 0xD1, 0xE6, 23 | 0xF7, 0x82, 24 | 0x03, 0x49, 25 | 0xAE, 26 | 0x21, 27 | 0x1A, 28 | 0x63, 29 | 0x97, 30 | 0xCD, 31 | 0xE2, 32 | 0xEB 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/ctfspui/IID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/ctfspui.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class IID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid IID_ITfSpeechUIServer 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x44, 0xA9, 0xE9, 0x90, 23 | 0x44, 0x92, 24 | 0x9F, 0x48, 25 | 0xA7, 26 | 0x8F, 27 | 0xDE, 28 | 0x67, 29 | 0xAF, 30 | 0xC0, 31 | 0x13, 32 | 0xA7 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/devicetopology/Windows.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/devicetopology.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class Windows 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid EVENTCONTEXT_VOLUMESLIDER 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xDE, 0xE9, 0xC2, 0xE2, 23 | 0xB1, 0x09, 24 | 0x04, 0x4B, 25 | 0x84, 26 | 0xE5, 27 | 0x07, 28 | 0x93, 29 | 0x12, 30 | 0x25, 31 | 0xEE, 32 | 0x04 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("#define DEVTOPO_HARDWARE_INITIATED_EVENTCONTEXT 'draH'")] 41 | public const int DEVTOPO_HARDWARE_INITIATED_EVENTCONTEXT = 0x64726148; 42 | } 43 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/mfapi/AM.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/mfapi.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class AM 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid AM_MEDIA_TYPE_REPRESENTATION 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xD2, 0x2A, 0xE4, 0xE2, 23 | 0x2C, 0x13, 24 | 0x1E, 0x49, 25 | 0xA2, 26 | 0x68, 27 | 0x3C, 28 | 0x7C, 29 | 0x2D, 30 | 0xCA, 31 | 0x18, 32 | 0x1F 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/mfapi/CLSID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/mfapi.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class CLSID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid CLSID_MFSourceResolver 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x0F, 0xB6, 0xEA, 0x90, 23 | 0x3A, 0xE4, 24 | 0x88, 0x41, 25 | 0xBC, 26 | 0xC4, 27 | 0xE4, 28 | 0x7F, 29 | 0xDF, 30 | 0x04, 31 | 0x86, 32 | 0x8C 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/mfapi/FORMAT.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/mfapi.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class FORMAT 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid FORMAT_MFVideoFormat 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x2D, 0xAB, 0xD4, 0xAE, 23 | 0x26, 0x73, 24 | 0xCB, 0x43, 25 | 0x94, 26 | 0x64, 27 | 0xC8, 28 | 0x79, 29 | 0xCA, 30 | 0xB9, 31 | 0xC4, 32 | 0x3D 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/mfsharingengine/MF.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/mfsharingengine.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class MF 14 | { 15 | [NativeTypeName("const IID")] 16 | public static ref readonly Guid MF_MEDIA_SHARING_ENGINE_DEVICE_NAME 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0xD1, 0x05, 0x1E, 0x77, 23 | 0x2F, 0x86, 24 | 0x99, 0x42, 25 | 0x95, 26 | 0xAC, 27 | 0xAE, 28 | 0x81, 29 | 0xFD, 30 | 0x14, 31 | 0xF3, 32 | 0xE7 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const IID")] 41 | public static ref readonly Guid MF_MEDIA_SHARING_ENGINE_DEVICE 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x8A, 0xC5, 0x61, 0xB4, 48 | 0x08, 0x7A, 49 | 0x98, 0x4B, 50 | 0x99, 51 | 0xA8, 52 | 0x70, 53 | 0xFD, 54 | 0x5F, 55 | 0x3B, 56 | 0xAD, 57 | 0xFD 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid MF_MEDIA_SHARING_ENGINE_INITIAL_SEEK_TIME 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0xF5, 0x97, 0x34, 0x6F, 73 | 0x28, 0xD5, 74 | 0x4F, 0x4A, 75 | 0x8D, 76 | 0xD7, 77 | 0xDB, 78 | 0x36, 79 | 0x65, 80 | 0x7E, 81 | 0xC4, 82 | 0xC9 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("const GUID")] 91 | public static ref readonly Guid MF_SHUTDOWN_RENDERER_ON_ENGINE_SHUTDOWN 92 | { 93 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 94 | get 95 | { 96 | ReadOnlySpan data = new byte[] { 97 | 0x4D, 0xD9, 0x12, 0xC1, 98 | 0x9C, 0x6B, 99 | 0xF8, 0x48, 100 | 0xB6, 101 | 0xF9, 102 | 0x79, 103 | 0x50, 104 | 0xFF, 105 | 0x9A, 106 | 0xB7, 107 | 0x1E 108 | }; 109 | 110 | Debug.Assert(data.Length == Unsafe.SizeOf()); 111 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 112 | } 113 | } 114 | 115 | [NativeTypeName("const GUID")] 116 | public static ref readonly Guid MF_PREFERRED_SOURCE_URI 117 | { 118 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 119 | get 120 | { 121 | ReadOnlySpan data = new byte[] { 122 | 0x88, 0x54, 0xC8, 0x5F, 123 | 0x6A, 0x43, 124 | 0xB8, 0x4D, 125 | 0x90, 126 | 0xAF, 127 | 0x4D, 128 | 0xB4, 129 | 0x02, 130 | 0xAE, 131 | 0x5C, 132 | 0x57 133 | }; 134 | 135 | Debug.Assert(data.Length == Unsafe.SizeOf()); 136 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 137 | } 138 | } 139 | 140 | [NativeTypeName("const GUID")] 141 | public static ref readonly Guid MF_SHARING_ENGINE_SHAREDRENDERER 142 | { 143 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 144 | get 145 | { 146 | ReadOnlySpan data = new byte[] { 147 | 0xA0, 0x46, 0xA4, 0xEF, 148 | 0xE7, 0x73, 149 | 0x4E, 0x40, 150 | 0x8A, 151 | 0xE2, 152 | 0xFE, 153 | 0xF6, 154 | 0x0A, 155 | 0xF5, 156 | 0xA3, 157 | 0x2B 158 | }; 159 | 160 | Debug.Assert(data.Length == Unsafe.SizeOf()); 161 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 162 | } 163 | } 164 | 165 | [NativeTypeName("const GUID")] 166 | public static ref readonly Guid MF_SHARING_ENGINE_CALLBACK 167 | { 168 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 169 | get 170 | { 171 | ReadOnlySpan data = new byte[] { 172 | 0x95, 0x1E, 0xDC, 0x57, 173 | 0x52, 0xD2, 174 | 0xFA, 0x43, 175 | 0x9B, 176 | 0xBC, 177 | 0x18, 178 | 0x00, 179 | 0x70, 180 | 0xEE, 181 | 0xFE, 182 | 0x6D 183 | }; 184 | 185 | Debug.Assert(data.Length == Unsafe.SizeOf()); 186 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 187 | } 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/mmdeviceapi/Windows.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/mmdeviceapi.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | using System.Runtime.Versioning; 11 | using static TerraFX.Interop.Windows.EndpointFormFactor; 12 | 13 | namespace TerraFX.Interop.Windows; 14 | 15 | public static unsafe partial class Windows 16 | { 17 | [NativeTypeName("const GUID")] 18 | public static ref readonly Guid DEVINTERFACE_AUDIO_RENDER 19 | { 20 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 21 | get 22 | { 23 | ReadOnlySpan data = new byte[] { 24 | 0xAD, 0x7C, 0x32, 0xE6, 25 | 0xEC, 0xDC, 26 | 0x49, 0x49, 27 | 0xAE, 28 | 0x8A, 29 | 0x99, 30 | 0x1E, 31 | 0x97, 32 | 0x6A, 33 | 0x79, 34 | 0xD2 35 | }; 36 | 37 | Debug.Assert(data.Length == Unsafe.SizeOf()); 38 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 39 | } 40 | } 41 | 42 | [NativeTypeName("const GUID")] 43 | public static ref readonly Guid DEVINTERFACE_AUDIO_CAPTURE 44 | { 45 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 46 | get 47 | { 48 | ReadOnlySpan data = new byte[] { 49 | 0xBE, 0x81, 0xEF, 0x2E, 50 | 0xFA, 0x33, 51 | 0x00, 0x48, 52 | 0x96, 53 | 0x70, 54 | 0x1C, 55 | 0xD4, 56 | 0x74, 57 | 0x97, 58 | 0x2C, 59 | 0x3F 60 | }; 61 | 62 | Debug.Assert(data.Length == Unsafe.SizeOf()); 63 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 64 | } 65 | } 66 | 67 | [NativeTypeName("const GUID")] 68 | public static ref readonly Guid DEVINTERFACE_MIDI_OUTPUT 69 | { 70 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 71 | get 72 | { 73 | ReadOnlySpan data = new byte[] { 74 | 0x20, 0x33, 0xC2, 0x6D, 75 | 0x33, 0xAB, 76 | 0xE4, 0x4C, 77 | 0x80, 78 | 0xD4, 79 | 0xBB, 80 | 0xB3, 81 | 0xEB, 82 | 0xBF, 83 | 0x28, 84 | 0x14 85 | }; 86 | 87 | Debug.Assert(data.Length == Unsafe.SizeOf()); 88 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 89 | } 90 | } 91 | 92 | [NativeTypeName("const GUID")] 93 | public static ref readonly Guid DEVINTERFACE_MIDI_INPUT 94 | { 95 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 96 | get 97 | { 98 | ReadOnlySpan data = new byte[] { 99 | 0x2C, 0xE3, 0x4B, 0x50, 100 | 0xF6, 0xCC, 101 | 0x2C, 0x4D, 102 | 0xB7, 103 | 0x3F, 104 | 0x6F, 105 | 0x8B, 106 | 0x37, 107 | 0x47, 108 | 0xE2, 109 | 0x2B 110 | }; 111 | 112 | Debug.Assert(data.Length == Unsafe.SizeOf()); 113 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 114 | } 115 | } 116 | 117 | /// 118 | [DllImport("mmdevapi", ExactSpelling = true)] 119 | [SupportedOSPlatform("windows8.0")] 120 | public static extern HRESULT ActivateAudioInterfaceAsync([NativeTypeName("LPCWSTR")] ushort* deviceInterfacePath, [NativeTypeName("const IID &")] Guid* riid, PROPVARIANT* activationParams, IActivateAudioInterfaceCompletionHandler* completionHandler, IActivateAudioInterfaceAsyncOperation** activationOperation); 121 | 122 | [NativeTypeName("#define ENDPOINT_SYSFX_ENABLED 0x00000000")] 123 | public const int ENDPOINT_SYSFX_ENABLED = 0x00000000; 124 | 125 | [NativeTypeName("#define ENDPOINT_SYSFX_DISABLED 0x00000001")] 126 | public const int ENDPOINT_SYSFX_DISABLED = 0x00000001; 127 | 128 | [NativeTypeName("#define HDMI DigitalAudioDisplayDevice")] 129 | public const EndpointFormFactor HDMI = DigitalAudioDisplayDevice; 130 | } 131 | -------------------------------------------------------------------------------- /cs_guid_definitions/sources/Interop/Windows/Windows/um/wincodec/CATID.cs: -------------------------------------------------------------------------------- 1 | // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. 2 | 3 | // Ported from um/wincodec.h in the Windows SDK for Windows 10.0.22000.0 4 | // Original source is Copyright © Microsoft. All rights reserved. 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Runtime.CompilerServices; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace TerraFX.Interop.Windows; 12 | 13 | public static partial class CATID 14 | { 15 | [NativeTypeName("const GUID")] 16 | public static ref readonly Guid CATID_WICBitmapDecoders 17 | { 18 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 19 | get 20 | { 21 | ReadOnlySpan data = new byte[] { 22 | 0x37, 0x68, 0xD9, 0x7E, 23 | 0xF0, 0x96, 24 | 0x12, 0x48, 25 | 0xB2, 26 | 0x11, 27 | 0xF1, 28 | 0x3C, 29 | 0x24, 30 | 0x11, 31 | 0x7E, 32 | 0xD3 33 | }; 34 | 35 | Debug.Assert(data.Length == Unsafe.SizeOf()); 36 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 37 | } 38 | } 39 | 40 | [NativeTypeName("const GUID")] 41 | public static ref readonly Guid CATID_WICBitmapEncoders 42 | { 43 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 44 | get 45 | { 46 | ReadOnlySpan data = new byte[] { 47 | 0x96, 0x72, 0x75, 0xAC, 48 | 0x22, 0x35, 49 | 0x11, 0x4E, 50 | 0x98, 51 | 0x62, 52 | 0xC1, 53 | 0x7B, 54 | 0xE5, 55 | 0xA1, 56 | 0x76, 57 | 0x7E 58 | }; 59 | 60 | Debug.Assert(data.Length == Unsafe.SizeOf()); 61 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 62 | } 63 | } 64 | 65 | [NativeTypeName("const GUID")] 66 | public static ref readonly Guid CATID_WICPixelFormats 67 | { 68 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 69 | get 70 | { 71 | ReadOnlySpan data = new byte[] { 72 | 0x0F, 0xE7, 0x46, 0x2B, 73 | 0xA7, 0xCD, 74 | 0x3E, 0x47, 75 | 0x89, 76 | 0xF6, 77 | 0xDC, 78 | 0x96, 79 | 0x30, 80 | 0xA2, 81 | 0x39, 82 | 0x0B 83 | }; 84 | 85 | Debug.Assert(data.Length == Unsafe.SizeOf()); 86 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 87 | } 88 | } 89 | 90 | [NativeTypeName("const GUID")] 91 | public static ref readonly Guid CATID_WICFormatConverters 92 | { 93 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 94 | get 95 | { 96 | ReadOnlySpan data = new byte[] { 97 | 0xE8, 0xEA, 0x35, 0x78, 98 | 0x14, 0xBF, 99 | 0xD1, 0x49, 100 | 0x93, 101 | 0xCE, 102 | 0x53, 103 | 0x3A, 104 | 0x40, 105 | 0x7B, 106 | 0x22, 107 | 0x48 108 | }; 109 | 110 | Debug.Assert(data.Length == Unsafe.SizeOf()); 111 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 112 | } 113 | } 114 | 115 | [NativeTypeName("const GUID")] 116 | public static ref readonly Guid CATID_WICMetadataReader 117 | { 118 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 119 | get 120 | { 121 | ReadOnlySpan data = new byte[] { 122 | 0xD8, 0x94, 0xAF, 0x05, 123 | 0x74, 0x71, 124 | 0xD2, 0x4C, 125 | 0xBE, 126 | 0x4A, 127 | 0x41, 128 | 0x24, 129 | 0xB8, 130 | 0x0E, 131 | 0xE4, 132 | 0xB8 133 | }; 134 | 135 | Debug.Assert(data.Length == Unsafe.SizeOf()); 136 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 137 | } 138 | } 139 | 140 | [NativeTypeName("const GUID")] 141 | public static ref readonly Guid CATID_WICMetadataWriter 142 | { 143 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 144 | get 145 | { 146 | ReadOnlySpan data = new byte[] { 147 | 0xA4, 0xB9, 0xE3, 0xAB, 148 | 0x7D, 0x25, 149 | 0x97, 0x4B, 150 | 0xBD, 151 | 0x1A, 152 | 0x29, 153 | 0x4A, 154 | 0xF4, 155 | 0x96, 156 | 0x22, 157 | 0x2E 158 | }; 159 | 160 | Debug.Assert(data.Length == Unsafe.SizeOf()); 161 | return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/Macros.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package com.falsepattern.jwin32; 24 | 25 | import java.util.function.BiConsumer; 26 | 27 | public class Macros { 28 | 29 | public static int HIWORD(long value) { 30 | return (int) (value >> 16); 31 | } 32 | 33 | public static int LOWORD(long value) { 34 | return (int) (value & 0xFFFF); 35 | } 36 | 37 | public static int GET_X_LPARAM(long lParam) { 38 | return (short)LOWORD(lParam); 39 | } 40 | 41 | public static int GET_Y_LPARAM(long lParam) { 42 | return (short)HIWORD(lParam); 43 | } 44 | 45 | public static int GET_XBUTTON_WPARAM(long wParam) { 46 | return HIWORD(wParam); 47 | } 48 | 49 | public static void MAKEPOINTS(long lParam, int[] buffer) { 50 | if (buffer.length < 2) { 51 | throw new IllegalArgumentException("buffer must be at least 2 elements long"); 52 | } 53 | buffer[0] = GET_X_LPARAM(lParam); 54 | buffer[1] = GET_Y_LPARAM(lParam); 55 | } 56 | 57 | public static void MAKEPOINTS(long lParam, BiConsumer consumer) { 58 | consumer.accept(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); 59 | } 60 | 61 | public static int MAKELANGID(int primary, int sub) { 62 | return (sub << 10) | primary; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/AccessSpecifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | public class AccessSpecifier { 25 | public enum Visibility { 26 | PUBLIC, PACKAGE, PRIVATE 27 | } 28 | public Visibility vis = Visibility.PRIVATE; 29 | public boolean stat = false; 30 | public boolean fin = false; 31 | @Override 32 | public String toString() { 33 | return 34 | "%s%s%s".formatted(switch (vis) { 35 | case PUBLIC -> "public "; 36 | case PACKAGE -> ""; 37 | case PRIVATE -> "private "; 38 | }, stat ? "static " : "", fin ? "final " : ""); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | import java.util.ArrayList; 25 | import java.util.HashSet; 26 | import java.util.List; 27 | import java.util.Set; 28 | import java.util.function.Predicate; 29 | import java.util.stream.Collectors; 30 | 31 | public class CClass { 32 | public String pkg; 33 | public final AccessSpecifier accessSpecifier = new AccessSpecifier(); 34 | public String name; 35 | public CType superclass; 36 | public final Set imports = new HashSet<>(); 37 | public final List fields = new ArrayList<>(); 38 | public final List constructors = new ArrayList<>(); 39 | public final List methods = new ArrayList<>(); 40 | 41 | public void importImplicitly(CType type) { 42 | imports.add(type); 43 | } 44 | 45 | public void addField(CField field) { 46 | imports.add(field.type); 47 | fields.add(field); 48 | } 49 | 50 | public void addConstructor(CConstructor constructor) { 51 | imports.addAll(constructor.getTypes()); 52 | constructors.add(constructor); 53 | } 54 | 55 | public void addMethod(CMethod method) { 56 | imports.addAll(method.getTypes()); 57 | methods.add(method); 58 | } 59 | 60 | public void superConstructors(CClass other) { 61 | 62 | constructors.forEach((constructor) -> { 63 | if (constructor.accessSpecifier.vis.equals(AccessSpecifier.Visibility.PRIVATE)) return; 64 | if (constructor.accessSpecifier.vis.equals(AccessSpecifier.Visibility.PACKAGE) && !other.pkg.equals(pkg)) return; 65 | var newConstructor = new CConstructor(); 66 | newConstructor.accessSpecifier.vis = constructor.accessSpecifier.vis; 67 | newConstructor.paramList.parameters.addAll(constructor.paramList.parameters); 68 | newConstructor.code.append("super(").append(constructor.paramList.asFunctionCallParams()).append(");"); 69 | other.addConstructor(newConstructor); 70 | }); 71 | } 72 | 73 | public CType asCType() { 74 | return new CType(pkg + "." + name, name, false); 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | return """ 80 | package %s; 81 | 82 | %s 83 | %s 84 | %sclass %s%s { 85 | %s 86 | %s 87 | %s 88 | } 89 | """.formatted( 90 | pkg, 91 | imports.stream().filter(Predicate.not(CType::primitive)).filter(imp -> !imp.name().equals(pkg + "." + imp.simpleName())).map(CType::asImport).sorted().collect(Collectors.joining()), 92 | superclass != null ? superclass.name().equals(pkg + "." + superclass.simpleName()) ? "" : superclass.name() : "", 93 | accessSpecifier, 94 | name, 95 | superclass != null ? " extends " + superclass.simpleName() : "", 96 | fields.stream().map(CField::toString).collect(Collectors.joining("\n")).indent(4), 97 | constructors.stream().map(constructor -> constructor.toString(name)).collect(Collectors.joining("\n")).indent(4), 98 | methods.stream().map(CMethod::toString).collect(Collectors.joining("\n")).indent(4)); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CConstructor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | import java.util.Set; 25 | 26 | public class CConstructor implements TypeCarrier { 27 | public final AccessSpecifier accessSpecifier = new AccessSpecifier(); 28 | public final CParamList paramList = new CParamList(); 29 | public final StringBuilder code = new StringBuilder(); 30 | 31 | public String toString(String className) { 32 | return "%s%s(%s){\n%s}".formatted( 33 | accessSpecifier.toString(), 34 | className, 35 | paramList.toString(), 36 | code.toString().indent(4)); 37 | } 38 | 39 | @Override 40 | public Set getTypes() { 41 | return paramList.getTypes(); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | public class CField { 25 | public final AccessSpecifier accessSpecifier = new AccessSpecifier(); 26 | public CType type; 27 | public String name; 28 | public final StringBuilder initializer = new StringBuilder(); 29 | @Override 30 | public String toString() { 31 | return "%s%s %s%s;".formatted(accessSpecifier.toString(), type.simpleName(), name, initializer.length() > 0 ? " = " + initializer : ""); 32 | } 33 | 34 | public CType type(){return type;} 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | import java.util.HashSet; 25 | import java.util.Set; 26 | 27 | public class CMethod implements TypeCarrier { 28 | public final AccessSpecifier accessSpecifier = new AccessSpecifier(); 29 | public CType returnType = CType.VOID; 30 | public String name; 31 | public final CParamList paramList = new CParamList(); 32 | public final StringBuilder code = new StringBuilder(); 33 | 34 | @Override 35 | public String toString() { 36 | return "%s%s %s(%s){\n%s}".formatted( 37 | accessSpecifier.toString(), 38 | returnType.simpleName(), 39 | name, 40 | paramList.toString(), 41 | code.toString().indent(4)); 42 | } 43 | 44 | @Override 45 | public Set getTypes() { 46 | var result = new HashSet(); 47 | result.add(returnType); 48 | result.addAll(paramList.getTypes()); 49 | return result; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CParamList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | import java.util.ArrayList; 25 | import java.util.List; 26 | import java.util.Set; 27 | import java.util.stream.Collectors; 28 | 29 | public class CParamList implements TypeCarrier { 30 | public final List parameters = new ArrayList<>(); 31 | 32 | public void add(CParameter parameter) { 33 | parameters.add(parameter); 34 | } 35 | 36 | @Override 37 | public Set getTypes() { 38 | return parameters.stream().map(CParameter::type).collect(Collectors.toUnmodifiableSet()); 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return parameters.stream().map(CParameter::toString).collect(Collectors.joining(", ")); 44 | } 45 | 46 | public String asFunctionCallParams() { 47 | return parameters.stream().map(CParameter::name).collect(Collectors.joining(", ")); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | public record CParameter(CType type, String name) { 25 | @Override 26 | public String toString() { 27 | return type.simpleName() + " " + name; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/CType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | import jdk.incubator.foreign.*; 25 | import win32.pure.Win32; 26 | 27 | public record CType(String name, String simpleName, boolean primitive) { 28 | public static final CType VOID = new CType(void.class); 29 | public static final CType BYTE = new CType(byte.class); 30 | public static final CType CHAR = new CType(char.class); 31 | public static final CType SHORT = new CType(short.class); 32 | public static final CType INT = new CType(int.class); 33 | public static final CType LONG = new CType(long.class); 34 | public static final CType FLOAT = new CType(float.class); 35 | public static final CType DOUBLE = new CType(double.class); 36 | public static final CType STRING = new CType(String.class); 37 | public static final CType MEMORY_SEGMENT = new CType(MemorySegment.class); 38 | public static final CType MEMORY_ADDRESS = new CType(MemoryAddress.class); 39 | public static final CType SEGMENT_ALLOCATOR = new CType(SegmentAllocator.class); 40 | public static final CType RESOURCE_SCOPE = new CType(ResourceScope.class); 41 | public static final CType WIN32 = new CType(Win32.class); 42 | public CType(Class clazz) { 43 | this(getBaseTypeOfNDimensionalArray(clazz).getName().replace('$', '.'), getSimpleString(clazz), getBaseTypeOfNDimensionalArray(clazz).isPrimitive()); 44 | } 45 | 46 | private static Class getBaseTypeOfNDimensionalArray(Class clazz) { 47 | while (clazz.isArray()) { 48 | clazz = clazz.componentType(); 49 | } 50 | return clazz; 51 | } 52 | 53 | private static String unwrapArrayBaseTypeName(Class clazz) { 54 | if (clazz.isArray()) return unwrapArrayBaseTypeName(clazz.componentType()); 55 | return clazz.getName().replace('$', '.'); 56 | } 57 | 58 | private static String getSimpleString(Class clazz) { 59 | var enclosing = clazz.getEnclosingClass(); 60 | if (enclosing != null) { 61 | return getSimpleString(enclosing) + "." + clazz.getSimpleName(); 62 | } else { 63 | return clazz.getSimpleName(); 64 | } 65 | } 66 | 67 | public String asImport() { 68 | return primitive ? "" : "import %s;\n".formatted(name); 69 | } 70 | 71 | public static CType fromValueLayout(ValueLayout layout) { 72 | return switch ((int) layout.byteSize()) { 73 | case 1 -> BYTE; 74 | case 2 -> SHORT; 75 | case 4 -> INT; 76 | case 8 -> LONG; 77 | default -> null; 78 | }; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/common/TypeCarrier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.internal.conversion.common; 23 | 24 | import java.util.Set; 25 | 26 | public interface TypeCarrier { 27 | Set getTypes(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/conversion/special/SpecialBehaviour.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package com.falsepattern.jwin32.internal.conversion.special; 24 | 25 | import com.falsepattern.jwin32.internal.conversion.common.CClass; 26 | import jdk.incubator.foreign.GroupLayout; 27 | 28 | public interface SpecialBehaviour { 29 | boolean isApplicableBase(GroupLayout layout, String pkg, Class parent); 30 | void applyBaseImpl(CClass implementation, GroupLayout layout, String pkg, Class parent); 31 | 32 | boolean isApplicableExtends(String pkg, Class parent, Class baseImpl); 33 | void applyExtendsImpl(CClass implementation, String pkg, Class parent, Class baseImpl); 34 | 35 | static SpecialBehaviour[] genBehaviours() { 36 | return new SpecialBehaviour[] {new StructGUID()}; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/guid/FileTreeIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package com.falsepattern.jwin32.internal.guid; 24 | 25 | import java.io.File; 26 | import java.util.Arrays; 27 | import java.util.concurrent.LinkedBlockingDeque; 28 | import java.util.function.Consumer; 29 | 30 | public class FileTreeIterator { 31 | private final Consumer processor; 32 | public FileTreeIterator(Consumer processor) { 33 | this.processor = processor; 34 | } 35 | 36 | public void iterate(File root) { 37 | var stack = new LinkedBlockingDeque(); 38 | stack.add(root); 39 | 40 | while (!stack.isEmpty()) { 41 | var file = stack.pop(); 42 | if (file.isDirectory()) { 43 | var subFiles = file.listFiles(); 44 | if (subFiles == null) continue; 45 | stack.addAll(Arrays.asList(subFiles)); 46 | } else { 47 | processor.accept(file); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/internal/guid/GUIDHunter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package com.falsepattern.jwin32.internal.guid; 24 | 25 | import java.io.File; 26 | import java.io.IOException; 27 | import java.nio.file.Files; 28 | import java.util.Arrays; 29 | import java.util.HashMap; 30 | import java.util.List; 31 | import java.util.Map; 32 | import java.util.function.Consumer; 33 | import java.util.regex.Pattern; 34 | import java.util.stream.Collectors; 35 | import java.util.stream.IntStream; 36 | 37 | /** 38 | * Finds all GUIDs which were pulled in by jextract. 39 | */ 40 | public class GUIDHunter implements Consumer { 41 | private final Map guidMap = new HashMap<>(); 42 | 43 | //Gigantic regex pattern to match the third party code's declarations 44 | private final Pattern guidRegex = Pattern.compile(""" 45 | \\s*\\[NativeTypeName\\("const GUID"\\)]\ 46 | \\s*public static ref readonly Guid (\\w+)\ 47 | \\s*\\{\ 48 | \\s*\\[MethodImpl\\(MethodImplOptions.AggressiveInlining\\)]\ 49 | \\s*get\ 50 | \\s*\\{\ 51 | \\s*ReadOnlySpan data = new byte\\[] \\{\ 52 | \\s*(0x\\w\\w), (0x\\w\\w), (0x\\w\\w), (0x\\w\\w),\ 53 | \\s*(0x\\w\\w), (0x\\w\\w),\ 54 | \\s*(0x\\w\\w), (0x\\w\\w),\ 55 | \\s*(0x\\w\\w),\ 56 | \\s*(0x\\w\\w),\ 57 | \\s*(0x\\w\\w),\ 58 | \\s*(0x\\w\\w),\ 59 | \\s*(0x\\w\\w),\ 60 | \\s*(0x\\w\\w),\ 61 | \\s*(0x\\w\\w),\ 62 | \\s*(0x\\w\\w)\ 63 | """); //Don't care about the rest 64 | 65 | private final Pattern jextractGUIDRegex = Pattern.compile(""" 66 | static final MemorySegment \\w+\\$SEGMENT = RuntimeHelper\\.lookupGlobalVariable\\(Win32\\.LIBRARIES, "(\\w+)", constants\\$\\d+.\\w+\\$LAYOUT\\); 67 | """); 68 | 69 | public GUIDHunter(File rootDirectory) { 70 | System.out.println("Initializing GUIDHunter..."); 71 | var iter = new FileTreeIterator(this); 72 | iter.iterate(rootDirectory); 73 | System.out.println("GUIDHunter discovered " + guidMap.size() + " GUIDs!"); 74 | } 75 | 76 | @Override 77 | public void accept(File file) { 78 | String contents; 79 | try { 80 | contents = Files.readString(file.toPath()); 81 | } catch (IOException e) { 82 | System.err.println("Failed to read " + file.getAbsolutePath()); 83 | e.printStackTrace(); 84 | return; 85 | } 86 | var matcher = guidRegex.matcher(contents); 87 | boolean found = false; 88 | while (matcher.find()) { 89 | found = true; 90 | guidMap.put(matcher.group(1),"new byte[] {" + IntStream.range(2, 18).mapToObj(matcher::group).map((str) -> "(byte)" + str).collect(Collectors.joining(",")) + "}"); 91 | } 92 | if (!found) { 93 | System.err.println("Couldn't find any GUID definitions in file: " + file.getAbsolutePath()); 94 | } 95 | } 96 | 97 | public String injectIntoMappings(List files) { 98 | var log = new StringBuilder(); 99 | files.parallelStream().forEach((file) -> { 100 | try { 101 | Files.writeString(file.toPath(), 102 | jextractGUIDRegex.matcher(Files.readString(file.toPath())) 103 | .replaceAll((match) -> { 104 | var guidName = match.group(1); 105 | if (guidMap.containsKey(guidName)) { 106 | return ("static final MemorySegment " + guidName + "$SEGMENT = MemorySegment.allocateNative(16, MemorySegment.globalNativeSegment().scope());\n" + 107 | "static {" + guidName + "$SEGMENT.copyFrom(MemorySegment.ofArray(" + guidMap.get(guidName) + "));}\n").replace("$", "\\$"); 108 | } else if (guidName.contains("IID")) { 109 | synchronized (log) { 110 | log.append("GUID mapping not found: ").append(guidName).append('\n'); 111 | } 112 | } 113 | return match.group().replace("$", "\\$"); 114 | })); 115 | } catch (IOException e) { 116 | System.err.println("Failed to process GUID mappings for file: " + file.getAbsolutePath()); 117 | e.printStackTrace(); 118 | } 119 | }); 120 | return log.toString(); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/com/falsepattern/jwin32/memory/MemoryStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 FalsePattern 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | package com.falsepattern.jwin32.memory; 23 | 24 | import jdk.incubator.foreign.MemorySegment; 25 | import jdk.incubator.foreign.ResourceScope; 26 | 27 | import java.util.Stack; 28 | 29 | /** 30 | * A thread local allocated memory segment, which is useful for allocating short-lived native memory, such as configuration structs. 31 | */ 32 | public class MemoryStack implements MemoryAllocator, AutoCloseable { 33 | private static final long MAX_ALIGNMENT = 0x1000; 34 | 35 | private final MemorySegment rootSegment; 36 | @SuppressWarnings("FieldCanBeLocal") 37 | private final ResourceScope scope; 38 | private final Stack offsets = new Stack<>(); 39 | private final Stack scopes = new Stack<>(); 40 | 41 | private ResourceScope currentScope; 42 | private long baseOffset = 0; 43 | private long currentOffset = 0; 44 | 45 | private static final ThreadLocal threadLocalStack = ThreadLocal.withInitial(() -> { 46 | var scope = ResourceScope.newImplicitScope(); 47 | //4 MB thread local stack 48 | var segment = MemorySegment.allocateNative(4 * 1024 * 1024, MAX_ALIGNMENT, scope); 49 | return new MemoryStack(segment, scope); 50 | }); 51 | 52 | private MemoryStack(MemorySegment rootSegment, ResourceScope scope) { 53 | this.scope = scope; 54 | this.rootSegment = rootSegment; 55 | this.currentScope = ResourceScope.newConfinedScope(); 56 | } 57 | 58 | private void align(long alignment) { 59 | if (currentOffset % alignment != 0) 60 | currentOffset += alignment - (currentOffset % alignment); 61 | } 62 | 63 | @Override 64 | public MemorySegment mallocAligned(long size, long alignment) { 65 | if (alignment > MAX_ALIGNMENT) throw new IllegalArgumentException("Tried to allocate with alignment " + alignment + ", which is greater than the maximum " + MAX_ALIGNMENT); 66 | align(alignment); 67 | return malloc(size); 68 | } 69 | 70 | @Override 71 | public MemorySegment malloc(long size) { 72 | var newSegment = rootSegment.asSlice(currentOffset, size); 73 | currentOffset += size; 74 | return newSegment; 75 | } 76 | 77 | /** 78 | * Retrieves the thread local stack without pushing a new memory scope. 79 | * @return The thread's stack 80 | */ 81 | public static MemoryStack getCurrentStack() { 82 | return threadLocalStack.get(); 83 | } 84 | 85 | /** 86 | * Pushes a new memory scope, which then later must be {@link #pop()}-ed. 87 | * @return This memory stack 88 | */ 89 | public MemoryStack push() { 90 | offsets.push(baseOffset); 91 | scopes.push(currentScope); 92 | currentScope = ResourceScope.newConfinedScope(); 93 | baseOffset = currentOffset; 94 | return this; 95 | } 96 | 97 | /** 98 | * Pops the topmost memory scope, releasing all segments allocated in that scope. 99 | */ 100 | public void pop() { 101 | if (offsets.isEmpty()) throw new RuntimeException("Tried to pop empty memory stack!"); 102 | currentOffset = baseOffset; 103 | currentScope.close(); 104 | currentScope = scopes.pop(); 105 | baseOffset = offsets.pop(); 106 | } 107 | 108 | /** 109 | * Retrieves the thread local stack, and then immediately pushes a new memory scope. 110 | * Useful for try-with-resource blocks. 111 | * @return The thread's memory stack 112 | */ 113 | public static MemoryStack stackPush() { 114 | var stack = threadLocalStack.get(); 115 | return stack.push(); 116 | } 117 | 118 | /** 119 | * Used for try-with-resources blocks, it's a wrapper function for {@link #pop()}. 120 | */ 121 | @Override 122 | public void close() { 123 | pop(); 124 | } 125 | 126 | /** 127 | * @return The currently active memory scope for functions that require one. 128 | */ 129 | public ResourceScope scope() { 130 | return currentScope; 131 | } 132 | } 133 | --------------------------------------------------------------------------------