GCHandleExtensions.GetAddressOfArrayData<T> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
重要
此 API 不符合 CLS 規範。
取得陣列資料的 handle位址。
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T* GetAddressOfArrayData(System::Runtime::InteropServices::PinnedGCHandle<cli::array <T> ^> handle);
[System.CLSCompliant(false)]
public static T* GetAddressOfArrayData<T>(this System.Runtime.InteropServices.PinnedGCHandle<T[]> handle);
[<System.CLSCompliant(false)>]
static member GetAddressOfArrayData : System.Runtime.InteropServices.PinnedGCHandle<'T[]> -> nativeptr<'T>
類型參數
- T
參數
- handle
- PinnedGCHandle<T[]>
用來取回指標的把手。
傳回
T*
是釘選陣列第 0 個陣列元素的位址,或 null 是當 handle 不指向任何物件時。
- 屬性
例外狀況
把手尚未初始化或已處置。