reactos/modules/rostests/apitests/winspool/GetPrintProcessorDirectory.c

128 lines
6.8 KiB
C
Raw Normal View History

Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
/*
* PROJECT: ReactOS Print Spooler DLL API Tests
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
* PURPOSE: Tests for GetPrintProcessorDirectoryA/GetPrintProcessorDirectoryW
* COPYRIGHT: Copyright 2015-2016 Colin Finck (colin@reactos.org)
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
*/
#include <apitest.h>
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winspool.h>
START_TEST(GetPrintProcessorDirectoryA)
{
DWORD cbNeeded;
DWORD cbTemp;
PSTR pszBuffer;
// Try with an invalid level, this needs to be caught first.
SetLastError(0xDEADBEEF);
cbNeeded = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryA(NULL, NULL, 0, NULL, 0, &cbNeeded), "GetPrintProcessorDirectoryA returns TRUE!\n");
ok(GetLastError() == ERROR_INVALID_LEVEL, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
ok(cbNeeded == 0xDEADBEEF, "cbNeeded is %lu!\n", cbNeeded);
// Now try with valid level, but no pcbNeeded.
SetLastError(0xDEADBEEF);
ok(!GetPrintProcessorDirectoryA(NULL, NULL, 1, NULL, 0, NULL), "GetPrintProcessorDirectoryA returns TRUE!\n");
ok(GetLastError() == RPC_X_NULL_REF_POINTER, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
// Try with an invalid environment as well.
SetLastError(0xDEADBEEF);
cbNeeded = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryA(NULL, "invalid", 1, NULL, 0, &cbNeeded), "GetPrintProcessorDirectoryA returns TRUE!\n");
ok(GetLastError() == ERROR_INVALID_ENVIRONMENT, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
ok(cbNeeded == 0, "cbNeeded is %lu!\n", cbNeeded);
// Now get the required buffer size by supplying pcbNeeded. This needs to fail with ERROR_INSUFFICIENT_BUFFER.
// Note for GetPrintProcessorDirectoryA: cbNeeded will be the same as for GetPrintProcessorDirectoryW, even though the ANSI string only needs half of it!
SetLastError(0xDEADBEEF);
cbNeeded = 0;
ok(!GetPrintProcessorDirectoryA(NULL, NULL, 1, NULL, 0, &cbNeeded), "GetPrintProcessorDirectoryA returns TRUE!\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
ok(cbNeeded > 0, "cbNeeded is 0!\n");
// Now provide the demanded size, but no buffer.
SetLastError(0xDEADBEEF);
cbTemp = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryA(NULL, NULL, 1, NULL, cbNeeded, &cbTemp), "GetPrintProcessorDirectoryA returns TRUE!\n");
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
ok(cbTemp == 0, "cbTemp is %lu!\n", cbTemp);
// Same error has to occur with a size too small.
SetLastError(0xDEADBEEF);
cbTemp = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryA(NULL, NULL, 1, NULL, 1, &cbTemp), "GetPrintProcessorDirectoryA returns TRUE!\n");
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
ok(cbTemp == 0, "cbTemp is %lu!\n", cbTemp);
// Finally use the function as intended and aim for success!
pszBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbNeeded);
SetLastError(0xDEADBEEF);
ok(GetPrintProcessorDirectoryA(NULL, NULL, 1, (PBYTE)pszBuffer, cbNeeded, &cbTemp), "GetPrintProcessorDirectoryA returns FALSE!\n");
ok(GetLastError() == ERROR_SUCCESS, "GetPrintProcessorDirectoryA returns error %lu!\n", GetLastError());
// Note for GetPrintProcessorDirectoryA: cbNeeded is the same as for GetPrintProcessorDirectoryW!
ok(strlen(pszBuffer) == cbNeeded / sizeof(WCHAR) - 1, "GetPrintProcessorDirectoryA string is %Iu characters long, but %lu characters expected!\n", strlen(pszBuffer), cbNeeded / sizeof(WCHAR) - 1);
HeapFree(GetProcessHeap(), 0, pszBuffer);
}
START_TEST(GetPrintProcessorDirectoryW)
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
{
DWORD cbNeeded;
DWORD cbTemp;
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
PWSTR pwszBuffer;
// Try with an invalid level, this needs to be caught first.
SetLastError(0xDEADBEEF);
cbNeeded = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryW(NULL, NULL, 0, NULL, 0, &cbNeeded), "GetPrintProcessorDirectoryW returns TRUE!\n");
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
ok(GetLastError() == ERROR_INVALID_LEVEL, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
ok(cbNeeded == 0xDEADBEEF, "cbNeeded is %lu!\n", cbNeeded);
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
// Now try with valid level, but no pcbNeeded.
SetLastError(0xDEADBEEF);
ok(!GetPrintProcessorDirectoryW(NULL, NULL, 1, NULL, 0, NULL), "GetPrintProcessorDirectoryW returns TRUE!\n");
ok(GetLastError() == RPC_X_NULL_REF_POINTER, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
// Try with an invalid environment as well.
SetLastError(0xDEADBEEF);
cbNeeded = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryW(NULL, L"invalid", 1, NULL, 0, &cbNeeded), "GetPrintProcessorDirectoryW returns TRUE!\n");
ok(GetLastError() == ERROR_INVALID_ENVIRONMENT, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
ok(cbNeeded == 0, "cbNeeded is %lu!\n", cbNeeded);
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
// Now get the required buffer size by supplying pcbNeeded. This needs to fail with ERROR_INSUFFICIENT_BUFFER.
SetLastError(0xDEADBEEF);
cbNeeded = 0;
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
ok(!GetPrintProcessorDirectoryW(NULL, NULL, 1, NULL, 0, &cbNeeded), "GetPrintProcessorDirectoryW returns TRUE!\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
ok(cbNeeded > 0, "cbNeeded is 0!\n");
// Now provide the demanded size, but no buffer.
SetLastError(0xDEADBEEF);
cbTemp = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryW(NULL, NULL, 1, NULL, cbNeeded, &cbTemp), "GetPrintProcessorDirectoryW returns TRUE!\n");
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
ok(cbTemp == 0, "cbTemp is %lu!\n", cbTemp);
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
// Same error has to occur with a size too small.
SetLastError(0xDEADBEEF);
cbTemp = 0xDEADBEEF;
ok(!GetPrintProcessorDirectoryW(NULL, NULL, 1, NULL, 1, &cbTemp), "GetPrintProcessorDirectoryW returns TRUE!\n");
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
ok(cbTemp == 0, "cbTemp is %lu!\n", cbTemp);
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
// Finally use the function as intended and aim for success!
pwszBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbNeeded);
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
SetLastError(0xDEADBEEF);
ok(GetPrintProcessorDirectoryW(NULL, NULL, 1, (PBYTE)pwszBuffer, cbNeeded, &cbTemp), "GetPrintProcessorDirectoryW returns FALSE!\n");
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
ok(GetLastError() == ERROR_SUCCESS, "GetPrintProcessorDirectoryW returns error %lu!\n", GetLastError());
ok(wcslen(pwszBuffer) == cbNeeded / sizeof(WCHAR) - 1, "GetPrintProcessorDirectoryW string is %Iu characters long, but %lu characters expected!\n", wcslen(pwszBuffer), cbNeeded / sizeof(WCHAR) - 1);
Time to commit some Work-In-Progress stuff before my diff gets too large.. [LOCALSPL] - Begin work on the Local Spooler. Return a structure with function pointers in InitializePrintProvidor. - Design and document internal structures for managing LocalSpl Handles, Printer Handles, Printers, Print Jobs and Print Processors. Manage Printers and Print Processors in Generic Tables, with one Job Queue per Printer managed as a Doubly Linked List. - Implement LocalOpenPrinter, LocalEnumPrintProcessorDatatypes, LocalEnumPrintProcessors, LocalGetPrintProcessorDirectory, with focus on catching all corner cases. Currently working on LocalStartDocPrinter. - Build upon the documentation at http://www.undocprint.org/formats/winspool/shd to read and write .SHD files. [WINPRINT] Begin work on the Standard Print Processor. Implement EnumPrintProcessorDatatypesW. [WINSPOOL_APITEST] Add an API Test for winspool.drv, currently testing some corner cases of ClosePrinter, EnumPrintProcessorDatatypesW, GetPrintProcessorDirectoryW, OpenPrinterW, StartDocPrinterW. TODO: Find a way to actually test the localspl.dll functions instead of only winspool.drv. This DLL doesn't like to be tested standalone under Windows, e.g. without being used through spoolsv/spoolss. [SPOOLSS] Implement InitializeRouter by calling the InitializePrintProvidor function of localspl there. This function should later also initialize further Print Providers. [SPOOLSV] Call InitializeRouter when starting up the service. [WINSPOOL] Add dummy functions for EnumPrintProcessorDatatypesA/EnumPrintProcessorDatatypesW. [All modules] Fix printf format specifiers for errors (%lu) and statuses (%ld). svn path=/branches/colins-printing-for-freedom/; revision=67847
2015-05-22 15:29:07 +00:00
HeapFree(GetProcessHeap(), 0, pwszBuffer);
}