这样的神武变异霜狼狼还用洗么 跪求回答

后使用快捷导航没有帐号?
查看: 2797|回复: 12
驱动编译问题,跪求***?
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
编译提示信息如下:
1&------ 已启动生成: 项目: Inline_ObOpenObjectByPointer.WXP, 配置: WXP checked Win32 ------
1&正在执行生成文件项目操作
1&OSR DDKBUILD.CMD V7.2 () - OSR, Open Systems Resources, Inc.
1&DDKBLD: && Setting custom environment variables [ddkbldenv.cmd] ...
1&DDKBLD: && Finished setting custom environment variables [ddkbldenv.cmd] ...
1&DDKBLD: && Performing pre-build steps [ddkprebld.cmd] ...
1&DDKBLD: New build number is 18 ...
1&DDKBLD: && Finished pre-build steps [ddkprebld.cmd] ...
1&DDKBLD: WXP (checked) using the Windows XP DDK and %WXPBASE%
1&DDKBLD: Directory: D:\projects\INLINE~1\INLINE~1
1&DDKBLD: WXPBASE: C:\WINDDK\2600
1&DDKBLD: Run build -Ze -MI for checked version in .
1&BUILD: Object root set to: ==& objchk
1&BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
1&BUILD: /i switch ignored
1&BUILD: Using 2 child processes
1&BUILD: Compile and Link for i386
1&BUILD: Examining d:\projects\inline~1\inline~1 directory for files to compile.
1&& & d:\projects\inline~1\inline~1
1&BUILD: Compiling d:\projects\inline~1\inline~1 directory
1&BUILD: Linking d:\projects\inline~1\inline~1 directory
1&1&Linking Executable - objchk\i386\inline_obopenobjectbypointer.sys for i386
1&inline_obopenobjectbypointer.obj() : error LNK2019: unresolved external symbol &__declspec(dllimport) long __stdcall ObOpenObjectByPointer(void *,unsigned long,struct _ACCESS_STATE *,unsigned long,struct _OBJECT_TYPE *,char,void * *)& (__imp_?ObOpenObjectByPointer@@YGJPAXKPAU_ACCESS_STATE@@KPAU_OBJECT_TYPE@@DPAPAX@Z) referenced in function &void __stdcall StopHook(void)& (?StopHook@@YGXXZ)
1&inline_obopenobjectbypointer.obj() : error LNK2019: unresolved external symbol &__declspec(dllimport) struct _EPROCESS * __stdcall IoThreadToProcess(struct _ETHREAD *)& (__imp_?IoThreadToProcess@@YGPAU_EPROCESS@@PAU_ETHREAD@@@Z) referenced in function &long __stdcall fake_ObOpenObjectByPointer(void *,unsigned long,struct _ACCESS_STATE *,unsigned long,struct _OBJECT_TYPE *,char,void * *)& (?fake_ObOpenObjectByPointer@@YGJPAXKPAU_ACCESS_STATE@@KPAU_OBJECT_TYPE@@DPAPAX@Z)
1&inline_obopenobjectbypointer.obj() : error LNK2001: unresolved external symbol &struct _OBJECT_TYPE * * PsThreadType& (?PsThreadType@@3PAPAU_OBJECT_TYPE@@A)
1&inline_obopenobjectbypointer.obj() : error LNK2001: unresolved external symbol &struct _OBJECT_TYPE * * PsProcessType& (?PsProcessType@@3PAPAU_OBJECT_TYPE@@A)
1&inline_obopenobjectbypointer.obj() : error LNK2019: unresolved external symbol &__declspec(dllimport) long __stdcall PsLookupProcessByProcessId(unsigned long,struct _EPROCESS * *)& (__imp_?PsLookupProcessByProcessId@@YGJKPAPAU_EPROCESS@@@Z) referenced in function _DriverEntry@8
1&inline_obopenobjectbypointer.obj() : error LNK2019: unresolved external symbol &__declspec(dllimport) long __stdcall ZwQuerySystemInformation(unsigned long,void *,unsigned long,unsigned long *)& (__imp_?ZwQuerySystemInformation@@YGJKPAXKPAK@Z) referenced in function _DriverEntry@8
1&objchk\i386\inline_obopenobjectbypointer.sys() : error LNK1120: 6 unresolved externals
1&BUILD: Done
1&& & 1 executable built - 7 Errors
1&DDKBLD: Build complete
1&DDKBLD: Building browse information files
1&DDKBLD: && Performing post-build steps [ddkpostbld.cmd] ...
1&DDKBLD: && Finished post-build steps [ddkpostbld.cmd] ...
1&生成日志保存在“file://d:\projects\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer\BuildLog.htm”
1&Inline_ObOpenObjectByPointer.WXP - 7 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
如何查找函数属于哪个库文件和头文件?
在线时间1 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
extern &C& {
这里写#include &头文件&
在线时间1 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
我是这么写的,应该没问题的呀
#ifdef __cplusplus
extern &C& {
#include &ntddk.h&
#include &windef.h&
#include &stdlib.h&
#ifdef __cplusplus
}; // extern &C&
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
你把#ifdef和#endif都去掉试试。
在线时间1 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
都去掉了还是一样
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
是不是每加某个库文件?
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
谢谢cnzdgs帮我解决问题
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
你是不是有多个cpp文件?每个文件都要这样包含头文件。
DDK中的lib主要都是C语言的形式,从错误信息可以看出你是以C++的形式包含的头文件。
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
如果实在不行,你把文件扩展名都改成.c试试。
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
我只有一个C++文件,我改成C后问题跟多了,如下:
1&1&Compiling - inline_obopenobjectbypointer.c for i386
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(284) : error C2275: 'NTSTATUS' : illegal use of this type as an expression
1&c:\winddk\2600\inc\wxp\ntdef.h(557) : error see declaration of 'NTSTATUS'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(284) : error C2146: syntax error : missing ';' before identifier 'ntStatus'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(284) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(284) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(284) : error C2143: syntax error : missing ';' before 'identifier'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(284) : error C2065: 'ntStatus' : undeclared identifier
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(285) : error C2143: syntax error : missing ';' before 'type'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(286) : error C2275: 'ULONG' : illegal use of this type as an expression
1&c:\winddk\2600\inc\wxp\ntdef.h(411) : error see declaration of 'ULONG'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(286) : error C2146: syntax error : missing ';' before identifier 'cbBuffer'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(286) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(286) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(286) : error C2143: syntax error : missing ';' before 'identifier'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(286) : error C2065: 'cbBuffer' : undeclared identifier
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(287) : error C2275: 'PSYSTEM_PROCESS_INFORMATION' : illegal use of this type as an expression
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.h(153) : error see declaration of 'PSYSTEM_PROCESS_INFORMATION'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(287) : error C2146: syntax error : missing ';' before identifier 'pInfo'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(287) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(287) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(287) : error C2143: syntax error : missing ';' before 'identifier'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(287) : error C2065: 'pInfo' : undeclared identifier
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(288) : error C2143: syntax error : missing ';' before 'type'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(290) : error C2065: 'pBuffer' : undeclared identifier
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(290) : error C4047: '=' : 'int' differs in levels of indirection from 'PVOID'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(291) : error C4047: '==' : 'int' differs in levels of indirection from 'void *'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(295) : error C4022: 'ZwQuerySystemInformation' : pointer mismatch for actual parameter 2
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(299) : error C4022: 'ExFreePoolWithTag' : pointer mismatch for actual parameter 1
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(303) : error C4047: '=' : 'int' differs in levels of indirection from 'PSYSTEM_PROCESS_INFORMATION'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(306) : error C2223: left of '-&ProcessName' must point to struct/union
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(310) : error C2065: 'ProcessName' : undeclared identifier
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(310) : error C4047: 'function' : 'char *' differs in levels of indirection from 'int'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(312) : error C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(314) : error C2223: left of '-&ProcessId' must point to struct/union
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(315) : error C2223: left of '-&ProcessId' must point to struct/union
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(319) : error C2223: left of '-&NextEntryDelta' must point to struct/union
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(322) : error C2223: left of '-&NextEntryDelta' must point to struct/union
1&d:\projects\inline_obopenobjectbypointer\inline_obopenobjectbypointer\inline_obopenobjectbypointer.c(324) : error C4022: 'ExFreePoolWithTag' : pointer mismatch for actual parameter 1
1&BUILD: Compile errors: not linking d:\projects\inline~1\inline~1 directory
1&BUILD: Done
1&& & 2 files compiled - 38 Errors
1&DDKBLD: ================ Build warnings =======================
1&d:\projects\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer.c(284) : error C2275: 'NTSTATUS' : illegal use of this type as an expression
1&d:\projects\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer.c(284) : error C2146: syntax error : missing ';' before identifier 'ntStatus'
1&d:\projects\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer.c(284) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer.c(284) : error C2144: syntax error : '&Unknown&' should be preceded by '&Unknown&'
1&d:\projects\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer\Inline_ObOpenObjectByPointer.c(284) : error C2143: syntax error : missing ';' before 'identifier'
...........
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
搞定了,应该用c文件,而且变量声明放在函数开始
在线时间0 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
一粒金砂(初级), 积分 0, 距离下一级还需 5 积分
如果用.c文件,要按照C语言的语法,变量只能在函数开头定义,如果不方便改,就还用cpp好了。
你用cpp文件添加了extern &C&之后错误信息完全一样吗?把文件开头部分贴出来看看。
Powered by
逛了这许久,何不进去瞧瞧?后使用我的收藏没有帐号?
所属分类: &
查看: 1|回复: 0
有没有类似下图这种画风的动漫壁纸, 要高清的。跪求
有没有类似下图这种画风的动漫壁纸, 要高清的。跪求。
点这里&&&&
2017大家一起来18183闹元宵赢好礼!

参考资料

 

随机推荐