VirtualBox

Changeset 90417 in vbox for trunk


Ignore:
Timestamp:
Jul 29, 2021 9:29:10 PM (3 years ago)
Author:
vboxsync
Message:

IPRT: Implemented RTThreadQueryTerminationStatus for NT (windows). bugref:6695

Location:
trunk/src/VBox/Runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r90416 r90417  
    31833183        generic/RTLogWriteStdOut-stub-generic.cpp \
    31843184        generic/RTMpGetCoreCount-generic.cpp \
    3185         generic/RTThreadQueryTerminationStatus-stub-generic.cpp \
    31863185        generic/RTTimerCreate-generic.cpp \
    31873186        generic/mppresent-generic-online.cpp \
  • trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp

    r82968 r90417  
    112112/** MmUnsecureVirtualMemory - Introduced in NT 3.51.   */
    113113decltype(MmUnsecureVirtualMemory)      *g_pfnrtMmUnsecureVirtualMemory;
     114/** PsIsThreadTerminating - Introduced in NT 3.50. */
     115decltype(PsIsThreadTerminating)        *g_pfnrtPsIsThreadTerminating;
    114116/** RtlGetVersion, introduced in ??. */
    115117PFNRTRTLGETVERSION                      g_pfnrtRtlGetVersion;
  • trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h

    r86175 r90417  
    9696extern decltype(MmSecureVirtualMemory)        *g_pfnrtMmSecureVirtualMemory;
    9797extern decltype(MmUnsecureVirtualMemory)      *g_pfnrtMmUnsecureVirtualMemory;
     98extern decltype(PsIsThreadTerminating)        *g_pfnrtPsIsThreadTerminating;
    9899
    99100extern PFNRTRTLGETVERSION                      g_pfnrtRtlGetVersion;
  • trunk/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp

    r82968 r90417  
    3737#endif
    3838#include <iprt/assert.h>
    39 #include <iprt/errcore.h>
     39#include <iprt/err.h>
    4040#include <iprt/mp.h>
    4141#include "internal-r0drv-nt.h"
     
    227227}
    228228
     229
     230RTDECL(int) RTThreadQueryTerminationStatus(RTTHREAD hThread)
     231{
     232    AssertReturn(hThread == NIL_RTTHREAD, VERR_INVALID_HANDLE);
     233    if (RT_LIKELY(g_pfnrtPsIsThreadTerminating))
     234    {
     235        BOOLEAN fRc = g_pfnrtPsIsThreadTerminating(PsGetCurrentThread());
     236        return !fRc ? VINF_SUCCESS : VINF_THREAD_IS_TERMINATING;
     237    }
     238    return VERR_NOT_SUPPORTED;
     239}
     240
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