阅读:1276回复:3
在这里需要做dpc吗???
我做一个ipfilterHook,想在receive接收例程里将过滤信息写入一个文件中却失败啦我想是否需要在receive例程里做个dpc???
PUCHAR pByte; NTSTATUS status; IPHeader * pPacketHeader = (IPHeader *) PacketHeader; pByte = (PUCHAR)&pPacketHeader->iph_dest; IO_STATUS_BLOCK iostatus; PCHAR pMsg = new CHAR[30]; USHORT ip1 = (USHORT)pByte[0], ip2 = (USHORT)pByte[1], ip3 = (USHORT)pByte[2] , ip4 = (USHORT)pByte[3] ; sprintf( pMsg, \"%u.%u.%u.%u\\n\", ip1, ip2, ip3, ip4 ); t<<pMsg; status = ZwWriteFile( hFile1, NULL, NULL, NULL, &iostatus, pMsg, strlen(pMsg), NULL, NULL); delete pMsg; if( NT_SUCCESS(status) ) { t<<L\"writefile ok\"<<\"\\n\"; } else { t<<status<<L\"writefile failed\\n\"; } |
|
沙发#
发布于:2002-06-04 14:58
怎么高手都不感冒?请多讨论
|
|
板凳#
发布于:2002-06-07 10:23
怎么高手都不感冒?请多讨论 别的先不说,你那个new CHAR成功了么? |
|
地板#
发布于:2002-06-07 12:22
你所谓的失败是指什么?文件内容没变?还是烂屏?
|
|