Skip to content

Commit 3042b5f

Browse files
author
Mirroring
committed
Merge commit '6911289cc35166f1179c63e1ed0bf2dc389f572f'
2 parents e9d24d5 + 6911289 commit 3042b5f

File tree

12 files changed

+25
-30
lines changed

12 files changed

+25
-30
lines changed

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
Microsoft.NET.Sdk.IL.targets requires definition of MicrosoftNETCoreILAsmVersion
5050
-->
5151
<MicrosoftNETCoreILAsmVersion>$(MicrosoftNETCoreILAsmPackageVersion)</MicrosoftNETCoreILAsmVersion>
52-
<MicrosoftWindowsCsWin32PackageVersion>0.3.75-beta</MicrosoftWindowsCsWin32PackageVersion>
52+
<MicrosoftWindowsCsWin32PackageVersion>0.3.106</MicrosoftWindowsCsWin32PackageVersion>
5353
</PropertyGroup>
5454
<!-- Docs / Intellisense -->
5555
<PropertyGroup>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System.Runtime.InteropServices;
5-
64
namespace Windows.Win32.Graphics.GdiPlus;
75

86
internal partial struct EncoderParameters
97
{
108
[UnscopedRef]
11-
internal unsafe Span<EncoderParameter> Parameters => MemoryMarshal.CreateSpan(ref Parameter._0, (int)Count);
9+
internal unsafe Span<EncoderParameter> Parameters => Parameter.AsSpan((int)Count);
1210
}

src/System.Windows.Forms.Primitives/src/NativeMethods.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ HideCaret
277277
HitTestThemeBackground
278278
HT*
279279
HTML_HELP_COMMAND
280+
HtmlHelp
280281
HTREEITEM
281282
IAccessible
282283
IAccessibleEx

src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.HtmlHelp.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System.Runtime.InteropServices;
54
using Windows.Win32.Data.HtmlHelp;
65

76
namespace Windows.Win32;
87

