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.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 9 April 2018

Writing WDF Drivers I: Core Concepts, Manchester, NH, 7 May 2018

Kernel Debugging & Crash Analysis for Windows, Manchester, NH, 21 May 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 8  
12 Apr 18 08:43
Paul Jackson
xxxxxx@gmail.com
Join Date: 15 Apr 2018
Posts To This List: 8
IoAcquireRemoveLock and Microsoft's toaster example

Hi guys, I'm new in the Windows drivers world, and I'm working on a fliter driver which is based on this toaster example: https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea08d519 a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c You can see that the IoAcquireRemoveLock function is used in most callbacks, such as this one: FilterDispatchPower, source: https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea08d519 a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c#L704-L710 But IoAcquireRemoveLock is not used when processing custom IOCTL-s, in the callback function FilterDispatchIo, source: https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea08d519 a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c#L969-L971 I wanted to know whether that's an omission of the example, or whether there's a reason behind it? Thanks.
  Message 2 of 8  
12 Apr 18 09:14
Don Burn
xxxxxx@windrvr.com
Join Date: 23 Feb 2011
Posts To This List: 1405
IoAcquireRemoveLock and Microsoft's toaster example

The real question is why are you mucking with the WDM sample? It is conditions like the one you cite that drove the development of KMDF, and for 99.99% of the filter drivers WDM should not be used. Don Burn Windows Driver Consulting Website: http://www.windrvr.com -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com Sent: Thursday, April 12, 2018 8:43 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: [ntdev] IoAcquireRemoveLock and Microsoft's toaster example Hi guys, I'm new in the Windows drivers world, and I'm working on a fliter driver which is based on this toaster example: https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea0 8d519a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c You can see that the IoAcquireRemoveLock function is used in most callbacks, such as this one: FilterDispatchPower, source: https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea0 8d519a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c# L704-L710 But IoAcquireRemoveLock is not used when processing custom IOCTL-s, in the callback function FilterDispatchIo, source: https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea0 8d519a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c# L969-L971 I wanted to know whether that's an omission of the example, or whether there's a reason behind it? Thanks. --- NTDEV is sponsored by OSR Visit the list online at: <http://www.osronline.com/showlists.cfm?list=ntdev> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <http://www.osr.com/seminars> To unsubscribe, visit the List Server section of OSR Online at <http://www.osronline.com/page.cfm?name=ListServer>
  Message 3 of 8  
12 Apr 18 09:33
Jamey Kirby
xxxxxx@gmail.com
Join Date: 31 Dec 2014
Posts To This List: 270
IoAcquireRemoveLock and Microsoft's toaster example

As a recent convert to KMDF, I second Don's post. Start using KMDF and you'll never have to worry about remove locks. On Thu, Apr 12, 2018 at 9:14 AM xxxxx@windrvr.com <xxxxx@lists.osr.com> wrote: > The real question is why are you mucking with the WDM sample? It is > conditions like the one you cite that drove the development of KMDF, and > for > 99.99% of the filter drivers WDM should not be used. > > > Don Burn > Windows Driver Consulting > Website: http://www.windrvr.com > <...excess quoted lines suppressed...> --
  Message 4 of 8  
12 Apr 18 12:58
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11894
IoAcquireRemoveLock and Microsoft's toaster example

xxxxx@gmail.com wrote: > I'm new in the Windows drivers world, and I'm working on a fliter driver which is based on this toaster example: > https://github.com/ljvblfz/WindowsServer2003DDKFiles/blob/3d85bdfeaea192aea08d519 a32e1da9b89cda8b9/WINDDK/3790.1830/src/general/toaster/filter/filter.c Did you really not notice that this sample is 13 years old?  It is an antique.  Development tools don't age like wine, they age like milk. It's also illegal for that person to have posted the entire Windows 2003 DDK in public.   > I wanted to know whether that's an omission of the example, or whether there's a reason behind it? The reason is that you shouldn't be looking at antiques.  Those problems have been fixed in the 8 or 9 major WDK releases since then.  The current WDK is free, and the current authorized and modernized Microsoft samples are also freely available on GitHub:     https://github.com/Microsoft/Windows-driver-samples/ -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 5 of 8  
12 Apr 18 14:42
Peter Viscarola (OSR)
xxxxxx@osr.com
Join Date:
Posts To This List: 6130
List Moderator
IoAcquireRemoveLock and Microsoft's toaster example

<quote> The reason is that you shouldn't be looking at antiques. Those problems have been fixed in the 8 or 9 major WDK releases since then. The current WDK is free, and the current authorized and modernized Microsoft samples are also freely available on GitHub: https://github.com/Microsoft/Windows-driver-samples/ </quote> Candidate for Post Of The Week right there. STRONG candidate... Peter OSR @OSRDrivers
  Message 6 of 8  
12 Apr 18 17:16
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3233
IoAcquireRemoveLock and Microsoft's toaster example

Usermode IOCTLs (and Read/Write) take the remove lock on the whole stack. The stack will not get IRP_MN_REMOVE_DEVICE while there is any usermode I/O pending on it. Only QUERY_REMOVE will get through. SURPRISE_REMOVAL will, as well.
  Message 7 of 8  
15 Apr 18 04:22
Paul Jackson
xxxxxx@gmail.com
Join Date: 15 Apr 2018
Posts To This List: 8
IoAcquireRemoveLock and Microsoft's toaster example

Thank you guys, I will check out KMDF. The reason I was looking at the old example is that I found code which does what I need (working with webcams), and it was based on that example.
  Message 8 of 8  
16 Apr 18 05:45
maik peterson
xxxxxx@googlemail.com
Join Date: 17 Nov 2016
Posts To This List: 5
IoAcquireRemoveLock and Microsoft's toaster example

> ...Development tools don't age like wine, they age like milk. > > oh man, the best comment ever ! --
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 08:26.


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