INDEndpoint::Bind Method
Binds a memory window to a buffer that is within the registered memory.
Syntax
HRESULT Bind(
[in] ND_RESULT *pResult,
[in] ND_MR_HANDLE hMr,
[in] INDMemoryWindow *pMw,
[in] const VOID *pBuffer,
[in] SIZE_T BufferSize,
[in] DWORD Flags,
[out] ND_MW_DESCRIPTOR *pMwDescriptor
);
Parameters
pResult [in]
An ND_RESULT structure which will receive the status of the operation. This method can set the following status codes:- ND_SUCCESS
- ND_CANCELED
- ND_INVALID_REQUEST
- ND_FAILURE
hMr [in]
A handle to the registered memory. The INDAdapter::RegisterMemory method returns the handle.pMw [in]
The memory window to bind to the registered memory. The INDAdapter::CreateMemoryWindow method returns this interface.pBuffer [in]
A buffer within the registered memory to which the memory window is bound. This buffer must be entirely within the bounds of the specified registered memory.BufferSize [in]
The size, in bytes, of the memory window buffer.Flags [in]
The following flags control the operations that the remote peer can perform against the memory. You can specify one or more of the following flags (you must specify at least ND_OP_FLAG_ALLOW_READ or ND_OP_FLAG_ALLOW_WRITE):Value Meaning ND_OP_FLAG_SILENT_SUCCESS 0x00000001 If the request completes successfully, do not generate an entry in the completion queue. Requests that fail will generate an entry in the completion queue.
ND_OP_FLAG_READ_FENCE 0x00000002 All prior Read requests must be complete before the hardware processes new requests.
ND_OP_FLAG_ALLOW_READ 0x00000008 A remote peer can perform Read operations against the memory window.
ND_OP_FLAG_ALLOW_WRITE 0x00000010 A remote peer can perform Write operations against the memory window.
pMwDescriptor [out]
A ND_MW_DESCRIPTOR structure that describes the memory window. The descriptor is sent to the remote peer to allow it to perform Read and Write operations against the memory window.
Return Value
When you implement this method, you should return the following return values. If you return others, try to use well-known values to aid in debugging issues.
Return code | Description |
---|---|
ND_SUCCESS | The operation succeeded. Completion status will be returned through the outbound completion queue associated with the endpoint. |
ND_CONNECTION_INVALID | The endpoint is not connected. |
ND_NO_MORE_ENTRIES | The request would have exceeded the number of outbound requests allowed on the endpoint. The nOutboundEntries parameter of the INDConnector::CreateEndpoint method specifies the limit. |
Remarks
The remote peer can use the window for Read and Write operations after you send the window descriptor to the remote peer. Typically, you send the descriptor as part of a Send request.
The endpoint can be bound to only one memory window at a time. To unbind the window, you can call the INDEndpoint::Invalidate, however, typically, the remote peer removes the binding by calling the INDEndpoint::SendAndInvalidate method.
Requirements
Product |
Microsoft Message Passing Interface (MS-MPI) |
Header |
Ndspi.h |
See Also
Send comments about this topic to Microsoft
Build date: 7/2/2010