为什么Windows 10中的kernel32.dll上的GetFileVersionInfo返回版本6.2?

问题描述 投票:4回答:2

我试图检索kernel32.dll版本,以执行Windows版本检查。然而,由于某种原因,即使kernel32.dll的版本(如文件属性中所示)是10.0.10586.0,返回的版本是:6.2.10586.0怎么样?

    DWORD dwDummy;
    DWORD dwFVISize = GetFileVersionInfoSize(lpszFilePath, &dwDummy);
    LPBYTE lpVersionInfo = new BYTE[dwFVISize];
    if (GetFileVersionInfo(lpszFilePath, 0, dwFVISize, lpVersionInfo) == 0)
    {
        return FALSE;
    }

    UINT uLen;
    VS_FIXEDFILEINFO *lpFfi;
    BOOL bVer = VerQueryValue(lpVersionInfo, L"\\", (LPVOID *)&lpFfi, &uLen);

    if (!bVer || uLen == 0)
    {
        return FALSE;
    }
    DWORD dwFileVersionMS = lpFfi->dwFileVersionMS;
    DWORD dwFileVersionLS = lpFfi->dwFileVersionLS;
    delete[] lpVersionInfo;

    DWORD dwLeftMost = HIWORD(dwFileVersionMS);
    DWORD dwSecondLeft = LOWORD(dwFileVersionMS);
    DWORD dwSecondRight = HIWORD(dwFileVersionLS);
    DWORD dwRightMost = LOWORD(dwFileVersionLS);

Kernel32.dll属性(与SysWow64中相同):enter image description here

c++ winapi windows-10 kernel32
2个回答
© www.soinside.com 2019 - 2024. All rights reserved.