阅读:2526回复:10
关于共享内存的若干问题,概念问题,详细代码贴出来了,再请版主来看下啊
我在控制码里面用的是METHOD_BUFFERED然后呢还是先看看我的代码吧 驱动:在PtRegisterDevice里面: SystemAddr=ExAllocatePool(NonPagedPool,1024);
Mdl=IoAllocateMdl(SystemAddr,1024,FALSE,FALSE,NULL); MmBuildMdlForNonPagedPool(Mdl); 在deviocontrol例程里面: …… NTSTATUS status=STATUS_INVALID_DEVICE_REQUEST;……switch(uIoControlCode) { case IOCTL_GET_SHAREMEMORY: DBGPRINT(("IOCTL_GET_SHAREMEMORY==========================:\n")); UserAddr=MmMapLockedPagesSpecifyCache(Mdl,UserMode,MmCached,NULL,FALSE,NormalPagePriority); DBGPRINT(("SystemAddr的地址为: %p\n",(PUCHAR)SystemAddr)); DBGPRINT(("UserAddr的地址为: %p\n",(PUCHAR)UserAddr)); (PVOID)pIrp->AssociatedIrp.SystemBuffer=UserAddr; if(pIrp->AssociatedIrp.SystemBuffer) { DBGPRINT(("共享地址分配成功!pIrp->AssociatedIrp.SystemBuffer的地址为:%p\n",(PUCHAR)pIrp->AssociatedIrp.SystemBuffer)); status=STATUS_SUCCESS; } else { DBGPRINT(("共享地址分配失败!\n")); } break; ……default:…… }if(status==STATUS_SUCCESS) pIrp->IoStatus.Information=uTransferLen; else pIrp->IoStatus.Information=0; pIrp->IoStatus.Status=status; IoCompleteRequest(pIrp,IO_NO_INCREMENT); DBGPRINT(("==>DevIoControl\n")); return status; 在处理一个接受到的包时候,我把它拷贝到共享内存里面了,是这样做的: memset(SystemAddr, 0, 100); memcpy(SystemAddr, (PVOID)ip_p, sizeof(ip_p)); 应用层: char pOutBuffer[100]={0}; DWORD pOutBufferLen=strlen(pOutBuffer); hFile=::CreateFile(_T("\\\\.\\PassThru"),GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if(!hFile) { MessageBox(_T("error CreateFile!")); return; } BOOL bRet=::DeviceIoControl(hFile,IOCTL_GET_SHAREMEMORY,NULL,0,(LPVOID)pOutBuffer,pOutBufferLen,&pOutBufferLen,NULL); if(!bRet) { AfxMessageBox(_T("error1")); return ; } psharememory=(PVOID)pOutBuffer; 大概就是这样了 我的问题就是,应用层无法获取包的内容,不知道问题出在哪里,还请帮忙看一下另外,还想请教一些问题,不大明白 1.我看网上都是:*((PVOID *)pIrp->AssociatedIrp.SystemBuffer)=UserAddr这句,干嘛用两个*号,直接(PVOID)pIrp->AssociatedIrp.SystemBuffer=UserAddr不行吗?而且我这样用两个*号还蓝屏了,不用到没事 2.驱动开辟的内存是怎么映射到用户程序的,也就是 我的疑惑:SystemAddr UserAddr pIrp->AssociatedIrp.SystemBuffer pOutBuffer之间的关系 ,SystemAddr 是驱动开的一块内存,只能由驱动访问,所以驱动在拷贝数据到共享内存的时候就用这个地址,对不对? 而UserAddr是将这块应用层看不到的地址映射到其能看到的内存里面,是不是?SystemAddr UserAddr都指向这块共享内存? pIrp>AssociatedIrp.SystemBuffer是deviceiocontrol缓冲区,是不是将拷贝到共享内存的数据通过他再传到用户程序里?PVOID)pIrp->AssociatedIrp.SystemBuffer=UserAddr这句是不是把pIrp->AssociatedIrp.SystemBuffer指针指向UserAddr所指向的内存?如果是的话,那么应用程序里:pOutBuffer指针岂不是也指向这块地址?而pOutBuffer不是已经在应用程序里面分配过了吗? 总之,他们的关系我有点乱,还请多多指教啊,可不可以详细地说明一下啊,谢谢啊 最后 衷心感谢你能够百忙之中抽空回答我这么一群问题,甚至很可笑,但是,这将会给我们这些新手莫大的鼓舞,谢谢 |
|
沙发#
发布于:2008-08-01 11:59
1.我看网上都是:*((PVOID *)pIrp->AssociatedIrp.SystemBuffer)=UserAddr这句,干嘛用两个*号,直接(PVOID)pIrp->AssociatedIrp.SystemBuffer=UserAddr不行吗?而且我这样用两个*号还蓝屏了,不用到没事
》应该是:*((PVOID *)pIrp->AssociatedIrp.SystemBuffer)=UserAddr,含义只是把UserAddr这个四字节的值传回到应用程序,蓝屏可能是你的指针非法引起的,检查一下应用程序调用DeviceIoCntrol,pOutBuffers是不是合法的指针。pIrp->AssociatedIrp.SystemBuffer=UserAddr是完全错误的。 2.SystemAddr 是驱动开的一块内存,只能由驱动访问,所以驱动在拷贝数据到共享内存的时候就用这个地址,对不对? 》对 而UserAddr是将这块应用层看不到的地址映射到其能看到的内存里面,是不是? 》是,通过分页机制,不同的虚拟地址可以指向同一块物理内存 pIrp>AssociatedIrp.SystemBuffer是deviceiocontrol缓冲区,是不是将拷贝到共享内存的数据通过他再传到用户程序里? 》基本正确,看一下METHOD_BUFFERED的说明,SystemBuffer是内核分配的一块缓冲区,是max(Inbuf,Outbuf),调用驱动的iocontrol前,把Inbuf拷贝到SystemBuf,当驱动返回后,把SystemBuf的内容拷贝到Outbuf |
|
板凳#
发布于:2008-08-01 13:32
谢谢斑竹
可是现在老蓝屏 是这样改的: 驱动: *((PVOID *)(pIrp->AssociatedIrp.SystemBuffer))=UserAddr 应用层: char pOutBuffer[100]={0}; DWORD pOutBufferLen=strlen(pOutBuffer); hFile=::CreateFile(_T("\\\\.\\PassThru"),GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if(!hFile) { MessageBox(_T("error CreateFile!")); return; } BOOL bRet=::DeviceIoControl(hFile,IOCTL_GET_SHAREMEMORY,NULL,0,(LPVOID)pOutBuffer,pOutBufferLen,&dwTranferLen,NULL); if(!bRet) { AfxMessageBox(_T("error1")); return ; } psharememory=*((PVOID *)pOutBuffer); 不知道有什么问题,还请斑竹赐教! |
|
地板#
发布于:2008-08-01 14:36
pOutBufferLen应该是4,按照你的代码strlen算出来是0,当然不对了.改成4再测试一下
|
|
地下室#
发布于:2008-08-01 15:14
我把createfile中的0改成了:FILE_SHARE_READ | FILE_SHARE_WRITE
就不蓝屏了 出现异常错误 (windows 报错) 改成4还是报错 我调试一下 pOutBuffer返回的前4个字节为0 剩下的是随机乱码 是什么问题呢? 版主可不可以留个联系方式呢?能在线交流就行,如果方便的话 |
|
5楼#
发布于:2008-08-01 17:20
还有一个问题,请帮个忙
刚才版主说 :*((PVOID *)pIrp->AssociatedIrp.SystemBuffer)=UserAddr,含义只是把UserAddr这个四字节的值传回到应用程序 那么我在应用程序中,pShareMemory的值就是UserAddr的地址了,就是说pShareMemory是指向指针的指针了,那我要用拷贝到共享内存的数据,如将截获到的包在应用程序中打印出来,该怎么样使用pShareMemory这个指针了?定义的时候不是将其定义为PVOID吗?并不是双指针啊? 帮忙回答一下阿 |
|
6楼#
发布于:2008-08-01 20:34
1.改成4后什么错误?
2.你的理解还是有问题,内存是内核中分配的,应用程序就不需要分配了 PVOID pShareMemory; BOOL bRet=::DeviceIoControl(hFile,IOCTL_GET_SHAREMEMORY,NULL,0,(PVOID)&pShareMemory,sizeof(PVOID),&dwTranferLen,NULL); pSharedMemory就是UserAddr。 |
|
7楼#
发布于:2008-08-01 21:55
真的很感谢版主
原来的的错误已经没有了,又遇到新的问题了,学习驱动真的坎坷啊 再次感谢版主,赞一个 现在新的问题是这样的,不知道我的代码又是哪边出错了,我在vs2005下面调试,发现只要执行 BOOL bRet=::DeviceIoControl(hFile,IOCTL_GET_SHAREMEMORY,NULL,0,(PVOID)&psharememory,sizeof(PVOID),&dwTranferLen,NULL);就出问题,问题是,执行完后hFile的值会被改变,导致下面用到hFile的地方报错 另外,感谢版主帮助我解决以前关于psharememory的问题,调试后,psharemeory的值为UserAddr的值 下面,我把我的主要代码全部贴出来,请版主和各位一起看看,帮小弟指条名路。非常感谢!!! 首先,说明一下我代码的功能,很简单,就是在驱动层截获一个ICMP包,然后将其信息输出在一个MFC程序界面上 应用层相关代码: void Cmyfilter_exeDlg::OnBnClickedOk() { // TODO: 在此添加控件通知处理程序代码 UpdateData(TRUE); MONITOR=TRUE; if(!m_check_ICMP&&!m_check_UDP) m_start.EnableWindow(TRUE); //===========================================ICMP============================================= if(m_check_ICMP) { m_start.EnableWindow(FALSE); m_stop.EnableWindow(TRUE); hFile=::CreateFile(_T("\\\\.\\PassThru"),GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if(!hFile) { MessageBox(_T("error CreateFile!")); return; } BOOL bRet=::DeviceIoControl(hFile,IOCTL_GET_SHAREMEMORY,NULL,0,(PVOID)&psharememory,sizeof(PVOID),&dwTranferLen,NULL); if(!bRet) { AfxMessageBox(_T("error1")); return ; } m_Event_ICMP=CreateEvent(NULL,FALSE,FALSE,NULL); bRet=::DeviceIoControl(hFile,IOCTL_DROP_ICMP,(LPVOID)m_Event_ICMP,0,NULL,0,&dwTranferLen,NULL); if(!bRet) { AfxMessageBox(_T("error2")); CString str; str.Format(L"%d",GetLastError()); AfxMessageBox(str,MB_OKCANCEL,0); return; } CreateMyThread_ICMP(); } } 具体线程部分就不贴了,先帮我解决遇到的问题吧! 驱动层: NTSTATUS DevIoControl( IN PDEVICE_OBJECT Device_Object, IN PIRP pIrp ) { NTSTATUS status=STATUS_INVALID_DEVICE_REQUEST; PIO_STACK_LOCATION pIrpStack; ULONG uIoControlCode; PVOID pIoBuffer; ULONG uInSize; ULONG uOutSize; ULONG uTransferLen=13; HANDLE Event_ICMP; HANDLE Event_UDP; OBJECT_HANDLE_INFORMATION objHandleInfo_ICMP; OBJECT_HANDLE_INFORMATION objHandleInfo_UDP; pIrpStack=IoGetCurrentIrpStackLocation(pIrp); uIoControlCode=pIrpStack->Parameters.DeviceIoControl.IoControlCode; uInSize=pIrpStack->Parameters.DeviceIoControl.InputBufferLength; uOutSize=pIrpStack->Parameters.DeviceIoControl.OutputBufferLength; switch(uIoControlCode) { case IOCTL_GET_SHAREMEMORY: DBGPRINT(("IOCTL_GET_SHAREMEMORY==========================:\n")); UserAddr=MmMapLockedPagesSpecifyCache(Mdl,UserMode,MmCached,NULL,FALSE,NormalPagePriority); DBGPRINT(("SystemAddr的地址为: %p\n",(PUCHAR)SystemAddr)); DBGPRINT(("UserAddr的地址为: %p\n",(PUCHAR)UserAddr)); *((PVOID *)(pIrp->AssociatedIrp.SystemBuffer))=UserAddr; uTransferLen=sizeof(PVOID); if(pIrp->AssociatedIrp.SystemBuffer) { DBGPRINT(("共享地址分配成功!pIrp->AssociatedIrp.SystemBuffer的地址为:%p\n",(PUCHAR)pIrp->AssociatedIrp.SystemBuffer)); DBGPRINT(("共享地址分配成功!pIrp->AssociatedIrp.SystemBuffer的数据为:%x%x%x%x\n",*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer+3),*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer+2),*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer+1),*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer))); status=STATUS_SUCCESS; } else { DBGPRINT(("共享地址分配失败!\n")); } break; case IOCTL_DROP_ICMP: DBGPRINT(("IOCTL_DROP_ICMP:===============================\n")); Event_ICMP=(HANDLE)(pIrpStack->Parameters.DeviceIoControl.Type3InputBuffer); if(Event_ICMP) { DBGPRINT(("Event_ICMP事件不为空!\n")); } else DBGPRINT(("Event_ICMP事件为空!\n")); status = ObReferenceObjectByHandle(Event_ICMP,GENERIC_ALL,NULL,KernelMode,&gpEventObject_ICMP,&objHandleInfo_ICMP); if(status != STATUS_SUCCESS) { DBGPRINT(("ObReferenceObjectByHandle failed! status = %x\n", status)); break; } else DBGPRINT(("Referenct object sussfully!\n")); DROP_ICMP=1; break; case IOCTL_STOP: DBGPRINT(("IOCTL_STOP:\n")); DROP_ICMP=0; DROP_UDP=0; status=STATUS_SUCCESS; break; case IOCTL_DROP_UDP: DBGPRINT(("IOCTL_DROP_UDP:\n")); UserAddr=MmMapLockedPages(Mdl,UserMode); /*UserAddr=MmMapLockedPagesSpecifyCache(Mdl,UserMode,MmCached,NULL,FALSE,NormalPagePriority);*/ (PVOID)pIrp->UserBuffer=UserAddr; if(pIrp->UserBuffer) { DBGPRINT(("共享地址分配成功!\n")); } else DBGPRINT(("共享地址分配失败!\n")); Event_UDP=(HANDLE)(pIrpStack->Parameters.DeviceIoControl.Type3InputBuffer); if(Event_UDP) { DBGPRINT(("Event_UDP事件不为空!\n")); } else DBGPRINT(("Event_UDP事件为空!\n")); status = ObReferenceObjectByHandle(Event_UDP,GENERIC_ALL,NULL,KernelMode,&gpEventObject_UDP,&objHandleInfo_UDP); if(status != STATUS_SUCCESS) { DBGPRINT(("ObReferenceObjectByHandle failed! status = %x\n", status)); break; } else DBGPRINT(("Referenct object sussfully!\n")); DROP_UDP=1; break; case IO_CLEAR_EVENT_ICMP: KeClearEvent(gpEventObject_ICMP); DbgPrint("KeClearEvent_ICMP successfully! 成功将事件重新变为 非信号状态!\n"); status=STATUS_SUCCESS; break; case IO_CLEAR_EVENT_UDP: KeClearEvent(gpEventObject_UDP); DbgPrint("KeClearEvent_UDP successfully! 成功将事件重新变为 非信号状态!\n"); status=STATUS_SUCCESS; break; default: status=STATUS_NOT_SUPPORTED; break; } if(status==STATUS_SUCCESS) pIrp->IoStatus.Information=uTransferLen; else pIrp->IoStatus.Information=0; pIrp->IoStatus.Status=status; IoCompleteRequest(pIrp,IO_NO_INCREMENT); DBGPRINT(("==>DevIoControl\n")); return status; } 与应用层公用: #define IOCTL_DROP_ICMP \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x201, METHOD_NEITHER, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IOCTL_DROP_UDP \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x202, METHOD_NEITHER, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IO_CLEAR_EVENT_ICMP \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x203, METHOD_NEITHER, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IO_CLEAR_EVENT_UDP \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x204, METHOD_NEITHER, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IOCTL_STOP \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x205, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IOCTL_GET_SHAREMEMORY \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x206, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 截包函数:(PTReceivePacket) PtReceivePacket( IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_PACKET Packet ) /*++ Routine Description: ReceivePacket handler. Called by NDIS if the miniport below supports NDIS 4.0 style receives. Re-package the buffer chain in a new packet and indicate the new packet to protocols above us. Any context for packets indicated up must be kept in the MiniportReserved field. NDIS 5.1 - packet stacking - if there is sufficient "stack space" in the packet passed to us, we can use the same packet in a receive indication. Arguments: ProtocolBindingContext - Pointer to our adapter structure. Packet - Pointer to the packet Return Value: == 0 -> We are done with the packet != 0 -> We will keep the packet and call NdisReturnPackets() this many times when done. --*/ { PADAPT pAdapt =(PADAPT)ProtocolBindingContext; NDIS_STATUS Status; PNDIS_PACKET MyPacket; BOOLEAN Remaining; PUCHAR pPacketContent; PIPPacket ip_p; UINT PacketLength; DBGPRINT(("路线:PTReceivePacket1\n")); // // Drop the packet silently if the upper miniport edge isn't initialized or // the miniport edge is in low power state // if ((!pAdapt->MiniportHandle) || (pAdapt->MPDeviceState > NdisDeviceStateD0)) { DBGPRINT(("PTReceivePacket:!pAdapt->MiniportHandle || pAdapt->MPDeviceState > NdisDeviceStateD0\n")); return 0; } #ifdef NDIS51 // // Check if we can reuse the same packet for indicating up. // See also: PtReceive(). // #endif // NDIS51 DBGPRINT(("路线:PTReceivePacket2\n")); Status = NdisAllocateMemory(&pPacketContent, BUFFER_SIZE, 0, HighestAcceptableMax); if(Status != NDIS_STATUS_SUCCESS) { DBGPRINT(("PTReceivePacket:NdisAllocateMemory Failed\n")); return(NDIS_STATUS_NOT_ACCEPTED); } if(pPacketContent == NULL) { DBGPRINT(("PTReceivePacket:pPacketContent==NULL\n")); return(NDIS_STATUS_NOT_ACCEPTED); } DBGPRINT(("PTReceivePacket:pPacketContent:Allocate Sucecess\n")); NdisZeroMemory(pPacketContent, BUFFER_SIZE); CopyPacket2Buffer( Packet, pPacketContent, &PacketLength ) ; ip_p=(PIPPacket)pPacketContent; // NdisFreeMemory(pPacketContent, BUFFER_SIZE, 0); /*if(ip_p->H_frame_type==8&&ip_p->L_frame_type==6) { DbgPrint(("ARP过滤")); NdisFreeMemory(pPacketContent, BUFFER_SIZE, 0); return NDIS_STATUS_NOT_ACCEPTED; }*/ DBGPRINT(("DROP_ICMP: %d",DROP_ICMP)); DBGPRINT(("DROP_UDP: %d",DROP_UDP)); if(DROP_ICMP) { if(ip_p->H_frame_type==8&&ip_p->L_frame_type==0&&ip_p->proto==1) { DBGPRINT(("所捕捉到的包 原地址为: %p 端口为 : %d\n",ip_p->sourceIP,*(ip_p+sizeof(IP_Packet)))); DBGPRINT(("ip_p->H_frame_type %d ip_p->L_frame_type %d ip_p->proto %d",ip_p->H_frame_type,ip_p->L_frame_type,ip_p->proto)); if(!KeReadStateEvent(gpEventObject_ICMP)) { DBGPRINT(("gpEventObject_ICMP事件状态为 非 信号状态 即将复制数据到共享内存!\n")); // 复制数据到共享内存 DBGPRINT(("拷贝到共享内存中的数据为======SystemAddr======: %u\n",SystemAddr)); DBGPRINT(("拷贝到共享内存中的数据为======UserAddr======: %u\n",UserAddr)); memset(SystemAddr, 0, 100); //memcpy(SystemAddr, (PVOID)ip_p, sizeof(ip_p)); //uTransferLen=sizeof(ip_p); memcpy(SystemAddr,pPacketContent,PacketLength); NdisFreeMemory(pPacketContent, BUFFER_SIZE, 0); DBGPRINT(("捕捉到的包的地址为: %p \n",(PUCHAR)SystemAddr)); DBGPRINT(("拷贝到共享内存中的数据为: %p \n",(PUCHAR)SystemAddr)); DBGPRINT(("拷贝到共享内存中的数据为======SystemAddr======: %u\n",SystemAddr)); DBGPRINT(("拷贝到共享内存中的数据为======UserAddr======: %u\n",UserAddr)); KeSetEvent(gpEventObject_ICMP, 0, FALSE); if(KeReadStateEvent(gpEventObject_ICMP)) { DBGPRINT(("gpEventObject_ICMP事件状态为 有 信号状态 KeSetEvent操作成功!\n")); } } else { DBGPRINT(("gpEventObject_ICMP事件状态为 有 信号状态 ! 核心层过滤未工作!\n")); } DBGPRINT(("ICMP过滤成功\n")); return NDIS_STATUS_NOT_ACCEPTED; } else { DBGPRINT(("PTReceivePacket------ICMP过滤打开 但此包非ICMP包!\n")); } } 感谢各位帮忙,感谢版主再次亲临指导 谢谢各位 如果能指出我代码中的错误,我会非常感激的,大家一同进步!!! |
|
8楼#
发布于:2008-08-02 10:27
问题已经解决了,先回顾一下我的问题:在发送IOCTL_GET_SHAREMEMORY控制码时候,会改变原先的hFile和m_Event_ICMP的值
我是这样解决的: 在驱动层处理IOCTL_GET_SHAREMEMORY控制码的时候加了一个异常处理: case IOCTL_GET_SHAREMEMORY: try { DBGPRINT(("IOCTL_GET_SHAREMEMORY==========================:\n")); UserAddr=MmMapLockedPagesSpecifyCache(Mdl,UserMode,MmCached,NULL,FALSE,NormalPagePriority); DBGPRINT(("SystemAddr的地址为: %p\n",(PUCHAR)SystemAddr)); DBGPRINT(("UserAddr的地址为: %p\n",(PUCHAR)UserAddr)); *((PVOID *)(pIrp->AssociatedIrp.SystemBuffer))=UserAddr; if(pIrp->AssociatedIrp.SystemBuffer) { DBGPRINT(("共享地址分配成功!pIrp->AssociatedIrp.SystemBuffer的地址为:%p\n",(PUCHAR)pIrp->AssociatedIrp.SystemBuffer)); DBGPRINT(("共享地址分配成功!pIrp->AssociatedIrp.SystemBuffer的数据为:%x%x%x%x\n",*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer+3),*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer+2),*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer+1),*((PUCHAR)pIrp->AssociatedIrp.SystemBuffer))); } else { DBGPRINT(("共享地址分配失败!\n")); } status=STATUS_SUCCESS; uTransferLen=sizeof(PVOID); } except(EXCEPTION_EXECUTE_HANDLER){} break; 现在就可以正常执行了 可是不知道为什么? 还请各位多多指教 |
|
9楼#
发布于:2008-08-04 09:26
调用BOOL bRet=::DeviceIoControl(hFile,IOCTL_GET_SHAREMEMORY,NULL,0,(PVOID)&psharememory,sizeof(PVOID),&dwTranferLen,NULL);
后hFile就改变了吗? softice里,对hFile设置一个内存写断点,看看是哪里导致改变的。 |
|
10楼#
发布于:2010-03-13 10:04
好帖子 我也在做这个 我的实在驱动给共享内存拷贝时蓝屏 还没有解决
|
|