ndis 编译问题
wwwaj 2009-04-29 05:36:08 #include "ntddk.h"
VOID
GetBuff(
IN PNDIS_PACKET Packet
)
{
WCHAR logFileNameBuffer[]=L"\\??\\c:\\abc.log";
UNICODE_STRING logFileUnicodeString;
IO_STATUS_BLOCK ioStatus;
OBJECT_ATTRIBUTES objectAttributes;
HANDLE hLogFile;
NDIS_STATUS ntStatus;
RtlInitUnicodeString(&logFileUnicodeString,logFileNameBuffer);
InitializeObjectAttributes(&objectAttributes,&logFileUnicodeString,OBJ_CASE_INSENSITIVE,NULL,NULL);
ntStatus=ZwCreateFile( &hLogFile,FILE_WRITE_DATA|SYNCHRONIZE,
&objectAttributes,&ioStatus,NULL,
FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ,
FILE_OPEN_IF, FILE_SYNCHRONOUS_IO_NONALERT,
NULL,0);
if(NT_SUCCESS(ntStatus))
{
ZwWriteFile(hLogFile,NULL,NULL,NULL,&IoStatus,“tttttttttt",10,NULL,NULL);
ZwClose(hLogFile);
}
}
编译时:报 'IO_STATUS_BLOCK' : undeclared identifier
'OBJECT_ATTRIBUTES' : undeclared identifier
'HANDLE' : illegal use of this type as an expression
'NDIS_STATUS' : illegal use of this type as an expression
'RtlInitUnicodeString' undefined; assuming extern returning int
'InitializeObjectAttributes' undefined; assuming extern returning int
'OBJ_CASE_INSENSITIVE' : undeclared identifier
'ZwCreateFile' undefined; assuming extern returning int
'FILE_WRITE_DATA' : undeclared identifier
'SYNCHRONIZE' : undeclared identifier
'FILE_ATTRIBUTE_NORMAL' : undeclared identifier
'FILE_SHARE_READ' : undeclared identifier
'FILE_OPEN_IF' : undeclared identifier
'FILE_SYNCHRONOUS_IO_NONALERT' : undeclared identifier
'ZwWriteFile' undefined; assuming extern returning int
'IoStatus' : undeclared identifier
'ZwClose' undefined; assuming extern returning int
不知什么原因????
哪位大侠能给解决一下!!!急 谢谢!