Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Upcoming OSR Seminars:

Writing WDF Drivers I: Core Concepts, Nashua, NH 15-19 May, 2017
Writing WDF Drivers II: Advanced Implementation Tech., Nashua, NH 23-26 May, 2017
Kernel Debugging and Crash Analysis, Dulles, VA 26-30 June, 2017
Windows Internals & Software Driver Development, Nashua, NH 24-28 July, 2017


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 7  
20 Apr 17 02:06
Neo
xxxxxx@gmail.com
Join Date: 23 Feb 2012
Posts To This List: 29
System reboots when WdfDpcEnqueue using NotMyFault

When .crash is used to create memory dump all is good but when NotMyFault.exe(From sysinternals) application is used then as soon as WdfDpcEnqueue() is invoked in the driver code the system reboots. Curious to know why the system rebooted when WdfDpcEnqueue() is invoked. In both the cases, this path is hit from BugCheck callback and called at HIGH_IRQL. From MSDN WdfDpcEnqueue() can be called from any IRQL. Checked the params passed to WdfDpcEnqueue() and are valid.
  Message 2 of 7  
20 Apr 17 05:25
Neo
xxxxxx@gmail.com
Join Date: 23 Feb 2012
Posts To This List: 29
System reboots when WdfDpcEnqueue using NotMyFault

I have assumed that this isn't posted and submitted, http://www.osronline.com/showthread.cfm?link=283289 Please close this.
  Message 3 of 7  
20 Apr 17 08:50
Mark Roddy
xxxxxx@gmail.com
Join Date: 25 Feb 2000
Posts To This List: 3946
System reboots when WdfDpcEnqueue using NotMyFault

Regardless of doc loopholes, your bugcheck callback should not call WdfDpcEnqueue. What do you think this call is going to accomplish? The system is not going to run any dpcs. The bugcheck code is all running at IRQ HIGH_LEVEL. No interrupts, no dpcs. If there is code in your dpc routine that you need to execute, you need to re-arrange your driver so that you can run that code from your bugcheck callback directly. As there is no way to synchronize with any other code running on any other processor, (all of which are not executing anymore anyway) you had better be able to get your device into a safe state from your bugcheck callback using register operations and polling mechanisms, or just forget about interacting with the device at all. Mark Roddy On Thu, Apr 20, 2017 at 5:23 AM, <xxxxx@gmail.com> wrote: > I have assumed that this isn't posted and submitted, > http://www.osronline.com/showthread.cfm?link=283289 > > Please close this. > > > --- > NTDEV is sponsored by OSR > > Visit the list online at: <http://www.osronline.com/ <...excess quoted lines suppressed...> --
  Message 4 of 7  
25 Apr 17 00:50
Neo
xxxxxx@gmail.com
Join Date: 23 Feb 2012
Posts To This List: 29
System reboots when WdfDpcEnqueue using NotMyFault

Hi Mark, I understood your points and fixed my code not calling WdfDpcEnqueue. The reason for my post is to know the probable reasons for the system reboots when the same code path at same IRQL is exercised with NotMyFault and why it completes collecting memory dump with .crash. Curiosity.
  Message 5 of 7  
25 Apr 17 00:53
Neo
xxxxxx@gmail.com
Join Date: 23 Feb 2012
Posts To This List: 29
System reboots when WdfDpcEnqueue using NotMyFault

There is a function xyz() which is called from many places in the driver, also the same function is invoked from the BugCheck callback function. Scenario A: - If the bugcheck happens by invoking .crash from the debugger. All is good. Which means the WdfDpcEnqueue() enqueues a dpc(of course which never never gets called) and the bugcheck call back continues. Scenario B: But, if the bugcheck is caused using NotMyFault application(from Sysinternals) then as soon as WdfDpcEnqueue() is executed the system reboots.(The bugcheck callback isn't completed) I am not able to understand the difference between scenario A & B for this different behavior. Also, WdfDpcEnqueue() can be called at any IRQ Level, but why the system rebooted when WdfDpcEnqueue() is executed ? Checked the validity of the DPC(parameter of WdfDpcEnqueue()) and it's valid.
  Message 6 of 7  
25 Apr 17 13:03
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11404
System reboots when WdfDpcEnqueue using NotMyFault

xxxxx@gmail.com wrote: > There is a function xyz() which is called from many places in the driver, also the same function is invoked from the BugCheck callback function. > > Scenario A: - If the bugcheck happens by invoking .crash from the debugger. All is good. Which means the WdfDpcEnqueue() enqueues a dpc(of course which never never gets called) and the bugcheck call back continues. > > Scenario B: But, if the bugcheck is caused using NotMyFault application(from Sysinternals) then as soon as WdfDpcEnqueue() is executed the system reboots.(The bugcheck callback isn't completed) > > I am not able to understand the difference between scenario A & B for this different behavior. Also, WdfDpcEnqueue() can be called at any IRQ Level, but why the system rebooted when WdfDpcEnqueue() is executed ? Honestly, the fundamental answer is "it doesn't matter". Your only action is "don't do that". The system does a bugcheck because the kernel is damaged. That's WHY the operating system is being killed -- the kernel and its data structures are in an inconsistent state. You can't do ANYTHING in a bugcheck handler that relies on intact kernel data structures. It might explode, it might not. The fact that it happens to work sometimes should not provide you any comfort. What you're doing is WRONG and you need to stop it. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 7 of 7  
26 Apr 17 03:10
Neo
xxxxxx@gmail.com
Join Date: 23 Feb 2012
Posts To This List: 29
System reboots when WdfDpcEnqueue using NotMyFault

Hi Tim, As i mentioned in earlier comment, i have fixed my code already. But only curios to know why .crash consistently never shows up this problem and with NotMyFault.exe it consistently fails. I understand your explanation of inconsistent kernel. Absolutely not looking for any solution. Just trying to see if anything new available to learn wrto this scenario.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 12:03.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license