Classe System::Runtime::InteropServices::Marshal

Marshal class

Fournit une implémentation du marshaling. Pour la compatibilité avec le code traduit uniquement, car aucun code géré n’est pris en charge du côté C++. Il s’agit d’un type statique sans services d’instance. Vous ne devez jamais créer d’instances de celui-ci, quel que soit le moyen.

class Marshal

Méthodes

MéthodeDescription
static AllocHGlobal(int32_t)Alloue de la mémoire non gérée.
static AllocHGlobal(IntPtr)Alloue de la mémoire non gérée.
static Copy(const IntPtr, container&&, int, int)Implémente la sémantique public static void Copy(IntPtr source, byte[] destination, int startIndex, int length).
static Copy(const void *, container&&, int, int)Implémente la sémantique public static void Copy(IntPtr source, byte[] destination, int startIndex, int length).
static Copy(const container&, int, void *, int)Implémente public static void Copy(char[] source, int startIndex, IntPtr destination, int length).
static Copy(const container&, int, IntPtr, int)Implémente public static void Copy(char[] source, int startIndex, IntPtr destination, int length).
static FreeHGlobal(IntPtr)Libère la mémoire non gérée.
static GetHRForException(const System::Exception&)Obtient le HResult de l’exception.
static PtrToStringAnsi(IntPtr)Crée un String géré à partir d’une chaîne UTF8 non gérée terminée par zéro.
static PtrToStringAnsi(IntPtr, int)Crée un String géré à partir d’une chaîne UTF8 non gérée.
static PtrToStringAuto(IntPtr)Crée un String géré à partir d’une chaîne non gérée terminée par zéro.
static PtrToStringAuto(IntPtr, int)Crée un String géré à partir d’une chaîne non gérée.
static PtrToStringUni(IntPtr)Crée un String géré à partir d’une chaîne Unicode non gérée terminée par zéro.
static PtrToStringUni(IntPtr, int)Crée un String géré à partir d’une chaîne Unicode non gérée.
static PtrToStringUTF8(IntPtr)Crée un String géré à partir d’une chaîne UTF8 non gérée terminée par zéro.
static PtrToStringUTF8(IntPtr, int)Crée un String géré à partir d’une chaîne UTF8 non gérée.
static ReadByte(IntPtr, int)Lit un octet depuis la mémoire.
static ReadInt16(IntPtr, int)Lit un short depuis la mémoire.
static ReadInt32(IntPtr, int)Lit un int depuis la mémoire.
static SecureStringToGlobalAllocAnsi(const SharedPtr<Security::SecureString>&)Copie le contenu de la chaîne sécurisée spécifiée dans la mémoire non gérée, en le convertissant au format ANSI.
static SecureStringToGlobalAllocUnicode(const SharedPtr<Security::SecureString>&)Copie le contenu de la chaîne sécurisée spécifiée dans la mémoire non gérée.
static StringToHGlobalAnsi(const String&)Copie le contenu d’une chaîne spécifiée dans la mémoire non gérée.
static StringToHGlobalAuto(const String&)Copie le contenu d’une chaîne spécifiée dans la mémoire non gérée, en le convertissant au format ANSI si nécessaire.
static StringToHGlobalUni(const String&)Copie le contenu d’une chaîne spécifiée dans la mémoire non gérée.
static WriteByte(IntPtr, int, uint8_t)Écrit un octet en mémoire.
static WriteByte(IntPtr, uint8_t)Écrit un octet en mémoire.
static WriteInt16(IntPtr, int, int16_t)Écrit un short en mémoire.
static WriteInt32(IntPtr, int, int32_t)Écrit un int en mémoire.
static WriteInt64(IntPtr, int, int64_t)Écrit un long en mémoire.
static ZeroFreeGlobalAllocAnsi(IntPtr)Libère le pointeur de chaîne non géré qui a été alloué en utilisant la méthode SecureStringToGlobalAllocAnsi.
static ZeroFreeGlobalAllocUnicode(IntPtr)Libère le pointeur de chaîne non géré qui a été alloué en utilisant la méthode SecureStringToGlobalAllocUnicode.

Voir aussi