Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 3, 2025

Updated Microsoft.Windows.CsWin32 from 0.3.209 to 0.3.239.

Release notes

Sourced from Microsoft.Windows.CsWin32's releases.

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

## 0.3.213

## What's Changed
* Retarget to roslyn for VS 2022 Update 14 by @​AArnott in https://github.com/microsoft/CsWin32/pull/1466
* .NET targeting projects should reference `Microsoft.Windows.SDK.NET.Ref` instead by @​AArnott in https://github.com/microsoft/CsWin32/pull/1471
* Update win32metadata version to 65.0.8-preview by @​jevansaks in https://github.com/microsoft/CsWin32/pull/1469
* Update dependency Microsoft.Build.NoTargets to 3.7.134 by @​renovate[bot] in https://github.com/microsoft/CsWin32/pull/1461


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

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

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

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

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

## 65.0.8-preview


## Changes:

* #​2129: Update ChangesSinceLastRelease.txt
* #​2116: Add additional console APIs/types
* #​2128: Update CODEOWNERS
* #​2122: Upgrade D3D12 Agility SDK to 1.618.1
* #​2043: Add missing InvalidHandleValue metadata on RAII types
* #​2124: Update crossarch list based on new component partitions
* #​2125: Fix return value of ShellExecute
* #​2121: Update to v65

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

## 64.0.22-preview


## Changes:


### Fixes:


* #​2058: CldApi Handles generate invalid SafeFileHandle overloads
* #​2030: Namespace of IsCharLowerW seems wrong
* #​2021: Update DEVPROPKEY and PROPERTYKEY namespaces in ConstantsScraper.header.txt

### Enhancements:


* #​2028: Problem with the dwreadflags parameter of the ReadEventLog function

### Others:


* #​2120: Add missing WLDP and SPOOLSS APIs
* #​2091: Upgrade D3D12 Agility SDK to 1.616.0
* #​2092: Bundle license with win32docs package
<details><summary><b>See More</b></summary>

* #​2062: CldApi Handles generate invalid SafeFileHandle overloads. Fixed #​2058.
* #​2060: `DPI_AWARENESS_CONTEXT` value -1 is valid but metadata indicates otherwise
* #​2042: Restore missing headers
* #​2031: Missing PROCESS_CREATION_MITIGATION_POLICY_* macros
* #​2055: Upgrade D3D12 Agility SDK to 1.615.0
* #​2041: `LPM_HANDLE` refers to free function `LPM_Deinitialize` that doesn't exist
* #​2032: Fixed some namespace cycles.
* #​2040: Problem with the dwreadflags parameter of the ReadEventLog function
* #​2036: `D3D11CreateDevice` `HMODULE Software` parameter is optional
* #​2038: `CreateStreamOnHGlobal` `HGLOBAL` parameter is optional
* #​2050: `CreateTransaction` parameters are incorrectly attributed
* #​2057: Philnach/ngbvcentralize
* #​2025: nbgv still pulled from nuget.org
* #​1964: Add GetFileInformationByName (requires SDK 10.0.26100.1)

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

## 63.0.31-preview


## Changes:


### Enhancements:


* #​1922: It would be nice to have an `impl From<DEVPROPKEY> for PROPERTYKEY`

### Others:


* #​2019: Add additional device partitions
* #​2008: WINTRUST_SIGNATURE_SETTINGS_FLAGS should be a flagged enum
* #​1994: More Retained functions
* #​2004: CopyFile* constants should be in the `Windows.Win32.Storage.FileSystem` namespace
* #​2007: `IExplorerCommand:` Methods could return flag type instead of `u32` and flag types should be marked as flags
* #​2009: Support for enum types in CreateFont method instead of casting to uint
* #​2010: CRYPTCATATTRIBUTE can use a flagged enum
<details><summary><b>See More</b></summary>

* #​2017: Apply same NuGetConfigFile change as wdkmetadata to pipeline yaml
* #​2011: IContextMenu::QueryContextMenu returns multiple success values
* #​2013: Update Install-DotNetTool.ps1 to use repos NuGet.config
* #​2012: Address dependabot alerts about MessagePack NuGet package
* #​1997: Add additional BCrypt APIs
* #​1995: Move win32metadaata onto a more secure nuget feed
* #​1980: Revert `[RetVal]` annotation for multi-output `DCompositionGetStatistics()`
* #​1979: Correct GdiPlus Bitmap, Image documentation links
* #​1977: Correct AviStream documentation links
* #​1993: Annotate _input_ length of `DCompositionGetStatistics::targetIds`
* #​1987: Add PRINTER_HANDLE type
* #​1988: Remove RAIIFree attribute from PSID
* #​1978: Remove StructSizeField from BLOB, BSTRBLOB
* #​1976: Correct PMPRADMINCONNECTIONHANGUPNOTIFICATION3 parameter 4
* #​1974: Add NET_IF_COMPARTMENT_ID typedef and constants
* #​1975: Add QueryOptionalDelayLoadedAPI
* #​1969: Fix error where pipeline name ending in a '.' would cause the PR pipeline to fail
* #​1971: Mark `ID3D12GraphicsCommandList::ClearDepthStencilView` `pRects` as `Optional`
* #​1453: Bug: ID3D12GraphicsCommandList::ClearRenderTargetView pRects should be marked optional
* #​1970: Annotate missing `ComOutPtr` in `CompositionSwapchain` and `DirectCom…

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

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

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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>

Bumps Microsoft.Windows.CsWin32 from 0.3.209 to 0.3.239
Bumps Microsoft.Windows.SDK.Win32Metadata from 62.0.23-preview to 65.0.8-preview

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

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Nov 3, 2025
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Nov 10, 2025

Superseded by #12.

@dependabot dependabot bot closed this Nov 10, 2025
@dependabot dependabot bot deleted the dependabot/nuget/src/multi-58dfc54309 branch November 10, 2025 13:24
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