OpenProcess error 5 in Windows XP

作者: admin 分类: 开发问题 发布时间: 2013-11-27 12:01 ė2,847 浏览数 6没有评论
文章转自王牌软件
站长推荐:NSetup一键部署软件
一键式完成美化安装包制作,自动增量升级,数据统计,数字签名。应对各种复杂场景,脚本模块化拆分,常规复杂的脚本代码,图形化设置。无需专业的研发经验,轻松完成项目部署。(www.nsetup.cn)

最近在做一个一键代理浏览器的软件,需要Hook 浏览器的联网。

在Windows7 上一切OK,但是在XP上运行以下代码出错

hRemoteProcess == NULL

查到资料 http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/eeb93be6-872c-4028-b0ae-cd873e089825/openprocess-error-in-windows-xp

修改OpenProcess的参数 PROCESS_ALL_ACCESS 为PROCESS_VM_READ   it work fine

I just went through OpenProcess API in msdn, it says below for for PROCESS_ALL_ACCESS. I think this was the issue which you were facing.
Windows Server 2003 and Windows XP/2000: The size of the PROCESS_ALL_ACCESS flag increased on Windows Server 2008 and Windows Vista. If an application compiled for Windows Server 2008 and Windows Vista is run on Windows Server 2003 or Windows XP/2000, the PROCESS_ALL_ACCESS flag is too large and the function specifying this flag fails with ERROR_ACCESS_DENIED. To avoid this problem, specify the minimum set of access rights required for the operation. If PROCESS_ALL_ACCESS must be used, set _WIN32_WINNT to the minimum operating system targeted by your application (for example,#define _WIN32_WINNT _WIN32_WINNT_WINXP). For more information, see Using the Windows Headers .

 

good luck for you

 



只回答业务咨询点击这里给我发消息 点击这里给我发消息

学习日记,兼职软件设计,软件修改,毕业设计。

本文出自 学习日记,转载时请注明出处及相应链接。

本文永久链接: https://www.softwareace.cn/?p=650

0

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">


Ɣ回顶部

无觅相关文章插件,快速提升流量