1

I'm debugging a WinRT async method call which fails. How can I locate where the problem arises? I think this could be done by tracking where the error is firstly reported. Any clues? I'm using IDA Pro & VS 2013.

After deeply debugging I think I found where the error is fristly read - by the ntdll "NtGetCompleteWnfStateSubscription" undocomented function (you could check the linked question for more details about it). But I can't seek what function sets it. Also I can't debug the "NtGetCompleteWnfStateSubscription" function itself as it's a kernel one.

This is a more generic question. It's origin from this one.

Community
  • 1
  • 1
AnArrayOfFunctions
  • 3,452
  • 2
  • 29
  • 66
  • Set a breakpoint on `RoOriginateError`. Inproc components usually call this function at the point the error is generated. – Raymond Chen Sep 23 '14 at 23:03
  • Thanks for the advice. I set a breakpoint on this function but it seems that is called a way after "NtGetCompleteWnfStateSubscription" which was the function it seems really query the error. – AnArrayOfFunctions Sep 24 '14 at 09:29
  • So it seems it is actually called to report the recieved error but not to state for it from the WinRT method. – AnArrayOfFunctions Sep 27 '14 at 10:03

1 Answers1

0

What I usually do is I wrap an async call in a task using create_task() and in .then() lambda - call task.get() in a try-catch block. That gives me the exception.

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100