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));
#define ERROR_INVALID_PARAMETER
static LONG WINAPI OpenKey(HANDLE hcKey, LPCWSTR pszSubKey, REGSAM samDesired, PHANDLE phkResult, HANDLE hSpooler)
LPMONITOR2(WINAPI * PInitializePrintMonitor2)(PMONITORINIT, PHANDLE)
PWSTR WINAPI AllocSplStr(PCWSTR pwszInput)
BOOL InitializePrintMonitorList(void)
HKEYMONITOR hckRegistryRoot
static LONG WINAPI QueryInfoKey(HANDLE hcKey, PDWORD pcSubKeys, PDWORD pcbKey, PDWORD pcValues, PDWORD pcbValue, PDWORD pcbData, PDWORD pcbSecurityDescriptor, PFILETIME pftLastWriteTime, HANDLE hSpooler)
BOOL WINAPI DllFreeSplMem(PVOID pMem)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
#define ERROR_NOT_ENOUGH_MEMORY
DWORD WINAPI GetLastError(VOID)
static LONG WINAPI EnumValue(HANDLE hcKey, DWORD dwIndex, LPWSTR pszValue, PDWORD pcbValue, PDWORD pType, PBYTE pData, PDWORD pcbData, HANDLE hSpooler)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
#define REG_OPENED_EXISTING_KEY
#define InsertTailList(ListHead, Entry)
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
struct _MONITOR_INFO_2W MONITOR_INFO_2W
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)
const DWORD cbCurrentEnvironment
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
BOOL WINAPI LocalAddMonitor(PWSTR pName, DWORD Level, PBYTE pMonitors)
static DWORD dwMonitorInfo1Offsets[]
const WCHAR wszCurrentEnvironment[]
LONG WINAPI RegCloseKey(HKEY hKey)
static void _LocalGetMonitorLevel2(PLOCAL_PRINT_MONITOR pPrintMonitor, PMONITOR_INFO_2W *ppMonitorInfo, PBYTE *ppMonitorInfoEnd, PDWORD pcbNeeded)
#define ERROR_ACCESS_DENIED
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
PWSTR AllocAndRegQueryWSZ(HKEY hKey, PCWSTR pwszValueName)
struct _MONITORREG MONITORREG
#define ERROR_UNKNOWN_PRINT_MONITOR
PPRINTENV_T validate_envW(LPCWSTR env)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
struct _MONITORINIT MONITORINIT
#define REG_OPTION_NON_VOLATILE
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
struct _LIST_ENTRY * Flink
BOOL WINAPI LocalEnumMonitors(PWSTR pName, DWORD Level, PBYTE pMonitors, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned)
static DWORD dwMonitorInfo2Offsets[]
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static LONG WINAPI QueryValue(HANDLE hcKey, LPCWSTR pszValue, PDWORD pType, PBYTE pData, PDWORD pcbData, HANDLE hSpooler)
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)
static LONG WINAPI EnumKey(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName, PDWORD pcchName, PFILETIME pftLastWriteTime, HANDLE hSpooler)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static const WCHAR Cleanup[]
BOOL WINAPI LocalDeleteMonitor(PWSTR pName, PWSTR pEnvironment, PWSTR pMonitorName)
LSTATUS WINAPI RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
static LONG WINAPI DeleteValue(HANDLE hcKey, LPCWSTR pszValue, HANDLE hSpooler)
#define ERROR_PRINT_MONITOR_ALREADY_INSTALLED
#define ERROR_PROC_NOT_FOUND
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
_In_ DWORD _Out_ PDWORD pcbNeeded
static LONG WINAPI SetValue(HANDLE hcKey, LPCWSTR pszValue, DWORD dwType, const BYTE *pData, DWORD cbData, HANDLE hSpooler)
static LONG WINAPI DeleteKey(HANDLE hcKey, LPCWSTR pszSubKey, HANDLE hSpooler)
#define InitializeListHead(ListHead)
#define FIELD_OFFSET(t, f)
static LPCWSTR LPCWSTR LPCWSTR env
LIST_ENTRY PrintMonitorList
static LONG WINAPI CloseKey(HANDLE hcKey, HANDLE hSpooler)
BOOL WINAPI DllFreeSplStr(PWSTR pwszString)
LPMONITOREX(WINAPI * PInitializePrintMonitor)(PWSTR)
LONG copy_servername_from_name(LPCWSTR name, LPWSTR target)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
#define ERROR_CALL_NOT_IMPLEMENTED
struct _MONITOR2 * PMONITOR2
#define ERROR_INVALID_NAME
#define GetProcAddress(x, y)
struct _MONITOR_INFO_2W * LPMONITOR_INFO_2W
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)
PVOID WINAPI DllAllocSplMem(DWORD dwBytes)
PLOCAL_PRINT_MONITOR FindPrintMonitor(PCWSTR pwszName)
BOOL AddPrintMonitorList(LPCWSTR pName, LPWSTR DllName)
#define ERROR_INVALID_LEVEL
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
struct _MONITOR_INFO_1W MONITOR_INFO_1W
struct _MONITOREX * LPMONITOREX
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
static void _LocalGetMonitorLevel1(PLOCAL_PRINT_MONITOR pPrintMonitor, PMONITOR_INFO_1W *ppMonitorInfo, PBYTE *ppMonitorInfoEnd, PDWORD pcbNeeded)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
base of all file and directory entries
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
#define HKEY_LOCAL_MACHINE
static LONG WINAPI CreateKey(HANDLE hcKey, LPCWSTR pszSubKey, DWORD dwOptions, REGSAM samDesired, PSECURITY_ATTRIBUTES pSecurityAttributes, PHANDLE phckResult, PDWORD pdwDisposition, HANDLE hSpooler)
#define ERROR_INSUFFICIENT_BUFFER