共用方式為


3.1.4.2.26 RpcEnumPerMachineConnections (Opnum 87)

Enumerates each of the connections and copies PRINTER_INFO_4 (section 2.2.1.10.5) structures for all the per-machine connections into the buffer pPrinterEnum.<316>

This method is used for remote administration of client computers running the print system.

 DWORD RpcEnumPerMachineConnections(
   [in, string, unique] STRING_HANDLE pServer,
   [in, out, unique, size_is(cbBuf), disable_consistency_check] 
     BYTE* pPrinterEnum,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded,
   [out] DWORD* pcReturned
 );

pServer: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).

pPrinterEnum: A pointer to the BUFFER, as specified in INFO Structures Query Parameters (section 3.1.4.1.9).

BUFFER TYPE: PRINTER_INFO_4

This parameter can be NULL if cbBuf equals zero.

cbBuf: A parameter specified in section 3.1.4.1.9.

pcbNeeded: A parameter specified in section 3.1.4.1.9.

pcReturned: A parameter specified in section 3.1.4.1.9.

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 section 3.1.4.1.4.

  • Perform the validation steps specified in section 3.1.4.1.9.

  • This method SHOULD NOT perform any access checks.

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:

  • Enumerate all printers in the list of per-machine connections on the server that is identified by the pServer parameter (regardless of whether the user has logged on and the printer object has actually been created).

  • Using the enumerated objects, perform the processing and response steps specified in section 3.1.4.1.9.

  • Return the status of the operation.

The server MUST NOT change the list of printer objects representing pushed printers as part of processing this method.