Partager via


ICLRTask::SwitchIn, méthode

Notifie le Common Language Runtime (CLR) que la tâche que l'instance actuelle ICLRTask représente se trouve maintenant dans un état opérationnel.

HRESULT SwitchIn (
    [in] HANDLE threadHandle
);

Paramètres

  • threadHandle
    [in] Handle du thread physique sur lequel la tâche représentée par l'instance ICLRTask actuelle est en cours d'exécution.

Valeur de retour

HRESULT

Description

S_OK

SwitchIn a été retourné avec succès.

HOST_E_CLRNOTAVAILABLE

Le CLR n'a pas été chargé dans un processus ou le CLR présente un état dans lequel il ne peut pas exécuter de code managé ou traiter l'appel avec succès.

HOST_E_TIMEOUT

L'appel a expiré.

HOST_E_NOT_OWNER

L'appelant ne possède pas le verrou.

HOST_E_ABANDONED

Un événement a été annulé alors qu'un thread bloqué ou une fibre l'attendait.

E_FAIL

Une défaillance grave et inconnue s'est produite. Lorsqu'une méthode retourne E_FAIL, le CLR n'est plus utilisable dans le processus. Les appels suivants aux méthodes d'hébergement retournent HOST_E_CLRNOTAVAILABLE.

HOST_E_INVALIDOPERATION

SwitchIn a été appelée sans appel antérieur à ICLRTask::SwitchOut, méthode.

Notes

Le paramètre threadHandle représente un handle du thread du système d'exploitation sur lequel la tâche représentée par l'instance ICLRTask actuelle a été planifiée. Si l'emprunt d'identité s'est produit sur ce thread, vous devez appeler IHostSecurityManager::RevertToSelf avant d'importer la tâche.

RemarqueRemarque

Un appel à SwitchIn sans appel antérieur à SwitchOut échoue avec une valeur HRESULT de HOST_E_INVALIDOPERATION.

Configuration requise

Plateformes : consultez Configuration requise du .NET Framework.

En-tête : MSCorEE.h

Bibliothèque : incluse en tant que ressource dans MSCorEE.dll

Versions du .NET Framework : 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

Voir aussi

Référence

ICLRTask, interface

ICLRTaskManager, interface

IHostTask, interface

IHostTaskManager, interface