Skip to content

Bump Microsoft.Windows.CsWin32 and Microsoft.Windows.SDK.Win32Metadata#134

Closed
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/nuget/src/Generator/multi-ac1863a0cf
Closed

Bump Microsoft.Windows.CsWin32 and Microsoft.Windows.SDK.Win32Metadata#134
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/nuget/src/Generator/multi-ac1863a0cf

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Jan 26, 2026

Updated Microsoft.Windows.CsWin32 from 0.3.213 to 0.3.272.

Release notes

Sourced from Microsoft.Windows.CsWin32's releases.

0.3.269

Changes:

  • #​1613: Use Marshal.InitHandle API to avoid memory leak when OOM happens
  • #​1614: Update to latest win32metadata
  • #​1603: Generate SafeHandle when freeing method accepts additional reserved parameters
  • #​1597: Add more examples to the docs

This list of changes was auto generated.

0.3.264

Changes:

  • #​1593: Fix IDispatch property returns with built-in COM
  • #​1591: Update README.md & add sample snippets
  • #​1589: Add [Optional] on optional params

This list of changes was auto generated.

0.3.259

Changes:

  • #​1545: Generate struct wrapper around function pointer to make a native delegate typedef
  • #​1578: Update win32metadata to latest (68.0.4-preview)

This list of changes was auto generated.

0.3.257

Changes:

  • #​1575: Fix bug when multiple Span-params share a CountParamIndex and one param is null
  • #​1567: Fix mis-handling of parameters that are arrays of HANDLE
  • #​1565: Switch CsWin32RunAsBuildTask to EmitSingleFile by default (for VS incremental scenario)
  • #​1562: Move to .NET 10 SDK, add test coverage for net10 TFM

This list of changes was auto generated.

0.3.253

Changes:

  • #​1557: Improve intellisense experience with CsWin32RunAsBuildTask mode

This list of changes was auto generated.

0.3.252

Changes:

  • #​1550: Support $(ProjectName).NativeMethods.txt pattern for single-file-app projects
  • #​1555: Downgrade dependencies so the source analyzer works with .NET 8 SDK again

This list of changes was auto generated.

0.3.250

Changes:

  • #​1554: Translate VARIANT to ComVariant when using COM source generators
  • #​1548: Add common Win32 message parameter extraction macros

This list of changes was auto generated.

0.3.248

Changes:

  • #​1544: Improve optional out interface arguments (e.g. IWbemServices.GetObject) and other minor tweaks
  • #​1547: Add test for cross-winmd IInspectable derivation and fix a tiny bug
  • #​1541: Don't emit friendly overload of Span param for flexible array structs
  • #​1536: Handle struct returns for COM interface methods across all marshalling modes
  • #​1534: Preserve pointer return types
  • #​1533: Fix out ** pointer parameters

This list of changes was auto generated.

0.3.242

Changes:

  • #​1524: Add an option to FriendlyOverloads to request previous pointer overloads
  • #​1526: Generate real IDispatch when requested
  • #​1522: [Retained] parameters need to project as pointer
  • #​1521: Add implicit IntPtr casts to void* typedefs

This list of changes was auto generated.

0.3.238

Changes:

  • #​1520: Don't make void* params Span in friendly methods
  • #​1517: CsWin32Generator should allow newer language versions

This list of changes was auto generated.

0.3.236

NOTE: This changes the signature of methods with optional parameters. This change is also documented at https://microsoft.github.io/CsWin32/docs/getting-started.html:

Optional out/ref parameters

Some parameters in win32 are [optional, out] or [optional, in, out]. C# does not have an idiomatic way to represent this concept, so for any method that has such parameters, CsWin32 will generate two versions: one with all ref or out parameters included, and one with all such parameters omitted. For example:

// Omitting the optional parameter:
IsTextUnicode(buffer);

// Passing ref for optional parameter:
IS_TEXT_UNICODE_RESULT result = default;
IsTextUnicode(buffer, ref result);

Working with Span-typed and MemorySize-d parameters

