satanli1982
驱动牛犊
驱动牛犊
  • 注册日期2004-03-07
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分7分
  • 威望3点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:3137回复:8

谁能告诉我为什么IFS自带的例子(filespy)都编译不了?

楼主#
更多 发布于:2004-03-28 19:01
我用DriverStudio的工具Source to Dsp converter把filespy 的sources文件转化成.dsw文件,然后用VC编译,结果报出一大堆错。请
大侠们指点,感激万分!!!!!
是我环境变量设错了吗?但是我直接用Source to Dsp converter编译
也不行呀。
编译.sys文件的错如下:
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(2603) : error C2054: expected '(' to follow 'FORCEINLINE'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(2606) : error C2085: 'QueryDepthSList' : not in formal parameter list
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(2606) : error C2143: syntax error : missing ';' before '{'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(4093) : error C2373: '_ReturnAddress' : redefinition; different type modifiers
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(6840) : error C2054: expected '(' to follow 'FORCEINLINE'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(6844) : error C2085: 'RtlConvertLongToLuid' : not in formal parameter list
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(6844) : error C2143: syntax error : missing ';' before '{'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(6856) : error C2054: expected '(' to follow 'FORCEINLINE'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(6860) : error C2085: 'RtlConvertUlongToLuid' : not in formal parameter list
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(6860) : error C2143: syntax error : missing ';' before '{'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(11728) : error C2061: syntax error : identifier 'KAFFINITY'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(11733) : error C2059: syntax error : '}'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(11734) : error C2143: syntax error : missing '{' before '*'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(11992) : error C2054: expected '(' to follow 'FORCEINLINE'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(11997) : error C2085: 'InterlockedExchange' : not in formal parameter list
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(11997) : error C2143: syntax error : missing ';' before '{'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(12046) : error C2054: expected '(' to follow 'FORCEINLINE'
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(12051) : error C2085: 'InterlockedExchangeAdd' : not in formal parameter list
D:\Program Files\WINDDK\2462\inc\ifs\ntifs.h(12051) : error C2143: syntax error : missing ';' before '{'

编译.exe文件的错如下:

D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(70) : error C2065: 'SERVICE_STATUS_PROCESS' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(70) : error C2146: syntax error : missing ';' before identifier 'serviceInfo'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(70) : error C2065: 'serviceInfo' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(71) : error C2275: 'DWORD' : illegal use of this type as an expression
        D:\Program Files\NTDDK\inc\windef.h(141) : see declaration of 'DWORD'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(71) : error C2146: syntax error : missing ';' before identifier 'bytesNeeded'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(71) : error C2065: 'bytesNeeded' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(72) : error C2275: 'HANDLE' : illegal use of this type as an expression
        D:\Program Files\NTDDK\inc\winnt.h(282) : see declaration of 'HANDLE'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(72) : error C2146: syntax error : missing ';' before identifier 'hDevice'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(72) : error C2065: 'hDevice' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(72) : warning C4047: '=' : 'int ' differs in levels of indirection from 'void *'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(73) : error C2275: 'BOOL' : illegal use of this type as an expression
        D:\Program Files\NTDDK\inc\windef.h(142) : see declaration of 'BOOL'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(73) : error C2146: syntax error : missing ';' before identifier 'bResult'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(73) : error C2065: 'bResult' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(74) : error C2275: 'DWORD' : illegal use of this type as an expression
        D:\Program Files\NTDDK\inc\windef.h(141) : see declaration of 'DWORD'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(74) : error C2146: syntax error : missing ';' before identifier 'result'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(74) : error C2065: 'result' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(75) : error C2275: 'ULONG' : illegal use of this type as an expression
        D:\Program Files\NTDDK\inc\windef.h(43) : see declaration of 'ULONG'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(75) : error C2146: syntax error : missing ';' before identifier 'threadId'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(75) : error C2065: 'threadId' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(76) : error C2275: 'HANDLE' : illegal use of this type as an expression
        D:\Program Files\NTDDK\inc\winnt.h(282) : see declaration of 'HANDLE'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(76) : error C2146: syntax error : missing ';' before identifier 'thread'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(76) : error C2065: 'thread' : undeclared identifier
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(76) : warning C4047: '=' : 'int ' differs in levels of indirection from 'void *'
D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyUser.c(77) : error C2275: 'LOG_CONTEXT' : illegal use of this type as an expression
        D:\Documents and Settings\JuncaoLi\桌面\filter\filespy\user\fspyLog.h(40) : see declaration of 'LOG_CONTEXT'
ammehrb
驱动牛犊
驱动牛犊
  • 注册日期2003-07-02
  • 最后登录2005-05-16
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-03-30 15:14
filespy不能用vc编译,可能是因为是文件系统过滤驱动程序的原因,但可以在vc环境下利用driverstudio编译。
chacker
驱动小牛
驱动小牛
  • 注册日期2002-11-22
  • 最后登录2007-11-15
  • 粉丝0
  • 关注0
  • 积分193分
  • 威望20点
  • 贡献值0点
  • 好评度17点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-03-30 22:03
我用DriverStudio的工具Source to Dsp converter把filespy 的sources文件转化成.dsw文件,然后用VC编译,结果报出一大堆错。请
大侠们指点,感激万分!!!!!
是我环境变量设错了吗?但是我直接用Source to Dsp converter编译
也不行呀。
编译.sys文件的错如下:
D:Program FilesWINDDK2462incifsntifs.h(2603) : error C2054: expected '(' to follow 'FORCEINLINE'
D:Program FilesWINDDK2462incifsntifs.h(2606) : error C2085: 'QueryDepthSList' : not in formal parameter list
D:Program FilesWINDDK2462incifsntifs.h(2606) : error C2143: syntax error : missing ';' before '{'
D:Program FilesWINDDK2462incifsntifs.h(4093) : error C2373: '_ReturnAddress' : redefinition; different type modifiers
D:Program FilesWINDDK2462incifsntifs.h(6840) : error C2054: expected '(' to follow 'FORCEINLINE'
D:Program FilesWINDDK2462incifsntifs.h(6844) : error C2085: 'RtlConvertLongToLuid' : not in formal parameter list
D:Program FilesWINDDK2462incifsntifs.h(6844) : error C2143: syntax error : missing ';' before '{'
D:Program FilesWINDDK2462incifsntifs.h(6856) : error C2054: expected '(' to follow 'FORCEINLINE'
D:Program FilesWINDDK2462incifsntifs.h(6860) : error C2085: 'RtlConvertUlongToLuid' : not in formal parameter list
D:Program FilesWINDDK2462incifsntifs.h(6860) : error C2143: syntax error : missing ';' before '{'
D:Program FilesWINDDK2462incifsntifs.h(11728) : error C2061: syntax error : identifier 'KAFFINITY'
D:Program FilesWINDDK2462incifsntifs.h(11733) : error C2059: syntax error : '}'
D:Program FilesWINDDK2462incifsntifs.h(11734) : error C2143: syntax error : missing '{' before '*'
D:Program FilesWINDDK2462incifsntifs.h(11992) : error C2054: expected '(' to follow 'FORCEINLINE'
D:Program FilesWINDDK2462incifsntifs.h(11997) : error C2085: 'InterlockedExchange' : not in formal parameter list
D:Program FilesWINDDK2462incifsntifs.h(11997) : error C2143: syntax error : missing ';' before '{'
D:Program FilesWINDDK2462incifsntifs.h(12046) : error C2054: expected '(' to follow 'FORCEINLINE'
D:Program FilesWINDDK2462incifsntifs.h(12051) : error C2085: 'InterlockedExchangeAdd' : not in formal parameter list
D:Program FilesWINDDK2462incifsntifs.h(12051) : error C2143: syntax error : missing ';' before '{'

编译.exe文件的错如下:

D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(70) : error C2065: 'SERVICE_STATUS_PROCESS' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(70) : error C2146: syntax error : missing ';' before identifier 'serviceInfo'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(70) : error C2065: 'serviceInfo' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(71) : error C2275: 'DWORD' : illegal use of this type as an expression
        D:Program FilesNTDDKincwindef.h(141) : see declaration of 'DWORD'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(71) : error C2146: syntax error : missing ';' before identifier 'bytesNeeded'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(71) : error C2065: 'bytesNeeded' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(72) : error C2275: 'HANDLE' : illegal use of this type as an expression
        D:Program FilesNTDDKincwinnt.h(282) : see declaration of 'HANDLE'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(72) : error C2146: syntax error : missing ';' before identifier 'hDevice'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(72) : error C2065: 'hDevice' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(72) : warning C4047: '=' : 'int ' differs in levels of indirection from 'void *'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(73) : error C2275: 'BOOL' : illegal use of this type as an expression
        D:Program FilesNTDDKincwindef.h(142) : see declaration of 'BOOL'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(73) : error C2146: syntax error : missing ';' before identifier 'bResult'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(73) : error C2065: 'bResult' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(74) : error C2275: 'DWORD' : illegal use of this type as an expression
        D:Program FilesNTDDKincwindef.h(141) : see declaration of 'DWORD'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(74) : error C2146: syntax error : missing ';' before identifier 'result'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(74) : error C2065: 'result' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(75) : error C2275: 'ULONG' : illegal use of this type as an expression
        D:Program FilesNTDDKincwindef.h(43) : see declaration of 'ULONG'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(75) : error C2146: syntax error : missing ';' before identifier 'threadId'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(75) : error C2065: 'threadId' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(76) : error C2275: 'HANDLE' : illegal use of this type as an expression
        D:Program FilesNTDDKincwinnt.h(282) : see declaration of 'HANDLE'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(76) : error C2146: syntax error : missing ';' before identifier 'thread'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(76) : error C2065: 'thread' : undeclared identifier
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(76) : warning C4047: '=' : 'int ' differs in levels of indirection from 'void *'
D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyUser.c(77) : error C2275: 'LOG_CONTEXT' : illegal use of this type as an expression
        D:Documents and SettingsJuncaoLi桌面filterfilespyuserfspyLog.h(40) : see declaration of 'LOG_CONTEXT'



你这样做是错的,进入编译环境下,将ifs里的build.exe这个文件copy到你的文件夹里,执行,就可以编译了!
walkonthesky
驱动中牛
驱动中牛
  • 注册日期2003-11-26
  • 最后登录2012-11-06
  • 粉丝0
  • 关注0
  • 积分1分
  • 威望20点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2004-03-31 12:56
你没有配置好VC的驱动编译环境

我也是调了半天才搞定

建MAKEFILE工程
调用setenv.bat
cd 你的工作目录
BUILD

将以上步骤做一个批处理文件就可以了
[img]http://www.driverdevelop.com/forum/upload/walkonthesky/2004-07-08_2004-07-07_b847.gif[/img]
ammehrb
驱动牛犊
驱动牛犊
  • 注册日期2003-07-02
  • 最后登录2005-05-16
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-04-01 10:16

你这样做是错的,进入编译环境下,将ifs里的build.exe这个文件copy到你的文件夹里,执行,就可以编译了! [/quote]

直接copy build.exe文件,但有如下错误:

TSSflt2.obj : error LNK2019: unresolved external symbol __imp__IoRegisterFsRegistrationChange@8 referenced in function _DriverEntry@8
TSSflt2.obj : error LNK2019: unresolved external symbol _PsGetVersion@16 referenced in function _DriverEntry@8
TSSfltHash.obj : error LNK2019: unresolved external symbol _PsGetCurrentThreadId@0 referenced in function _TSSFLTLogIrp@8
tssfltLib.obj : error LNK2001: unresolved external symbol _PsGetCurrentThreadId@0
TSSfltHash.obj : error LNK2019: unresolved external symbol _PsGetCurrentProcessId@0 referenced in function _TSSFLTLogIrp@8
tssfltLib.obj : error LNK2019: unresolved external symbol _PsGetCurrentProcessId@0 referenced in function _TSSFLTNewRecord@4
tssfltLib.obj : error LNK2019: unresolved external symbol __imp__IoGetTopLevelIrp@0 referenced in function _TSSFLTGetFullPathName@16
tssfltLib.obj : error LNK2019: unresolved external symbol __imp__IoGetBaseFileSystemDeviceObject@4 referenced in function _TSSFLTIsAttachedToDeviceByUserDeviceName@16
tssfltLib.obj : error LNK2019: unresolved external symbol __imp__ObQueryNameString@16 referenced in function _TSSFLTGetObjectName@8

请教该如何处理
ammehrb
驱动牛犊
驱动牛犊
  • 注册日期2003-07-02
  • 最后登录2005-05-16
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2004-04-01 10:18
相同的源码在ddk中编译是正常
he_x_p
驱动小牛
驱动小牛
  • 注册日期2002-11-15
  • 最后登录2005-07-30
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2004-04-01 12:40
你应保证安装了DDK,然后将DriverStudio在VC中的编译路径指向DDK路径,另外还会有Windows2000/xp/2003之类的选项,看是否匹配
乘着梦的翅膀, 借助黎明时柔和的阳光, 化着一只自由自在的冲天鸟, 在有梦的地方潇洒地飞翔......
chacker
驱动小牛
驱动小牛
  • 注册日期2002-11-22
  • 最后登录2007-11-15
  • 粉丝0
  • 关注0
  • 积分193分
  • 威望20点
  • 贡献值0点
  • 好评度17点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2004-04-01 13:31

你这样做是错的,进入编译环境下,将ifs里的build.exe这个文件copy到你的文件夹里,执行,就可以编译了!


直接copy build.exe文件,但有如下错误:

TSSflt2.obj : error LNK2019: unresolved external symbol __imp__IoRegisterFsRegistrationChange@8 referenced in function _DriverEntry@8
TSSflt2.obj : error LNK2019: unresolved external symbol _PsGetVersion@16 referenced in function _DriverEntry@8
TSSfltHash.obj : error LNK2019: unresolved external symbol _PsGetCurrentThreadId@0 referenced in function _TSSFLTLogIrp@8
tssfltLib.obj : error LNK2001: unresolved external symbol _PsGetCurrentThreadId@0
TSSfltHash.obj : error LNK2019: unresolved external symbol _PsGetCurrentProcessId@0 referenced in function _TSSFLTLogIrp@8
tssfltLib.obj : error LNK2019: unresolved external symbol _PsGetCurrentProcessId@0 referenced in function _TSSFLTNewRecord@4
tssfltLib.obj : error LNK2019: unresolved external symbol __imp__IoGetTopLevelIrp@0 referenced in function _TSSFLTGetFullPathName@16
tssfltLib.obj : error LNK2019: unresolved external symbol __imp__IoGetBaseFileSystemDeviceObject@4 referenced in function _TSSFLTIsAttachedToDeviceByUserDeviceName@16
tssfltLib.obj : error LNK2019: unresolved external symbol __imp__ObQueryNameString@16 referenced in function _TSSFLTGetObjectName@8

请教该如何处理 [/quote]
你要进入2000 or xp or win2003编译环境下编译才行哦
satanli1982
驱动牛犊
驱动牛犊
  • 注册日期2004-03-07
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分7分
  • 威望3点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2004-04-01 22:08
谢谢大家,我终于搞定了。
用driver studio的DDK Build Settings打开VC,编译环境自然会设置好,剩下的编译就行了。
游客

返回顶部