reactos/win32ss/printing/base/winspool/precomp.h
James Tabor 7bffb70353 [Printing] Fix ups and Implementations.
WinSpool : Implement missing API. Sync/Port from wine. Setting it to fast track for needed testing of the later GDI code. Leaving Fix-me debug prints on.
Local tree has WinSpool_winetest turned on. So no debug noise during normal ReactOS operation.

SpoolSS : Reordered header types. Have more Spl function to be added while SpoolSV is being coded to forward to LocalSpl.

Based on wine and old research from the GDI code.
2020-08-03 21:07:58 -05:00

106 lines
2.5 KiB
C

/*
* PROJECT: ReactOS Spooler API
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Precompiled Header for all source files
* COPYRIGHT: Copyright 2015-2017 Colin Finck (colin@reactos.org)
*/
#ifndef _PRECOMP_H
#define _PRECOMP_H
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include <winreg.h>
#include <winspool.h>
#include <winspool_c.h>
#include <winsplp.h>
#include <winddiui.h>
#include <ndk/rtlfuncs.h>
#include <strsafe.h>
#include <spoolss.h>
#include <marshalling/marshalling.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(winspool);
#define SPOOLER_HANDLE_SIG 'gg'
// Structures
/*
* Describes a handle returned by AddPrinterW or OpenPrinterW.
*/
typedef struct _SPOOLER_HANDLE
{
DWORD_PTR Sig;
BOOL bStartedDoc : 1;
BOOL bJob : 1;
BOOL bAnsi : 1;
BOOL bDocEvent : 1;
BOOL bTrayIcon : 1;
BOOL bNoColorProfile : 1;
BOOL bShared : 1;
BOOL bClosed : 1;
DWORD dwJobID;
HANDLE hPrinter;
HANDLE hSPLFile;
DWORD cCount;
HANDLE hSpoolFileHandle;
DWORD dwOptions;
}
SPOOLER_HANDLE, *PSPOOLER_HANDLE;
// main.c
extern HANDLE hProcessHeap;
extern CRITICAL_SECTION rtlCritSec;
// utils.c
DWORD UnicodeToAnsiInPlace(PWSTR pwszField);
DWORD UnicodeToAnsiZZInPlace(PWSTR pwszzField);
SECURITY_DESCRIPTOR * get_sd( SECURITY_DESCRIPTOR *sd, DWORD *size );
LONG WINAPI IntProtectHandle(HANDLE,BOOL);
BOOL WINAPI IntUnprotectHandle(HANDLE);
// devmode.c
extern void RosConvertAnsiDevModeToUnicodeDevmode(PDEVMODEA pDevModeInput, PDEVMODEW *pDevModeOutput);
extern void RosConvertUnicodeDevModeToAnsiDevmode(PDEVMODEW pDevModeInput, PDEVMODEA pDevModeOutput);
// RC
#define IDS_CAPTION 10
#define IDS_FILE_EXISTS 11
#define IDS_CANNOT_OPEN 12
#define FILENAME_DIALOG 100
#define EDITBOX 201
//
// [MS-EMF] 2.2.27 UniversalFontId Object
//
typedef struct _UNIVERSAL_FONT_ID
{
ULONG CheckSum;
ULONG Index;
} UNIVERSAL_FONT_ID, *PUNIVERSAL_FONT_ID;
BOOL WINAPI IsValidDevmodeNoSizeW(PDEVMODEW pDevmode);
/* RtlCreateUnicodeStringFromAsciiz will return an empty string in the buffer
if passed a NULL string. This returns NULLs to the result.
*/
static inline PWSTR AsciiToUnicode( UNICODE_STRING * usBufferPtr, LPCSTR src )
{
if ( (src) )
{
RtlCreateUnicodeStringFromAsciiz(usBufferPtr, src);
return usBufferPtr->Buffer;
}
usBufferPtr->Buffer = NULL; /* so that RtlFreeUnicodeString won't barf */
return NULL;
}
#endif