// winsplp.h
typedef struct _MONITORREG {
DWORD cbSize;
LONG()(HKEYMONITOR hcKey,LPCTSTR pszSubKey,DWORD dwOptions,REGSAM samDesired,PSECURITY_ATTRIBUTES pSecurityAttributes,HKEYMONITOR *phckResult,PDWORD pdwDisposition,HANDLE hSpooler) * fpCreateKey;
LONG()(HKEYMONITOR hcKey,LPCTSTR pszSubKey,REGSAM samDesired,HKEYMONITOR *phkResult,HANDLE hSpooler) * fpOpenKey;
LONG( )(HKEYMONITOR hcKey,HANDLE hSpooler) *fpCloseKey;
LONG( )(HKEYMONITOR hcKey,LPCTSTR pszSubKey,HANDLE hSpooler) *fpDeleteKey;
LONG( )(HKEYMONITOR hcKey,DWORD dwIndex,LPTSTR pszName,PDWORD pcchName,PFILETIME pftLastWriteTime,HANDLE hSpooler) *fpEnumKey;
LONG( )(HKEYMONITOR hcKey,PDWORD pcSubKeys,PDWORD pcbKey,PDWORD pcValues,PDWORD pcbValue,PDWORD pcbData,PDWORD pcbSecurityDescriptor,PFILETIME pftLastWriteTime,HANDLE hSpooler) *fpQueryInfoKey;
LONG()(HKEYMONITOR hcKey,LPCTSTR pszValue,DWORD dwType, const BYTE *pData,DWORD cbData,HANDLE hSpooler) * fpSetValue;
LONG( )(HKEYMONITOR hcKey,LPCTSTR pszValue,HANDLE hSpooler) *fpDeleteValue;
LONG( )(HKEYMONITOR hcKey,DWORD dwIndex,LPTSTR pszValue,PDWORD pcbValue,PDWORD pTyp,PBYTE pData,PDWORD pcbData,HANDLE hSpooler) *fpEnumValue;
LONG( )(HKEYMONITOR hcKey,LPCTSTR pszValue,PDWORD pType,PBYTE pData,PDWORD pcbData,HANDLE hSpooler) *fpQueryValue;
} MONITORREG, *PMONITORREG;
View the official Windows Driver Kit DDI referenceNo description available.
The MONITORREG structure supplies print monitors with the address of registry functions to use instead of Win32 registry API functions.
cbSizeSize, in bytes, of the MONITORREG structure.
fpCreateKeyPointer to a CreateKey spooler registry function.
fpOpenKeyPointer to an OpenKey spooler registry function.
fpCloseKeyPointer to a CloseKey spooler registry function.
fpDeleteKeyPointer to a DeleteKey spooler registry function.
fpEnumKeyPointer to an EnumKey spooler registry function.
fpQueryInfoKeyPointer to a QueryInfoKey spooler registry function.
fpSetValuePointer to a SetValue spooler registry function.
fpDeleteValuePointer to a DeleteValue spooler registry function.
fpEnumValuePointer to an EnumValue spooler registry function.
fpQueryValuePointer to a QueryValue spooler registry function.
The MONITORREG structure's address is supplied in a MONITORINIT structure, which is passed to a print monitor's InitializePrintMonitor2 function.
When storing port configuration information, print monitors must not explicitly call either the Win32 registry API or the cluster registry API.
The spooler contains a copy of the registry. Do not use the Win32 registry API to get the value actually used by the spooler. Use the spooler registry functions listed below whose pointers are contained in the MONITORREG structure.
Instead, they must call equivalent spooler registry functions. The MONITORREG structure supplies the addresses of these functions. The following table lists each spooler registry function and its equivalent cluster registry function.
| Spooler registry function | Equivalent cluster registry function |
|---|---|
| CreateKey | ClusterRegCreateKey |
| OpenKey | ClusterRegOpenKey |
| CloseKey | ClusterRegCloseKey |
| DeleteKey | ClusterRegDeleteKey |
| EnumKey | ClusterRegEnumKey |
| QueryInfoKey | ClusterRegQueryInfoKey |
| SetValue | ClusterRegSetValue |
| DeleteValue | ClusterRegDeleteValue |
| EnumValue | ClusterRegEnumValue |
| QueryValue | ClusterRegQueryValue |
Input and output parameters for these spooler functions match the parameters of the equivalent cluster registry functions in the clusapi.h header, with the following exceptions:
Each spooler registry function requires an hSpooler input parameter. This is the spooler handle received in the MONITORINIT structure.
The spooler registry functions use HANDLE and PHANDLE parameter types instead of the HKEY and PHKEY types used by the cluster registry functions. Monitors receive the handle of the root registry location in the hckRegistryRoot member of the MONITORINIT structure.