toaster sample package eliyas yakub windows nt ® ddk support engineer developer support microsoft...
TRANSCRIPT
Toaster Sample PackageToaster Sample Package
Eliyas YakubEliyas Yakub Windows NTWindows NT®® DDK Support Engineer DDK Support EngineerDeveloper SupportDeveloper SupportMicrosoft CorporationMicrosoft Corporation
AgendaAgenda
Introduce various components of Introduce various components of Toaster Sample PackageToaster Sample Package
Describe how the sample was Describe how the sample was implemented by highlighting implemented by highlighting core componentscore components
Package LayoutPackage Layout
Located under NTDDK\SRC\GENERAL\TOASTERLocated under NTDDK\SRC\GENERAL\TOASTER
Objectives Of The SampleObjectives Of The Sample
De-mystify WindowsDe-mystify Windows®® Driver Model Driver Model Through the use of sample code Through the use of sample code
demonstrate how to develop:demonstrate how to develop: Bus DriverBus Driver Function DriverFunction Driver Filter Drivers (Class & Device)Filter Drivers (Class & Device) Coinstaller DLLCoinstaller DLL Power ManagementPower Management WMIWMI Plug and Play Notification in user-mode and Plug and Play Notification in user-mode and
kernel-modekernel-mode
What Is Toaster BusWhat Is Toaster Bus
Hypothetical bus for toaster devicesHypothetical bus for toaster devices Simulates hot plug-in, unplug, and Simulates hot plug-in, unplug, and
eject toasters deviceseject toasters devices Toasters support power managementToasters support power management Defines a new “Toaster” device class Defines a new “Toaster” device class
Bus Driver (BusEnum.sys)Bus Driver (BusEnum.sys)
Dual personality driverDual personality driver Use bus.inf and busf.inf to install Use bus.inf and busf.inf to install
through the Add HW Wizardthrough the Add HW Wizard System root enumerates the bus driverSystem root enumerates the bus driver DriverEntry() DriverEntry()
Sets dispatch pointsSets dispatch points AddDevice()AddDevice()
Creates FDO and attaches it to the PDO Creates FDO and attaches it to the PDO provided by the Plug and Play managerprovided by the Plug and Play manager
Bus DriverBus Driver
Registers Registers GUID_TOASTER_BUS_ENUMERATOR_INTERFACGUID_TOASTER_BUS_ENUMERATOR_INTERFACE_CLASSE_CLASS interface interface
Driver typically handles following IRPs:Driver typically handles following IRPs: IRP_MN_FILTER_RESOURCE_REQUIREMENTSIRP_MN_FILTER_RESOURCE_REQUIREMENTS IRP_MN_START_DEVICEIRP_MN_START_DEVICE IRP_MN_QUERY_CAPABILITIESIRP_MN_QUERY_CAPABILITIES IRP_MN_QUERY_PNP_DEVICE_STATEIRP_MN_QUERY_PNP_DEVICE_STATE IRP_MN_QUERY_DEVICE_RELATIONS IRP_MN_QUERY_DEVICE_RELATIONS
(BusRelations)(BusRelations) This is not a complete list. Drivers shouldn’t This is not a complete list. Drivers shouldn’t
make any assumptions about the order of make any assumptions about the order of these IRPsthese IRPs
Plug In A Device Plug In A Device
Simulating Plug-In Of New Simulating Plug-In Of New Toaster DeviceToaster Device Application opens the interface Application opens the interface
registered by BusEnumregistered by BusEnum Application sends Application sends
IOCTL_BUSENUM_PLUGIN_HARDWARE IOCTL_BUSENUM_PLUGIN_HARDWARE Provides Serial Number and HW ID Provides Serial Number and HW ID
of the deviceof the device
Plug-InPlug-In
BusEnum creates a DeviceObject BusEnum creates a DeviceObject (PDO) for the new device(PDO) for the new device
Initializes device extensionInitializes device extension Present = TRUE;Present = TRUE; ReportedMissing = FALSE;ReportedMissing = FALSE;
BusEnum notifies Plug and Play BusEnum notifies Plug and Play manager manager Calls IoInvalidateDeviceRelations() Calls IoInvalidateDeviceRelations()
with BusRelations parameterwith BusRelations parameter
Plug-InPlug-In
Plug and Play manager sends Plug and Play manager sends IRP_MN_QUERY_DEVICE_RELATIONS IRP_MN_QUERY_DEVICE_RELATIONS to BusEnum’s FDOto BusEnum’s FDO
The BusEnum returns a list of The BusEnum returns a list of PDO pointersPDO pointers
Plug and Play manager starts Plug and Play manager starts enumeration after discovering PDO for enumeration after discovering PDO for the new Toaster devicethe new Toaster device
Plug-InPlug-In
Plug and Play manager sends following IRPs to the Plug and Play manager sends following IRPs to the new PDO to learn more about the device:new PDO to learn more about the device: IRP_MN_QUERY_ID (BusQueryDeviceID)IRP_MN_QUERY_ID (BusQueryDeviceID) IRP_MN_QUERY_CAPABILITIESIRP_MN_QUERY_CAPABILITIES IRP_MN_QUERY_DEVICE_TEXT (Description)IRP_MN_QUERY_DEVICE_TEXT (Description) IRP_MN_QUERY_DEVICE_TEXT (Location)IRP_MN_QUERY_DEVICE_TEXT (Location) IRP_MN_QUERY_ID (BusInstanceID)IRP_MN_QUERY_ID (BusInstanceID) IRP_MN_QUERY_ID (BusQueryHardwareIDs)IRP_MN_QUERY_ID (BusQueryHardwareIDs) IRP_MN_QUERY_ID (BusQueryCompatibleIDs)IRP_MN_QUERY_ID (BusQueryCompatibleIDs) IRP_MN_QUERY_RESOURCE_REQUIREMENTSIRP_MN_QUERY_RESOURCE_REQUIREMENTS IRP_MN_QUERY_BUS_INFORMATIONIRP_MN_QUERY_BUS_INFORMATION IRP_MN_QUERY_RESOURCESIRP_MN_QUERY_RESOURCES
Plug-InPlug-In
Plug and Play loads the toaster.sys Plug and Play loads the toaster.sys function driverfunction driver Matches the Device ID in toaster.infMatches the Device ID in toaster.inf Loads the function Driver (toaster.sys)Loads the function Driver (toaster.sys) Calls AddDevice in toaster.sysCalls AddDevice in toaster.sys Function driver handles following Plug and Function driver handles following Plug and
Play IRPs:Play IRPs: IRP_MN_FILTER_RESOURCE_REQUIREMENTSIRP_MN_FILTER_RESOURCE_REQUIREMENTS IRP_MN_QUERY_INTERFACEIRP_MN_QUERY_INTERFACE IRP_MN_START_DEVICEIRP_MN_START_DEVICE IRP_MN_QUERY_CAPABILITIESIRP_MN_QUERY_CAPABILITIES IRP_MN_QUERY_PNP_DEVICE_STATEIRP_MN_QUERY_PNP_DEVICE_STATE
Notify.exeNotify.exe
FDOFDOPDOPDO
Toast.exeToast.exe
FDOFDO
BusEnum.sysBusEnum.sys
Toaster.sysToaster.sys
Plug and Play Plug and Play ManagerManager
PDOPDO. . . . . . . . .. . . . . . . . .PDOPDO FDOFDO
Diagram Of Single Toaster DeviceDiagram Of Single Toaster Device
Notify.exeNotify.exe
FDOFDOPDOPDO PDOPDO
FDOFDO
Toast.exeToast.exe
PDOPDO
FDOFDO
BusEnum.sysBusEnum.sys
Toaster.sysToaster.sys
Plug and Play ManagerPlug and Play Manager PDOPDO. . . . . . . . .. . . . . . . . . PDOPDO
Diagram Of Two Toaster DevicesDiagram Of Two Toaster Devices
Unplug A DeviceUnplug A Device
Application sends an Application sends an IOCTL_BUSENUM_UNPLUG_IOCTL_BUSENUM_UNPLUG_HARDWARE with the Serial NumberHARDWARE with the Serial Number
BusEnum marks the device as BusEnum marks the device as not presentnot present Present = FALSE;Present = FALSE;
BusEnum informs Plug and Play manager BusEnum informs Plug and Play manager by calling IoInvalidateDeviceRelations()by calling IoInvalidateDeviceRelations()
Plug and Play manager sends Plug and Play manager sends IRP_MN_QUERY_DEVICE_RELATIONSIRP_MN_QUERY_DEVICE_RELATIONS
BusEnum does not include the unplugged BusEnum does not include the unplugged PDO in list of PDOsPDO in list of PDOs
UnPlugUnPlug
Set the ReportedMissing to TRUESet the ReportedMissing to TRUE ReportedMissing = TRUE;ReportedMissing = TRUE;
The Plug and Play manager sends:The Plug and Play manager sends: IRP_MN_SURPRISE_REMOVALIRP_MN_SURPRISE_REMOVAL IRP_MN_REMOVE_DEVICEIRP_MN_REMOVE_DEVICE
Function driver detaches and deletes Function driver detaches and deletes its device objectits device object
Busenum deletes the PDO after Busenum deletes the PDO after receiving IRP_MN_REMOVE_DEVICEreceiving IRP_MN_REMOVE_DEVICE
Eject A DeviceEject A Device
User Application sends User Application sends IOCTL_BUSENUM_EJECT_HARDWIOCTL_BUSENUM_EJECT_HARDWARE with the Serial NumberARE with the Serial Number
BusEnum calls BusEnum calls IoRequestDeviceEject IoRequestDeviceEject
The Plug and Play manager sends: The Plug and Play manager sends: IRP_MN_QUERY_REMOVALIRP_MN_QUERY_REMOVAL IRP_MN_REMOVE_DEVICEIRP_MN_REMOVE_DEVICE
EjectEject
Plug and Play manager sends Plug and Play manager sends IRP_MN_EJECT IRP_MN_EJECT
set the Present = FALSE;set the Present = FALSE; IRP_MN_QUERY_DEVICE_RELATIONIRP_MN_QUERY_DEVICE_RELATION
S (BusRelations)S (BusRelations)
set the ReportedMissing = TRUE;set the ReportedMissing = TRUE; IRP_MN_REMOVE_DEVICEIRP_MN_REMOVE_DEVICE
Device Plug And Play StateDevice Plug And Play Statetypedef enum _DEVICE_PNP_STATE {typedef enum _DEVICE_PNP_STATE {
NotStarted = 0,NotStarted = 0, // Not started yet// Not started yet
Started, Started, // Device has received the START_DEVICE IRP// Device has received the START_DEVICE IRP
StopPending,StopPending, // Device has received the QUERY_STOP IRP// Device has received the QUERY_STOP IRP
Stopped, Stopped, // Device has received the STOP_DEVICE IRP// Device has received the STOP_DEVICE IRP
RemovePending, RemovePending, // Device has received the QUERY_REMOVE IRP// Device has received the QUERY_REMOVE IRP
SurpriseRemovePending, // Device has received the SURPRISE_REMOVE IRPSurpriseRemovePending, // Device has received the SURPRISE_REMOVE IRP
Deleted Deleted // Device has received the REMOVE_DEVICE IRP// Device has received the REMOVE_DEVICE IRP
} DEVICE_PNP_STATE;} DEVICE_PNP_STATE;
Notice the use of following macros:Notice the use of following macros: INITIALIZE_PNP_STATEINITIALIZE_PNP_STATE SET_NEW_PNP_STATESET_NEW_PNP_STATE RESTORE_PREVIOUS_PNP_STATERESTORE_PREVIOUS_PNP_STATE
PDO DeletionPDO Deletion
Bus drivers must delete the PDO only after Bus drivers must delete the PDO only after device is physically removeddevice is physically removed Surprise removalSurprise removal
After receiving IRP_MN_REMOVE_DEVICEAfter receiving IRP_MN_REMOVE_DEVICE
EjectingEjecting After receiving the second IRP_MN_REMOVE_DEVICE After receiving the second IRP_MN_REMOVE_DEVICE During ejection Plug and Play manager sends During ejection Plug and Play manager sends
QUERY_REMOVE, REMOVE, EJECT QUERY_REMOVE, REMOVE, EJECT QUERY_DEVICE_RELATIONS, REMOVEQUERY_DEVICE_RELATIONS, REMOVE
Second IRP_MN_REMOVE_DEVICE is sent in Second IRP_MN_REMOVE_DEVICE is sent in response to missing PDO returned with response to missing PDO returned with QUERY_DEVICE_RELATIONS IRP QUERY_DEVICE_RELATIONS IRP
PDO DeletionPDO Deletion
Delete all children PDOs when bus is Delete all children PDOs when bus is removed or disabledremoved or disabled EXCEPTION: Do NOT delete PDOs in the EXCEPTION: Do NOT delete PDOs in the
process of being surprised removedprocess of being surprised removed Do NOT delete PDO when Do NOT delete PDO when
device is disableddevice is disabled BUS Driver will receive QUERY_REMOVE / BUS Driver will receive QUERY_REMOVE /
REMOVE IRPs when device is disabledREMOVE IRPs when device is disabled Do not delete the PDO because the device Do not delete the PDO because the device
is still presentis still present
Function Driver (toaster.sys)Function Driver (toaster.sys)
Demonstrates:Demonstrates: Plug and Play handlingPlug and Play handling Power management by acting as a Power management by acting as a
power policy owner of the devicepower policy owner of the device WMIWMI IRP Queuing, Cancel and IRP Queuing, Cancel and
Cleanup techniquesCleanup techniques Demonstrates the use of Demonstrates the use of
IoInValidateDeviceState() to hide IoInValidateDeviceState() to hide your deviceyour device
INF FilesINF Files
Bus.inf: For the bus driverBus.inf: For the bus driver Toaster.inf: For the function driverToaster.inf: For the function driver Busf.inf: Bus driver with upper and Busf.inf: Bus driver with upper and
lower device filterslower device filters Toasterf.inf: Function driver with Toasterf.inf: Function driver with
lower and upper device and lower and upper device and class filtersclass filters
Toastco.inf: Installs function driver Toastco.inf: Installs function driver and a coinstaller dlland a coinstaller dll
Filter.inf: Installs a device upper Filter.inf: Installs a device upper filter for the toaster device using filter for the toaster device using Update DriverUpdate Driver
Filter DriversFilter Drivers
A single source file is used to generate A single source file is used to generate six different filter drivers:six different filter drivers: Devupper.sysDevupper.sys Devlower.sysDevlower.sys Clasupper.sysClasupper.sys Claslower.sysClaslower.sys BFdoLwr.sysBFdoLwr.sys BFdoUpr.sysBFdoUpr.sys
To load all the filters you should use busf.inf To load all the filters you should use busf.inf to install the enumerator and use toasterf.inf to install the enumerator and use toasterf.inf to install device and class filtersto install device and class filters
Device Filters InstallationDevice Filters Installation
Use DDInstall.HW sections in the INF file to Use DDInstall.HW sections in the INF file to install filtersinstall filters [Toaster_Device.NT.HW.AddReg][Toaster_Device.NT.HW.AddReg] HKR,,"UpperFilters",0x00010000,"devupper"HKR,,"UpperFilters",0x00010000,"devupper" HKR,,"LowerFilters",0x00010000,"devlower"HKR,,"LowerFilters",0x00010000,"devlower"
These sections adds above registry values These sections adds above registry values under the device hardware keyunder the device hardware key HKLM\System\CurrentControlSet\Enum\MsToaster\HKLM\System\CurrentControlSet\Enum\MsToaster\
1&1a590e2c&1&011&1a590e2c&1&01 UpperFilters:REG_MULTI_SZ:DevupperUpperFilters:REG_MULTI_SZ:Devupper LowerFilters:REG_MULTI_SZ:DevlowerLowerFilters:REG_MULTI_SZ:Devlower
Enum.exeEnum.exe
FDOFDOPDOPDO
Toast.exeToast.exe
FiDOFiDO
BusEnum.sysBusEnum.sys
Toaster.sysToaster.sys
Plug and Play ManagerPlug and Play Manager
FDOFDO
FiDOFiDO
DevUpper.sysDevUpper.sys
DevLower.sysDevLower.sys
PDOPDOPDOPDOFDOFDO
Toaster Stack Toaster Stack With Device With Device FiltersFilters
Class FiltersClass Filters
Class filters are specified adding Class filters are specified adding UpperFilters or LowerFilters name UpperFilters or LowerFilters name value under the class keyvalue under the class keyHKLM\System\CurrentControlSet\HKLM\System\CurrentControlSet\
Control\Class\{B85B7C50-6A01-11d2-Control\Class\{B85B7C50-6A01-11d2-B841-00C04FAD5171}B841-00C04FAD5171}UpperFilters:REG_MULTI_SZ:ClasupperUpperFilters:REG_MULTI_SZ:Clasupper
LowerFilters:REG_MULTI_SZ:ClaslowerLowerFilters:REG_MULTI_SZ:Claslower
Enum.exeEnum.exe
FDOFDOPDOPDO PDOPDO
Toast.exeToast.exe
FiDOFiDO FiDOFiDO
BusEnum.sysBusEnum.sys
Toaster.sysToaster.sys
Plug and Play ManagerPlug and Play Manager
FDOFDO FDOFDO
FiDOFiDO FiDOFiDO
DevUpper.sysDevUpper.sys
DevLower.sysDevLower.sys FiDOFiDO FiDOFiDO
FiDOFiDO FiDOFiDO
ClasLower.sysClasLower.sys
ClasUpper.sysClasUpper.sys
PDOPDOPDOPDOFDOFDO
Co-InstallerCo-Installer
Loaded whenever a toaster device Loaded whenever a toaster device is installed or removedis installed or removed
Shows how to process custom Shows how to process custom sections in an INF filesections in an INF file
Shows how to create a friendly nameShows how to create a friendly name
Notify ApplicationNotify Application
Simulates plug in, unplug, and Simulates plug in, unplug, and ejection of devicesejection of devices
Demonstrates how applications Demonstrates how applications monitor and process user-mode monitor and process user-mode Plug and Play notificationsPlug and Play notifications
Combines the functionality of Combines the functionality of Enum.exe and toast.exe Enum.exe and toast.exe
Notify ApplicationNotify Application
Register for Interface Register for Interface Change NotificationChange Notification
DEV_BROADCAST_DEVICEINTERFACE filter;DEV_BROADCAST_DEVICEINTERFACE filter;
filter.dbcc_size = sizeof(filter);filter.dbcc_size = sizeof(filter);filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
filter.dbcc_classguid = InterfaceGuid;filter.dbcc_classguid = InterfaceGuid;
hInterfaceNotification = RegisterDeviceNotification(hWnd, hInterfaceNotification = RegisterDeviceNotification(hWnd, &filter, 0);&filter, 0);
Handles Plug and Play notificationsHandles Plug and Play notifications DBT_DEVICEARRIVALDBT_DEVICEARRIVAL DBT_DEVICEREMOVECOMPLETEDBT_DEVICEREMOVECOMPLETE
Notify ApplicationNotify Application
Open a toster device and register Open a toster device and register another notification on the file handleanother notification on the file handle filter.dbch_size = sizeof(filter);filter.dbch_size = sizeof(filter);
filter.dbch_devicetype = DBT_DEVTYP_HANDLE;filter.dbch_devicetype = DBT_DEVTYP_HANDLE; filter.dbch_handle = DeviceInfo[NumDevices].hDevice;filter.dbch_handle = DeviceInfo[NumDevices].hDevice; DeviceInfo[NumDevices].hHandleNotification = DeviceInfo[NumDevices].hHandleNotification =
RegisterDeviceNotification(hWnd, RegisterDeviceNotification(hWnd, &filter, 0);&filter, 0);
Handle Device Change NotificationHandle Device Change Notification DBT_DEVICEQUERYREMOVEDBT_DEVICEQUERYREMOVE DBT_DEVICEREMOVECOMPLETEDBT_DEVICEREMOVECOMPLETE DBT_DEVICEREMOVEPENDINGDBT_DEVICEREMOVEPENDING DBT_DEVICEQUERYREMOVEFAILEDDBT_DEVICEQUERYREMOVEFAILED
ToastMonToastMon
Demonstrates how drivers monitor Demonstrates how drivers monitor Plug and Play events of arbitrary Plug and Play events of arbitrary devicesdevices Example: monitors a non-Plug and Example: monitors a non-Plug and
Play serial devicePlay serial device Uses kernel-mode Plug and Play Uses kernel-mode Plug and Play
notificationnotification Use toatmon.inf to install the driver Use toatmon.inf to install the driver
through root enumerationthrough root enumeration
ToastMonToastMon
Register for interface arrival Register for interface arrival notification in AddDevicenotification in AddDevice
status = IoRegisterPlugPlayNotification ( status = IoRegisterPlugPlayNotification ( EventCategoryDeviceInterfaceChange, EventCategoryDeviceInterfaceChange,
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_ INTERFACES, INTERFACES,
(PVOID)&GUID_TOASTER_DEVICE_INTERFACE_CLASS(PVOID)&GUID_TOASTER_DEVICE_INTERFACE_CLASSDriverObject, DriverObject,
(PDRIVER_NOTIFICATION_CALLBACK_ROUTINE) (PDRIVER_NOTIFICATION_CALLBACK_ROUTINE) ToastMon_PnpNotifyInterfaceChange, ToastMon_PnpNotifyInterfaceChange,(PVOID)deviceExtension,(PVOID)deviceExtension,&deviceExtension->NotificationHandle);&deviceExtension->NotificationHandle);
Open the device in response to Open the device in response to GUID_TOASTER_DEVICE_INTERFACE_CLASSGUID_TOASTER_DEVICE_INTERFACE_CLASS notification callbacknotification callback
ToastMon ToastMon
Careful coding required in Careful coding required in notification callbacknotification callback Do NOT open interface that can cause Do NOT open interface that can cause
Plug and Play eventPlug and Play event Example: SWENUMExample: SWENUM Doing so can cause deadlockDoing so can cause deadlock
ToastMonToastMon
Register for Device change notification on Register for Device change notification on the FileObjectthe FileObject
IoRegisterPlugPlayNotification ( IoRegisterPlugPlayNotification ( EventCategoryTargetDeviceChange,EventCategoryTargetDeviceChange,
0,0,(PVOID)List->FileObject,(PVOID)List->FileObject,List->DeviceExtension->List->DeviceExtension-> DeviceObject->DriverObject, DeviceObject->DriverObject,
(PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)ToastMon_PnpNotifyDeviceChange, ToastMon_PnpNotifyDeviceChange, (PVOID)List, (PVOID)List,
&List->NotificationHandle);&List->NotificationHandle);
Handle Notification Callback Events For:Handle Notification Callback Events For:GUID_TARGET_DEVICE_QUERY_REMOVEGUID_TARGET_DEVICE_QUERY_REMOVEGUID_TARGET_DEVICE_REMOVE_COMPLETEGUID_TARGET_DEVICE_REMOVE_COMPLETEGUID_TARGET_DEVICE_REMOVE_CANCELLEDGUID_TARGET_DEVICE_REMOVE_CANCELLED
Setup Class GUIDSetup Class GUID
Setup class GUID is specified in Setup class GUID is specified in the INF filethe INF file
[Version][Version]Signature="$WINDOWS NT$“Signature="$WINDOWS NT$“Class=TOASTERClass=TOASTERClassGuid={B85B7C50-6A01-11d2-ClassGuid={B85B7C50-6A01-11d2-B841-00C04FAD5171}B841-00C04FAD5171}
All the system defined GUIDs are listed All the system defined GUIDs are listed in in DEVGUID.HDEVGUID.H
Interface Class GUIDInterface Class GUID
Interface GUIDs are used to interact Interface GUIDs are used to interact with the driverwith the driver Registered in AddDeviceRegistered in AddDevice Enabled during StartEnabled during Start Disabled during RemoveDisabled during Remove
Are defined in device specific header files Are defined in device specific header files under the NTDDK\INC directoryunder the NTDDK\INC directory Examples:Examples:
ntdd8042.h, ntddbeep.h, ntddcdrm.h, ntdddisk.h, ntdd8042.h, ntddbeep.h, ntddcdrm.h, ntdddisk.h, ntddft.h, ntddft2.h, ntddkbd.h, ntddmou.h, ntddft.h, ntddft2.h, ntddkbd.h, ntddmou.h, ntddndis.h, ntddpar.h, ntddpcm.h, ntddscsi.h, ntddndis.h, ntddpar.h, ntddpcm.h, ntddscsi.h, ntddser.h, ntddstor.h, ntddtdi.h, ntddvol.hntddser.h, ntddstor.h, ntddtdi.h, ntddvol.h
Call To ActionCall To Action
Study the toaster sample to learn how Study the toaster sample to learn how all the components of a device all the components of a device stack fit togetherstack fit together Sample complements the Sample complements the
DDK documentation DDK documentation Contains extensive internal documentation Contains extensive internal documentation
E-mail me E-mail me (([email protected]@microsoft.com)) with with questions regarding the samplequestions regarding the sample
ErrataErrata
In Line 63, the driver name should be In Line 63, the driver name should be toastmon.sys instead of genport.systoastmon.sys instead of genport.sys
In the toaster.c of function driver In the toaster.c of function driver the line the line
IoSetCancelRoutine(nextIrp, Null) IoSetCancelRoutine(nextIrp, Null) should be replace by should be replace by
If(IoSetCancelRoutine(nextIrp, Null) )If(IoSetCancelRoutine(nextIrp, Null) ) {{
KeReleaseSpinlock();KeReleaseSpinlock(); Continue;Continue;
} }