Skip to content

Instantly share code, notes, and snippets.

@DropDemBits
Last active September 15, 2023 22:44
Show Gist options
  • Save DropDemBits/ebe2c533dce8e83b6342c5d23dbe39e1 to your computer and use it in GitHub Desktop.
Save DropDemBits/ebe2c533dce8e83b6342c5d23dbe39e1 to your computer and use it in GitHub Desktop.
diff --git a/generation/WDK/Partitions/Wdf.Umdf/main.cpp b/generation/WDK/Partitions/Wdf.Umdf/main.cpp
new file mode 100644
index 0000000..2a2c181
--- /dev/null
+++ b/generation/WDK/Partitions/Wdf.Umdf/main.cpp
@@ -0,0 +1,5 @@
+#include <windows.h>
+#define WDF_STUB
+#include <umdf/2.33/wdf.h>
diff --git a/generation/WDK/Partitions/Wdf.Umdf/settings.rsp b/generation/WDK/Partitions/Wdf.Umdf/settings.rsp
new file mode 100644
index 0000000..0d42f6d
--- /dev/null
+++ b/generation/WDK/Partitions/Wdf.Umdf/settings.rsp
@@ -0,0 +1,39 @@
+--exclude
+WDFFUNC
+--traverse
+<IncludeRoot>/wdf/umdf/2.33/wdf.h
+<IncludeRoot>/wdf/umdf/2.33/wdftypes.h
+<IncludeRoot>/wdf/umdf/2.33/wdfglobals.h
+<IncludeRoot>/wdf/umdf/2.33/wdffuncenum.h
+<IncludeRoot>/wdf/umdf/2.33/wdfstatus.h
+<IncludeRoot>/wdf/umdf/2.33/wdfassert.h
+<IncludeRoot>/wdf/umdf/2.33/wdfverifier.h
+<IncludeRoot>/wdf/umdf/2.33/wdfobject.h
+<IncludeRoot>/wdf/umdf/2.33/wdfsync.h
+<IncludeRoot>/wdf/umdf/2.33/wdfcore.h
+<IncludeRoot>/wdf/umdf/2.33/wdfdriver.h
+<IncludeRoot>/wdf/umdf/2.33/WdfQueryInterface.h
+<IncludeRoot>/wdf/umdf/2.33/wdfmemory.h
+<IncludeRoot>/wdf/umdf/2.33/wdfchildlist.h
+<IncludeRoot>/wdf/umdf/2.33/wdffileobject.h
+<IncludeRoot>/wdf/umdf/2.33/wdfdevice.h
+<IncludeRoot>/wdf/umdf/2.33/wdfcollection.h
+<IncludeRoot>/wdf/umdf/2.33/wdftimer.h
+<IncludeRoot>/wdf/umdf/2.33/wdfworkitem.h
+<IncludeRoot>/wdf/umdf/2.33/wdfinterrupt.h
+<IncludeRoot>/wdf/umdf/2.33/wdfresource.h
+<IncludeRoot>/wdf/umdf/2.33/wdfrequest.h
+<IncludeRoot>/wdf/umdf/2.33/wdfiotarget.h
+<IncludeRoot>/wdf/umdf/2.33/wdfio.h
+<IncludeRoot>/wdf/umdf/2.33/wdffdo.h
+<IncludeRoot>/wdf/umdf/2.33/wdfpdo.h
+<IncludeRoot>/wdf/umdf/2.33/wdfcontrol.h
+<IncludeRoot>/wdf/umdf/2.33/WdfWMI.h
+<IncludeRoot>/wdf/umdf/2.33/wdfstring.h
+<IncludeRoot>/wdf/umdf/2.33/wdfregistry.h
+<IncludeRoot>/wdf/umdf/2.33/wdfbugcodes.h
+<IncludeRoot>/wdf/umdf/2.33/wdfroletypes.h
+<IncludeRoot>/wdf/umdf/2.33/wdfhwaccess.h
+<IncludeRoot>/wdf/umdf/2.33/wdfcompanion.h
+--namespace
+Windows.Wdk.Wdf.Umdf
\ No newline at end of file
diff --git a/generation/WDK/Windows.Wdk.proj b/generation/WDK/Windows.Wdk.proj
index 88c0c75..f8102a0 100644
--- a/generation/WDK/Windows.Wdk.proj
+++ b/generation/WDK/Windows.Wdk.proj
@@ -31,11 +31,11 @@
<PropertyGroup>
<SdkIncRoot>$(MSBuildThisFileDirectory)RecompiledIdlHeaders</SdkIncRoot>
- <AdditionalIncludes>$(MSBuildProjectDirectory)\inc;$(SdkIncRoot)\km</AdditionalIncludes>
+ <AdditionalIncludes>$(MSBuildProjectDirectory)\inc;$(SdkIncRoot)\km;$(SdkIncRoot)\wdf</AdditionalIncludes>
<ShowEmitWinmdOutputDetails>true</ShowEmitWinmdOutputDetails>
<!-- To regenerate this list; remove the property and the build will indicate what names can safely go here as a build optimization -->
- <ExcludeFromCrossarch>Direct3D;FileSystem;FileSystem.Minifilters;OfflineRegistry;SystemServices</ExcludeFromCrossarch>
+ <ExcludeFromCrossarch>Direct3D;FileSystem;FileSystem.Minifilters;OfflineRegistry;SystemServices;Wdf.Umdf</ExcludeFromCrossarch>
<UseWinSDKAssets>true</UseWinSDKAssets>
</PropertyGroup>
diff --git a/scripts/RecompileIdlFilesForScraping.ps1 b/scripts/RecompileIdlFilesForScraping.ps1
index 2b6091f..db0fb77 100644
--- a/scripts/RecompileIdlFilesForScraping.ps1
+++ b/scripts/RecompileIdlFilesForScraping.ps1
@@ -28,6 +28,7 @@ Copy-Item "$wdkIncludeDir\km" "$recompiledIdlHeadersDir" -Recurse
Copy-Item "$wdkIncludeDir\shared" "$recompiledIdlHeadersDir" -Recurse
Copy-Item "$wdkIncludeDir\winrt" "$recompiledIdlHeadersDir" -Recurse
Copy-Item "$wdkIncludeDir\ucrt" "$recompiledIdlHeadersDir" -Recurse
+Copy-Item "$wdkIncludeDir\wdf" "$recompiledIdlHeadersDir" -Recurse
Write-Host "Converting MIDL attributes to SAL annotations..."
$idlFilesToRecompile = [System.Collections.ArrayList]@()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment