共用方式為


3.1.4.2.27 RpcSendRecvBidiData (Opnum 97)

The RpcSendRecvBidiData method sends and receives bidirectional data. This method is used to communicate with port monitors that support such data.<317>

 DWORD RpcSendRecvBidiData(
   [in] PRINTER_HANDLE hPrinter,
   [in, string, unique] const wchar_t* pAction,
   [in] RPC_BIDI_REQUEST_CONTAINER* pReqData,
   [out] RPC_BIDI_RESPONSE_CONTAINER** ppRespData
 );

hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).

pAction: A pointer to a string that specifies an action to take. The following actions SHOULD be supported.<318>, <319> Port monitors MAY support additional, implementation-specific action strings.

Name/value

Description

BIDI_ACTION_ENUM_SCHEMA

"EnumSchema"

The method MUST enumerate the supported schemas. The pReqData parameter MUST be ignored. The method MUST store one or more values that correspond to supported schema entries in the buffer that is pointed to by the ppRespData parameter.

BIDI_ACTION_GET

"Get"

The method MUST return the specific value item requested. The pReqData parameter specifies a single value entry in the schema. The method MUST store the value of that entry in the buffer that is pointed to by the ppRespData parameter.

BIDI_ACTION_SET

"Set"

The method MUST store the supplied data in a single value item in the schema. The pReqData parameter specifies a single value entry for the schema and the new value to be stored there. This action MUST NOT change the contents of the buffer that is pointed to by the ppRespData parameter.

BIDI_ACTION_GET_ALL

"GetAll"

The method MUST return one or more value items that are reachable from the requested schema item. The pReqData parameter specifies an entry in the schema, which is either a value item or an inner schema entry. The action MUST store one or more value entries, and their associated values, in the buffer that is pointed to by the ppRespData parameter.

BIDI_ACTION_GET_WITH_ARGUMENT

"GetWithArgument"

The method MUST return one or more value items that are reachable from the requested schema item. The pReqData parameter specifies an entry in the schema, which is either a value item or an inner schema entry, and a data value to be used when processing the request. The action MUST store one or more value entries, and their associated values, in the buffer that is pointed to by the ppRespData parameter.

pReqData: A pointer to an RPC_BIDI_REQUEST_CONTAINER (section 2.2.1.2.10) structure that contains the requested binary data.

ppRespData: A pointer to a variable that receives a pointer to a RPC_BIDI_RESPONSE_CONTAINER (section 2.2.1.2.11) structure that contains the response binary data.

Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure [MS-ERREF].

Upon receiving this message, the server MUST validate parameters as follows:

  • Perform the validation steps specified in PRINTER_HANDLE Parameters (section 3.1.4.1.11). This method SHOULD assume that the handle to the printer or port object can be used without further access checks.

  • Verify that the port monitor supports this method, and if that verification fails, return ERROR_NOT_SUPPORTED.

  • Verify that the string that is pointed to by the pAction parameter specifies a valid command and is supported by the port monitor, and if that verification fails, return any of the following error codes to indicate the request cannot be supported: ERROR_NOT_SUPPORTED, ERROR_INVALID_PARAMETER.

  • Verify that the pReqData is a pointer, and if that verification fails, return ERROR_INVALID_PARAMETER.

  • Additional validation MAY be performed<320>.

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client. Otherwise, the server MUST process the message and compose a response to the client as follows:

  • If the hPrinter parameter is a handle to a printer object, load the executable object of the monitor supporting the port associated with the printer identified by hPrinter.

  • If the hPrinter parameter is a handle to a port object, load the executable object of the monitor supporting the port identified by hPrinter.

  • Invoke the method in that library that is identified by the value of the pAction parameter and pass pReqData to that method.

  • Copy the data that is sent from the action method in the buffer that is pointed to by the ppRespData parameter; the number of response items MUST match the number of request items.

  • Return the status of the operation.