Задайте вопросЗадайте вопрос
 

ОтвеченоHow to determine whether an Windows OS is 64 bit or not from Registry Editor

  • 8 февраля 2008 г. 12:16VenuGopal545 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

     

    Hi ,

     

    I need to run a batch file to check whether an operating system is 32 bit or 64 bit .This need to be checked in registry only .I am able to check for 32 bit OS However I never checked for 64 bit OS .So can anyone pls guide me how to know whether the OS is 64 bit or not ?

     

    We need to retrieve from Registry but not basing on the Hardware or the Processor Architecture .Is there any dword value please send me the response

     

    Thanx a lot folks............!

     

Ответы

  • 9 апреля 2008 г. 21:54Jarred Clore Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено

     You can do an IsWow64Process API call to see:

     

    typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);

    BOOL IsWow64()
    {

        BOOL bIsWow64 = FALSE; // assume 32 bit
     
        // can't call IsWow64Process on x32, so first look up the entry point in kernel32
        LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle ("kernel32"),"IsWow64Process");
     // if we have an entry point for IsWow64Process, we can call it
        if (NULL != fnIsWow64Process)
        {
            if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
            {
                // handle error
            }
        }
        return bIsWow64;
    }

     

Все ответы