Stream Interface is appropriate for any I/O device that produces or consumes streams of data.
Stream Driver is a DLL and has 12 standard Entry Points(函式/介面)
(Init 、Deinit、IOControl、PowerDown、PowerUp、Open、 Read、 Write、 Seek、 Close..etc )
怎麼判斷是否為Stream Driver??
public\common\oak\drivers下 的 def 檔,通常會使用 CreateFile("XXXN:", FILES_EXIST, ....)
DeviceIoControl 操作的 Driver 都是 Stream Driver,即將 Driver 模擬成檔案來操作
Several ways to implement the stream driver:
1. With only Init and Deinit entry points and no device prefix.
==>You cannot access this driver using CreateFile.
(e.g. %_WINCEROOT%\Public\Common\OAK\Drivers\RegEnum)
2.With device prefix in driver entry points.
==>
DWORD DEM_Init( LPCTSTR pContext, LPCVOID lpvBusContext)
{
OutputDebugString(L"DEM_DRIVER - DEM_Init - Context: ");
OutputDebugString(pContext);
OutputDebugString(L"\n");
OutputDebugString(L"DEM_DRIVER - Exit DEM_Init\n");
return 0x1234;
}
3.If DEVFLAGS_NAKEDENTRIES is specified in the driver's Flags registry sub-key, entry points can be undecorated
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Battery]
"Prefix"="BAT"
"Dll"="battdrvr.dll"
"Flags"=dword:8 ; DEVFLAGS_NAKEDENTRIES
"Order"=dword:0
Ref:
Linda's blog
Customizing the Windows CE Build System Using DIRS, SOURCES, and CECs
Ariel's blog
留言