共用方式為


3.1.4.11.4 WSDMON

This section describes the implementation of the XcvData method in WSDMON. This monitor module is used to control Web Services for Devices (WSD) printers.<391> WSDMON does not have a corresponding user interface module.

For network port naming, see section 2.2.4.10.

For structures used with the WSDMON monitor module, see section 2.2.2.15.

The following table defines command values used by the WSDMON monitor module.<392>

Value

Description

"CleanupPort"

Attempts to remove the Web Services for Devices (WSD) port associated with the hXcv handle. If printers are still using the port, it is not removed.

"DeviceID"

Initiates a query for the WSD DeviceID. The required value for the pOutputData parameter is a pointer to a buffer that receives a string containing the WSD DeviceID (PKEY_PNPX_GlobalIdentity).

"PnPXID"

Initiates a query for the WSD PnPXID. The required value for the pOutputData parameter is a pointer to a buffer that receives a string containing the WSD PnPXID (PKEY_PNPX_ID).

"ResetCommunication"

Attempts to make sure that the communication between the printer and the operating system is working properly.

"ServiceID"

Initiates a query for the WSD ServiceID. The required value for the pOutputData parameter is a pointer to a buffer that receives a string containing the WSD ServiceID (PKEY_PNPX_ServiceID).

"CheckCluster"

Determines whether the queried server is a stand-alone server or a cluster node. The required value for the pOutputData parameter is a pointer to a variable that receives the DWORD value 0x00000000 if the queried server is not a cluster node and a nonzero value otherwise.

"DiscoverDevice"

Uses WS-discovery directed unicast search to try to find a WSD–enabled device at the supplied URI of the endpoint. The required value for the pInputData parameter is a pointer to a string specifying the URI of the WSD endpoint. If a WSD device is found, and it supports the WSD print service definition, ERROR_SUCCESS is returned; otherwise, ERROR_PRINTER_NOT_FOUND is returned [MS-ERREF].

"DriverAvailable"

Determines whether a printer driver for the queried device is available in the server's driver store. The required value for the pInputData parameter is a pointer to a string specifying the URI of the WSD endpoint. The required value for the pOutputData parameter is a pointer to a buffer that receives a WSD_DRIVER_DATA structure if the specified endpoint supports a WSD Printer Service and a driver is available. If the endpoint does not support the WSD Printer Service, ERROR_PRINTER_NOT_FOUND is returned [MS-ERREF]. If no driver can be found, ERROR_CANNOT_DETECT_DRIVER_FAILURE is returned.

"AssocDevice"

Searches for a WSD Printer Service at the supplied URI of the endpoint and installs the printer if found. This command is only supported on stand-alone servers. The required value for the pInputData parameter is a pointer to a string specifying the URI of the WSD endpoint. If a WSD Printer Service is found, a PnPX installation of the printer is initiated; otherwise, ERROR_PRINTER_NOT_FOUND is returned [MS-ERREF].

"AddPrinterPort"

Searches for a WSD Printer Service at the supplied URI of the endpoint, and if one is found, creates a new WSD port connected to the discovered device. This command is only supported on cluster servers. The required value for the pInputData parameter is a pointer to a string specifying the URI of the WSD endpoint. The required value for the pOutputData parameter is a pointer to a buffer that receives a string identifying the new port name if a WSD Printer Service is found; otherwise, ERROR_PRINTER_NOT_FOUND is returned [MS-ERREF].

"BackupPort"

Initiates a query for the WSD port backup data. The required value for the pOutputData parameter is a pointer to a buffer that receives a WSD_BACKUP_PORT_DATA structure.

"AssocDeviceMulticast"

Searches for a WSD Printer Service at the device endpoint that is specified by the GlobalID, which in turn is specified by the string pointed to by pInputData, and installs the printer if found. This command is only supported on stand-alone servers. The required value for the pInputData parameter is a pointer to a string specifying the GlobalID of the WSD endpoint. If a WSD Printer Service is found, a PnPX installation of the printer is initiated; otherwise, ERROR_PRINTER_NOT_FOUND is returned [MS-ERREF].

"RestorePort"

Searches for a WSD printer service that is identified by the ServiceID at the device endpoint specified by the GlobalID and optionally RemoteURL, depending on the value of the DiscoveryMethod.<393> If the value of DiscoveryMethod is kMulticast, only the ServiceID and GlobalID values MUST be used for the search. If the value of DiscoveryMethod is kDirected, the ServiceID, GlobalID, and RemoteURL values MUST be used for the search.  The required value for the pInputData parameter is a WSD_BACKUP_PORT_DATA_EX structure (section 2.2.2.15.3) that contains the values relevant to the printer port to restore. If a matching WSD printer service is found, a PnPX installation of the printer is initiated; otherwise a new port with the specified information is created with a status of PORT_STATUS_OFFLINE (section 2.2.1.9.3). The required value for the pOutputData parameter is a pointer to a buffer that receives a string identifying the new port by name.

"AddMulticastPort"

Searches for a WSD Printer Service at the device endpoint that is specified by the GlobalID, which in turn is specified by the string pointed to by pInputData, and if one is found, creates a new WSD port connected to the discovered device.<394><395>