This documentation is archived and is not being maintained.

Marshal.PrelinkAll Method

Performs a pre-link check for all methods on a class.

[Visual Basic]
Public Shared Sub PrelinkAll( _
   ByVal c As Type _
)
[C#]
public static void PrelinkAll(
 Type c
);
[C++]
public: static void PrelinkAll(
 Type* c
);
[JScript]
public static function PrelinkAll(
   c : Type
);

Parameters

c
A Type that identifies the class whose methods are to be checked.

Exceptions

Exception Type Condition
ArgumentNullException c is not a valid type.

Remarks

The PrelinkAll method invokes Marshal.Prelink on every method for a given type. Prelink executes one-time method setup tasks without calling each method. You can only use PrelinkAll for platform invoke calls.

Note   This method uses SecurityAction.LinkDemand to prevent it from being called from untrusted code; only the immediate caller is required to have SecurityPermissionAttribute.UnmanagedCode permission. If your code can be called from partially trusted code, do not pass user input to Marshal class methods without validation. For important limitations on using the LinkDemand member, see Demand vs. LinkDemand.

Example

[Visual Basic, C#] The following example demonstrates how to use PrelinkAll.

[Visual Basic] 
Marshal.PrelinkAll(obj.GetType())
[C#] 
Marshal.PrelinkAll(obj.GetType());

[Visual Basic, C#]

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

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

Show: