reactos/win32ss/printing/base/spoolss/precomp.h

56 lines
1.5 KiB
C
Raw Normal View History

/*
* PROJECT: ReactOS Spooler Router
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Precompiled Header for all source files
* COPYRIGHT: Copyright 2015 Colin Finck (colin@reactos.org)
*/
#ifndef _PRECOMP_H
#define _PRECOMP_H
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
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 <winreg.h>
#include <winspool.h>
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 <winsplp.h>
#include <ndk/rtlfuncs.h>
[LOCALSPL_APITEST] - Add more tests for fpEnumPrinters. For some reason, using SEH here works only once. We experience a hang in the testing process when you run the test again for a second time without restarting spoolsv. Needs more investigation. - Ensure that the spooler service is running before starting any testing. - Do proper cleanup in every case. [LOCALSPL] - Implement LocalEnumPrinters level 1 based on the API-Tests. - Use DllAllocSplMem/DllFreeSplMem instead of HeapAlloc/HeapFree. - Use AllocSplStr with DllFreeSplStr now that DuplicateStringW is gone. - Use _countof where applicable. [SPOOLSS] - Found out that I was not the only one needing a wcsdup equivalent. My DuplicateStringW from localspl is actually exported as AllocSplStr in spoolss. This is actually part of a range of undocumented memory functions in spoolss, so implement and document AllocSplStr, DllAllocSplMem, DllFreeSplMem, DllFreeSplStr, ReallocSplMem and ReallocSplStr. Information about some of them was gathered through black box testing and DDK samples (down to Win95 DDK), which at least contained prototypes of them. - Implement SplInitializeWinSpoolDrv based on the API-Test and simply return FALSE for SplIsUpgrade. [SPOOLSS_APITEST] - Add a test for ReallocSplStr, which was actually the most undocumented function of spoolss' memory functions. [WINSPOOL] SplInitializeWinSpoolDrv shows that we can't just auto-assign an ordinal to all winspool.drv functions. We even need to export some nameless functions by ordinal only. Redo the whole .spec file based on the ordinals found in Windows Server 2003's winspool.drv. Trust WINE for the nameless stubs. svn path=/branches/colins-printing-for-freedom/; revision=68089
2015-06-09 13:22:25 +00:00
#include <spoolss.h>
#include <marshalling/marshalling.h>
[LOCALSPL_APITEST] - Add more tests for fpEnumPrinters. For some reason, using SEH here works only once. We experience a hang in the testing process when you run the test again for a second time without restarting spoolsv. Needs more investigation. - Ensure that the spooler service is running before starting any testing. - Do proper cleanup in every case. [LOCALSPL] - Implement LocalEnumPrinters level 1 based on the API-Tests. - Use DllAllocSplMem/DllFreeSplMem instead of HeapAlloc/HeapFree. - Use AllocSplStr with DllFreeSplStr now that DuplicateStringW is gone. - Use _countof where applicable. [SPOOLSS] - Found out that I was not the only one needing a wcsdup equivalent. My DuplicateStringW from localspl is actually exported as AllocSplStr in spoolss. This is actually part of a range of undocumented memory functions in spoolss, so implement and document AllocSplStr, DllAllocSplMem, DllFreeSplMem, DllFreeSplStr, ReallocSplMem and ReallocSplStr. Information about some of them was gathered through black box testing and DDK samples (down to Win95 DDK), which at least contained prototypes of them. - Implement SplInitializeWinSpoolDrv based on the API-Test and simply return FALSE for SplIsUpgrade. [SPOOLSS_APITEST] - Add a test for ReallocSplStr, which was actually the most undocumented function of spoolss' memory functions. [WINSPOOL] SplInitializeWinSpoolDrv shows that we can't just auto-assign an ordinal to all winspool.drv functions. We even need to export some nameless functions by ordinal only. Redo the whole .spec file based on the ordinals found in Windows Server 2003's winspool.drv. Trust WINE for the nameless stubs. svn path=/branches/colins-printing-for-freedom/; revision=68089
2015-06-09 13:22:25 +00:00
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(spoolss);
// Function pointers
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
typedef BOOL (WINAPI *PInitializePrintProvidor)(LPPRINTPROVIDOR, DWORD, LPWSTR);
// Structures
/**
* Describes a Print Provider.
*/
typedef struct _SPOOLSS_PRINT_PROVIDER
{
LIST_ENTRY Entry;
PRINTPROVIDOR PrintProvider;
}
SPOOLSS_PRINT_PROVIDER, *PSPOOLSS_PRINT_PROVIDER;
/*
* Describes a handle returned by OpenPrinterW.
* We can't just pass the handle returned by the Print Provider, because spoolss has to remember which Print Provider opened this handle.
*/
typedef struct _SPOOLSS_PRINTER_HANDLE
{
PSPOOLSS_PRINT_PROVIDER pPrintProvider; /** Pointer to the Print Provider that opened this printer. */
HANDLE hPrinter; /** The handle returned by fpOpenPrinter of the Print Provider and passed to subsequent Print Provider functions. */
}
SPOOLSS_PRINTER_HANDLE, *PSPOOLSS_PRINTER_HANDLE;
[LOCALSPL_APITEST] - Add more tests for fpEnumPrinters. For some reason, using SEH here works only once. We experience a hang in the testing process when you run the test again for a second time without restarting spoolsv. Needs more investigation. - Ensure that the spooler service is running before starting any testing. - Do proper cleanup in every case. [LOCALSPL] - Implement LocalEnumPrinters level 1 based on the API-Tests. - Use DllAllocSplMem/DllFreeSplMem instead of HeapAlloc/HeapFree. - Use AllocSplStr with DllFreeSplStr now that DuplicateStringW is gone. - Use _countof where applicable. [SPOOLSS] - Found out that I was not the only one needing a wcsdup equivalent. My DuplicateStringW from localspl is actually exported as AllocSplStr in spoolss. This is actually part of a range of undocumented memory functions in spoolss, so implement and document AllocSplStr, DllAllocSplMem, DllFreeSplMem, DllFreeSplStr, ReallocSplMem and ReallocSplStr. Information about some of them was gathered through black box testing and DDK samples (down to Win95 DDK), which at least contained prototypes of them. - Implement SplInitializeWinSpoolDrv based on the API-Test and simply return FALSE for SplIsUpgrade. [SPOOLSS_APITEST] - Add a test for ReallocSplStr, which was actually the most undocumented function of spoolss' memory functions. [WINSPOOL] SplInitializeWinSpoolDrv shows that we can't just auto-assign an ordinal to all winspool.drv functions. We even need to export some nameless functions by ordinal only. Redo the whole .spec file based on the ordinals found in Windows Server 2003's winspool.drv. Trust WINE for the nameless stubs. svn path=/branches/colins-printing-for-freedom/; revision=68089
2015-06-09 13:22:25 +00:00
// main.c
extern HANDLE hProcessHeap;
extern LIST_ENTRY PrintProviderList;
[LOCALSPL_APITEST] - Add more tests for fpEnumPrinters. For some reason, using SEH here works only once. We experience a hang in the testing process when you run the test again for a second time without restarting spoolsv. Needs more investigation. - Ensure that the spooler service is running before starting any testing. - Do proper cleanup in every case. [LOCALSPL] - Implement LocalEnumPrinters level 1 based on the API-Tests. - Use DllAllocSplMem/DllFreeSplMem instead of HeapAlloc/HeapFree. - Use AllocSplStr with DllFreeSplStr now that DuplicateStringW is gone. - Use _countof where applicable. [SPOOLSS] - Found out that I was not the only one needing a wcsdup equivalent. My DuplicateStringW from localspl is actually exported as AllocSplStr in spoolss. This is actually part of a range of undocumented memory functions in spoolss, so implement and document AllocSplStr, DllAllocSplMem, DllFreeSplMem, DllFreeSplStr, ReallocSplMem and ReallocSplStr. Information about some of them was gathered through black box testing and DDK samples (down to Win95 DDK), which at least contained prototypes of them. - Implement SplInitializeWinSpoolDrv based on the API-Test and simply return FALSE for SplIsUpgrade. [SPOOLSS_APITEST] - Add a test for ReallocSplStr, which was actually the most undocumented function of spoolss' memory functions. [WINSPOOL] SplInitializeWinSpoolDrv shows that we can't just auto-assign an ordinal to all winspool.drv functions. We even need to export some nameless functions by ordinal only. Redo the whole .spec file based on the ordinals found in Windows Server 2003's winspool.drv. Trust WINE for the nameless stubs. svn path=/branches/colins-printing-for-freedom/; revision=68089
2015-06-09 13:22:25 +00:00
#endif