Share via


IHostTaskManager Interface

Provides methods that allow the common language runtime (CLR) to work with tasks through the host instead of using the standard operating system threading or fiber functions.

interface IHostTaskManager : IUnknown
{
    HRESULT GetCurrentTask (
                [out] IHostTask **pTask
        );

    HRESULT CreateTask (
                [in] DWORD dwStackSize,
        [in] LPTHREAD_START_ROUTINE pStartAddress,
        [in] PVOID pParameter,
        [out] IHostTask **ppTask
        );

    HRESULT Sleep (
                [in] DWORD dwMilliseconds,
        [in] DWORD option
        );

    HRESULT SwitchToTask (
                [in] DWORD option
        );

    HRESULT SetUILocale (
                [in] LCID lcid
        );

    HRESULT SetLocale (
                [in] LCID lcid
        );

    HRESULT CallNeedsHostHook (
                [in] SIZE_T target,
        [out] BOOL *pbCallNeedsHostHook
        );

    HRESULT LeaveRuntime (
                [in] SIZE_T target
        );

    HRESULT EnterRuntime ();

    HRESULT ReverseLeaveRuntime ();

    HRESULT ReverseEnterRuntime ();

    HRESULT BeginDelayAbort ();

    HRESULT EndDelayAbort ();

    HRESULT BeginThreadAffinity ();

    HRESULT EndThreadAffinity ();

    HRESULT SetStackGuarantee (
                [in] ULONG guarantee
        );

    HRESULT GetStackGuarantee (
                [out] ULONG *pGuarantee
        );

    HRESULT SetCLRTaskManager (
        [in] ICLRTaskManager *ppManager
        );

}

Methods

Method Description

IHostTaskManager::BeginDelayAbort Method

Notifies the host that managed code is entering a period in which the current task must not be aborted.

IHostTaskManager::BeginThreadAffinity Method

Notifies the host that managed code is entering a period in which the current task must not be moved to another operating system thread.

IHostTaskManager::CallNeedsHostHook Method

Enables the host to specify whether the common language runtime can inline the specified call to an unmanaged function.

IHostTaskManager::CreateTask Method

Requests that the host create a new task.

IHostTaskManager::EndDelayAbort Method

Notifies the host that managed code is exiting the period in which the current task must not be aborted, following an earlier call to BeginDelayAbort.

IHostTaskManager::EndThreadAffinity Method

Notifies the host that managed code is exiting the period in which the current task must not be moved to another operating system thread, following an earlier call to BeginThreadAffinity.

IHostTaskManager::EnterRuntime Method

Notifies the host that a call to an unmanaged method, such as a platform invoke method, is returning execution control to the CLR.

IHostTaskManager::GetCurrentTask Method

Gets an interface pointer to the task that is currently executing on the operating system thread from which this call is made.

IHostTaskManager::GetStackGuarantee Method

Gets the amount of stack space that is guaranteed to be available after a stack operation completes, but before the closing of a process.

IHostTaskManager::LeaveRuntime Method

Notifies the host that managed code is about to make a call to an unmanaged function.

IHostTaskManager::ReverseEnterRuntime Method

Notifies the host that a call is being made into the common language runtime (CLR) from unmanaged code.

IHostTaskManager::ReverseLeaveRuntime Method

Notifies the host that control is leaving the CLR and entering an unmanaged function that was, in turn, called from managed code.

IHostTaskManager::SetCLRTaskManager Method

Provides the host with an interface pointer to an ICLRTaskManager Interface instance implemented by the CLR.

IHostTaskManager::SetLocale Method

Notifies the host that the CLR has changed the locale on the current task.

IHostTaskManager::SetStackGuarantee Method

Reserved for internal use only.

IHostTaskManager::SetUILocale Method

Notifies the host that the user interface locale has been changed on the current task.

IHostTaskManager::Sleep Method

Notifies the host that the current task is going to sleep.

IHostTaskManager::SwitchToTask Method

Notifies the host that it should switch out the current task.

Remarks

IHostTaskManager allows the CLR to create and manage tasks, to provide hooks for the host to take action when control transfers from managed to unmanaged code and vice versa, and to specify certain actions the host can and cannot take during code execution.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: MSCorEE.idl

Library: Included as a resource in MSCorEE.dll

.NET Framework Version: 2.0

See Also

Reference

ICLRTask Interface
ICLRTaskManager Interface
IHostTask Interface

Other Resources

Hosting Interfaces