Note : WDK Kernel Mode fundamental

Windows Driver Kit: Kernel-Mode Driver Architecture

Introduction to Standard Driver Routines

http://msdn.microsoft.com/en-us/library/ms794996.aspx

最基本的需要實做出來的函式

  • DriverEntry, Initializes the driver and its driver object. 初始化驅動程式與他的驅動物件
  • AddDevice, Initializes devices and creates device objects. 初始化裝置與建立裝置物件
  • Dispatch Routines, Receive and process IRPs. 接收與處理 IRPs (I/O Request Packet)
  • Unload, Release system resources acquired by the driver. 釋放這個驅動程式已經取得的系統資源

Dispatch Routines, 在 DriverEntry 裡面初始化 Driver Object 的相關function pointer,

Required Dispatch Routines

Most drivers must handle the following Dispatch routines:

DispatchPnP

DispatchPower

DispatchCreate

DispatchClose

DispatchRead

DispatchWrite

DispatchDeviceControl

DispatchInternalDeviceControl

DispatchSystemControl

Drivers handle IRPs set with some or all of the following major function codes:

IRP_MJ_CREATE

IRP_MJ_PNP

IRP_MJ_POWER

IRP_MJ_READ

IRP_MJ_WRITE

IRP_MJ_FLUSH_BUFFERS

IRP_MJ_QUERY_INFORMATION

IRP_MJ_SET_INFORMATION

IRP_MJ_DEVICE_CONTROL

IRP_MJ_INTERNAL_DEVICE_CONTROL

IRP_MJ_SYSTEM_CONTROL

IRP_MJ_CLEANUP

IRP_MJ_CLOSE

IRP_MJ_SHUTDOWN

廣告

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

%d 位部落客按了讚: