Package system.runtime.interopservices
Class Marshal
- java.lang.Object
-
- org.mases.jcobridge.netreflection.NetObject
-
- system.runtime.interopservices.Marshal
-
- All Implemented Interfaces:
IJCOBridgeReflected
public class Marshal extends NetObject
The base .NET class managing System.Runtime.InteropServices.Marshal, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e..NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.InteropServices.Marshal
Powered by JCOBridge: more info at https://www.jcobridge.com
- Author:
- MASES s.r.l https://masesgroup.com
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
assemblyFullName
Fully assembly qualified name: System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798estatic java.lang.String
assemblyShortName
Assembly name: System.Private.CoreLibstatic java.lang.String
className
Qualified class name: System.Runtime.InteropServices.Marshalstatic JCType
classType
The type managed from JCOBridge.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
AreComObjectsAvailableForCleanup()
static NetObject
BindToMoniker(java.lang.String monikerName)
static Marshal
cast(IJCOBridgeReflected from)
Try to cast theIJCOBridgeReflected
instance intoMarshal
, a cast assert is made to check if types are compatible.static void
ChangeWrapperHandleStrength(NetObject otp, boolean fIsWeak)
static void
CleanupUnusedObjectsInCurrentContext()
static NetObject
CreateWrapperOfType(NetObject o, NetType t)
static int
FinalReleaseComObject(NetObject o)
static Guid
GenerateGuidForType(NetType type)
static java.lang.String
GenerateProgIdForType(NetType type)
static NetObject
GetComObjectData(NetObject obj, NetObject key)
static int
GetEndComSlot(NetType t)
static int
GetExceptionCode()
static NetException
GetExceptionForHR(int errorCode)
static int
GetHRForException(NetException e)
static int
GetHRForLastWin32Error()
java.lang.String
getJCOAssemblyName()
Returns the reflected Assembly namejava.lang.String
getJCOClassName()
Returns the reflected Class namejava.lang.Object
getJCOInstance()
Returns the instantiated classjava.lang.String
getJCOObjectName()
Returns the reflected Class name used to build the objectJCType
getJCOType()
Returns the instantiated class Typestatic int
GetLastPInvokeError()
static java.lang.String
GetLastPInvokeErrorMessage()
static int
GetLastSystemError()
static int
GetLastWin32Error()
static java.lang.String
GetPInvokeErrorMessage(int error)
static int
GetStartComSlot(NetType t)
static NetType
GetTypeFromCLSID(Guid clsid)
static java.lang.String
GetTypeInfoName(ITypeInfo typeInfo)
static boolean
IsComObject(NetObject o)
static boolean
IsTypeVisibleFromCom(NetType t)
static void
Prelink(MethodInfo m)
static void
PrelinkAll(NetType c)
static byte
ReadByte(NetObject ptr, int ofs)
static short
ReadInt16(NetObject ptr, int ofs)
static int
ReadInt32(NetObject ptr, int ofs)
static long
ReadInt64(NetObject ptr, int ofs)
static int
ReleaseComObject(NetObject o)
static boolean
SetComObjectData(NetObject obj, NetObject key, NetObject data)
void
setJCOInstance(JCObject instance)
static void
SetLastPInvokeError(int error)
static void
SetLastSystemError(int error)
static int
SizeOf(NetObject structure)
static int
SizeOf(NetType t)
static void
ThrowExceptionForHR(int errorCode)
static void
WriteByte(NetObject ptr, int ofs, byte val)
static void
WriteInt16(JCORefOut<NetObject> ptr, int ofs, char val)
static void
WriteInt16(NetObject ptr, int ofs, short val)
static void
WriteInt32(NetObject ptr, int ofs, int val)
static void
WriteInt64(NetObject ptr, int ofs, long val)
-
-
-
Field Detail
-
assemblyFullName
public static final java.lang.String assemblyFullName
Fully assembly qualified name: System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e- See Also:
- Constant Field Values
-
assemblyShortName
public static final java.lang.String assemblyShortName
Assembly name: System.Private.CoreLib- See Also:
- Constant Field Values
-
className
public static final java.lang.String className
Qualified class name: System.Runtime.InteropServices.Marshal- See Also:
- Constant Field Values
-
-
Method Detail
-
getJCOAssemblyName
public java.lang.String getJCOAssemblyName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Assembly name- Specified by:
getJCOAssemblyName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOAssemblyName
in classNetObject
- Returns:
- A
String
representing the Fullname of reflected Assembly
-
getJCOClassName
public java.lang.String getJCOClassName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name- Specified by:
getJCOClassName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOClassName
in classNetObject
- Returns:
- A
String
representing the Fullname of reflected Class
-
getJCOObjectName
public java.lang.String getJCOObjectName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name used to build the object- Specified by:
getJCOObjectName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOObjectName
in classNetObject
- Returns:
- A
String
representing the name used to allocated the object in CLR context
-
getJCOInstance
public java.lang.Object getJCOInstance()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class- Specified by:
getJCOInstance
in interfaceIJCOBridgeReflected
- Overrides:
getJCOInstance
in classNetObject
- Returns:
- An
Object
representing the CLR instance of the instantiated Class
-
setJCOInstance
public void setJCOInstance(JCObject instance)
- Overrides:
setJCOInstance
in classNetObject
-
getJCOType
public JCType getJCOType()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class Type- Specified by:
getJCOType
in interfaceIJCOBridgeReflected
- Overrides:
getJCOType
in classNetObject
- Returns:
- A
JCType
representing the CLR Type of the instantiated Class
-
cast
public static Marshal cast(IJCOBridgeReflected from) throws java.lang.Throwable
Try to cast theIJCOBridgeReflected
instance intoMarshal
, a cast assert is made to check if types are compatible.- Parameters:
from
-IJCOBridgeReflected
instance to be casted- Returns:
Marshal
instance- Throws:
java.lang.Throwable
- in case of error during cast operation
-
AreComObjectsAvailableForCleanup
public static boolean AreComObjectsAvailableForCleanup() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
IsComObject
public static boolean IsComObject(NetObject o) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
IsTypeVisibleFromCom
public static boolean IsTypeVisibleFromCom(NetType t) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
SetComObjectData
public static boolean SetComObjectData(NetObject obj, NetObject key, NetObject data) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, IndexOutOfRangeException, RankException, CultureNotFoundException, ObjectDisposedException
-
ReadByte
public static byte ReadByte(NetObject ptr, int ofs) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, ObjectDisposedException, RankException, IndexOutOfRangeException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
ArgumentNullException
InvalidOperationException
PlatformNotSupportedException
ArrayTypeMismatchException
NotSupportedException
ObjectDisposedException
RankException
IndexOutOfRangeException
AccessViolationException
OutOfMemoryException
MarshalDirectiveException
-
ReadInt16
public static short ReadInt16(NetObject ptr, int ofs) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
-
FinalReleaseComObject
public static int FinalReleaseComObject(NetObject o) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, IndexOutOfRangeException, RankException, CultureNotFoundException, ObjectDisposedException
-
GetEndComSlot
public static int GetEndComSlot(NetType t) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
GetExceptionCode
public static int GetExceptionCode() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetHRForException
public static int GetHRForException(NetException e) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException
-
GetHRForLastWin32Error
public static int GetHRForLastWin32Error() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetLastPInvokeError
public static int GetLastPInvokeError() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetLastSystemError
public static int GetLastSystemError() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetLastWin32Error
public static int GetLastWin32Error() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetStartComSlot
public static int GetStartComSlot(NetType t) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
ReadInt32
public static int ReadInt32(NetObject ptr, int ofs) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
-
ReleaseComObject
public static int ReleaseComObject(NetObject o) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, IndexOutOfRangeException, RankException, CultureNotFoundException, ObjectDisposedException, NullReferenceException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
ArgumentNullException
InvalidOperationException
PlatformNotSupportedException
ArrayTypeMismatchException
NotSupportedException
IndexOutOfRangeException
RankException
CultureNotFoundException
ObjectDisposedException
NullReferenceException
-
SizeOf
public static int SizeOf(NetObject structure) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
SizeOf
public static int SizeOf(NetType t) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
ReadInt64
public static long ReadInt64(NetObject ptr, int ofs) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
-
GetExceptionForHR
public static NetException GetExceptionForHR(int errorCode) throws java.lang.Throwable, NotSupportedException, ArgumentException, PlatformNotSupportedException
- Throws:
java.lang.Throwable
NotSupportedException
ArgumentException
PlatformNotSupportedException
-
GenerateGuidForType
public static Guid GenerateGuidForType(NetType type) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
BindToMoniker
public static NetObject BindToMoniker(java.lang.String monikerName) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, IndexOutOfRangeException, RankException, CultureNotFoundException, ObjectDisposedException
-
CreateWrapperOfType
public static NetObject CreateWrapperOfType(NetObject o, NetType t) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, IndexOutOfRangeException, RankException, CultureNotFoundException, ObjectDisposedException
-
GetComObjectData
public static NetObject GetComObjectData(NetObject obj, NetObject key) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, IndexOutOfRangeException, RankException, CultureNotFoundException, ObjectDisposedException
-
GenerateProgIdForType
public static java.lang.String GenerateProgIdForType(NetType type) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException, FormatException, AmbiguousMatchException
-
GetLastPInvokeErrorMessage
public static java.lang.String GetLastPInvokeErrorMessage() throws java.lang.Throwable, NotSupportedException, ArgumentException, PlatformNotSupportedException, ArgumentOutOfRangeException, InvalidOperationException, FormatException
-
GetPInvokeErrorMessage
public static java.lang.String GetPInvokeErrorMessage(int error) throws java.lang.Throwable, ArgumentException, NotSupportedException, InvalidOperationException, ArgumentOutOfRangeException, IndexOutOfRangeException, PlatformNotSupportedException, ArgumentNullException, FormatException
-
GetTypeInfoName
public static java.lang.String GetTypeInfoName(ITypeInfo typeInfo) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
GetTypeFromCLSID
public static NetType GetTypeFromCLSID(Guid clsid) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, CultureNotFoundException, ObjectDisposedException
-
ChangeWrapperHandleStrength
public static void ChangeWrapperHandleStrength(NetObject otp, boolean fIsWeak) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
CleanupUnusedObjectsInCurrentContext
public static void CleanupUnusedObjectsInCurrentContext() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
Prelink
public static void Prelink(MethodInfo m) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
PrelinkAll
public static void PrelinkAll(NetType c) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
-
SetLastPInvokeError
public static void SetLastPInvokeError(int error) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
SetLastSystemError
public static void SetLastSystemError(int error) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
ThrowExceptionForHR
public static void ThrowExceptionForHR(int errorCode) throws java.lang.Throwable, PlatformNotSupportedException
- Throws:
java.lang.Throwable
PlatformNotSupportedException
-
WriteByte
public static void WriteByte(NetObject ptr, int ofs, byte val) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, NotSupportedException, ObjectDisposedException, RankException, IndexOutOfRangeException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
ArgumentNullException
InvalidOperationException
PlatformNotSupportedException
ArrayTypeMismatchException
NotSupportedException
ObjectDisposedException
RankException
IndexOutOfRangeException
AccessViolationException
OutOfMemoryException
MarshalDirectiveException
-
WriteInt16
public static void WriteInt16(JCORefOut<NetObject> ptr, int ofs, char val) throws java.lang.Throwable, ArgumentException, NotSupportedException, InvalidOperationException, ArgumentOutOfRangeException, PlatformNotSupportedException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException, ArgumentNullException
-
WriteInt16
public static void WriteInt16(NetObject ptr, int ofs, short val) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
-
WriteInt32
public static void WriteInt32(NetObject ptr, int ofs, int val) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
-
WriteInt64
public static void WriteInt64(NetObject ptr, int ofs, long val) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, AccessViolationException, OutOfMemoryException, MarshalDirectiveException
-
-