UpdatePrintDeviceObject function (winsplp.h)

Warning

Starting with Windows 10, the APIs which support third-party print providers are deprecated. Microsoft does not recommend any investment into third-party print providers. Additionally, on Windows 8 and newer products where the v4 print driver model is available, third-party print providers may not create or manage queues which use v4 print drivers.

The UpdatePrintDeviceObject function updates the properties of a device object that is in the print provider queue.

Syntax

HRESULT UpdatePrintDeviceObject(
  [in] HANDLE hPrinter,
  [in] HANDLE hDeviceObject
);

Parameters

[in] hPrinter

The HANDLE to an open printer. This should be a handle that was returned by the AddPrinter or OpenPrinter spooler functions.

[in] hDeviceObject

The HANDLE to the device object to be updated. This should be a device object that was created with AddPrintDeviceObject.

Return value

The UpdatePrintDeviceObject function returns S_OK, if the properties of the device object were updated successfully. Otherwise it returns an error.

For example, this function can return HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE), if the function call was made with an invalid HANDLE, or the device object was removed before the function call was made.

Remarks

The PRINTER_INFO_2 structure is a good example of the kind of properties that UpdatePrintDeviceObject can update.

Requirements

Requirement Value
Target Platform Desktop
Header winsplp.h (include Winspool.h)
Library WinSpool.lib
DLL WinSpool.drv

See also

AddPrintDeviceObject

PRINTER_INFO_2