2 * PROJECT: ReactOS Spooler Router
3 * LICENSE: GNU LGPL v2.1 or any later version as published by the Free Software Foundation
4 * PURPOSE: Main functions
5 * COPYRIGHT: Copyright 2015 Colin Finck <colin@reactos.org>
11 PRINTPROVIDOR LocalSplFuncs
;
15 DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
19 case DLL_PROCESS_ATTACH
:
20 DisableThreadLibraryCalls(hinstDLL
);
21 hProcessHeap
= GetProcessHeap();
29 InitializeRouter(HANDLE SpoolerStatusHandle
)
31 HINSTANCE hinstLocalSpl
;
32 PInitializePrintProvidor pfnInitializePrintProvidor
;
34 // Only initialize localspl.dll for now.
35 // This function should later look for all available print providers in the registry and initialize all of them.
36 hinstLocalSpl
= LoadLibraryW(L
"localspl");
39 ERR("LoadLibraryW for localspl failed with error %lu!\n", GetLastError());
43 pfnInitializePrintProvidor
= (PInitializePrintProvidor
)GetProcAddress(hinstLocalSpl
, "InitializePrintProvidor");
44 if (!pfnInitializePrintProvidor
)
46 ERR("GetProcAddress failed with error %lu!\n", GetLastError());
50 if (!pfnInitializePrintProvidor(&LocalSplFuncs
, sizeof(PRINTPROVIDOR
), NULL
))
52 ERR("InitializePrintProvidor failed for localspl with error %lu!\n", GetLastError());
60 SplInitializeWinSpoolDrv(PVOID
* pTable
)
65 hWinspool
= LoadLibraryW(L
"winspool.drv");
68 ERR("Could not load winspool.drv, last error is %lu!\n", GetLastError());
72 // Get the function pointers which are meant to be returned by this function.
73 pTable
[0] = GetProcAddress(hWinspool
, "OpenPrinterW");
74 pTable
[1] = GetProcAddress(hWinspool
, "ClosePrinter");
75 pTable
[2] = GetProcAddress(hWinspool
, "SpoolerDevQueryPrintW");
76 pTable
[3] = GetProcAddress(hWinspool
, "SpoolerPrinterEvent");
77 pTable
[4] = GetProcAddress(hWinspool
, "DocumentPropertiesW");
78 pTable
[5] = GetProcAddress(hWinspool
, (LPSTR
)212);
79 pTable
[6] = GetProcAddress(hWinspool
, (LPSTR
)213);
80 pTable
[7] = GetProcAddress(hWinspool
, (LPSTR
)214);
81 pTable
[8] = GetProcAddress(hWinspool
, (LPSTR
)215);
83 // Verify that all calls succeeded.
84 for (i
= 0; i
< 9; i
++)
100 // Nothing to do here yet
101 return ERROR_SUCCESS
;