Minidriver Flow of Control

Minidriver Flow of Control

The following set of steps is typically followed in initializing, using, and uninitializing streaming minidrivers. The following referenced commands and structures are described elsewhere in this documentation.

The steps followed in initializing, using, and uninitializing streaming minidrivers are
  1. The hardware adapter supported by the minidriver is detected by the Plug and Play enumerator. The enumerator checks the registry to resolve any symbolic references and passes the request to the I/O subsystem.
  2. The I/O subsystem loads the minidriver and calls the minidriver's DriverEntry routine (see DriverEntry for Stream Class Minidrivers) where a HW_INITIALIZATION_DATA structure is allocated and initialized. A file object is created from the information in the DriverEntry routine.
  3. The minidriver's DriverEntry routine then calls the stream class driver's StreamClassRegisterMinidriver function and passes the HW_INITIALIZATION_DATA structure as a parameter. The HW_INITIALIZATION_DATA structure includes the addresses of minidriver functions that handle SRBs. This allows the minidriver to respond to SRBs sent by the class driver.
  4. During initialization, the stream class driver calls the function specified in the HW_INITIALIZATION_DATA structure's HwReceivePacket member (see StrMiniReceiveDevicePacket) with and SRB with the Command member set to SRB_INITIALIZE_DEVICE. The minidriver then initializes the hardware adapter.
  5. The stream class driver calls the function specified in the HW_INITIALIZATION_DATA structure's HwReceivePacket member with SRB_GET_STREAM_INFO. The minidriver then returns information on the streams it supports.
  6. The stream class driver calls the function specified in the HW_INITIALIZATION_DATA structure's HwReceivePacket member with SRB_OPEN_STREAM, with a HW_STREAM_OBJECT structure. The minidriver performs the necessary hardware action to open the specified stream.
  7. The stream class driver sends or requests data from the stream by passing a SRB_READ_DATA or SRB_WRITE_DATA command to the function specified in the ReceiveDataPacket member of the HW_STREAM_OBJECT structure for the stream.
  8. The stream class driver gets and sets properties and other control information for the stream by passing the appropriate stream request block (HW_STREAM_REQUEST_BLOCK) to the function specified in the ReceiveControlPacket member of the HW_STREAM_OBJECT structure for the stream.
  9. When the system is through using a stream, the stream class driver calls the function specified in the HW_INITIALIZATION_DATA structure's HwReceivePacket member with SRB_CLOSE_STREAM. The minidriver then closes the specified stream.
  10. When it is time to uninitialize the adapter, the stream class driver calls the function specified in the HW_INITIALIZATION_DATA structure's HwReceivePacket member with SRB_UNINITIALIZE_DEVICE. The minidriver then uninitializes the device.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值