Skip to content

[package] Update Microsoft.Windows.CsWin32 from 0.3.269 to 0.3.275#66944

Merged
wtgodbe merged 1 commit into
mainfrom
update-cswin32-0.3.275-343a5fafa381c512
Jun 1, 2026
Merged

[package] Update Microsoft.Windows.CsWin32 from 0.3.269 to 0.3.275#66944
wtgodbe merged 1 commit into
mainfrom
update-cswin32-0.3.275-343a5fafa381c512

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates Microsoft.Windows.CsWin32 from 0.3.269 to 0.3.275 and fixes associated breaking changes and workarounds.

Version Change

eng/Versions.props: 0.3.2690.3.275

CsWin32 0.3.275 Changelog

Breaking Change Fixed: HttpCloseRequestQueue signature change

File: src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs

CsWin32 0.3.275 changed PInvoke.HttpCloseRequestQueue to take HTTP_REQUEST_QUEUE_HANDLE (a struct) instead of SafeHandle (CsWin32 issue #1672). HttpCreateRequestQueue now returns HttpCloseRequestQueueSafeHandle (a SafeHandle subclass that calls HttpCloseRequestQueue in ReleaseHandle).

Fix: Replace the explicit PInvoke.HttpCloseRequestQueue(Handle) call with Handle.Dispose(). Since Handle is a HttpCloseRequestQueueSafeHandle, calling Dispose() correctly closes the queue handle (via ReleaseHandle) before the BoundHandle is disposed. The now-redundant Handle.SetHandleAsInvalid() call was also removed.

Workaround Removed: HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo enum cast

File: src/Servers/IIS/IIS/src/Core/IISHttpContext.cs

Previously a hardcoded integer cast was required because CsWin32 did not generate the HttpRequestPropertyTlsCipherInfo enum member:

// Before
(HTTP_REQUEST_PROPERTY)14 /* HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo */
// After
HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo

CsWin32 0.3.275 (via updated win32 metadata) now generates this member, so the cast workaround is no longer needed.

Build Output

Both affected projects build successfully with 0 warnings and 0 errors:

  • Microsoft.AspNetCore.Server.HttpSys.csproj
  • Microsoft.AspNetCore.Server.IIS.csproj

Remaining Workarounds (not yet removable)

Workaround File Reason
_sockaddr.sin6_addr.u.Byte.AsReadOnlySpan() src/Shared/HttpSys/NativeInterop/SocketAddress.cs CsWin32 issue #1086 closed as "not planned" — inline arrays not implemented; __byte_16 still lacks implicit ReadOnlySpan<byte> conversion
Manual SecPkgContext_CipherInfo struct src/Shared/HttpSys/NativeInterop/SecPkgContext_CipherInfo.cs CsWin32 can generate this struct, but migration would require namespace changes across shared source files used by both HttpSys and IIS

Generated by Update CsWin32 Package · sonnet46 6.5M ·

- Bumps CsWin32 version in eng/Versions.props
- Fixes breaking change: HttpCloseRequestQueue now takes HTTP_REQUEST_QUEUE_HANDLE
  struct instead of SafeHandle; replace explicit PInvoke call with Handle.Dispose()
  since the SafeHandle already calls HttpCloseRequestQueue in ReleaseHandle
- Removes hardcoded cast workaround: HTTP_REQUEST_PROPERTY.HttpRequestPropertyTlsCipherInfo
  is now generated by CsWin32 0.3.275 (previously required integer cast workaround)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 1, 2026
@github-actions github-actions Bot requested review from a team, BrennanConroy, halter73 and wtgodbe as code owners June 1, 2026 01:22
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 1, 2026
@wtgodbe wtgodbe merged commit 3d3e43a into main Jun 1, 2026
24 checks passed
@wtgodbe wtgodbe deleted the update-cswin32-0.3.275-343a5fafa381c512 branch June 1, 2026 23:26
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants