引用 12 楼 veabol 的回复:
\PUBLIC\COMMON\OAK\DRIVERS\USBFN\CLASS\STORAGE\TRANSPORT\BOT
这里应该是没判断是否multi-bin,且都能够正常工作
-->
extern "C"
DWORD
Init(
LPCTSTR pszActiveKey
)
{
DWORD dwErr = UfnInitializeInterface(pszActiveKey, &g_hDevice,
&g_ufnFuncs, &g_pvInterface);
if (dwErr == ERROR_SUCCESS) {
--> dwErr = BOT_InternalInit(pszActiveKey);
(bot.cpp)-->// Initialize the Bulk-Only Transport layer.
DWORD
BOT_InternalInit(
LPCTSTR pszActiveKey
)
{
_tcsncpy(g_szActiveKey, pszActiveKey, dim(g_szActiveKey));
bot.cpp -->// Process a device event.
static
BOOL
WINAPI
BOT_DeviceNotify(
PVOID pvNotifyParameter,
DWORD dwMsg,
DWORD dwParam
)
...
--> case UFN_ATTACH: {
DEBUGCHK(!g_fStoreOpened);
DWORD dwRet = STORE_Init(g_szActiveKey);
-->(block.cpp)STORE_Init() Initialize SCSI-2 direct-access device emulator
-->OpenDeviceKey(pszActiveKey);
--> g_hStore = OpenStore(g_szDeviceName);复制代码
看了那驱动, 不知道那参数LPCTSTR pszActiveKey 上层到底传了什么进去