dotnet / dotnet/wpf

DivideByZeroException when PenThreadWorker.ThreadProc

Open
#7,945 0 comments 0 reactions 0 assignees View on GitHub
area-Touch Bug needs more information
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

The `UnsafeNativeMethods.GetPenEventMultiple` in `PenThreadWorker.ThreadProc` will throw System.DivideByZeroException.

This is not a good report and I lack the steps to reproduce it.

This exception info from my application telemetry.

### Reproduction Steps

None.

### Expected behavior

Work well.

### Actual behavior

Throw System.DivideByZeroException

```
System.DivideByZeroException: Attempted to divide by zero.
in bool UnsafeNativeMethods.GetPenEventMultiple(int cCommHandles, IntPtr[] commHandles, IntPtr handleReset, out int iHandle, out int evt, out int stylusPointerId, out int cPackets, out int cbPacket, out IntPtr pPackets)
in void PenThreadWorker.ThreadProc()
in void StartHelper.Callback(object state)
in void Thread.StartCallback()
```

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

OS: Microsoft Windows 6.1.7601 Service Pack 1

dotnet: 6.0.13

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.