• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dapplo / Dapplo.Windows / 21365007899

26 Jan 2026 04:17PM UTC coverage: 34.905% (-0.4%) from 35.341%
21365007899

push

github

Lakritzator
Added support for getting the cursor with the correct size.

647 of 2024 branches covered (31.97%)

Branch coverage included in aggregate %.

1 of 86 new or added lines in 5 files covered. (1.16%)

2 existing lines in 2 files now uncovered.

1818 of 5038 relevant lines covered (36.09%)

21.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Dapplo.Windows.User32/SafeHandles/SafeCursorHandle.cs
1
// Copyright (c) Dapplo and contributors. All rights reserved.
2
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3

4
using System;
5
using System.Security;
6
using Microsoft.Win32.SafeHandles;
7

8

9
#if !NET6_0_OR_GREATER
10
using System.Security.Permissions;
11
#endif
12

13
namespace Dapplo.Windows.User32.SafeHandles;
14

15
/// <summary>
16
///     A SafeHandle class implementation for the hCursor
17
/// </summary>
18
public class SafeCursorHandle : SafeHandleZeroOrMinusOneIsInvalid
19
{
20
    /// <summary>
21
    ///     Default constructor is needed to support marshalling!!
22
    /// </summary>
23
    [SecurityCritical]
NEW
24
    public SafeCursorHandle() : base(true)
×
25
    {
NEW
26
    }
×
27

28
    /// <summary>
29
    ///     Create a SafeCursorHandle from a hCursor
30
    /// </summary>
31
    /// <param name="hCursor">IntPtr to an hCursor</param>
NEW
32
    public SafeCursorHandle(IntPtr hCursor) : base(true)
×
33
    {
NEW
34
        SetHandle(hCursor);
×
NEW
35
    }
×
36

37
    /// <summary>
38
    ///     Call DestroyCursor
39
    /// </summary>
40
    /// <returns>true if this worked</returns>
41
#if !NET6_0_OR_GREATER
42
    [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
43
#endif
44
    protected override bool ReleaseHandle()
45
    {
NEW
46
        return User32Api.DestroyCursor(handle);
×
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc