|
如果flash的驱动就是 DSK1的话 那就是FMD_OEMIoControl 的问题了
不要 传参数呐
先进入case 中打印些 信息 看是不是进入到FMD_OEMIoControl 里面了
要是进入了 估计就是你的 地址没转换
给下 我的部分代码
BOOL FMD_OEMIoControl(DWORD dwIoControlCode, PBYTE pInBuf, DWORD nInBufSize, PBYTE pOutBuf, DWORD nOutBufSize, PDWORD pBytesReturned)
{
#if 1
volatile LPBYTE pReadBuffer;
volatile LPBYTE pWriteBuffer;
pflReadWriteInput pBufMsg_Input = (pflReadWriteInput)pInBuf;
pflReadWriteOutput pbufMsg_Output = (pflReadWriteOutput)pOutBuf;
switch(dwIoControlCode)
{
case IOCTL_FMD_READ:
pReadBuffer = (LPBYTE)MapPtrToProcess(pbufMsg_Output->pSectorBuff,GetOwnerProcess());
Sleep(1);
return FMD_ReadSector(pBufMsg_Input->startSectorAddr, pReadBuffer, pbufMsg_Output->pSectorInfoBuff, pBufMsg_Input->dwNumSectors);
case IOCTL_FMD_ERASE:
return FMD_EraseBlock(pBufMsg_Input->blockID);
case IOCTL_FMD_WRITE:
pWriteBuffer = (LPBYTE)MapPtrToProcess(pBufMsg_Input->pSectorBuff,GetOwnerProcess());
Sleep(1);
return FMD_WriteSector(pBufMsg_Input->startSectorAddr, pWriteBuffer, pBufMsg_Input->pSectorInfoBuff, pBufMsg_Input->dwNumSectors);
case IOCTL_FMD_GET_STATUS:
if(FMD_GetBlockStatus(pBufMsg_Input->blockID) != BLOCK_STATUS_BAD)
return FALSE;
case IOCTL_FMD_SET_STATUS:
return FMD_SetBlockStatus(pBufMsg_Input->blockID, BLOCK_STATUS_BAD);
default:
DEBUGMSG(1, (L"FMD_OEMIoControl: unrecognized IOCTL (0x%x)\r\n",dwIoControlCode));
return FALSE;
}
#endif
return(TRUE);
} |
|