vs2008中,link2001错误的问题,代码如下
#include <ntddk.h>
VOID OnUnload(IN PDRIVER_OBJECT pDriverObject); //
typedef struct _SERVICE_DESCRIPTOR_TABLE
{
PVOID ServiceTableBase;
PULONG ServiceCounterTableBase;
ULONG NumberOfService;
ULONG ParamTableBase;
}SERVICE_DESCRIPTOR_TABLE,*PSERVICE_DESCRIPTOR_TABLE;
extern PSERVICE_DESCRIPTOR_TABLE KeServiceDescriptorTable;
NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject,PUNICODE_STRING B) //TYPEDEF LONG NTSTATUS
{
ULONG SSDT_Addrss;
pDriverObject->DriverUnload=OnUnload;
DbgPrint("load");
push eax
push ebx
mov ebx,KeServiceDescriptorTable
mov ebx,[KeServiceDescriptorTable]
mov ebx,[ebx]
mov SSDT_Addrss,ebx
pop ebx
pop eax
return (1);
}
VOID OnUnload(IN PDRIVER_OBJECT pDriverObject)
{
DbgPrint("unload");
}
错误 8
error LNK2001: 无法解析的外部符号 "struct _SERVICE_DESCRIPTOR_TABLE * KeServiceDescriptorTable" (?KeServiceDescriptorTable@@3PAU_SERVICE_DESCRIPTOR_TABLE@@A)
错误 9 fatal error LNK1120: 1 个无法解析的外部命令
请大牛解答。
------解决方案--------------------
http://bbs.pediy.com/showthread.php?t=120949