98
internal static partial class PInvoke
109
{
11-
internal static unsafe HWND HtmlHelp(HWND hwndCaller, string? pszFile, HTML_HELP_COMMAND uCommand, nuint dwData)
10+
/// <inheritdoc cref="HtmlHelp(HWND, string, HTML_HELP_COMMAND, nuint)" />
11+
internal static unsafe HWND HtmlHelp<T>(T hwndCaller, string? pszFile, HTML_HELP_COMMAND uCommand, nuint dwData)
12+
where T : IHandle<HWND>
1213
{
13-
// Copied from generated code pending resolution of https://github.com/microsoft/win32metadata/issues/1749
14-
15-
fixed (char* p = pszFile)
16-
{
17-
HWND __retVal = LocalExternFunction(hwndCaller, p, (uint)uCommand, dwData);
18-
return __retVal;
19-
}
20-
21-
[DllImport(Libraries.Hhctrl, ExactSpelling = true, EntryPoint = "HtmlHelpW")]
22-
static extern HWND LocalExternFunction(HWND hwndCaller, PCWSTR pszFile, uint uCommand, nuint dwData);
14+
HWND result = HtmlHelp(hwndCaller.Handle, pszFile, uCommand, dwData);
15+
GC.KeepAlive(hwndCaller.Wrapper);
16+
return result;
2317
}
2418

2519
/// <inheritdoc cref="HtmlHelp(HWND, string, HTML_HELP_COMMAND, nuint)" />

src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.ImmGetContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Windows.Win32.Globalization;
4+
using Windows.Win32.UI.Input.Ime;
55

66
namespace Windows.Win32;
77

src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.ImmReleaseContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Windows.Win32.Globalization;
4+
using Windows.Win32.UI.Input.Ime;
55

66
namespace Windows.Win32;
77

src/System.Windows.Forms.Primitives/tests/TestUtilities/Metafiles/EmfRecord.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public EmfRecord(
2929
}
3030

3131
public ENHANCED_METAFILE_RECORD_TYPE Type => _lpmr->iType;
32-
public ReadOnlySpan<uint> Params => _lpmr->dParm.AsReadOnlySpan();
32+
public ReadOnlySpan<uint> Params => _lpmr->dParm.AsSpan((int)(_lpmr->nSize / sizeof(uint)) - 2);
3333
public ReadOnlySpan<HGDIOBJ> Handles => new(_lpht, _nHandles);
3434

3535
public ENHMETAHEADER* HeaderRecord => Type == ENHANCED_METAFILE_RECORD_TYPE.EMR_HEADER ? (ENHMETAHEADER*)_lpmr : null;

src/System.Windows.Forms.Primitives/tests/UnitTests/Interop/Oleaut32/SAFEARRAYTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public void SAFEARRAY_CreateSingleDimension_GetProperties_Success(ushort vt, ush
6666
Assert.Equal(expectedCbElements, psa->cbElements);
6767
Assert.Equal(0u, psa->cLocks);
6868
Assert.True(psa->pvData != null);
69-
Assert.Equal(10u, psa->rgsabound._0.cElements);
70-
Assert.Equal(1, psa->rgsabound._0.lLbound);
69+
Assert.Equal(10u, psa->rgsabound.AsSpan(1)[0].cElements);
70+
Assert.Equal(1, psa->rgsabound.AsSpan(1)[0].lLbound);
7171

7272
VARENUM arrayVt = VT_EMPTY;
7373
HRESULT hr = PInvokeCore.SafeArrayGetVartype(psa, &arrayVt);
@@ -102,8 +102,8 @@ public void SAFEARRAY_CreateSingleDimensionRECORD_GetProperties_Success()
102102
Assert.Equal((uint)sizeof(int), psa->cbElements);
103103
Assert.Equal(0u, psa->cLocks);
104104
Assert.True(psa->pvData != null);
105-
Assert.Equal(10u, psa->rgsabound._0.cElements);
106-
Assert.Equal(1, psa->rgsabound._0.lLbound);
105+
Assert.Equal(10u, psa->rgsabound.AsSpan(1)[0].cElements);
106+
Assert.Equal(1, psa->rgsabound.AsSpan(1)[0].lLbound);
107107

108108
VARENUM arrayVt = VT_EMPTY;
109109
HRESULT hr = PInvokeCore.SafeArrayGetVartype(psa, &arrayVt);
@@ -190,8 +190,8 @@ public void SAFEARRAY_CreateMultipleDimensions_GetProperties_Success(ushort vt,
190190
Assert.Equal(expectedCbElements, psa->cbElements);
191191
Assert.Equal(0u, psa->cLocks);
192192
Assert.True(psa->pvData != null);
193-
Assert.Equal(20u, psa->rgsabound._0.cElements);
194-
Assert.Equal(0, psa->rgsabound._0.lLbound);
193+
Assert.Equal(20u, psa->rgsabound.AsSpan(1)[0].cElements);
194+
Assert.Equal(0, psa->rgsabound.AsSpan(1)[0].lLbound);
195195
Assert.Equal(10u, ((SAFEARRAYBOUND*)&psa->rgsabound)[1].cElements);
196196
Assert.Equal(1, ((SAFEARRAYBOUND*)&psa->rgsabound)[1].lLbound);
197197

src/System.Windows.Forms/src/System/Windows/Forms/Control.Ime.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.ComponentModel;
5-
using Windows.Win32.Globalization;
65
using Windows.Win32.UI.Input.Ime;
76

87
namespace System.Windows.Forms;

src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/MaskedTextBox.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Drawing.Design;
88
using System.Globalization;
99
using System.Windows.Forms.VisualStyles;
10-
using Windows.Win32.Globalization;
1110
using Windows.Win32.UI.Accessibility;
1211
using Windows.Win32.UI.Input.Ime;
1312

0 commit comments

Comments
 (0)