Microsoft KB Archive/262434

{|
 * width="100%"|

PRB: Errata for the Toaster Sample

 * }

Q262434

-

The information in this article applies to:


 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Professional
 * Microsoft Windows 2000 Driver Development Kit (DDK)

-

SYMPTOMS
This article lists the bugs and the bug fixes for the Toaster sample that is included with Microsoft Windows 2000 and the WinHEC update of the DDK. The sample is located in the Src\General\Toaster folder. To learn more about the sample, see the following Web address:

"http://www.microsoft.com/ddk/ddkdocs/win2K/toaster.htm"

RESOLUTION
These bug are fixed in the Windows 2000 SP1 DDK.

MORE INFORMATION
  File: func\toaster.c

Line No: 1628 - 1661

Fix: The following lines of the ToasterProcessQueuedRequests routine:        nextIrp = CONTAINING_RECORD(listEntry, IRP, Tail.Overlay.ListEntry);

//        // Check to see if it's already cancelled. //        if (nextIrp->Cancel) {           if(IoSetCancelRoutine (nextIrp, NULL)) {                           //                 // This IRP was just cancelled but the cancel routine // has not been called yet. So it's safe to cancel the IRP, // Let's queue the IRP in the cancelledIrp list and complete // them after releasing the lock. This is to ensure that // we don't call out of the driver while holding a lock. //

InsertTailList(&cancelledIrpList, listEntry); } else { //                // The cancel routine has run but it must be waiting to hold // the queue lock. It will cancel the IRP as soon as we                // drop the lock. So initialize the IRPs // listEntry so that the cancel routine wouldn't barf // when it tries to remove the IRP from the queue. //                InitializeListHead(listEntry); }

KeReleaseSpinLock(&FdoData->QueueLock, oldIrql); }       else {           IoSetCancelRoutine (nextIrp, NULL); //            // Release the lock before we call out of the driver //

KeReleaseSpinLock(&FdoData->QueueLock, oldIrql); should be replaced with:        PVOID               cancelRoutine= NULL; // declare this at the beginning of the procedure.

nextIrp = CONTAINING_RECORD(listEntry, IRP, Tail.Overlay.ListEntry);

//        // Set the cancel routine to NULL. This is an atomic operation. //        cancelRoutine = IoSetCancelRoutine (nextIrp, NULL); //        // Check to see if it's already cancelled. //        if (nextIrp->Cancel) {           //             // The I/O manager sets the CancelRoutine pointer in the IRP // to NULL before calling the routine. So check the previous // value to decide whether the cancel routine has been // called or not. //            if(cancelRoutine) {                           //                 // This IRP was just cancelled but the cancel routine // hasn't been called yet. So it's safe to cancel the IRP, // Let's queue the IRP in the cancelledIrp list and complete // them after releasing the lock. This is to ensure that // we don't call out of the driver while holding a lock. //

InsertTailList(&cancelledIrpList, listEntry); } else { //                // The cancel routine has run but it must be waiting to hold // the queue lock. It will cancel the IRP as soon as we                // drop the lock. So initialize the IRPs // listEntry so that the cancel routine wouldn't barf // when it tries to remove the IRP from the queue. //                InitializeListHead(listEntry); }

KeReleaseSpinLock(&FdoData->QueueLock, oldIrql); }       else {           //             // Release the lock before we call out of the driver //

KeReleaseSpinLock(&FdoData->QueueLock, oldIrql);   File: toastmon\toastmon.inf

Line No: 62 ServiceBinary = %12%\genport.sys should be replaced with: ServiceBinary = %12%\toastmon.sys   The Notify sample was re-written to fix some of the bugs associated with using arrays to store device information.

To obtain the updated file, see the following article in the Microsoft Knowledge Base: "Q263832 FILE: Notify.exe Application Sample for Windows 2000" Install the source file over the existing Notify sample located in the Src\Toaster\Exe\Notify folder.

NOTE: The Notify sample was added to the WinHec update of the DDK. 

Additional query words:

Keywords : kbDDK kbKMode kbOSWin2000 kbOSWin2000bug kbOSWin2000fix kbPlugPlay _IK kbGrpDSNTDDK kbWDM

Issue type : kbprb

Technology : kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Serv kbwin2000ServSearch kbwin2000Search kbwin2000ProSearch kbwin2000Pro kbwin2000DDK kbAudDeveloper kbWinDDKSearch kbWinAdvServSearch