在XP系统上出现无法定位程序输入点 K32GetProcessMemoryInfo
2015-09-23 10:11
786 查看
在XP系统上出现无法定位程序输入点 K32GetProcessMemoryInfo
VC2012升级补丁5.0之后,编译出来的程序发现在XP系统无法定位程序输入点 K32GetProcessMemoryInfo于动态链接库kernel32.dll之上。
之前程序一直在XP上安装正常,今天测试组的同事突然发现,新发布的版本不能在XP上使用,这个问题比较奇怪,因为以往的
版本都是没有问题的。为什么会突然出现这个问题呢?一开始就去查找是否所有工程都使用V110_XP来编译,找完所有工程都没
出错。最后才想到近来升级VC2012的Update5.0的补丁,再打包编译之后,才发现XP的电脑不能使用了。
经过查找分析,发现是如下问题:
这是由于GetProcessMemoryInfo在不同系统版本号不同导致的,官方说明如下:
Remarks
Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI version number affects the name used to call the function and the library that a program must load.
If PSAPI_VERSION is 2 or greater, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetProcessMemoryInfo in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetProcessMemoryInfo.
Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
解决方案:
只需要在#include <psapi.h>引用前添加
#ifndef PSAPI_VERSION
#define PSAPI_VERSION 1
#endif
#include <psapi.h>
#pragma comment(lib,"Psapi.lib")
看来微软已经不支持XP系统了,因此所有发布的新版本软件已经不再测试XP的兼容性了。看来明年,也需要转向不支持XP系统了,否则需要投
入的测试成本和维护成本急剧上升中,需要全面转向WIN7和WIN10系统的支持。有此可见,生态系统就是这么重要的事情,可以左右大局。
蔡军生 微信号: shenzhencai 深圳
VC2012升级补丁5.0之后,编译出来的程序发现在XP系统无法定位程序输入点 K32GetProcessMemoryInfo于动态链接库kernel32.dll之上。
之前程序一直在XP上安装正常,今天测试组的同事突然发现,新发布的版本不能在XP上使用,这个问题比较奇怪,因为以往的
版本都是没有问题的。为什么会突然出现这个问题呢?一开始就去查找是否所有工程都使用V110_XP来编译,找完所有工程都没
出错。最后才想到近来升级VC2012的Update5.0的补丁,再打包编译之后,才发现XP的电脑不能使用了。
经过查找分析,发现是如下问题:
这是由于GetProcessMemoryInfo在不同系统版本号不同导致的,官方说明如下:
Remarks
Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI version number affects the name used to call the function and the library that a program must load.
If PSAPI_VERSION is 2 or greater, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetProcessMemoryInfo in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetProcessMemoryInfo.
Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
解决方案:
只需要在#include <psapi.h>引用前添加
#ifndef PSAPI_VERSION
#define PSAPI_VERSION 1
#endif
#include <psapi.h>
#pragma comment(lib,"Psapi.lib")
看来微软已经不支持XP系统了,因此所有发布的新版本软件已经不再测试XP的兼容性了。看来明年,也需要转向不支持XP系统了,否则需要投
入的测试成本和维护成本急剧上升中,需要全面转向WIN7和WIN10系统的支持。有此可见,生态系统就是这么重要的事情,可以左右大局。
蔡军生 微信号: shenzhencai 深圳
相关文章推荐
- 在XP系统上出现无法定位程序输入点 K32GetProcessMemoryInfo
- V9站点名称的调用方法
- PHP获取用户真实IP
- 基于ThinkPHP+uploadify+upload+PHPExcel 无刷新导入数据
- laravel 教程链接
- ThinkPHP——RBAC角色和权限数据模拟及设计
- vsftpd.conf配置详解
- PhpStorm的使用
- vsftp服务详解
- 基于ThinkPHP+uploadify+upload+PHPExcel 无刷新导入数据
- PHP提高编程效率的20个要点
- PHPStrom中实用的功能和快捷键大全
- PHP中常见的缓存技术实例分析
- php实现的单一入口应用程序实例分析
- php实现简单的MVC框架实例
- php中session_id()函数详细介绍,会话id生成过程及session id长度
- 10个超级有用的PHP代码片段果断收藏
- 利用PHP如何实现Socket服务器
- php实现简易聊天室应用代码
- PHP编程效率的20个要点