VirtualBox

Changeset 3584 in kBuild for trunk/src/lib


Ignore:
Timestamp:
Jan 20, 2023 3:29:36 PM (2 years ago)
Author:
bird
Message:

nt/nt_child_inject_standard_handles.c: Fixed starting 64-bit binaries from a WOW64 process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/nt/nt_child_inject_standard_handles.c

    r3236 r3584  
    172172        } Wow64;
    173173    }                           BasicInfo = { { 0, 0, } };
    174     uintptr_t                   uBasicInfoPeb;
     174    ULONGLONG                   ullBasicInfoPeb;
    175175    NTSTATUS                    rcNt;
    176176    ULONGLONG                   ullPeb32 = 0;
     
    244244     */
    245245#if K_ARCH_BITS != 64
    246 /** @todo On vista PEB can be above 4GB!   */
    247246    if (s_fHostIs64Bit && pfnNtWow64QueryInformationProcess64)
    248247    {
     
    254253            return rcNt;
    255254        }
    256         if (   BasicInfo.Wow64.PebBaseAddress < 0x1000
    257             || BasicInfo.Wow64.PebBaseAddress > ~(uintptr_t)0x1000)
     255        if ((ULONGLONG)BasicInfo.Wow64.PebBaseAddress < 0x1000)
    258256        {
    259257            _snprintf(pszErr, cbErr, "NtWow64QueryInformationProcess64 returned bad PebBaseAddress: %#llx",
     
    261259            return ERROR_INVALID_ADDRESS;
    262260        }
    263         uBasicInfoPeb = (uintptr_t)BasicInfo.Wow64.PebBaseAddress;
     261        ullBasicInfoPeb = BasicInfo.Wow64.PebBaseAddress;
    264262    }
    265263    else
     
    276274        {
    277275            _snprintf(pszErr, cbErr, "NtQueryInformationProcess returned bad PebBaseAddress: %#llx",
    278                       BasicInfo.Natural.PebBaseAddress);
     276                      (ULONGLONG)BasicInfo.Natural.PebBaseAddress);
    279277            return ERROR_INVALID_ADDRESS;
    280278        }
    281         uBasicInfoPeb = (uintptr_t)BasicInfo.Natural.PebBaseAddress;
     279        ullBasicInfoPeb = (uintptr_t)BasicInfo.Natural.PebBaseAddress;
    282280    }
    283281
     
    289287#if K_ARCH_BITS != 64
    290288    if (!s_fHostIs64Bit)
    291         ullPeb32 = uBasicInfoPeb;
     289        ullPeb32 = ullBasicInfoPeb;
    292290    else
    293291#endif
     
    299297        {
    300298            ullPeb32 = uPeb32Ptr;
    301             ullPeb64 = uBasicInfoPeb;
     299            ullPeb64 = ullBasicInfoPeb;
    302300#if K_ARCH_BITS != 64
    303301            assert(ullPeb64 != ullPeb32);
     
    309307        {
    310308            assert(NT_SUCCESS(rcNt));
    311             ullPeb64 = uBasicInfoPeb;
     309            ullPeb64 = ullBasicInfoPeb;
    312310        }
    313311    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette