mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 02:41:22 +00:00
[LOCALSPL_APITEST]
Put the calls that eventually give us the function pointers to localspl into a separate procedure GetLocalsplFuncs to enable further tests easily. svn path=/branches/colins-printing-for-freedom/; revision=68194
This commit is contained in:
parent
1793014ec3
commit
a4d50f82ff
2 changed files with 35 additions and 23 deletions
|
@ -18,40 +18,20 @@
|
|||
#include "../localspl_apitest.h"
|
||||
#include <spoolss.h>
|
||||
|
||||
extern BOOL GetLocalsplFuncs(LPPRINTPROVIDOR pp);
|
||||
|
||||
START_TEST(fpEnumPrinters)
|
||||
{
|
||||
DWORD cbNeeded;
|
||||
DWORD cbTemp;
|
||||
DWORD dwReturned;
|
||||
DWORD i;
|
||||
HMODULE hLocalspl;
|
||||
PInitializePrintProvidor pfnInitializePrintProvidor;
|
||||
PRINTPROVIDOR pp;
|
||||
PPRINTER_INFO_1W pPrinterInfo1;
|
||||
PVOID pMem;
|
||||
|
||||
// Get us a handle to the loaded localspl.dll.
|
||||
hLocalspl = GetModuleHandleW(L"localspl");
|
||||
if (!hLocalspl)
|
||||
{
|
||||
skip("GetModuleHandleW failed with error %lu!\n", GetLastError());
|
||||
if (!GetLocalsplFuncs(&pp))
|
||||
return;
|
||||
}
|
||||
|
||||
// Get a pointer to its InitializePrintProvidor function.
|
||||
pfnInitializePrintProvidor = (PInitializePrintProvidor)GetProcAddress(hLocalspl, "InitializePrintProvidor");
|
||||
if (!pfnInitializePrintProvidor)
|
||||
{
|
||||
skip("GetProcAddress failed with error %lu!\n", GetLastError());
|
||||
return;
|
||||
}
|
||||
|
||||
// Get localspl's function pointers.
|
||||
if (!pfnInitializePrintProvidor(&pp, sizeof(pp), NULL))
|
||||
{
|
||||
skip("pfnInitializePrintProvidor failed with error %lu!\n", GetLastError());
|
||||
return;
|
||||
}
|
||||
|
||||
// Verify that localspl only returns information about a single print provider (namely itself).
|
||||
cbNeeded = 0xDEADBEEF;
|
||||
|
|
|
@ -34,6 +34,38 @@ const struct test winetest_testlist[] =
|
|||
{ 0, 0 }
|
||||
};
|
||||
|
||||
BOOL
|
||||
GetLocalsplFuncs(LPPRINTPROVIDOR pp)
|
||||
{
|
||||
HMODULE hLocalspl;
|
||||
PInitializePrintProvidor pfnInitializePrintProvidor;
|
||||
|
||||
// Get us a handle to the loaded localspl.dll.
|
||||
hLocalspl = GetModuleHandleW(L"localspl");
|
||||
if (!hLocalspl)
|
||||
{
|
||||
skip("GetModuleHandleW failed with error %u!\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Get a pointer to its InitializePrintProvidor function.
|
||||
pfnInitializePrintProvidor = (PInitializePrintProvidor)GetProcAddress(hLocalspl, "InitializePrintProvidor");
|
||||
if (!pfnInitializePrintProvidor)
|
||||
{
|
||||
skip("GetProcAddress failed with error %u!\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Get localspl's function pointers.
|
||||
if (!pfnInitializePrintProvidor(pp, sizeof(PRINTPROVIDOR), NULL))
|
||||
{
|
||||
skip("pfnInitializePrintProvidor failed with error %u!\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Running the tests from the injected DLL and redirecting their output to the pipe.
|
||||
BOOL WINAPI
|
||||
DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
|
|
Loading…
Reference in a new issue