#include "precomp.h"
// Global Variables
-HANDLE hProcessHeap;
WCHAR wszSpoolDirectory[MAX_PATH];
DWORD cchSpoolDirectory;
#error Unsupported architecture
#endif
+const WCHAR* wszPrintProviderInfo[3] = {
+ L"Windows NT Local Print Providor", // Name
+ L"Windows NT Local Printers", // Description
+ L"Locally connected Printers" // Comment
+};
+
static const PRINTPROVIDOR PrintProviderFunctions = {
LocalOpenPrinter, // fpOpenPrinter
NULL, // fpSetJob
_GetSpoolDirectory()
{
const WCHAR wszSpoolPath[] = L"\\spool";
- const DWORD cchSpoolPath = sizeof(wszSpoolPath) / sizeof(WCHAR) - 1;
+ const DWORD cchSpoolPath = _countof(wszSpoolPath) - 1;
// Get the system directory and append the "spool" subdirectory.
// Forget about length checks here. If this doesn't fit into MAX_PATH, our OS has more serious problems...
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL);
- hProcessHeap = GetProcessHeap();
_GetSpoolDirectory();
InitializePrintProcessorTable();
InitializePrinterTable();
BOOL WINAPI
InitializePrintProvidor(LPPRINTPROVIDOR pPrintProvidor, DWORD cbPrintProvidor, LPWSTR pFullRegistryPath)
{
- DWORD cbCopy;
-
- if (cbPrintProvidor < sizeof(PRINTPROVIDOR))
- cbCopy = cbPrintProvidor;
- else
- cbCopy = sizeof(PRINTPROVIDOR);
-
- CopyMemory(pPrintProvidor, &PrintProviderFunctions, cbCopy);
+ CopyMemory(pPrintProvidor, &PrintProviderFunctions, min(cbPrintProvidor, sizeof(PRINTPROVIDOR)));
return TRUE;
}