3.1.4 Message Processing Events and Sequencing Rules

An implementation of the Print System Asynchronous Remote Protocol MUST indicate the following to the remote procedure call (RPC) runtime ([MS-RPCE] section 3).

  • Perform a strict NDR data consistency check at target level 6.0.

  • Reject a NULL unique or full pointer with nonzero conformant value.

  • Using the strict_context_handle attribute ([MS-RPCE] section 2.2.4.15), reject the use of context handles that are created by the methods of a different RPC interface.

The methods that are defined by this protocol are grouped into functional categories, and their syntax and behavior are specified in sections, as shown in the following table. Most methods described in these sections have functional equivalents in the Print System Remote Protocol ([MS-RPRN] section 3.1.4).

Functional category

Description

Section

Printer management

Methods used for discovering and obtaining access to supported printers.

3.1.4.1

Printer driver management

Methods for discovering and installing printer drivers.

3.1.4.2

Printer port management

Methods for discovering and communicating with printer ports.

3.1.4.3

Print-processor management

Methods for discovering and manipulating print-processor objects.

3.1.4.4

Port monitor management

Methods for discovering and installation of port monitor modules.

3.1.4.5

Form management

Methods for discovering and configuring printer forms.

3.1.4.6

Job management

Methods for discovering, defining, and scheduling print jobs.

3.1.4.7

Job printing

Methods for adding documents, pages, and data to print jobs.

3.1.4.8

Printing-related notifications

Methods for obtaining notifications of printing events.

3.1.4.9

Job named property management

Methods for creating, updating, deleting, and enumerating Job Named Properties (section 3.1.1).<9>

3.1.4.10

Branch office print remote logging

Methods for processing Branch Office Print Remote Log Entries (section 3.1.1).<10>

3.1.4.11

The following table lists all the methods of the Print System Asynchronous Remote Protocol in ascending order of their opnums.

Methods in RPC opnum order:

Method

Description

RpcAsyncOpenPrinter

RpcAsyncOpenPrinter retrieves a handle to a specified printer, port, print job or print server. A client uses this method to obtain a print handle to an existing printer on a remote computer.

The counterpart of this method in the Print System Remote Protocol is RpcOpenPrinterEx. All parameters not defined below are specified in [MS-RPRN] section 3.1.4.2.14.

Opnum: 0

RpcAsyncAddPrinter

RpcAsyncAddPrinter installs a printer on the print server.

The counterpart of this method in the Print System Remote Protocol is RpcAddPrinterEx. All parameters not defined below are specified in [MS-RPRN] section 3.1.4.2.15.

Opnum: 1

RpcAsyncSetJob

RpcAsyncSetJob pauses, resumes, cancels, or restarts a print job on a specified printer. This method also can set print job parameters, including the job priority and document name.

Opnum: 2

RpcAsyncGetJob

RpcAsyncGetJob retrieves information about a specified print job on a specified printer.

Opnum: 3

RpcAsyncEnumJobs

RpcAsyncEnumJobs retrieves information about a specified set of print jobs on a specified printer.

Opnum: 4

RpcAsyncAddJob

RpcAsyncAddJob returns ERROR_INVALID_PARAMETER.

Opnum: 5

RpcAsyncScheduleJob

RpcAsyncScheduleJob returns ERROR_SPL_NO_ADDJOB.

Opnum: 6

RpcAsyncDeletePrinter

RpcAsyncDeletePrinter deletes the specified printer object.

The client MUST call RpcAsyncClosePrinter (section 3.1.4.1.10) with the same PRINTER_HANDLE after calling this method.

Opnum: 7

RpcAsyncSetPrinter

RpcAsyncSetPrinter sets the state of a specified printer.

Opnum: 8

RpcAsyncGetPrinter

RpcAsyncGetPrinter retrieves information about a specified printer.

Opnum: 9

RpcAsyncStartDocPrinter

RpcAsyncStartDocPrinter notifies a specified printer that a document is being spooled for printing.

Opnum: 10

RpcAsyncStartPagePrinter

RpcAsyncStartPagePrinter notifies a specified printer that a page is about to be printed.

Opnum: 11

RpcAsyncWritePrinter

RpcAsyncWritePrinter adds data to the file representing the spool file for a specified printer, if the spooling option is turned on; or it sends data to the device directly, if the printer is configured for direct printing.

