ערוך

שתף באמצעות


FtmBase Class

Represents a free-threaded marshaler object.

Syntax

class FtmBase :
    public Microsoft::WRL::Implements<
        Microsoft::WRL::RuntimeClassFlags<WinRtClassicComMix>,
        Microsoft::WRL::CloakedIid<IMarshal>
    >;

Remarks

For more information, see RuntimeClass Class.

Members

Public Constructors

Name Description
FtmBase::FtmBase Initializes a new instance of the FtmBase class.

Public Methods

Name Description
FtmBase::CreateGlobalInterfaceTable Creates a global interface table (GIT).
FtmBase::DisconnectObject Forcibly releases all external connections to an object. The object's server calls the object's implementation of this method prior to shutting down.
FtmBase::GetMarshalSizeMax Get the upper bound on the number of bytes needed to marshal the specified interface pointer on the specified object.
FtmBase::GetUnmarshalClass Gets the CLSID that COM uses to locate the DLL containing the code for the corresponding proxy. COM loads this DLL to create an uninitialized instance of the proxy.
FtmBase::MarshalInterface Writes into a stream the data required to initialize a proxy object in some client process.
FtmBase::ReleaseMarshalData Destroys a marshaled data packet.
FtmBase::UnmarshalInterface Initializes a newly created proxy and returns an interface pointer to that proxy.

Public Data Members

Name Description
FtmBase::marshaller_ Holds a reference to the free threaded marshaler.

Inheritance Hierarchy

FtmBase

Requirements

Header: ftm.h

Namespace: Microsoft::WRL

FtmBase::CreateGlobalInterfaceTable

Creates a global interface table (GIT).

static HRESULT CreateGlobalInterfaceTable(
   __out IGlobalInterfaceTable **git
);

Parameters

git
When this operation completes, a pointer to a global interface table.

Return Value

S_OK if successful; otherwise, an HRESULT that indicates the error.

Remarks

For more information, see IGlobalInterfaceTable.

FtmBase::DisconnectObject

Forcibly releases all external connections to an object. The object's server calls the object's implementation of this method prior to shutting down.

STDMETHODIMP DisconnectObject(
   __in DWORD dwReserved
) override;

Parameters

dwReserved
Reserved for future use; must be zero.

Return Value

S_OK if successful; otherwise, an HRESULT that indicates the error.

FtmBase::FtmBase

Initializes a new instance of the FtmBase class.

FtmBase();

FtmBase::GetMarshalSizeMax

Get the upper bound on the number of bytes needed to marshal the specified interface pointer on the specified object.

STDMETHODIMP GetMarshalSizeMax(
   __in REFIID riid,
   __in_opt void *pv,
   __in DWORD dwDestContext,
   __reserved void *pvDestContext,
   __in DWORD mshlflags,
   __out DWORD *pSize
) override;

Parameters

riid
Reference to the identifier of the interface to be marshaled.

pv
Interface pointer to be marshaled; can be NULL.

dwDestContext
Destination context where the specified interface is to be unmarshaled.

Specify one or more MSHCTX enumeration values.

Currently, unmarshaling can occur either in another apartment of the current process (MSHCTX_INPROC) or in another process on the same computer as the current process (MSHCTX_LOCAL).

pvDestContext
Reserved for future use; must be NULL.

mshlflags
Flag indicating whether the data to be marshaled is to be transmitted back to the client process — the typical case — or written to a global table, where it can be retrieved by multiple clients. Specify one or more MSHLFLAGS enumeration values.

pSize
When this operation completes, pointer to the upper bound on the amount of data to be written to the marshaling stream.

Return Value

S_OK if successful; otherwise, E_FAIL or E_NOINTERFACE.

FtmBase::GetUnmarshalClass

Gets the CLSID that COM uses to locate the DLL containing the code for the corresponding proxy. COM loads this DLL to create an uninitialized instance of the proxy.

STDMETHODIMP GetUnmarshalClass(
   __in REFIID riid,
   __in_opt void *pv,
   __in DWORD dwDestContext,
   __reserved void *pvDestContext,
   __in DWORD mshlflags,
   __out CLSID *pCid
) override;

Parameters

riid
Reference to the identifier of the interface to be marshaled.

pv
Pointer to the interface to be marshaled; can be NULL if the caller does not have a pointer to the desired interface.

dwDestContext
Destination context where the specified interface is to be unmarshaled.

Specify one or more MSHCTX enumeration values.

Unmarshaling can occur either in another apartment of the current process (MSHCTX_INPROC) or in another process on the same computer as the current process (MSHCTX_LOCAL).

pvDestContext
Reserved for future use; must be NULL.

mshlflags
When this operation completes, pointer to the CLSID to be used to create a proxy in the client process.

pCid

Return Value

S_OK if successful; otherwise, S_FALSE.

FtmBase::MarshalInterface

Writes into a stream the data required to initialize a proxy object in some client process.

STDMETHODIMP MarshalInterface(
   __in IStream *pStm,
   __in REFIID riid,
   __in_opt void *pv,
   __in DWORD dwDestContext,
   __reserved void *pvDestContext,
   __in DWORD mshlflags
) override;

Parameters

pStm
Pointer to the stream to be used during marshaling.

riid
Reference to the identifier of the interface to be marshaled. This interface must be derived from the IUnknown interface.

pv
Pointer to the interface pointer to be marshaled; can be NULL if the caller does not have a pointer to the desired interface.

dwDestContext
Destination context where the specified interface is to be unmarshaled.

Specify one or more MSHCTX enumeration values.

Unmarshaling can occur in another apartment of the current process (MSHCTX_INPROC) or in another process on the same computer as the current process (MSHCTX_LOCAL).

pvDestContext
Reserved for future use; must be zero.

mshlflags
Specifies whether the data to be marshaled is to be transmitted back to the client process — the typical case — or written to a global table, where it can be retrieved by multiple clients.

Return Value

S_OK The interface pointer was marshaled successfully.

E_NOINTERFACE The specified interface is not supported.

STG_E_MEDIUMFULL The stream is full.

E_FAIL The operation failed.

FtmBase::marshaller_

Holds a reference to the free threaded marshaler.

Microsoft::WRL::ComPtr<IMarshal> marshaller_; ;

FtmBase::ReleaseMarshalData

Destroys a marshaled data packet.

STDMETHODIMP ReleaseMarshalData(
   __in IStream *pStm
) override;

Parameters

pStm
Pointer to a stream that contains the data packet to be destroyed.

Return Value

S_OK if successful; otherwise, an HRESULT that indicates the error.

FtmBase::UnmarshalInterface

Initializes a newly created proxy and returns an interface pointer to that proxy.

STDMETHODIMP UnmarshalInterface(
   __in IStream *pStm,
   __in REFIID riid,
   __deref_out void **ppv
) override;

Parameters

pStm
Pointer to the stream from which the interface pointer is to be unmarshaled.

riid
Reference to the identifier of the interface to be unmarshaled.

ppv
When this operation completes, the address of a pointer variable that receives the interface pointer requested in riid. If this operation is successful, *ppv contains the requested interface pointer of the interface to be unmarshaled.

Return Value

S_OK if successful; otherwise, E_NOINTERFACE or E_FAIL.