[LOCALSPL_APITEST]
[reactos.git] / reactos / win32ss / printing / base / spoolss / main.c
index 39a4585..2a83055 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "precomp.h"
 
+HANDLE hProcessHeap;
 PRINTPROVIDOR LocalSplFuncs;
 
 
@@ -16,6 +17,20 @@ ClosePrinter(HANDLE hPrinter)
     return FALSE;
 }
 
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    switch (fdwReason)
+    {
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls(hinstDLL);
+            hProcessHeap = GetProcessHeap();
+            break;
+    }
+
+    return TRUE;
+}
+
 BOOL WINAPI
 EndDocPrinter(HANDLE hPrinter)
 {
@@ -95,6 +110,44 @@ StartDocPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo)
     return 0;
 }
 
+BOOL WINAPI
+SplInitializeWinSpoolDrv(PVOID* pTable)
+{
+    HINSTANCE hWinspool;
+    int i;
+
+    hWinspool = LoadLibraryW(L"winspool.drv");
+    if (!hWinspool)
+    {
+        ERR("Could not load winspool.drv, last error is %lu!\n", GetLastError());
+        return FALSE;
+    }
+
+    // Get the function pointers which are meant to be returned by this function.
+    pTable[0] = GetProcAddress(hWinspool, "OpenPrinterW");
+    pTable[1] = GetProcAddress(hWinspool, "ClosePrinter");
+    pTable[2] = GetProcAddress(hWinspool, "SpoolerDevQueryPrintW");
+    pTable[3] = GetProcAddress(hWinspool, "SpoolerPrinterEvent");
+    pTable[4] = GetProcAddress(hWinspool, "DocumentPropertiesW");
+    pTable[5] = GetProcAddress(hWinspool, (LPSTR)212);
+    pTable[6] = GetProcAddress(hWinspool, (LPSTR)213);
+    pTable[7] = GetProcAddress(hWinspool, (LPSTR)214);
+    pTable[8] = GetProcAddress(hWinspool, (LPSTR)215);
+
+    // Verify that all calls succeeded.
+    for (i = 0; i < 9; i++)
+        if (!pTable[i])
+            return FALSE;
+
+    return TRUE;
+}
+
+BOOL WINAPI
+SplIsUpgrade()
+{
+       return FALSE;
+}
+
 DWORD WINAPI
 SpoolerInit()
 {