Overlapped.UnsafePack Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Packe l’instance actuelle dans une NativeOverlapped structure. Ne propage pas la pile appelante.
Surcharges
| Nom | Description |
|---|---|
| UnsafePack(IOCompletionCallback) |
Obsolète.
Obsolète.
Packe l’instance actuelle dans une NativeOverlapped structure spécifiant le délégué à appeler lorsque l’opération d’E/S asynchrone est terminée. Ne propage pas la pile appelante. |
| UnsafePack(IOCompletionCallback, Object) |
Packs l’instance actuelle dans une NativeOverlapped structure, en spécifiant le délégué à appeler lorsque l’opération d’E/S asynchrone est terminée et l’objet managé qui sert de mémoire tampon. Ne propage pas la pile appelante. |
UnsafePack(IOCompletionCallback)
Attention
This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202
Attention
This method is not safe. Use UnsafePack (iocb, userData) instead. https://go.microsoft.com/fwlink/?linkid=14202
Important
Cette API n’est pas conforme CLS.
Packe l’instance actuelle dans une NativeOverlapped structure spécifiant le délégué à appeler lorsque l’opération d’E/S asynchrone est terminée. Ne propage pas la pile appelante.
public:
System::Threading::NativeOverlapped* UnsafePack(System::Threading::IOCompletionCallback ^ iocb);
[System.CLSCompliant(false)]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb);
[System.CLSCompliant(false)]
[System.Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb);
[System.CLSCompliant(false)]
[System.Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
[System.Security.SecurityCritical]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb);
[System.CLSCompliant(false)]
[System.Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb);
[<System.CLSCompliant(false)>]
member this.UnsafePack : System.Threading.IOCompletionCallback -> nativeptr<System.Threading.NativeOverlapped>
[<System.CLSCompliant(false)>]
[<System.Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.UnsafePack : System.Threading.IOCompletionCallback -> nativeptr<System.Threading.NativeOverlapped>
[<System.CLSCompliant(false)>]
[<System.Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
[<System.Security.SecurityCritical>]
member this.UnsafePack : System.Threading.IOCompletionCallback -> nativeptr<System.Threading.NativeOverlapped>
[<System.CLSCompliant(false)>]
[<System.Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.UnsafePack : System.Threading.IOCompletionCallback -> nativeptr<System.Threading.NativeOverlapped>
Paramètres
- iocb
- IOCompletionCallback
Délégué IOCompletionCallback qui représente la méthode de rappel appelée lorsque l’opération d’E/S asynchrone se termine.
Retours
Pointeur non managé vers une NativeOverlapped structure.
- Attributs
Exceptions
Le courant Overlapped a déjà été emballé.
Remarques
Le pointeur non managé retourné par cette méthode peut être transmis au système d’exploitation en opérations d’E/S superposées. La NativeOverlapped structure est fixe en mémoire physique jusqu’à ce qu’elle Unpack soit appelée.
L’appelant est responsable de l’épinglage de la mémoire tampon. Si le domaine d’application est déchargé, toutefois, le handle vers la mémoire tampon épinglée est détruit et la mémoire tampon est libérée, laissant l’opération d’E/S écrire à l’adresse libérée. Pour cette raison, il est préférable d’utiliser la UnsafePack(IOCompletionCallback, Object) surcharge de méthode, dans laquelle le runtime épingle la mémoire tampon.
Avertissement
L’utilisation de la UnsafePack méthode peut ouvrir par inadvertance un trou de sécurité. La sécurité de l’accès au code base ses contrôles d’autorisation sur les autorisations de tous les appelants sur la pile. La UnsafePack méthode ne propage pas la pile appelante. Le code malveillant peut être en mesure d’exploiter ce code pour éviter les vérifications d’autorisation.
S’applique à
UnsafePack(IOCompletionCallback, Object)
Important
Cette API n’est pas conforme CLS.
Packs l’instance actuelle dans une NativeOverlapped structure, en spécifiant le délégué à appeler lorsque l’opération d’E/S asynchrone est terminée et l’objet managé qui sert de mémoire tampon. Ne propage pas la pile appelante.
public:
System::Threading::NativeOverlapped* UnsafePack(System::Threading::IOCompletionCallback ^ iocb, System::Object ^ userData);
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(false)]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb, object userData);
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb, object userData);
[System.CLSCompliant(false)]
public System.Threading.NativeOverlapped* UnsafePack(System.Threading.IOCompletionCallback iocb, object userData);
[<System.CLSCompliant(false)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.UnsafePack : System.Threading.IOCompletionCallback * obj -> nativeptr<System.Threading.NativeOverlapped>
[<System.CLSCompliant(false)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
member this.UnsafePack : System.Threading.IOCompletionCallback * obj -> nativeptr<System.Threading.NativeOverlapped>
[<System.CLSCompliant(false)>]
member this.UnsafePack : System.Threading.IOCompletionCallback * obj -> nativeptr<System.Threading.NativeOverlapped>
Paramètres
- iocb
- IOCompletionCallback
Délégué IOCompletionCallback qui représente la méthode de rappel appelée lorsque l’opération d’E/S asynchrone se termine.
- userData
- Object
Objet ou tableau d’objets représentant la mémoire tampon d’entrée ou de sortie de l’opération. Chaque objet représente une mémoire tampon, par exemple un tableau d’octets.
Retours
Pointeur non managé vers une NativeOverlapped structure.
- Attributs
Exceptions
L’appelant n’a pas l’autorisation requise.
Le courant Overlapped est déjà emballé.
Remarques
Le pointeur non managé retourné par cette méthode peut être transmis au système d’exploitation en opérations d’E/S superposées. La NativeOverlapped structure est fixe en mémoire physique jusqu’à ce qu’elle Unpack soit appelée.
La mémoire tampon ou les mémoires tampons spécifiées userData doivent être identiques à celles transmises à la fonction de système d’exploitation non managée qui effectue les E/S asynchrones.
Le runtime épingle la mémoire tampon ou les mémoires tampons spécifiées pendantuserData la durée de l’opération d’E/S. Si le domaine d’application est déchargé, le runtime conserve la mémoire épinglée jusqu’à ce que l’opération d’E/S se termine.
Avertissement
L’utilisation de la UnsafePack méthode peut ouvrir par inadvertance un trou de sécurité. La sécurité de l’accès au code base ses contrôles d’autorisation sur les autorisations de tous les appelants sur la pile. La UnsafePack méthode ne propage pas la pile appelante. Le code malveillant peut être en mesure d’exploiter ce code pour éviter les vérifications d’autorisation.