请教WinCE下应用程序直接操作flash设备的方法试了两种方法都不行:C/C++ code hFlashDriver CreateFile(_
请教WinCE下应用程序直接操作flash设备的方法
试了两种方法都不行:
C/C++ code hFlashDriver = CreateFile(_T("DSK1:"),GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if(hFlashDriver == INVALID_HANDLE_VALUE) { MessageBox(L"Open Flash Device Failed!"); // return 0; }hFlashDriver = OpenStore(L"FlashDrv"); if(hFlashDriver == INVALID_HANDLE_VALUE) { MessageBox(L"Open Flash Device Failed!22"); return 0; }
注册表:
HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\FlashDrv]
"DriverPath"="Drivers\\BlockDevice\\FlashDrv"
"LoadFlags"=dword:1
; "MountFlags"=dword:11
"BootPhase"=dword:0
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE\Drivers\BlockDevice\FlashDrv]
"Prefix"="DSK"
"Index"=dword:1
"Dll"="FLASHDRV.dll"
"Order"=dword:4
"Ioctl"=dword:4
"Profile"="FlashDrv"
"FriendlyName"="MS Flash Driver"
; "MountFlags"=dword:11
"BootPhase"=dword:0
"Flags"=dword:1000
; Bind BINFS to the block driver
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDrv]
"DefaultFileSystem"="BINFS"
"PartitionDriver"="mspart.dll"
"AutoMount"=dword:1
"AutoFormat"=dword:1
;"AutoMount"=dword:0
"AutoPart"=dword:1
; "MountFlags"=dword:11
"Folder"="FlashDisk"
"Name"="Microsoft Flash Disk"
"BootPhase"=dword:0
"Flags"=dword:1000
[解决办法]只要有相对应的静态库就可以了
[解决办法]我做过,很简单的,到我的博客去Google一下。呵呵。
[解决办法]这部分内容你可以参考一下WINCE PUBLIC下USB FUNCTION的Storage驱动,里边有关于盘符的操作。
[解决办法]楼主是在multi-bin下实现的嘛?非multi-bin和multi-bin是不相同的····
[解决办法]#if IMGMULTIBIN
hFlash = OpenStore(L"MSFlash");
#else
hFlash = OpenStore(L"DSK1:");
#endif
[解决办法]\PUBLIC\COMMON\OAK\DRIVERS\USBFN\CLASS\STORAGE\TRANSPORT\BOT
这里应该是没判断是否multi-bin,且都能够正常工作