阅读:2493回复:3
各位大牛帮忙看一下磁盘文件过滤驱动中一段无法编译通过的代码
编译平台:win7 sp1
编译工具:WDK win7 x86 checked build environment 1)编译器提示的错误信息:d:\diskflt\diskflt.c(1899) : error C4028: formal parameter 2 different from declaration 2)diskflt.c(1899):RtlInitializeGenericTable(&volumeInfo->redirectMap, CompareRoutine, AllocateRoutine, FreeRoutine, NULL); 3)NTDDK中RtlInitializeGenericTable定义如下: #if (NTDDI_VERSION >= NTDDI_WIN2K) NTSYSAPI VOID NTAPI RtlInitializeGenericTable ( __out PRTL_GENERIC_TABLE Table, __in PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine, __in PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine, __in PRTL_GENERIC_FREE_ROUTINE FreeRoutine, __in_opt PVOID TableContext ); #endif 4)其中PRTL_GENERIC_COMPARE_ROUTINE定义如下: RTL_GENERIC_COMPARE_RESULTS NTAPI RTL_GENERIC_COMPARE_ROUTINE ( __in struct _RTL_GENERIC_TABLE *Table, __in PVOID FirstStruct, __in PVOID SecondStruct ); typedef RTL_GENERIC_COMPARE_ROUTINE *PRTL_GENERIC_COMPARE_ROUTINE; 5)diskflt.c中CompareRoutine定义如下: RTL_GENERIC_COMPARE_RESULTS NTAPI CompareRoutine( struct _RTL_GENERIC_TABLE *Table, PVOID FirstStruct, PVOID SecondStruct ); 6)这个问题困扰了小弟好几天,近乎崩溃,各处寻找资料,查msdn均无法解决 |
|
沙发#
发布于:2012-02-27 15:12
第二个参数它要的是指针吧
|
|
板凳#
发布于:2012-02-28 14:33
是啊,我传进去的就是指针啊
|
|
地板#
发布于:2012-03-05 11:43
没看出问题,试试修改 CompareRoutine 函数名,可能与其他定义有冲突
|
|