You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CsWin32 (v0.3.269) can generate SecPkgContext_CipherInfo from the Win32 metadata in the Windows.Win32.Security.Authentication.Identity namespace. This PR removes the manually-defined struct and uses the CsWin32-generated version.
Version change
No version bump — the existing CsWin32 version (0.3.269) already supports this type. GitHub API access was restricted (403) due to token lifetime policy, so the latest available NuGet version could not be verified externally; only the locally cached 0.3.269 was confirmed.
Manual struct definition removed. The file previously hand-defined SecPkgContext_CipherInfo (from Schannel.h) in the Microsoft.AspNetCore.HttpSys.Internal namespace using [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] and fixed char[64] fields.
CsWin32 generates an equivalent struct using __char_64 inline array wrappers (also [StructLayout(Sequential, CharSet = Unicode)]) which are binary-compatible with the previous definition. The struct file is replaced with a placeholder comment.
Consumer files updated:
src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs — added using Windows.Win32.Security.Authentication.Identity;
src/Servers/IIS/IIS/src/Core/IISHttpContext.cs — added using Windows.Win32.Security.Authentication.Identity;
GetProcAddress-based P/Invoke for HttpQueryRequestProperty / HttpSetRequestProperty (HttpApi.cs): These are deliberately loaded via GetProcAddress at runtime for availability detection (graceful fallback on older Windows). This is intentional design, not a CsWin32 workaround.
Build verification
Both affected projects build successfully with 0 errors, 0 warnings:
The bundle file is available in the agent artifact in the workflow run linked above.
To create a pull request with the changes:
# Download the artifact from the workflow run
gh run download 26735994773 -n agent -D /tmp/agent-26735994773
# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-26735994773/aw-cswin32-replace-manual-secpkgcontext_cipherinfo.bundle refs/heads/cswin32-replace-manual-SecPkgContext_CipherInfo:refs/bundles/create-pr-cswin32-replace-manual-SecPkgContext-CipherInfo-aa71629a0f4e1b48-79ff9197
git update-ref refs/heads/cswin32-replace-manual-SecPkgContext_CipherInfo-aa71629a0f4e1b48 refs/bundles/create-pr-cswin32-replace-manual-SecPkgContext-CipherInfo-aa71629a0f4e1b48-79ff9197
git checkout cswin32-replace-manual-SecPkgContext_CipherInfo-aa71629a0f4e1b48
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-cswin32-replace-manual-SecPkgContext-CipherInfo-aa71629a0f4e1b48-79ff9197
# Push the branch to origin
git push origin cswin32-replace-manual-SecPkgContext_CipherInfo-aa71629a0f4e1b48
# Create the pull request
gh pr create --title '[package] Replace manual SecPkgContext_CipherInfo struct with CsWin32-generated version' --base main --head cswin32-replace-manual-SecPkgContext_CipherInfo-aa71629a0f4e1b48 --repo DeagleGross/aspnetcore
Summary
CsWin32 (v0.3.269) can generate
SecPkgContext_CipherInfofrom the Win32 metadata in theWindows.Win32.Security.Authentication.Identitynamespace. This PR removes the manually-defined struct and uses the CsWin32-generated version.Version change
No version bump — the existing CsWin32 version (0.3.269) already supports this type. GitHub API access was restricted (403) due to token lifetime policy, so the latest available NuGet version could not be verified externally; only the locally cached 0.3.269 was confirmed.
Workarounds fixed
src/Shared/HttpSys/NativeInterop/SecPkgContext_CipherInfo.csManual struct definition removed. The file previously hand-defined
SecPkgContext_CipherInfo(fromSchannel.h) in theMicrosoft.AspNetCore.HttpSys.Internalnamespace using[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]andfixed char[64]fields.CsWin32 generates an equivalent struct using
__char_64inline array wrappers (also[StructLayout(Sequential, CharSet = Unicode)]) which are binary-compatible with the previous definition. The struct file is replaced with a placeholder comment.Consumer files updated:
src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs— addedusing Windows.Win32.Security.Authentication.Identity;src/Servers/IIS/IIS/src/Core/IISHttpContext.cs— addedusing Windows.Win32.Security.Authentication.Identity;NativeMethods.txt files updated:
src/Servers/HttpSys/src/NativeMethods.txt— addedSecPkgContext_CipherInfosrc/Servers/IIS/IIS/src/NativeMethods.txt— addedSecPkgContext_CipherInfoWorkarounds that remain
HttpQueryRequestProperty/HttpSetRequestProperty(HttpApi.cs): These are deliberately loaded viaGetProcAddressat runtime for availability detection (graceful fallback on older Windows). This is intentional design, not a CsWin32 workaround.Build verification
Both affected projects build successfully with 0 errors, 0 warnings:
Note
This was originally intended as a pull request, but the git push operation failed.
Workflow Run: View run details and download bundle artifact
The bundle file is available in the
agentartifact in the workflow run linked above.To create a pull request with the changes: