Skip to content

Use the Windows SDK 10.0.29648 NuGet package - #1

Open
CodeMaxx wants to merge 1 commit into
mainfrom
sdk-29648
Open

Use the Windows SDK 10.0.29648 NuGet package#1
CodeMaxx wants to merge 1 commit into
mainfrom
sdk-29648

Conversation

@CodeMaxx

Copy link
Copy Markdown
Owner

The Windows SDK now ships everything this sample needs, so it no longer has to
carry its own copies of the hotpatch definitions.

What changed

Windows SDK 10.0.29648, via NuGet. The SDK is not available as a standalone
installer yet, so the project references Microsoft.Windows.SDK.CPP (plus the
.x64 and .arm64 library packages) in src/packages.config. A NuGet
restore pulls them in, so building no longer requires a Windows SDK
installation at all.

No more locally declared structures. HOTPATCH_RUNTIME_REPORT,
HOTPATCH_INFO_ENTRY, HOTPATCH_REPORT_NAME_MAX_LENGTH and the hand-rolled
RUNTIME_REPORT_TYPE_HOTPATCH value are gone from HotpatchReport.h. The
sample now uses the SDK's definitions and the real RuntimeReportTypeHotpatch
enum value. Every report structure it touches now comes from winnt.h.

onecore.lib instead of mincore.lib. onecore.lib is the current umbrella
library, and in this SDK it resolves GetRuntimeAttestationReport through the
api-ms-win-core-sysinfo-l1-2-8 API set, which the loader maps to
kernelbase.dll.

Static CRT. The project now links the C runtime statically, so the
executable is a single self-contained file that runs on a clean machine with no
Visual C++ Redistributable installed. Its only imports are kernel32.dll,
bcrypt.dll, and the API set above, all of which ship with Windows.

Docs

README and BUILDING.md are updated for the NuGet SDK, the restore step, the new
linkage, and the static runtime. packages/ is gitignored.

Verification

  • x64 and ARM64 both build clean from a wiped packages/ using only the
    documented nuget restore + msbuild commands.
  • dumpbin /imports on both binaries shows only the three Windows-supplied
    DLLs, and confirms GetRuntimeAttestationReport binds to
    api-ms-win-core-sysinfo-l1-2-8.dll.
  • The x64 build was run on a Windows 11 build 29654 machine with VBS enabled: it
    printed a complete signed package (driver report plus hotpatch report) and
    exited 0, with no DLLs deployed alongside it.

The hotpatch report structures and the RuntimeReportTypeHotpatch enum value
now ship in the Windows SDK, so the sample no longer declares them itself.

- Reference the SDK as a NuGet package, so no SDK installation is needed
- Drop the local hotpatch structure definitions and use the SDK's
- Link onecore.lib instead of mincore.lib
- Link the CRT statically so the executable needs no redistributable
- Report malformed packages through the exit code, and check the package
  size and report extents while walking the envelope
- Fail with an accurate message when a rejected buffer comes back without
  a larger required size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant