This documentation is archived and is not being maintained.

Marshal.NumParamBytes Method

Calculates the number of bytes required to hold the parameters for the specified method.

[Visual Basic]
Public Shared Function NumParamBytes( _
   ByVal m As MethodInfo _
) As Integer
public static int NumParamBytes(
 MethodInfo m
public: static int NumParamBytes(
 MethodInfo* m
public static function NumParamBytes(
   m : MethodInfo
) : int;


A MethodInfo that identifies the method to be checked.

Return Value

The number of bytes required.


NumParamBytes is exposed for complier support only.

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.


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