33 TRACE(
"FindPrintMonitor(%S)\n", pwszName);
128 const WCHAR wszMonitorsPath[] =
L"SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors";
132 DWORD cchPrintMonitorName;
145 TRACE(
"InitializePrintMonitorList()\n");
154 ERR(
"RegOpenKeyExW failed with status %lu!\n", dwErrorCode);
159 dwErrorCode = (
DWORD)
RegQueryInfoKeyW(
hKey,
NULL,
NULL,
NULL, &dwSubKeys, &cchMaxSubKey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
162 ERR(
"RegQueryInfoKeyW failed with status %lu!\n", dwErrorCode);
167 for (
i = 0;
i < dwSubKeys;
i++)
176 if (pwszRegistryPath)
179 pwszRegistryPath =
NULL;
191 pPrintMonitor =
NULL;
199 ERR(
"DllAllocSplMem failed!\n");
210 ERR(
"DllAllocSplMem failed!\n");
215 cchPrintMonitorName = cchMaxSubKey + 1;
219 ERR(
"RegEnumKeyExW failed for iteration %lu with status %lu!\n",
i, dwErrorCode);
227 ERR(
"RegOpenKeyExW failed for Print Provider \"%S\" with status %lu!\n", pPrintMonitor->
pwszName, dwErrorCode);
238 if (!hinstPrintMonitor)
244 pPrintMonitor->
hModule = hinstPrintMonitor;
248 if (pfnInitializePrintMonitor2)
265 FIXME(
"InitializePrintMonitor2 loaded.\n");
272 if (pfnInitializePrintMonitor)
275 pwszRegistryPath =
DllAllocSplMem((cchMonitorsPath + 1 + cchPrintMonitorName + 1) *
sizeof(
WCHAR));
276 if (!pwszRegistryPath)
279 ERR(
"DllAllocSplMem failed!\n");
283 CopyMemory(pwszRegistryPath, wszMonitorsPath, cchMonitorsPath *
sizeof(
WCHAR));
284 pwszRegistryPath[cchMonitorsPath] =
L'\\';
285 CopyMemory(&pwszRegistryPath[cchMonitorsPath + 1], pPrintMonitor->
pwszName, (cchPrintMonitorName + 1) *
sizeof(
WCHAR));
297 ERR(
"No initialization routine found for \"%S\"!\n", pPrintMonitor->
pwszFileName);
304 FIXME(
"InitializePrintMonitorList Handle %p\n",pPrintMonitor->
hMonitor);
308 pPrintMonitor =
NULL;
318 if (pwszRegistryPath)
357 pwszStrings[0] = pPrintMonitor->
pwszName;
382 pwszStrings[0] = pPrintMonitor->
pwszName;
399 PBYTE pMonitorInfoEnd;
403 TRACE(
"LocalEnumMonitors(%S, %lu, %p, %lu, %p, %p)\n",
pName,
Level, pMonitors, cbBuf,
pcbNeeded, pcReturned);
435 pMonitorInfoEnd = &pMonitors[*
pcbNeeded];
459 const WCHAR wszMonitorsPath[] =
L"SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors\\";
464 DWORD cchPrintMonitorName;
474 FIXME(
"AddPrintMonitorList( %S, %S)\n",
pName, DllName);
476 StringCbCopyW(wszRegRoot,
sizeof(wszRegRoot), wszMonitorsPath);
483 ERR(
"RegOpenKeyExW %S failed with status %lu!\n", wszRegRoot, dwErrorCode);
492 ERR(
"DllAllocSplMem failed!\n");
503 ERR(
"DllAllocSplMem failed!\n");
509 if ( DllName ==
NULL )
525 ERR(
"DllName not found\n");
536 if (!hinstPrintMonitor)
543 pPrintMonitor->
hModule = hinstPrintMonitor;
547 if (pfnInitializePrintMonitor2)
571 if (pfnInitializePrintMonitor)
574 pwszRegistryPath =
DllAllocSplMem((cchMonitorsPath + 1 + cchPrintMonitorName + 1) *
sizeof(
WCHAR));
575 if (!pwszRegistryPath)
578 ERR(
"DllAllocSplMem failed!\n");
582 CopyMemory(pwszRegistryPath, wszMonitorsPath, cchMonitorsPath *
sizeof(
WCHAR));
583 pwszRegistryPath[cchMonitorsPath] =
L'\\';
584 CopyMemory(&pwszRegistryPath[cchMonitorsPath + 1], pPrintMonitor->
pwszName, (cchPrintMonitorName + 1) *
sizeof(
WCHAR));
596 ERR(
"No initialization routine found for \"%S\"!\n", pPrintMonitor->
pwszFileName);
603 FIXME(
"AddPrintMonitorList Handle %p\n",pPrintMonitor->
hMonitor);
608 pPrintMonitor =
NULL;
613 if (pwszRegistryPath)
644 const WCHAR wszMonitorsPath[] =
L"SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors\\";
677 ERR(
"unable to create key %s\n",
debugstr_w(wszMonitorsPath));
729 const WCHAR wszMonitorsPath[] =
L"SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors\\";
743 if (!pMonitorName || !pMonitorName[0])
745 ERR(
"pMonitorName %s is invalid\n",
debugstr_w(pMonitorName));
762 if (
pm2 &&
pm2->pfnShutdown )
778 pPrintMonitor =
NULL;
788 ERR(
"unable to create key %s\n",
debugstr_w(wszMonitorsPath));
const WCHAR wszCurrentEnvironment[]
#define RegCloseKey(hKey)
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)
static LPCWSTR LPCWSTR LPCWSTR env
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define ERROR_ACCESS_DENIED
#define ERROR_INVALID_NAME
static const WCHAR Cleanup[]
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InitializeListHead(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_OPTION_NON_VOLATILE
#define REG_OPENED_EXISTING_KEY
static LONG WINAPI CloseKey(HANDLE hcKey, HANDLE hSpooler)
BOOL WINAPI LocalEnumMonitors(PWSTR pName, DWORD Level, PBYTE pMonitors, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
PLOCAL_PRINT_MONITOR FindPrintMonitor(PCWSTR pwszName)
BOOL InitializePrintMonitorList(void)
BOOL WINAPI LocalDeleteMonitor(PWSTR pName, PWSTR pEnvironment, PWSTR pMonitorName)
static void _LocalGetMonitorLevel2(PLOCAL_PRINT_MONITOR pPrintMonitor, PMONITOR_INFO_2W *ppMonitorInfo, PBYTE *ppMonitorInfoEnd, PDWORD pcbNeeded)
static LONG WINAPI CreateKey(HANDLE hcKey, LPCWSTR pszSubKey, DWORD dwOptions, REGSAM samDesired, PSECURITY_ATTRIBUTES pSecurityAttributes, PHANDLE phckResult, PDWORD pdwDisposition, HANDLE hSpooler)
LIST_ENTRY PrintMonitorList
BOOL WINAPI LocalAddMonitor(PWSTR pName, DWORD Level, PBYTE pMonitors)
static LONG WINAPI QueryValue(HANDLE hcKey, LPCWSTR pszValue, PDWORD pType, PBYTE pData, PDWORD pcbData, HANDLE hSpooler)
static LONG WINAPI OpenKey(HANDLE hcKey, LPCWSTR pszSubKey, REGSAM samDesired, PHANDLE phkResult, HANDLE hSpooler)
static LONG WINAPI QueryInfoKey(HANDLE hcKey, PDWORD pcSubKeys, PDWORD pcbKey, PDWORD pcValues, PDWORD pcbValue, PDWORD pcbData, PDWORD pcbSecurityDescriptor, PFILETIME pftLastWriteTime, HANDLE hSpooler)
static LONG WINAPI EnumValue(HANDLE hcKey, DWORD dwIndex, LPWSTR pszValue, PDWORD pcbValue, PDWORD pType, PBYTE pData, PDWORD pcbData, HANDLE hSpooler)
static LONG WINAPI EnumKey(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName, PDWORD pcchName, PFILETIME pftLastWriteTime, HANDLE hSpooler)
static LONG WINAPI DeleteKey(HANDLE hcKey, LPCWSTR pszSubKey, HANDLE hSpooler)
BOOL AddPrintMonitorList(LPCWSTR pName, LPWSTR DllName)
static DWORD dwMonitorInfo1Offsets[]
static DWORD dwMonitorInfo2Offsets[]
static void _LocalGetMonitorLevel1(PLOCAL_PRINT_MONITOR pPrintMonitor, PMONITOR_INFO_1W *ppMonitorInfo, PBYTE *ppMonitorInfoEnd, PDWORD pcbNeeded)
struct _MONITORINIT MONITORINIT
struct _MONITOR2 * PMONITOR2
struct _MONITORREG MONITORREG
struct _MONITOREX * LPMONITOREX
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
base of all file and directory entries
struct _LIST_ENTRY * Flink
HKEYMONITOR hckRegistryRoot
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
BOOL WINAPI DllFreeSplMem(PVOID pMem)
PVOID WINAPI DllAllocSplMem(DWORD dwBytes)
BOOL WINAPI DllFreeSplStr(PWSTR pwszString)
PWSTR WINAPI AllocSplStr(PCWSTR pwszInput)
LONG copy_servername_from_name(LPCWSTR name, LPWSTR target)
LPMONITOR2(WINAPI * PInitializePrintMonitor2)(PMONITORINIT, PHANDLE)
const DWORD cbCurrentEnvironment
LPMONITOREX(WINAPI * PInitializePrintMonitor)(PWSTR)
PWSTR AllocAndRegQueryWSZ(HKEY hKey, PCWSTR pwszValueName)
PPRINTENV_T validate_envW(LPCWSTR env)
DWORD WINAPI GetLastError(void)
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
_In_ DWORD _Out_ PDWORD pcbNeeded
#define ERROR_INVALID_LEVEL
#define ERROR_UNKNOWN_PRINT_MONITOR
#define ERROR_PROC_NOT_FOUND
#define ERROR_PRINT_MONITOR_ALREADY_INSTALLED
#define HKEY_LOCAL_MACHINE
struct _MONITOR_INFO_1W MONITOR_INFO_1W
struct _MONITOR_INFO_2W MONITOR_INFO_2W
struct _MONITOR_INFO_2W * LPMONITOR_INFO_2W
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level