首页
社区
课程
招聘
问一个API....VerifyVersionInfo.....
2006-6-16 21:28 8170

问一个API....VerifyVersionInfo.....

2006-6-16 21:28
8170
下面是我从MSDN上找到的一段代码....可是编译通不过...提示说VER_SET_CONDITION,VER_MAJORVERSION等常量未定义....大家帮我看下吧.. 

  DWORDLONG 类形不知道在那个头文件中...还有就是...上而那些常量...
The following example determines whether the application is running on Windows 2000 Service Pack 1 or later.
#include <windows.h>
BOOL Is_Win2000_SP1_or_Later ()
{
   OSVERSIONINFOEX osvi;
   DWORDLONG dwlConditionMask = 0;

   // Initialize the OSVERSIONINFOEX structure.

   ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
   osvi.dwMajorVersion = 5;
   osvi.dwMinorVersion = 0;
   osvi.wServicePackMajor = 1;

   // Initialize the condition mask.

   VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION,
      VER_GREATER_EQUAL );
   VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION,
      VER_GREATER_EQUAL );
   VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMAJOR,
      VER_GREATER_EQUAL );

   // Perform the test.

   return VerifyVersionInfo(
      &osvi,
      VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR,
      dwlConditionMask);
}

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
点赞7
打赏
分享
最新回复 (5)
雪    币: 214
活跃值: (70)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
fengercn 2006-6-16 22:31
2
0
加入这个就行了
//
// RtlVerifyVersionInfo() type mask bits
//

#define VER_MINORVERSION                0x0000001
#define VER_MAJORVERSION                0x0000002
#define VER_SERVICEPACKMAJOR            0x0000020

//
//
// VerifyVersionInfo() macro to set the condition mask
//
// For documentation sakes here's the old version of the macro that got
// changed to call an API
// #define VER_SET_CONDITION(_m_,_t_,_c_)  _m_=(_m_|(_c_<<(1<<_t_)))
//
#define VER_SET_CONDITION(_m_,_t_,_c_)  \
        ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_)))
雪    币: 214
活跃值: (70)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
fengercn 2006-6-16 23:57
3
0
看少了一这个

typedef unsigned __int64 ULONGLONG;
typedef ULONGLONG  DWORDLONG;
雪    币: 207
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
AsmCCPlus 2006-6-17 09:53
4
0
先谢谢了...我用的是VC6.0.我查了MSDN如下 ...

VerifyVersionInfo

The VerifyVersionInfo function compares a set of operating system version requirements to the corresponding values for the currently running version of the system.

BOOL VerifyVersionInfo(
  LPOSVERSIONINFOEX lpVersionInfo,
  DWORD dwTypeMask,
  DWORDLONG dwlConditionMask
);

Requirements
Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.

但是在WINBASE.H中就没有VerifyVersionInfo的声明...我想不是是VC6.0中没有这个函数...请问下上面的VerifyVersionInfo函数是到底在那个头文件中呀...我在VC++的MSDN中找不到...但用VS.NET 2003中找到了...是不是...在VS 2003中才有呀..请多多指点......
雪    币: 214
活跃值: (10)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
RyoKou 1 2006-6-17 12:43
5
0
如果你使用的是vc6.0,你需要安砚Microsoft Platform SDK。。。。呃?你可以使用到很多新版msdn提到而在vc2003以上可以使用的?西。。
雪    币: 207
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
AsmCCPlus 2006-6-17 16:37
6
0
嗯是这个原因....我下了2003的SDK安装了之后就好了...谢谢老兄提醒.................
游客
登录 | 注册 方可回帖
返回