NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Marshal.GetPinnedHandle

Pins the specified object to prevent it from being garbage collected or moved. (This called must be matched with a subsequent FreePinnedHandle)

[Visual Basic]
Public Shared Function GetPinnedHandle( _
   ByVal obj As Object _
) As Integer
[C#]
public static int GetPinnedHandle(
   object obj
);
[C++]
public: static int GetPinnedHandle(
   Object* obj
);
[JScript]
public static function GetPinnedHandle(
   obj : Object
) : int;

Parameters

obj
Managed object to be pinned.

Return Value

A handle on the pinned object.

Exceptions

Exception Type Condition
System.Runtime.InteropServices.ArgumentException if obj is not an array of primitive types.
System.Runtime.InteropServices.NullReferenceException if obj is null.

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace