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, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..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: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089static java.lang.String
assemblyShortName
Assembly name: mscorlibstatic 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
GetActiveObject(java.lang.String progID)
static NetObject
GetComObjectData(NetObject obj, NetObject key)
static int
GetComSlotForMethodInfo(MemberInfo m)
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
GetLastWin32Error()
static MemberInfo
GetMethodInfoForComSlot(NetType t, int slot, JCORefOut<ComMemberType> memberType)
static int
GetStartComSlot(NetType t)
static Thread
GetThreadFromFiberCookie(int cookie)
static NetType
GetTypeFromCLSID(Guid clsid)
static java.lang.String
GetTypeInfoName(ITypeInfo typeInfo)
static java.lang.String
GetTypeInfoName(UCOMITypeInfo pTI)
static Guid
GetTypeLibGuid(ITypeLib typelib)
static Guid
GetTypeLibGuid(UCOMITypeLib pTLB)
static Guid
GetTypeLibGuidForAssembly(Assembly asm)
static int
GetTypeLibLcid(ITypeLib typelib)
static int
GetTypeLibLcid(UCOMITypeLib pTLB)
static java.lang.String
GetTypeLibName(ITypeLib typelib)
static java.lang.String
GetTypeLibName(UCOMITypeLib pTLB)
static void
GetTypeLibVersionForAssembly(Assembly inputAssembly, JCORefOut<java.util.concurrent.atomic.AtomicInteger> majorVersion, JCORefOut<java.util.concurrent.atomic.AtomicInteger> minorVersion)
static boolean
IsComObject(NetObject o)
static boolean
IsTypeVisibleFromCom(NetType t)
static int
NumParamBytes(MethodInfo m)
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 void
ReleaseThreadCache()
static boolean
SetComObjectData(NetObject obj, NetObject key, NetObject data)
void
setJCOInstance(JCObject instance)
static int
SizeOf(NetObject structure)
static int
SizeOf(NetType t)
static void
ThrowExceptionForHR(int errorCode)
static void
WriteByte(JCORefOut<NetObject> ptr, int ofs, byte val)
static void
WriteInt16(JCORefOut<NetObject> ptr, int ofs, char val)
static void
WriteInt16(JCORefOut<NetObject> ptr, int ofs, short val)
static void
WriteInt32(JCORefOut<NetObject> ptr, int ofs, int val)
static void
WriteInt64(JCORefOut<NetObject> ptr, int ofs, long val)
-
-
-
Field Detail
-
assemblyFullName
public static final java.lang.String assemblyFullName
Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089- See Also:
- Constant Field Values
-
assemblyShortName
public static final java.lang.String assemblyShortName
Assembly name: mscorlib- 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
- Throws:
java.lang.Throwable
-
IsTypeVisibleFromCom
public static boolean IsTypeVisibleFromCom(NetType t) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
SetComObjectData
public static boolean SetComObjectData(NetObject obj, NetObject key, NetObject data) throws java.lang.Throwable, ArgumentNullException, ArgumentException, NotImplementedException, ArgumentOutOfRangeException, FormatException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException
-
ReadByte
public static byte ReadByte(NetObject ptr, int ofs) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
ReadInt16
public static short ReadInt16(NetObject ptr, int ofs) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
FinalReleaseComObject
public static int FinalReleaseComObject(NetObject o) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
GetComSlotForMethodInfo
public static int GetComSlotForMethodInfo(MemberInfo m) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
GetEndComSlot
public static int GetEndComSlot(NetType t) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetExceptionCode
public static int GetExceptionCode() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetHRForException
public static int GetHRForException(NetException e) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetHRForLastWin32Error
public static int GetHRForLastWin32Error() 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
- Throws:
java.lang.Throwable
-
GetTypeLibLcid
public static int GetTypeLibLcid(ITypeLib typelib) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetTypeLibLcid
public static int GetTypeLibLcid(UCOMITypeLib pTLB) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
NumParamBytes
public static int NumParamBytes(MethodInfo m) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
ReadInt32
public static int ReadInt32(NetObject ptr, int ofs) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
ReleaseComObject
public static int ReleaseComObject(NetObject o) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
SizeOf
public static int SizeOf(NetObject structure) throws java.lang.Throwable, ArgumentNullException
- Throws:
java.lang.Throwable
ArgumentNullException
-
SizeOf
public static int SizeOf(NetType t) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
ReadInt64
public static long ReadInt64(NetObject ptr, int ofs) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetExceptionForHR
public static NetException GetExceptionForHR(int errorCode) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GenerateGuidForType
public static Guid GenerateGuidForType(NetType type) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetTypeLibGuid
public static Guid GetTypeLibGuid(ITypeLib typelib) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetTypeLibGuid
public static Guid GetTypeLibGuid(UCOMITypeLib pTLB) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetTypeLibGuidForAssembly
public static Guid GetTypeLibGuidForAssembly(Assembly asm) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
BindToMoniker
public static NetObject BindToMoniker(java.lang.String monikerName) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
CreateWrapperOfType
public static NetObject CreateWrapperOfType(NetObject o, NetType t) throws java.lang.Throwable, ArgumentNullException, ArgumentException, NotImplementedException, ObjectDisposedException, AbandonedMutexException, ArgumentOutOfRangeException, FormatException, InvalidOperationException
-
GetActiveObject
public static NetObject GetActiveObject(java.lang.String progID) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetComObjectData
public static NetObject GetComObjectData(NetObject obj, NetObject key) throws java.lang.Throwable, ArgumentNullException, ArgumentException, NotImplementedException, ObjectDisposedException, AbandonedMutexException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
NotImplementedException
ObjectDisposedException
AbandonedMutexException
-
GetMethodInfoForComSlot
public static MemberInfo GetMethodInfoForComSlot(NetType t, int slot, JCORefOut<ComMemberType> memberType) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GenerateProgIdForType
public static java.lang.String GenerateProgIdForType(NetType type) throws java.lang.Throwable, ArgumentNullException, ArgumentException, NotImplementedException, InvalidOperationException, MissingMethodException, TargetInvocationException, ArgumentOutOfRangeException, FormatException, NotSupportedException
-
GetTypeInfoName
public static java.lang.String GetTypeInfoName(ITypeInfo typeInfo) throws java.lang.Throwable, ArgumentNullException
- Throws:
java.lang.Throwable
ArgumentNullException
-
GetTypeInfoName
public static java.lang.String GetTypeInfoName(UCOMITypeInfo pTI) throws java.lang.Throwable, ArgumentNullException
- Throws:
java.lang.Throwable
ArgumentNullException
-
GetTypeLibName
public static java.lang.String GetTypeLibName(ITypeLib typelib) throws java.lang.Throwable, ArgumentNullException
- Throws:
java.lang.Throwable
ArgumentNullException
-
GetTypeLibName
public static java.lang.String GetTypeLibName(UCOMITypeLib pTLB) throws java.lang.Throwable, ArgumentNullException
- Throws:
java.lang.Throwable
ArgumentNullException
-
GetThreadFromFiberCookie
public static Thread GetThreadFromFiberCookie(int cookie) throws java.lang.Throwable, ArgumentException
- Throws:
java.lang.Throwable
ArgumentException
-
GetTypeFromCLSID
public static NetType GetTypeFromCLSID(Guid clsid) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
ChangeWrapperHandleStrength
public static void ChangeWrapperHandleStrength(NetObject otp, boolean fIsWeak) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
CleanupUnusedObjectsInCurrentContext
public static void CleanupUnusedObjectsInCurrentContext() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetTypeLibVersionForAssembly
public static void GetTypeLibVersionForAssembly(Assembly inputAssembly, JCORefOut<java.util.concurrent.atomic.AtomicInteger> majorVersion, JCORefOut<java.util.concurrent.atomic.AtomicInteger> minorVersion) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
Prelink
public static void Prelink(MethodInfo m) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
PrelinkAll
public static void PrelinkAll(NetType c) throws java.lang.Throwable, ArgumentNullException, ArgumentException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
-
ReleaseThreadCache
public static void ReleaseThreadCache() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
ThrowExceptionForHR
public static void ThrowExceptionForHR(int errorCode) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
WriteByte
public static void WriteByte(JCORefOut<NetObject> ptr, int ofs, byte val) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
WriteInt16
public static void WriteInt16(JCORefOut<NetObject> ptr, int ofs, char val) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
WriteInt16
public static void WriteInt16(JCORefOut<NetObject> ptr, int ofs, short val) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
WriteInt32
public static void WriteInt32(JCORefOut<NetObject> ptr, int ofs, int val) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
-