Opnum: 12

RpcAsyncEndPagePrinter

RpcAsyncEndPagePrinter notifies a specified printer that the application is at the end of a page in a print job.

Opnum: 13

RpcAsyncEndDocPrinter

RpcAsyncEndDocPrinter signals the completion of the current print job on a specified printer.

Opnum: 14

RpcAsyncAbortPrinter

RpcAsyncAbortPrinter aborts the current document on a specified printer.

Opnum: 15

RpcAsyncGetPrinterData

RpcAsyncGetPrinterData retrieves configuration data from a specified printer or print server.

Opnum: 16

RpcAsyncGetPrinterDataEx

RpcAsyncGetPrinterDataEx retrieves configuration data for the specified printer or print server. This method extends RpcAsyncGetPrinterData (section 3.1.4.1.6) and can retrieve values stored under a specified key by RpcAsyncSetPrinterDataEx (section 3.1.4.1.9).

Opnum: 17

RpcAsyncSetPrinterData

RpcAsyncSetPrinterData sets the configuration data for a printer or print server.

Opnum: 18

RpcAsyncSetPrinterDataEx

RpcAsyncSetPrinterDataEx sets the configuration data for a printer or print server. This method is similar to RpcAsyncSetPrinterData (section 3.1.4.1.8) but also allows the caller to specify the registry key under which to store the data.

Opnum: 19

RpcAsyncClosePrinter

RpcAsyncClosePrinter closes a handle to a printer object, server object, job object, or port object, which is opened by calling RpcAsyncOpenPrinter (section 3.1.4.1.1) or RpcAsyncAddPrinter (section 3.1.4.1.2).

Opnum: 20

RpcAsyncAddForm

RpcAsyncAddForm adds a form name to the list of supported forms.

Opnum: 21

RpcAsyncDeleteForm

RpcAsyncDeleteForm removes a form name from the list of supported forms.

Opnum: 22

RpcAsyncGetForm

RpcAsyncGetForm retrieves information about a specified form.

Opnum: 23

RpcAsyncSetForm

RpcAsyncSetForm sets the form information for the specified printer.

Opnum: 24

RpcAsyncEnumForms

RpcAsyncEnumForms enumerates the forms that the specified printer supports.

Opnum: 25

RpcAsyncGetPrinterDriver

RpcAsyncGetPrinterDriver retrieves data about a specified printer driver on a specified printer.

Opnum: 26

RpcAsyncEnumPrinterData

RpcAsyncEnumPrinterData enumerates configuration data for a specified printer.

Opnum: 27

RpcAsyncEnumPrinterDataEx

RpcAsyncEnumPrinterDataEx enumerates all value names and data for a specified printer and key. This method extends RpcAsyncEnumPrinterData (section 3.1.4.1.11) by retrieving several values in a single call.

Opnum: 28

RpcAsyncEnumPrinterKey

RpcAsyncEnumPrinterKey enumerates the subkeys of a specified key for a specified printer.

Opnum: 29

RpcAsyncDeletePrinterData

RpcAsyncDeletePrinterData deletes a specified value from the configuration of a specified printer.

Opnum: 30

RpcAsyncDeletePrinterDataEx

RpcAsyncDeletePrinterDataEx deletes a specified value from the configuration of a specified printer. This method is similar to RpcAsyncDeletePrinterData (section 3.1.4.1.14) but accesses the configuration data using a set of named and typed values that are stored in a hierarchy of registry keys.

Opnum: 31

RpcAsyncDeletePrinterKey

RpcAsyncDeletePrinterKey deletes a specified key and all its subkeys from the configuration of a specified printer.

Opnum: 32

RpcAsyncXcvData

RpcAsyncXcvData provides the means by which a port monitor client component can communicate with its server-side counterpart, the actual port monitor that is hosted by the server.

Opnum: 33

RpcAsyncSendRecvBidiData

RpcAsyncSendRecvBidiData sends and receives bidirectional data. This method is used to communicate with print monitors that support such data.

Opnum: 34

RpcAsyncCreatePrinterIC

RpcAsyncCreatePrinterIC creates an information context on a specified printer.

Opnum: 35

RpcAsyncPlayGdiScriptOnPrinterIC

