File tree 14 files changed +35
-31
lines changed
14 files changed +35
-31
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ public unsafe void Dispose()
143
143
}
144
144
145
145
public static implicit operator HDC ( DeviceContext context ) => context . Handle ;
146
- public static unsafe explicit operator DeviceContext ( WPARAM wparam ) => Create ( new ( new ( wparam ) ) ) ;
146
+ public static unsafe explicit operator DeviceContext ( WPARAM wparam ) => Create ( new ( ( nint ) wparam ) ) ;
147
147
148
148
[ Flags ]
149
149
private enum ContextState
Original file line number Diff line number Diff line change 2
2
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
4
4
using System . Runtime . InteropServices ;
5
- using Windows . Wdk . System . SystemServices ;
5
+ using Windows . Wdk . System . Registry ;
6
6
using Windows . Win32 . System . Registry ;
7
7
8
8
namespace Windows . Wdk ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ namespace Windows.Win32.Foundation;
10
10
{
11
11
public unsafe void Dispose ( )
12
12
{
13
- if ( Value != 0 && Value != - 1 )
13
+ if ( ( nint ) Value != 0 && ( nint ) Value != - 1 )
14
14
{
15
15
Interop . CloseHandle ( this ) . ThrowLastErrorIfFalse ( ) ;
16
16
}
Original file line number Diff line number Diff line change
1
+ // Copyright (c) Jeremy W. Kuhne. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ namespace Windows . Win32 . Foundation ;
5
+
6
+ public unsafe readonly partial struct LRESULT
7
+ {
8
+ public static explicit operator void * ( LRESULT value ) => ( void * ) value . Value ;
9
+ public static explicit operator LRESULT ( void * value ) => new ( ( nint ) value ) ;
10
+ }
Original file line number Diff line number Diff line change 5
5
6
6
namespace Windows . Win32 . Foundation ;
7
7
8
- public readonly partial struct WPARAM
8
+ public unsafe readonly partial struct WPARAM
9
9
{
10
- public static unsafe implicit operator void * ( WPARAM value ) => ( void * ) value . Value ;
11
- public static unsafe implicit operator WPARAM ( void * value ) => new ( ( nuint ) value ) ;
10
+ public static implicit operator void * ( WPARAM value ) => ( void * ) value . Value ;
11
+ public static implicit operator WPARAM ( void * value ) => new ( ( nuint ) value ) ;
12
12
13
13
public static explicit operator HWND ( WPARAM value ) => ( HWND ) ( nint ) value . Value ;
14
14
public static explicit operator WPARAM ( HWND value ) => new ( ( nuint ) value . Value ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public static explicit operator HBRUSH(HGDIOBJ handle)
24
24
25
25
public void Dispose ( )
26
26
{
27
- if ( Value != 0 && Value != - 1 )
27
+ if ( ( nint ) Value != 0 && ( nint ) Value != - 1 )
28
28
{
29
29
Interop . DeleteObject ( this ) ;
30
30
Unsafe . AsRef ( in this ) = default ;
Original file line number Diff line number Diff line change 5
5
6
6
namespace Windows . Win32 . Graphics . Gdi ;
7
7
8
- public partial struct HDC : IHandle < HDC >
8
+ public unsafe partial struct HDC : IHandle < HDC >
9
9
{
10
10
HDC IHandle < HDC > . Handle => this ;
11
11
object ? IHandle < HDC > . Wrapper => null ;
12
12
13
- public bool IsNull => Value == 0 ;
14
-
15
13
public static explicit operator HDC ( HGDIOBJ handle )
16
14
{
17
15
Debug . Assert ( handle . IsNull || ( OBJ_TYPE ) Interop . GetObjectType ( handle ) == OBJ_TYPE . OBJ_DC ) ;
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ public unsafe partial struct HGDIOBJ
7
7
{
8
8
public OBJ_TYPE GetObjectType ( ) => ( OBJ_TYPE ) Interop . GetObjectType ( this ) ;
9
9
10
- public static implicit operator HGDIOBJ ( StockFont font ) => new ( Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) font ) ) ;
11
- public static implicit operator HGDIOBJ ( StockBrush brush ) => new ( Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) brush ) ) ;
12
- public static implicit operator HGDIOBJ ( SystemColor color ) => new ( Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) color ) ) ;
13
- public static implicit operator HGDIOBJ ( StockPen pen ) => new ( Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) pen ) ) ;
14
- public static implicit operator HGDIOBJ ( GET_STOCK_OBJECT_FLAGS stockObject ) => new ( Interop . GetStockObject ( stockObject ) ) ;
10
+ public static implicit operator HGDIOBJ ( StockFont font ) => new ( ( nint ) Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) font ) ) ;
11
+ public static implicit operator HGDIOBJ ( StockBrush brush ) => new ( ( nint ) Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) brush ) ) ;
12
+ public static implicit operator HGDIOBJ ( SystemColor color ) => new ( ( nint ) Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) color ) ) ;
13
+ public static implicit operator HGDIOBJ ( StockPen pen ) => new ( ( nint ) Interop . GetStockObject ( ( GET_STOCK_OBJECT_FLAGS ) pen ) ) ;
14
+ public static implicit operator HGDIOBJ ( GET_STOCK_OBJECT_FLAGS stockObject ) => new ( ( nint ) Interop . GetStockObject ( stockObject ) ) ;
15
15
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public static explicit operator HPEN(HGDIOBJ handle)
21
21
22
22
public void Dispose ( )
23
23
{
24
- if ( Value != 0 && Value != - 1 )
24
+ if ( ( nint ) Value != 0 && ( nint ) Value != - 1 )
25
25
{
26
26
Interop . DeleteObject ( this ) ;
27
27
Unsafe . AsRef ( in this ) = default ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void Dispose()
26
26
/// <summary>
27
27
/// Special <see cref="HRGN"/> sent during WM_NCPAINT to indicate the entire window.
28
28
/// </summary>
29
- public static HRGN Full { get ; } = ( HRGN ) 1 ;
29
+ public static HRGN Full { get ; } = ( HRGN ) ( nint ) 1 ;
30
30
31
31
/// <summary>
32
32
/// Is special <see cref="HRGN.Full"/> value.
Original file line number Diff line number Diff line change 5
5
6
6
namespace Windows . Win32 . System . Registry ;
7
7
8
- public partial struct HKEY : IDisposable
8
+ public unsafe partial struct HKEY : IDisposable
9
9
{
10
10
private const uint REMOTE_HANDLE_TAG = 0x00000001 ;
11
11
private const uint REG_CLASSES_SPECIAL_TAG = 0x00000002 ;
@@ -16,13 +16,13 @@ public bool IsPerfKey()
16
16
/// <summary>
17
17
/// Returns true if the key is from the local machine.
18
18
/// </summary>
19
- public bool IsLocalKey => ( Value & REMOTE_HANDLE_TAG ) == 0 ;
19
+ public bool IsLocalKey => ( ( nuint ) Value & REMOTE_HANDLE_TAG ) == 0 ;
20
20
21
21
/// <summary>
22
22
/// Returns true if the key is special (notably in <see cref="HKEY.HKEY_CLASSES_ROOT"/>, where
23
23
/// it might be redirected to per user settings).
24
24
/// </summary>
25
- public bool IsSpecialKey => ( Value & REG_CLASSES_SPECIAL_TAG ) != 0 ;
25
+ public bool IsSpecialKey => ( ( nuint ) Value & REG_CLASSES_SPECIAL_TAG ) != 0 ;
26
26
27
27
public void Dispose ( )
28
28
{
Original file line number Diff line number Diff line change 4
4
using System . Buffers . Binary ;
5
5
using System . Runtime . InteropServices ;
6
6
using Windows . Support ;
7
+ using Windows . Wdk . System . Registry ;
7
8
using Windows . Wdk . System . SystemServices ;
8
9
9
10
namespace Windows . Win32 . System . Registry ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 13
13
</ItemGroup >
14
14
15
15
<ItemGroup >
16
- <PackageReference Include =" Microsoft.Windows.CsWin32" Version =" 0.3.106 " >
16
+ <PackageReference Include =" Microsoft.Windows.CsWin32" Version =" 0.3.151 " >
17
17
<PrivateAssets >all</PrivateAssets >
18
18
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
19
19
</PackageReference >
20
20
<PackageReference Include =" StyleCop.Analyzers" Version =" 1.2.0-beta.556" >
21
21
<PrivateAssets >all</PrivateAssets >
22
22
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
23
23
</PackageReference >
24
- <PackageReference Include =" System.Runtime.CompilerServices.Unsafe" Version =" 6.0.0" />
24
+ <PackageReference Include =" System.Runtime.CompilerServices.Unsafe" Version =" 6.1.0" />
25
+ </ItemGroup >
26
+
27
+ <ItemGroup >
28
+ <Folder Include =" Win32\UI\HiDpi\" />
25
29
</ItemGroup >
26
30
27
31
</Project >
You can’t perform that action at this time.
0 commit comments