Skip to content

WPF StylusPointPropertyInfo may throw ArgumentException in some machine #8826

Open

Description

@lindexi

Description

I'm sorry, this is not a good feedback issues, and I can not find the reproduction steps and machine. My users are reporting to me about app crashes with the exception:

System.ArgumentException: "{0}" must be greater than or equal to "{1}". (Parameter 'maximum'); 

   at System.Windows.Input.StylusPointPropertyInfo..ctor(StylusPointProperty stylusPointProperty, Int32 minimum, Int32 maximum, StylusPointPropertyUnit unit, Single resolution)
   at System.Windows.Input.PenContext.InitStylusPointDescription()
   at System.Windows.Input.PenContext.FirePenInRange(Int32 stylusPointerId, Int32[] data, Int32 timestamp)
   at System.Windows.Input.PenThreadWorker.FireEvent(PenContext penContext, Int32 evt, Int32 stylusPointerId, Int32 cPackets, Int32 cbPacket, IntPtr pPackets)
   at System.Windows.Input.PenThreadWorker.ThreadProc()
   at System.Threading.Thread.StartHelper.Callback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Thread.StartCallback(); 

Reference #7069 (comment) and #8435

Reproduction Steps

None. I will append any information I find in the future.

Expected behavior

Work well without exception.

Actual behavior

Throw the exception and the application crash

Regression?

No response

Known Workarounds

As the #8435 records.

Impact

No response

Configuration

No response

Other information

No response

Activity

  1. lindexi commented on Feb 20, 2024

    @lindexi
    MemberAuthor

    By the ways, I think the PenThreadWorker will crash the application when receive any exception, and how about we catch the exception and fallback to disable the touch?

  2. added
    Bug
    on Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚧 work in progressBug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions