|
最近一直被一个问题困扰
我的驱动一用createFile访问就会蓝屏~~
我的CreateFile的第一个参数是符号连接名+管道号:
\\.\\\\SymLinkName\\PIPE00
如果直接用\\.\\\\SymLinkName的话,在DispatchCreate里面fileObject->FileName.Length长度就为0.....
DispatchCreate:
if(pdx->Interface)
{
//KdPrint(("True"));
interface = pdx->Interface;
}
else
{
KdPrint(("Usb Interface Not Found!\n"));
ntStatus = STATUS_INVALID_DEVICE_STATE;
goto DispatchCreateExit;
}
if(fileObject)
{
fileObject->FsContext = NULL;
}
else
{
//KdPrint(("False"));
ntStatus = STATUS_INVALID_PARAMETER;
goto DispatchCreateExit;
}
KdPrint(("FileName.length = %d",fileObject->FileName.Length));
if(fileObject->FileName.Length == 0)
{
// 长度为0表示设备本身
ntStatus = STATUS_SUCCESS;
InterlockedIncrement(&pdx->OpenHandleCount);
KdPrint(("OpenHandleCount: 0x%x\n", pdx->OpenHandleCount));
if(pdx->SSEnable)
{
CancelSelectSuspend(pdx);
}
goto DispatchCreateExit;
}
// 导致PipeWithName无法执行
PipeContext = PipeWithName(fdo, &fileObject->FileName);
进而导致DispatchReadWrite无法执行!
请高手们解答!
困惑中...
|
|