VirtualBox

Changeset 53027 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 10, 2014 12:10:38 PM (10 years ago)
Author:
vboxsync
Message:

Forward ported r96507: SUP: Don't wait for yourself to quit, wait on your parent. Duh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp

    r53025 r53027  
    38303830    if (pThis->iWhich > 1)
    38313831    {
    3832         OBJECT_ATTRIBUTES ObjAttr;
    3833         InitializeObjectAttributes(&ObjAttr, NULL, 0, NULL /*hRootDir*/, NULL /*pSecDesc*/);
    3834 
    3835         CLIENT_ID ClientId;
    3836         ClientId.UniqueProcess = (HANDLE)pThis->BasicInfo.InheritedFromUniqueProcessId;
    3837         ClientId.UniqueThread  = NULL;
    3838 
    3839         rcNt = NtOpenProcess(&pThis->hParent, SYNCHRONIZE | PROCESS_QUERY_INFORMATION, &ObjAttr, &ClientId);
     3832        PROCESS_BASIC_INFORMATION SelfInfo;
     3833        rcNt = NtQueryInformationProcess(NtCurrentProcess(), ProcessBasicInformation, &SelfInfo, sizeof(SelfInfo), &cbActual);
     3834        if (NT_SUCCESS(rcNt))
     3835        {
     3836            OBJECT_ATTRIBUTES ObjAttr;
     3837            InitializeObjectAttributes(&ObjAttr, NULL, 0, NULL /*hRootDir*/, NULL /*pSecDesc*/);
     3838
     3839            CLIENT_ID ClientId;
     3840            ClientId.UniqueProcess = (HANDLE)SelfInfo.InheritedFromUniqueProcessId;
     3841            ClientId.UniqueThread  = NULL;
     3842
     3843            rcNt = NtOpenProcess(&pThis->hParent, SYNCHRONIZE | PROCESS_QUERY_INFORMATION, &ObjAttr, &ClientId);
    38403844#ifdef DEBUG
    3841         SUPR3HARDENED_ASSERT_NT_SUCCESS(rcNt);
     3845            SUPR3HARDENED_ASSERT_NT_SUCCESS(rcNt);
    38423846#endif
    3843         if (!NT_SUCCESS(rcNt))
    3844         {
    3845             pThis->hParent = NULL;
    3846             SUP_DPRINTF(("supR3HardNtChildGatherData: Failed to open parent process (%#p): %#x\n", ClientId.UniqueProcess, rcNt));
     3847            if (!NT_SUCCESS(rcNt))
     3848            {
     3849                pThis->hParent = NULL;
     3850                SUP_DPRINTF(("supR3HardNtChildGatherData: Failed to open parent process (%#p): %#x\n", ClientId.UniqueProcess, rcNt));
     3851            }
    38473852        }
     3853
    38483854    }
    38493855
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