SplUnRegister

This function allows applications to unregister for notification of events about printers. This function should be used when an application no longer wants certain alerts, in order to limit the network traffic.

Syntax
SplUnRegister(pszComputerName, pszName,      ulHandle, ulCategory, ulType);

Parameters

 * pszComputerName (PSZ) - input
 * Printer server name to unregister for alert notification.


 * This value is NULL for local printer ports.


 * pszName (PSZ) - input
 * Case-sensitive name of printer port to unregister for alerts.


 * This value can be a virtual port name.


 * ulHandle (ULONG) - input
 * Spooler alert handle previously allocated by SplRegister.


 * ulCategory (ULONG) - input
 * Category of alert to unregister.


 * This value can be the core alert category or an extended alert category as defined below:


 * PRTALERT_CATEGORY_ALL - 0x00000000
 * Unregister for all alerts for the given alert handle. This will remove registration for all printer ports (even remote ones) for the alert handle.


 * PRTALERT_CATEGORY_ALL_CORE - 0x00000002
 * Unregister for all core alerts for the port.


 * PRTALERT_CATEGORY_ALL_EXT - 0x00000003
 * Unregister for all extended alerts for the port.


 * PRTALERT_CATEGORY_CORE - 0x00000001
 * Core alert category. This will remove registration for only those core alerts whose bits are set in ulType for the port.


 * PRTALERT_CATEGORY_EXT_MAX - 0x0000DFFF
 * End of the extended alert categories.


 * PRTALERT_CATEGORY_EXTENDED - 0x0000D000
 * Beginning of the extended alert categories. Protocol converters should limit the category range to between 0x0000D000 and 0x0000DFFFF.


 * If the protocol converter does not support the given category, ERROR_INVALID_CATEGORY(117) is returned.


 * ulType (ULONG) - input
 * Type of alert to unregister for the given category.


 * If the category is PRTALERT_CATEGORY_CORE, then this is a bit-field that defines the core alerts to unregister.


 * If the category is not PRTALERT_CATEGORY_ALL, PRTALERT_CATEGORY_CORE, PRTALERT_CATEGORY_ALL_CORE, or PRTALERT_CATEGORY_ALL_EXT, this is a value that defines the specific extended alert to unregister.

Returns

 * rc (ULONG) - returns : Return codes.


 * 0 Success


 * ERROR_FILE_NOT_FOUND(2)
 * pszName is not a valid port name.


 * ERROR_INVALID_HANDLE(6)
 * The value ulHandle is not a valid spooler alert handle.


 * ERROR_INVALID_PARAMETER(87)
 * An invalid buffer given.


 * ERROR_NOT_SUPPORTED(50)
 * The spooler on the given print server cannot support alert notification.


 * PMERR_SPL_NOT_REGISTERED(0x4042)
 * The alert handle ulHandle is not currently registered for any alerts specified by ulCategory and ulType.


 * PMERR_SPL_SPOOLER_NOT_INSTALLED(0x4009)
 * The spooler is not enabled.

Sample

 * 1) define INCL_SPL
 * 2) define INCL_SPLBIDI
 * 3) include 

PSZ     pszComputerName;  /*  Printer server name to unregister for alert notification. */ PSZ     pszName;          /*  Case-sensitive name of printer port to unregister for alerts. */ ULONG   ulHandle;         /*  Spooler alert handle previously allocated by SplRegister. */ ULONG   ulCategory;       /*  Category of alert to unregister. */ ULONG   ulType;           /*  Type of alert to unregister for the given category. */ ULONG   rc;               /*  Return codes. */

rc = SplUnRegister(pszComputerName, pszName,      ulHandle, ulCategory, ulType);

Remarks
Registration is not maintained across reboots.