RpcAsyncPlayGdiScriptOnPrinterIC queries fonts for printer connections.

Opnum: 36

RpcAsyncDeletePrinterIC

RpcAsyncDeletePrinterIC deletes a printer information context.

Opnum: 37

RpcAsyncEnumPrinters

RpcAsyncEnumPrinters enumerates available local printers, printers on a specified print server, printers in a specified domain, or print providers.

Opnum: 38

RpcAsyncAddPrinterDriver

RpcAsyncAddPrinterDriver installs a specified local or a remote printer driver on a specified print server, and it links the configuration, data, and driver files.

Opnum: 39

RpcAsyncEnumPrinterDrivers

RpcAsyncEnumPrinterDrivers enumerates the printer drivers installed on a specified print server.

Opnum: 40

RpcAsyncGetPrinterDriverDirectory

RpcAsyncGetPrinterDriverDirectory retrieves the path of the printer-driver directory on a specified print server.

Opnum: 41

RpcAsyncDeletePrinterDriver

RpcAsyncDeletePrinterDriver removes the specified printer driver from the list of supported drivers for a specified print server.

Opnum: 42

RpcAsyncDeletePrinterDriverEx

RpcAsyncDeletePrinterDriverEx removes the specified printer driver from the list of supported drivers on a specified print server, and deletes the files associated with the driver. This method is similar to RpcAsyncDeletePrinterDriver (section 3.1.4.2.5) but can also delete specific versions of the driver.

Opnum: 43

RpcAsyncAddPrintProcessor

RpcAsyncAddPrintProcessor installs a specified print processor on the specified server and adds its name to an internal list of supported print processors.

Opnum: 44

RpcAsyncEnumPrintProcessors

RpcAsyncEnumPrintProcessors enumerates the print processors installed on a specified server.

Opnum: 45

RpcAsyncGetPrintProcessorDirectory

RpcAsyncGetPrintProcessorDirectory retrieves the path for the print processor on the specified server.

Opnum: 46

RpcAsyncEnumPorts

RpcAsyncEnumPorts enumerates the ports that are available for printing on a specified server.

Opnum: 47

RpcAsyncEnumMonitors

RpcAsyncEnumMonitors retrieves information about the port monitors installed on a specified server.

Opnum: 48

RpcAsyncAddPort

RpcAsyncAddPort adds a specified port name to the list of supported ports on a specified server.

Opnum: 49

RpcAsyncSetPort

RpcAsyncSetPort sets the status associated with a specified port on a specified print server.

Opnum: 50

RpcAsyncAddMonitor

RpcAsyncAddMonitor installs a specified local port monitor, and links the configuration, data, and monitor files on a specified print server.

Opnum: 51

RpcAsyncDeleteMonitor

RpcAsyncDeleteMonitor removes a specified port monitor from a specified print server.

Opnum: 52

RpcAsyncDeletePrintProcessor

RpcAsyncDeletePrintProcessor removes a specified print processor from a specified server.

Opnum: 53

RpcAsyncEnumPrintProcessorDatatypes

RpcAsyncEnumPrintProcessorDatatypes enumerates the data types that a specified print processor supports.

Opnum: 54

RpcAsyncAddPerMachineConnection

RpcAsyncAddPerMachineConnection persistently saves the configuration information for a connection, including the print server name and the name of the print providers for a specified connection.

Opnum: 55

RpcAsyncDeletePerMachineConnection

RpcAsyncDeletePerMachineConnection deletes the stored connection configuration information that corresponds to the pPrinterName parameter value.

Opnum: 56

RpcAsyncEnumPerMachineConnections

RpcAsyncEnumPerMachineConnections enumerates each of the per-machine connections into a specified buffer.

Opnum: 57

RpcSyncRegisterForRemoteNotifications

RpcSyncRegisterForRemoteNotifications opens a notification handle by using a printer handle or print server handle, to listen for remote printer change notifications.

Opnum: 58

RpcSyncUnRegisterForRemoteNotifications

RpcSyncUnRegisterForRemoteNotifications closes a notification handle that is opened by calling RpcSyncRegisterForRemoteNotifications (section 3.1.4.9.1).

Opnum: 59

RpcSyncRefreshRemoteNotifications

