小弟最近看了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'
表示不理解,哪里错了???
------解决方案--------------------
恭喜楼主!
我来接分...