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

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

2006-6-16 21:28
8795

下面是我从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);
}


[招生]科锐逆向工程师培训(2025年3月11日实地,远程教学同时开班, 第52期)!

收藏
免费 7
支持
分享
最新回复 (5)
雪    币: 214
活跃值: (70)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
2
加入这个就行了
//
// 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_)))
2006-6-16 22:31
0
雪    币: 214
活跃值: (70)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
看少了一这个

typedef unsigned __int64 ULONGLONG;
typedef ULONGLONG  DWORDLONG;
2006-6-16 23:57
0
雪    币: 207
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
先谢谢了...我用的是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中才有呀..请多多指点......
2006-6-17 09:53
0
雪    币: 214
活跃值: (10)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
5
如果你使用的是vc6.0,你需要安砚Microsoft Platform SDK。。。。呃?你可以使用到很多新版msdn提到而在vc2003以上可以使用的?西。。
2006-6-17 12:43
0
雪    币: 207
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
嗯是这个原因....我下了2003的SDK安装了之后就好了...谢谢老兄提醒.................
2006-6-17 16:37
0
游客
登录 | 注册 方可回帖
返回