RpcSyncRefreshRemoteNotifications gets notification information for all requested members. This is called by a client if the "RemoteNotifyData Flags" property in the RpcPrintPropertiesCollection (section 2.2.4) instance, which was returned as part of the notification from an RpcAsyncGetRemoteNotifications (section 3.1.4.9.4) call, has the PRINTER_NOTIFY_INFO_DISCARDED bit set ([MS-RPRN] section 2.2.3.2).

Opnum: 60

RpcAsyncGetRemoteNotifications

RpcAsyncGetRemoteNotifications is used to poll the print server for specified change notifications. A call to this method is suspended until the server has a new change notification for the client. Subsequently, the client calls this method again to poll for additional notifications from the server.

Opnum: 61

RpcAsyncInstallPrinterDriverFromPackage

RpcAsyncInstallPrinterDriverFromPackage installs a printer driver from a driver package.

Opnum: 62

RpcAsyncUploadPrinterDriverPackage

RpcAsyncUploadPrinterDriverPackage uploads a driver package so it can be installed with the RpcAsyncInstallPrinterDriverFromPackage method (section 3.1.4.2.7).

Opnum: 63

RpcAsyncGetCorePrinterDrivers

RpcAsyncGetCorePrinterDrivers retrieves the globally unique identifier (GUID), the version, the date of the specified core printer drivers, and the path to their packages.

Opnum: 64

RpcAsyncCorePrinterDriverInstalled

RpcAsyncCorePrinterDriverInstalled determines if a specific core printer driver is installed.

Opnum: 65

RpcAsyncGetPrinterDriverPackagePath

RpcAsyncGetPrinterDriverPackagePath gets the path to the specified printer driver package.

Opnum: 66

RpcAsyncDeletePrinterDriverPackage

RpcAsyncDeletePrinterDriverPackage deletes a specified printer driver package.

Opnum: 67

RpcAsyncReadPrinter

RpcAsyncReadPrinter retrieves data from the specified job object.

Opnum: 68

RpcAsyncResetPrinter

RpcAsyncResetPrinter resets the data type and device mode values to use for printing documents that are submitted by the RpcAsyncStartDocPrinter method (section 3.1.4.8.1).

Opnum: 69

RpcAsyncGetJobNamedPropertyValue

RpcAsyncGetJobNamedPropertyValue retrieves the value of the specified Job Named Property (section 3.1.1) for the specified print job.

Opnum: 70

RpcAsyncSetJobNamedProperty

RpcAsyncSetJobNamedProperty creates a new Job Named Property or changes the value of an existent Job Named Property for the specified print job.

Opnum: 71

RpcAsyncDeleteJobNamedProperty

RpcAsyncDeleteJobNamedProperty deletes a Job Named Property for the specified print job.

Opnum: 72

RpcAsyncEnumJobNamedProperties

RpcAsyncEnumJobNamedProperties enumerates the Job Named Properties for the specified print job.

Opnum: 73

RpcAsyncLogJobInfoForBranchOffice

RpcAsyncLogJobInfoForBranchOffice processes one or more Branch Office Print Remote Log Entries (section 3.1.1) by writing them to the Microsoft-Windows-PrintService/Admin and Microsoft-Windows-PrintService/Operations event channels.

Opnum: 74

All methods defined in this protocol are request/response RPC methods. Each method returns either an HRESULT value ([MS-ERREF] section 2.1) or a Win32 code ([MS-ERREF] section 2.2).

A non-negative HRESULT return value indicates successful completion, and a negative value indicates failure. A Win32 return value of zero indicates successful completion, and a nonzero value indicates failure, with the following exceptions.

The ERROR_MORE_DATA and ERROR_INSUFFICIENT_BUFFER Win32 codes defined in the table have specific meanings in this protocol. When a method has an output parameter that returns a required buffer size, the method can return one of these errors.

 Name/Value

 Meaning

ERROR_INSUFFICIENT_BUFFER

0x0000007A

The buffer size specified in a method call is too small.

ERROR_MORE_DATA

0x000000EA

More data is available.

The caller SHOULD NOT treat these return values as errors. The caller SHOULD use the buffer size returned by the method to resize the buffers, and it SHOULD call the method again using the resized buffers. These cases are noted in the method definitions in this section and in their corresponding definitions in [MS-RPRN] section 3.1.4.