Click or drag to resize
Marshal Class
Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks, and converting managed to unmanaged types, as well as other miscellaneous methods used when interacting with unmanaged code.
Inheritance Hierarchy
SystemObject
  System.Runtime.InteropServicesMarshal

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static class Marshal

The Marshal type exposes the following members.

Methods
  NameDescription
Public methodStatic memberOffsetOf
Returns the field offset of the unmanaged form of the managed class.
Public methodStatic memberSizeOf(Object)
Returns the unmanaged size of an object in bytes.
Public methodStatic memberSizeOf(Type)
Returns the size of an unmanaged type in bytes.
Top
Fields
  NameDescription
Public fieldStatic memberSystemDefaultCharSize
Represents the default character size on the system; the default is 2 for Unicode systems and 1 for ANSI systems. This field is read-only.
Public fieldStatic memberSystemMaxDBCSCharSize
Represents the maximum size of a double byte character set (DBCS) size, in bytes, for the current operating system. This field is read-only.
Top
See Also