In the Win32 APIs there are many functions where one parameter is a buffer (void* or byte*) and another parameter is the size of that buffer. When generating for a target framework that supports Spans, there will be overloads of these functions that take a Span<byte> which represents both of these parameters, since a Span refers to a chunk of memory and a length. For example, an API like IsTextUnicode has a void* parameter whose length is described by the iSize parameter in the native signature. The CsWin32 projection of this method will be:

BOOL IsTextUnicode(ReadOnlySpan<byte> lpv, ref IS_TEXT_UNICODE_RESULT lpiResult)

Instead of passing the buffer and length separately, in this projection you pass just one parameter. Span is a flexible type with many things that can be converted to it safely. You will also see Span parameters for things that may look like a struct but are variable sized. For example, InitializeAcl looks like it returns an ACL struct but the parameter is annotated with a [MemorySize] attribute in the metadata, indicating it is variable-sized based on another parameter. Thus, the cswin32 projection of this method will project this parameter as a Span<byte> since the size of the parameter is variable:

// The cswin32 signature:
static BOOL InitializeAcl(Span<byte> pAcl, ACE_REVISION dwAclRevision) { ... }

And you would call this by creating a buffer to receive the ACL. Then, after the call you can reinterpret the buffer as an ACL:

// Make a buffer
Span<byte> buffer = new byte[CalculateAclSize(...)];
InitializeAcl(buffer, ACE_REVISION.ACL_REVISION);

// The beginning of the buffer is an ACL, so cast it to a ref:
ref ACL acl = ref MemoryMarshal.AsRef<ACL>(buffer);

// Or treat it as a Span:
Span<ACL> aclSpan = MemoryMarshal.Cast<byte, ACL>(buffer);

CsWin32 will also generate a struct-typed parameter for convenience but this overload will pass sizeof(T) for the length parameter to the underlying Win32 API, so this only makes sense in some overloads such as SHGetFileInfo where the parameter has an annotation indicating it's variable-sized, but the size is only ever sizeof(SHFILEINFOW):

// Span<byte> overload:
static nuint SHGetFileInfo(string pszPath, FILE_FLAGS_AND_ATTRIBUTES dwFileAttributes, Span<byte> psfi, SHGFI_FLAGS uFlags)
// ref SHGETFILEINFOW overload:
static nuint SHGetFileInfo(string pszPath, FILE_FLAGS_AND_ATTRIBUTES dwFileAttributes, ref SHFILEINFOW psfi, SHGFI_FLAGS uFlags)
 ... (truncated)

## 0.3.235

## What's Changed
* Handle CoCreateable classes in ComSourceGenerators mode by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1502
* Simplify decimal conversions by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1512
* Prevent SafeHandle from being re-generated in downstream assembly by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1514
* Fix ArithmeticOverflow in HANDLE types and other helpers when CheckForOverflowUnderflow is enabled by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1513

**Full Changelog**: https://github.com/microsoft/CsWin32/compare/v0.3.228...v0.3.235

## 0.3.228

## What's Changed
* BuildTask mode should not generate types from InternalsVisibleTo referenced assemblies by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1492
* CsWin32 build task fixes for NET8/CSharp12 by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1498
* Fix platform case sensitivity issue with CsWin32Generator tool by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1499
* Update documentation for CsWin32RunAsBuildTask mode by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1497
* ArrayPool can be larger than requested resulting in freeing uninitialized GCHandles by @​jlaanstra in https://github.com/microsoft/CsWin32/pull/1405
* Fix analyzer test break in devdiv AzDO account by @​AArnott in https://github.com/microsoft/CsWin32/pull/1504

## New Contributors
* @​jlaanstra made their first contribution in https://github.com/microsoft/CsWin32/pull/1405

**Full Changelog**: https://github.com/microsoft/CsWin32/compare/v0.3.217...v0.3.228

https://www.nuget.org/packages/Microsoft.Windows.CsWin32/0.3.228

## 0.3.217

## What's Changed
* Add cswin32 mode to generate [GeneratedComInterface] and [LibraryImport] code by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1474
* Handle UnauthorizedAccessException in new ComTests by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1486
* Project byte* parameters as Span<byte> by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1488
* Fix nuspec to refer to only signed files and drop apphost.exe from the nuget by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1489


**Full Changelog**: https://github.com/microsoft/CsWin32/compare/v0.3.213...v0.3.217

Commits viewable in [compare view](https://github.com/microsoft/CsWin32/commits).
</details>

Updated [Microsoft.Windows.SDK.Win32Metadata](https://github.com/microsoft/win32metadata) from 65.0.8-preview to 69.0.7-preview.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Windows.SDK.Win32Metadata's releases](https://github.com/microsoft/win32metadata/releases)._

## 69.0.7-preview


## Changes:

* #​2193: Added DeliveryOptimization APIs
* #​2191: Add some parameter annotations
* #​2185: Correct close function for `FwpmEngineOpen0` handle
* #​2180: Change service connection for github release
* #​2175: Add additional globalization constants
* #​2176: Update script to support Visual Studio 2026
* #​2169: Rebaseline after publishing 68.0.4-preview

This list of changes was [auto generated](https://github-private.visualstudio.com/microsoft/_build/results?buildId=110387&view=logs).

## 68.0.4-preview


## Changes:

* #​2159: Remove vague Version doc mapping
* #​2157: Add SetLastError attribute to GetFileSecurityW
* #​2158: Add Reserved attribute to FwpmEngineOpen0::serverName
* #​2151: Update version after release
* #​2147: Update SDK to 10.0.26100.6584
* #​2149: Add additional product type constants to OS_PRODUCT_TYPE
* #​2139: Update UpdateSdk scripts so that running the script on the same version is idempotent
* #​2136: Bump version after 66.x release to 67.x

This list of changes was [auto generated](https://github-private.visualstudio.com/microsoft/_build/results?buildId=108654&view=logs).

## 67.0.4-preview


## Changes:

* #​2147: Update SDK to 10.0.26100.6584
* #​2149: Add additional product type constants to OS_PRODUCT_TYPE
* #​2139: Update UpdateSdk scripts so that running the script on the same version is idempotent
* #​2136: Bump version after 66.x release to 67.x

This list of changes was [auto generated](https://github-private.visualstudio.com/microsoft/_build/results?buildId=107572&view=logs).

## 66.0.5-preview


## Changes:

* #​2134: Printer API handle improvement
* #​2135: Upgrade D3D12 Agility SDK to 1.618.2
* #​2133: Add [Const] annotation for [In] string parameters in Printer APIs
* #​2131: Fix AddPrinter return value (should be PRINTER_HANDLE)
* #​2130: Update versions to start new release

This list of changes was [auto generated](https://github-private.visualstudio.com/microsoft/_build/results?buildId=106683&view=logs).

Commits viewable in [compare view](https://github.com/microsoft/win32metadata/compare/v65.0.8-preview...v69.0.7-preview).
</details>

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Bumps Microsoft.Windows.CsWin32 from 0.3.213 to 0.3.272
Bumps Microsoft.Windows.SDK.Win32Metadata from 65.0.8-preview to 69.0.7-preview

---
updated-dependencies:
- dependency-name: Microsoft.Windows.CsWin32
  dependency-version: 0.3.272
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Microsoft.Windows.SDK.Win32Metadata
  dependency-version: 69.0.7-preview
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: Microsoft.Windows.CsWin32
  dependency-version: 0.3.272
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Microsoft.Windows.SDK.Win32Metadata
  dependency-version: 69.0.7-preview
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Jan 26, 2026
@nefarius
Copy link
Copy Markdown
Owner

@dependabot rebase

@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot Bot commented on behalf of github May 30, 2026

Looks like these dependencies are no longer updatable, so this is no longer needed.

@dependabot dependabot Bot closed this May 30, 2026
@dependabot dependabot Bot deleted the dependabot/nuget/src/Generator/multi-ac1863a0cf branch May 30, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant