// ndkpi.h
NDK_FN_CREATE_MR NdkFnCreateMr;
NTSTATUS NdkFnCreateMr(
  [in]           NDK_PD *pNdkPd,
  [in]           BOOLEAN FastRegister,
  [in]           NDK_FN_CREATE_COMPLETION CreateCompletion,
  [in, optional] PVOID RequestContext,
                 NDK_MR **ppNdkMr
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The NdkCreateMr (NDK_FN_CREATE_MR) function creates an NDK memory region (MR) object.
pNdkPd [in]A pointer to an NDK protection domain (PD) object (NDK_PD).
FastRegister [in]If TRUE, MR is for fast-register only. Otherwise, MR is for normal register only.
CreateCompletion [in]A pointer to an NdkCreateCompletion (NDK_FN_CREATE_COMPLETION) function that completes the creation of an NDK object.
RequestContext [in, optional]A context value that the NDK provider passes back to the NdkCreateCompletion function that is specified in the CreateCompletion parameter.
ppNdkMrA pointer to the created MR object (NDK_MR) is returned in this location if request succeeds without returning STATUS_PENDING. If NdkCreateMr returns STATUS_PENDING, this parameter is ignored and the created object is returned with the callback that is specified in the CreateCompletion parameter.
The NdkCreateMr function returns one of the following NTSTATUS codes.
| Return code | Description | 
|---|---|
| STATUS_SUCCESS | The MR object was created successfully and returned with the *ppNdkMr parameter. | 
| STATUS_PENDING | The operation is pending and will be completed later. The provider will call the function specified in the CreateCompletion parameter(NDK_FN_CREATE_COMPLETION) to complete the pending operation. | 
| STATUS_INSUFFICIENT_RESOURCES | The request failed due to insufficient resources.  Important The request can fail inline as well as asynchronously with this status code.  | 
| Other status codes | An error occurred. | 
The NdkCreateMr function creates an NDK memory region (MR) object that can be used for memory registration and fast registration requests. If the function returns STATUS_SUCCESS, the created object is returned in the ppNdkMr parameter. If NdkCreateMr returns STATUS_PENDING, the created object is returned by the NdkCreateCompletion (NDK_FN_CREATE_COMPLETION) function that is specified in the CreateCompletion parameter.
NDKPI Object Lifetime Requirements