Author: cfinck Date: Mon May 4 13:39:07 2015 New Revision: 67544
URL: http://svn.reactos.org/svn/reactos?rev=67544&view=rev Log: Add a little test program "winspool_print" that just prints a single line of unformatted text. This line will arrive as RAW data in the printing stack, so it doesn't need any processing through GDI and serves as a good test for the very basic printing components.
Added: branches/colins-printing-for-freedom/reactos/temp/ (with props) branches/colins-printing-for-freedom/reactos/temp/CMakeLists.txt (with props) branches/colins-printing-for-freedom/reactos/temp/winspool_print/ (with props) branches/colins-printing-for-freedom/reactos/temp/winspool_print/CMakeLists.txt (with props) branches/colins-printing-for-freedom/reactos/temp/winspool_print/main.c (with props) Modified: branches/colins-printing-for-freedom/reactos/CMakeLists.txt
Modified: branches/colins-printing-for-freedom/reactos/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/reac... ============================================================================== --- branches/colins-printing-for-freedom/reactos/CMakeLists.txt [iso-8859-1] (original) +++ branches/colins-printing-for-freedom/reactos/CMakeLists.txt [iso-8859-1] Mon May 4 13:39:07 2015 @@ -244,6 +244,7 @@ add_subdirectory(modules) add_subdirectory(ntoskrnl) add_subdirectory(subsystems) + add_subdirectory(temp) add_subdirectory(tools/wpp) add_subdirectory(win32ss)
Propchange: branches/colins-printing-for-freedom/reactos/temp/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon May 4 13:39:07 2015 @@ -0,0 +1 @@ +((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or )?((CORE|ROSTESTS|ROSAPPS)-\d+))?
Propchange: branches/colins-printing-for-freedom/reactos/temp/ ------------------------------------------------------------------------------ bugtraq:message = See issue %BUGID% for more details.
Propchange: branches/colins-printing-for-freedom/reactos/temp/ ------------------------------------------------------------------------------ bugtraq:url = https://jira.reactos.org/browse/%BUGID%
Propchange: branches/colins-printing-for-freedom/reactos/temp/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Added: branches/colins-printing-for-freedom/reactos/temp/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/reac... ============================================================================== --- branches/colins-printing-for-freedom/reactos/temp/CMakeLists.txt (added) +++ branches/colins-printing-for-freedom/reactos/temp/CMakeLists.txt [iso-8859-1] Mon May 4 13:39:07 2015 @@ -0,0 +1 @@ +add_subdirectory(winspool_print)
Propchange: branches/colins-printing-for-freedom/reactos/temp/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Propchange: branches/colins-printing-for-freedom/reactos/temp/winspool_print/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon May 4 13:39:07 2015 @@ -0,0 +1 @@ +((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or )?((CORE|ROSTESTS|ROSAPPS)-\d+))?
Propchange: branches/colins-printing-for-freedom/reactos/temp/winspool_print/ ------------------------------------------------------------------------------ bugtraq:message = See issue %BUGID% for more details.
Propchange: branches/colins-printing-for-freedom/reactos/temp/winspool_print/ ------------------------------------------------------------------------------ bugtraq:url = https://jira.reactos.org/browse/%BUGID%
Propchange: branches/colins-printing-for-freedom/reactos/temp/winspool_print/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Added: branches/colins-printing-for-freedom/reactos/temp/winspool_print/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/reac... ============================================================================== --- branches/colins-printing-for-freedom/reactos/temp/winspool_print/CMakeLists.txt (added) +++ branches/colins-printing-for-freedom/reactos/temp/winspool_print/CMakeLists.txt [iso-8859-1] Mon May 4 13:39:07 2015 @@ -0,0 +1,4 @@ +add_executable(winspool_print main.c) +set_module_type(winspool_print win32cui) +add_importlibs(winspool_print kernel32 msvcrt winspool) +add_cd_file(TARGET winspool_print DESTINATION reactos/system32 FOR all)
Propchange: branches/colins-printing-for-freedom/reactos/temp/winspool_print/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Added: branches/colins-printing-for-freedom/reactos/temp/winspool_print/main.c URL: http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/reac... ============================================================================== --- branches/colins-printing-for-freedom/reactos/temp/winspool_print/main.c (added) +++ branches/colins-printing-for-freedom/reactos/temp/winspool_print/main.c [iso-8859-1] Mon May 4 13:39:07 2015 @@ -0,0 +1,58 @@ +#include <stdio.h> +#include <windows.h> + +int main() +{ + int ReturnValue = 1; + DWORD dwWritten; + HANDLE hPrinter = NULL; + DOC_INFO_1W docInfo; + char szString[] = "winspool_print Test\f"; + + if (!OpenPrinterW(L"Generic / Text Only", &hPrinter, NULL)) + { + printf("OpenPrinterW failed\n"); + goto Cleanup; + } + + ZeroMemory(&docInfo, sizeof(docInfo)); + docInfo.pDocName = L"winspool_print"; + + if (!StartDocPrinterW(hPrinter, 1, (LPBYTE)&docInfo)) + { + printf("StartDocPrinterW failed, last error is %u!\n", GetLastError()); + goto Cleanup; + } + + if (!StartPagePrinter(hPrinter)) + { + printf("StartPagePrinter failed, last error is %u!\n", GetLastError()); + goto Cleanup; + } + + if (!WritePrinter(hPrinter, szString, strlen(szString), &dwWritten)) + { + printf("WritePrinter failed, last error is %u!\n", GetLastError()); + goto Cleanup; + } + + if (!EndPagePrinter(hPrinter)) + { + printf("EndPagePrinter failed, last error is %u!\n", GetLastError()); + goto Cleanup; + } + + if (!EndDocPrinter(hPrinter)) + { + printf("EndDocPrinter failed, last error is %u!\n", GetLastError()); + goto Cleanup; + } + + ReturnValue = 0; + +Cleanup: + if (hPrinter) + ClosePrinter(hPrinter); + + return ReturnValue; +}
Propchange: branches/colins-printing-for-freedom/reactos/temp/winspool_print/main.c ------------------------------------------------------------------------------ svn:eol-style = native