首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 驱动开发 >

这个驱动该如何写

2012-08-26 
这个驱动该怎么写?小弟最近看了Windows驱动开发~~试着写一个HelloWorld级别的驱动,MSDN中如是写道C/C++ co

这个驱动该怎么写?
小弟最近看了Windows驱动开发~~试着写一个HelloWorld级别的驱动,MSDN中如是写道

C/C++ code
/*To define a DriverEntry callback routine, you must first provide a function declaration that Static Driver Verifier (SDV) and other verification tools require, as shown in the following code example:*/DRIVER_INITIALIZE DriverEntry;/*Then, implement your callback routine as follows:*/NTSTATUS   DriverEntry(     _In_ struct _DRIVER_OBJECT  *DriverObject,    _In_ PUNICODE_STRING  RegistryPath     )  {      // Function body  }
我如是写到
C/C++ code
DRIVER_INITIALIZE DriverEntry;extern "C" NTSTATUS  DriverEntry(__in PDRIVER_OBJECT pDriverObject,__in PUNICODE_STRING pRegistryPath )

然后输入build就提示出错: Error C2732: linkage specification contradicts earlier specification 
for 'DriverEntry'
表示不理解,哪里错了???

[解决办法]
恭喜楼主!
我来接分...

热点排行