2015-05-06 12:47:20 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Local Spooler
|
2017-09-29 17:18:19 +00:00
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
2015-05-06 12:47:20 +00:00
|
|
|
* PURPOSE: Main functions
|
2017-09-29 17:18:19 +00:00
|
|
|
* COPYRIGHT: Copyright 2015-2017 Colin Finck (colin@reactos.org)
|
2015-05-06 12:47:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.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
|
|
|
// Global Variables
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
HKEY hPrintKey = NULL;
|
|
|
|
HKEY hPrintersKey = NULL;
|
|
|
|
WCHAR wszJobDirectory[MAX_PATH];
|
|
|
|
DWORD cchJobDirectory;
|
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
|
|
|
WCHAR wszSpoolDirectory[MAX_PATH];
|
|
|
|
DWORD cchSpoolDirectory;
|
|
|
|
|
2015-06-19 15:21:30 +00:00
|
|
|
// Global Constants
|
2016-11-24 19:24:27 +00:00
|
|
|
#include <prtprocenv.h>
|
2015-07-07 17:06:48 +00:00
|
|
|
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
/** This is what the Spooler of Windows Server 2003 returns (for example using GetPrinterDataExW, SPLREG_MAJOR_VERSION/SPLREG_MINOR_VERSION) */
|
|
|
|
const DWORD dwSpoolerMajorVersion = 3;
|
|
|
|
const DWORD dwSpoolerMinorVersion = 0;
|
|
|
|
|
2015-06-19 15:21:30 +00:00
|
|
|
const WCHAR wszDefaultDocumentName[] = L"Local Downlevel Document";
|
|
|
|
|
2019-01-06 11:18:40 +00:00
|
|
|
PCWSTR wszPrintProviderInfo[3] = {
|
2015-06-09 13:22:25 +00:00
|
|
|
L"Windows NT Local Print Providor", // Name
|
2020-09-08 18:15:16 +00:00
|
|
|
L"Locally connected Printers", // Comment
|
|
|
|
L"Windows NT Local Printers" // Description
|
2015-06-09 13:22:25 +00:00
|
|
|
};
|
|
|
|
|
2015-06-19 15:21:30 +00:00
|
|
|
// Local Constants
|
|
|
|
static const PRINTPROVIDOR _PrintProviderFunctions = {
|
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
|
|
|
LocalOpenPrinter, // fpOpenPrinter
|
2015-06-25 12:29:18 +00:00
|
|
|
LocalSetJob, // fpSetJob
|
2015-06-19 15:21:30 +00:00
|
|
|
LocalGetJob, // fpGetJob
|
2015-06-25 15:27:38 +00:00
|
|
|
LocalEnumJobs, // fpEnumJobs
|
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
|
|
|
NULL, // fpAddPrinter
|
|
|
|
NULL, // fpDeletePrinter
|
|
|
|
NULL, // fpSetPrinter
|
2017-04-30 15:12:53 +00:00
|
|
|
LocalGetPrinter, // fpGetPrinter
|
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
|
|
|
LocalEnumPrinters, // fpEnumPrinters
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalAddPrinterDriver, // fpAddPrinterDriver
|
|
|
|
LocalEnumPrinterDrivers, // fpEnumPrinterDrivers
|
2018-12-29 22:51:32 +00:00
|
|
|
LocalGetPrinterDriver, // fpGetPrinterDriver
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalGetPrinterDriverDirectory, // fpGetPrinterDriverDirectory
|
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
|
|
|
NULL, // fpDeletePrinterDriver
|
|
|
|
NULL, // fpAddPrintProcessor
|
|
|
|
LocalEnumPrintProcessors, // fpEnumPrintProcessors
|
|
|
|
LocalGetPrintProcessorDirectory, // fpGetPrintProcessorDirectory
|
|
|
|
NULL, // fpDeletePrintProcessor
|
|
|
|
LocalEnumPrintProcessorDatatypes, // fpEnumPrintProcessorDatatypes
|
|
|
|
LocalStartDocPrinter, // fpStartDocPrinter
|
|
|
|
LocalStartPagePrinter, // fpStartPagePrinter
|
|
|
|
LocalWritePrinter, // fpWritePrinter
|
|
|
|
LocalEndPagePrinter, // fpEndPagePrinter
|
|
|
|
NULL, // fpAbortPrinter
|
[LOCALSPL, WINSPOOL]
Partially implement the whole StartDocPrinter, StartPagePrinter, ReadPrinter, WritePrinter, EndPagePrinter, EndDocPrinter, ClosePrinter group of functions.
They behave very differently based on whether spooled printing is enabled, whether it's a local or remote call, etc. Most information was gained by observing callchains under Windows.
So far, only the spooled path is implemented, the others need more investigation first.
Many other TODOs remain as well, see the comments.
Also make some more comments Doxygen-aware :)
svn path=/branches/colins-printing-for-freedom/; revision=68405
2015-07-16 15:03:47 +00:00
|
|
|
LocalReadPrinter, // fpReadPrinter
|
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
|
|
|
LocalEndDocPrinter, // fpEndDocPrinter
|
2015-06-19 15:21:30 +00:00
|
|
|
LocalAddJob, // fpAddJob
|
2015-06-28 15:51:32 +00:00
|
|
|
LocalScheduleJob, // fpScheduleJob
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
LocalGetPrinterData, // fpGetPrinterData
|
|
|
|
LocalSetPrinterData, // fpSetPrinterData
|
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
|
|
|
NULL, // fpWaitForPrinterChange
|
|
|
|
LocalClosePrinter, // fpClosePrinter
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalAddForm, // fpAddForm
|
|
|
|
LocalDeleteForm, // fpDeleteForm
|
|
|
|
LocalGetForm, // fpGetForm
|
2020-08-26 23:15:10 +00:00
|
|
|
LocalSetForm, // fpSetForm
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalEnumForms, // fpEnumForms
|
2015-07-07 17:06:48 +00:00
|
|
|
LocalEnumMonitors, // fpEnumMonitors
|
|
|
|
LocalEnumPorts, // fpEnumPorts
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalAddPort, // fpAddPort
|
|
|
|
LocalConfigurePort, // fpConfigurePort
|
|
|
|
LocalDeletePort, // fpDeletePort
|
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
|
|
|
NULL, // fpCreatePrinterIC
|
|
|
|
NULL, // fpPlayGdiScriptOnPrinterIC
|
|
|
|
NULL, // fpDeletePrinterIC
|
|
|
|
NULL, // fpAddPrinterConnection
|
|
|
|
NULL, // fpDeletePrinterConnection
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalPrinterMessageBox, // fpPrinterMessageBox
|
|
|
|
LocalAddMonitor, // fpAddMonitor
|
|
|
|
LocalDeleteMonitor, // fpDeleteMonitor
|
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
|
|
|
NULL, // fpResetPrinter
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalGetPrinterDriverEx, // fpGetPrinterDriverEx
|
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
|
|
|
NULL, // fpFindFirstPrinterChangeNotification
|
|
|
|
NULL, // fpFindClosePrinterChangeNotification
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalAddPortEx, // fpAddPortEx
|
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
|
|
|
NULL, // fpShutDown
|
|
|
|
NULL, // fpRefreshPrinterChangeNotification
|
|
|
|
NULL, // fpOpenPrinterEx
|
|
|
|
NULL, // fpAddPrinterEx
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalSetPort, // fpSetPort
|
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
|
|
|
NULL, // fpEnumPrinterData
|
|
|
|
NULL, // fpDeletePrinterData
|
|
|
|
NULL, // fpClusterSplOpen
|
|
|
|
NULL, // fpClusterSplClose
|
|
|
|
NULL, // fpClusterSplIsAlive
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
LocalSetPrinterDataEx, // fpSetPrinterDataEx
|
|
|
|
LocalGetPrinterDataEx, // fpGetPrinterDataEx
|
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
|
|
|
NULL, // fpEnumPrinterDataEx
|
|
|
|
NULL, // fpEnumPrinterKey
|
|
|
|
NULL, // fpDeletePrinterDataEx
|
|
|
|
NULL, // fpDeletePrinterKey
|
|
|
|
NULL, // fpSeekPrinter
|
|
|
|
NULL, // fpDeletePrinterDriverEx
|
|
|
|
NULL, // fpAddPerMachineConnection
|
|
|
|
NULL, // fpDeletePerMachineConnection
|
|
|
|
NULL, // fpEnumPerMachineConnections
|
2020-08-26 22:12:20 +00:00
|
|
|
LocalXcvData, // fpXcvData
|
|
|
|
LocalAddPrinterDriverEx, // fpAddPrinterDriverEx
|
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
|
|
|
NULL, // fpSplReadPrinter
|
|
|
|
NULL, // fpDriverUnloadComplete
|
2020-08-02 19:49:06 +00:00
|
|
|
LocalGetSpoolFileInfo, // fpGetSpoolFileInfo
|
|
|
|
LocalCommitSpoolData, // fpCommitSpoolData
|
|
|
|
LocalCloseSpoolFileHandle, // fpCloseSpoolFileHandle
|
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
|
|
|
NULL, // fpFlushPrinter
|
|
|
|
NULL, // fpSendRecvBidiData
|
|
|
|
NULL, // fpAddDriverCatalog
|
|
|
|
};
|
|
|
|
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
static BOOL
|
|
|
|
_InitializeLocalSpooler(void)
|
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
|
|
|
{
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
const WCHAR wszPrintersPath[] = L"\\PRINTERS";
|
|
|
|
const DWORD cchPrintersPath = _countof(wszPrintersPath) - 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
|
|
|
const WCHAR wszSpoolPath[] = L"\\spool";
|
2015-06-09 13:22:25 +00:00
|
|
|
const DWORD cchSpoolPath = _countof(wszSpoolPath) - 1;
|
2017-06-20 06:08:30 +00:00
|
|
|
const WCHAR wszSymbolicLinkValue[] = L"\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers";
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
const DWORD cbSymbolicLinkValue = sizeof(wszSymbolicLinkValue) - sizeof(WCHAR);
|
|
|
|
|
|
|
|
BOOL bReturnValue = FALSE;
|
|
|
|
DWORD cbData;
|
|
|
|
DWORD dwErrorCode;
|
2017-06-20 06:08:30 +00:00
|
|
|
HKEY hKey = NULL;
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
|
|
|
|
// On startup, always create a volatile symbolic link in the registry if it doesn't exist yet.
|
|
|
|
// "SYSTEM\CurrentControlSet\Control\Print\Printers" -> "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers"
|
|
|
|
//
|
|
|
|
// According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51
|
|
|
|
// this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive.
|
|
|
|
dwErrorCode = (DWORD)RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Print\\Printers", 0, NULL, REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK, KEY_CREATE_LINK | KEY_SET_VALUE, NULL, &hKey, NULL);
|
|
|
|
if (dwErrorCode == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
// Note that wszSymbolicLink has to be stored WITHOUT the terminating null character for the symbolic link to work!
|
|
|
|
// See cbSymbolicLinkValue above.
|
|
|
|
dwErrorCode = (DWORD)RegSetValueExW(hKey, L"SymbolicLinkValue", 0, REG_LINK, (PBYTE)wszSymbolicLinkValue, cbSymbolicLinkValue);
|
|
|
|
if (dwErrorCode != ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
ERR("RegSetValueExW failed for the Printers symlink with error %lu!\n", dwErrorCode);
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (dwErrorCode != ERROR_ALREADY_EXISTS)
|
|
|
|
{
|
|
|
|
ERR("RegCreateKeyExW failed for the Printers symlink with error %lu!\n", dwErrorCode);
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
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
|
|
|
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
// Open some registry keys and leave them open. We need them multiple times throughout the Local Spooler.
|
|
|
|
dwErrorCode = (DWORD)RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Print", 0, KEY_ALL_ACCESS, &hPrintKey);
|
|
|
|
if (dwErrorCode != ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
ERR("RegOpenKeyExW failed for \"Print\" with error %lu!\n", dwErrorCode);
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
dwErrorCode = (DWORD)RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers", 0, KEY_ALL_ACCESS, &hPrintersKey);
|
|
|
|
if (dwErrorCode != ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
ERR("RegOpenKeyExW failed for \"Printers\" with error %lu!\n", dwErrorCode);
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Construct the path to "%SystemRoot%\system32\spool".
|
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
|
|
|
// Forget about length checks here. If this doesn't fit into MAX_PATH, our OS has more serious problems...
|
|
|
|
cchSpoolDirectory = GetSystemDirectoryW(wszSpoolDirectory, MAX_PATH);
|
|
|
|
CopyMemory(&wszSpoolDirectory[cchSpoolDirectory], wszSpoolPath, (cchSpoolPath + 1) * sizeof(WCHAR));
|
|
|
|
cchSpoolDirectory += cchSpoolPath;
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
|
|
|
|
// Query the job directory.
|
|
|
|
cbData = sizeof(wszJobDirectory);
|
|
|
|
dwErrorCode = (DWORD)RegQueryValueExW(hPrintersKey, SPLREG_DEFAULT_SPOOL_DIRECTORY, NULL, NULL, (PBYTE)wszJobDirectory, &cbData);
|
|
|
|
if (dwErrorCode == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
cchJobDirectory = cbData / sizeof(WCHAR) - 1;
|
|
|
|
}
|
|
|
|
else if (dwErrorCode == ERROR_FILE_NOT_FOUND)
|
|
|
|
{
|
|
|
|
// Use the default "%SystemRoot%\system32\spool\PRINTERS".
|
|
|
|
CopyMemory(wszJobDirectory, wszSpoolDirectory, cchSpoolDirectory * sizeof(WCHAR));
|
|
|
|
CopyMemory(&wszJobDirectory[cchSpoolDirectory], wszPrintersPath, (cchPrintersPath + 1) * sizeof(WCHAR));
|
|
|
|
cchJobDirectory = cchSpoolDirectory + cchPrintersPath;
|
|
|
|
|
|
|
|
// Save this for next time.
|
|
|
|
RegSetValueExW(hPrintersKey, SPLREG_DEFAULT_SPOOL_DIRECTORY, 0, REG_SZ, (PBYTE)wszJobDirectory, (cchJobDirectory + 1) * sizeof(WCHAR));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ERR("RegQueryValueExW failed for \"%S\" with error %lu!\n", SPLREG_DEFAULT_SPOOL_DIRECTORY, dwErrorCode);
|
|
|
|
goto Cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Initialize all lists.
|
|
|
|
if (!InitializePrintMonitorList())
|
|
|
|
goto Cleanup;
|
|
|
|
|
|
|
|
if (!InitializePortList())
|
|
|
|
goto Cleanup;
|
|
|
|
|
|
|
|
if (!InitializePrintProcessorList())
|
|
|
|
goto Cleanup;
|
|
|
|
|
|
|
|
if (!InitializePrinterList())
|
|
|
|
goto Cleanup;
|
|
|
|
|
|
|
|
if (!InitializeGlobalJobList())
|
|
|
|
goto Cleanup;
|
|
|
|
|
2020-08-26 22:12:20 +00:00
|
|
|
if (!InitializeFormList())
|
|
|
|
goto Cleanup;
|
|
|
|
|
|
|
|
if (!InitializePrinterDrivers())
|
|
|
|
goto Cleanup;
|
|
|
|
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
// Local Spooler Initialization finished successfully!
|
|
|
|
bReturnValue = TRUE;
|
|
|
|
|
|
|
|
Cleanup:
|
|
|
|
if (hKey)
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
|
|
|
|
return bReturnValue;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
BOOL WINAPI
|
|
|
|
DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
|
|
{
|
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
[PRINTING]
- Implement GetPrinterDataA, GetPrinterDataExA, GetPrinterDataExW, GetPrinterDataW, SetPrinterDataA, SetPrinterDataExA, SetPrinterDataExW, SetPrinterDataW.
They support all features for Print Server and Printer Handles (minus security checks!)
I've also added tests for them.
- Store Printer data in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers instead of SYSTEM\CurrentControlSet\Control\Print\Printers and create a registry symlink from the former path to the new one just like Windows does.
According to https://social.technet.microsoft.com/Forums/windowsserver/en-US/a683ab54-c43c-4ebe-af8f-1f7a65af2a51, this is needed when having >900 printers to work around a size limit of the SYSTEM registry hive. And if Windows has both locations, we need both for compatibility anyway.
- Add several settings which are queried by the new Printer Data APIs when working with Print Server Handles.
- Store the job directory in the Windows-compatible "DefaultSpoolDirectory" setting and make use of it.
- Revert the ASSERTs in LocalEnumPrinters again to let us verify the NULL pointer exceptions in localspl_apitest (thanks Serge! CORE-13433)
- Translate ERROR_INVALID_NAME to ERROR_INVALID_PRINTER_NAME in all cases in OpenPrinterW (thanks Victor! CORE-13412)
- Make EnumMonitorsW and EnumPortsW in spoolss more robust against failing Print Monitors.
- Remove the wrong !phPrinter check in OpenPrinterW to make Print Server Handles work for real.
- Fix error handling when memory allocation fails: HeapAlloc doesn't set last error, so it's just wrong to query or return it.
One more item done from https://reactos.org/wiki/Printing !
This is all still a big Work-in-Progress, with many subtle bugs deep down in ReactOS, for which I need to open additional tickets. But I didn't want to make this commit even bigger..
svn path=/trunk/; revision=75125
2017-06-19 14:18:19 +00:00
|
|
|
return _InitializeLocalSpooler();
|
2015-07-07 17:06:48 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
return TRUE;
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2015-05-06 12:47:20 +00:00
|
|
|
BOOL WINAPI
|
|
|
|
InitializePrintProvidor(LPPRINTPROVIDOR pPrintProvidor, DWORD cbPrintProvidor, LPWSTR pFullRegistryPath)
|
|
|
|
{
|
2017-07-05 15:29:13 +00:00
|
|
|
TRACE("InitializePrintProvidor(%p, %lu, %S)\n", pPrintProvidor, cbPrintProvidor, pFullRegistryPath);
|
|
|
|
|
2015-06-19 15:21:30 +00:00
|
|
|
CopyMemory(pPrintProvidor, &_PrintProviderFunctions, min(cbPrintProvidor, sizeof(PRINTPROVIDOR)));
|
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
|
|
|
|
2015-06-23 13:46:14 +00:00
|
|
|
SetLastError(ERROR_SUCCESS);
|
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
|
|
|
return TRUE;
|
2015-05-06 12:47:20 +00:00
|
|
|
}
|