ReactOS 0.4.15-dev-7958-gcd0bb1a
spoolfile.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Spooler Router
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Functions related to Spool File
5 * COPYRIGHT: Copyright 1998-2022 ReactOS
6 */
7
8#include "precomp.h"
9
12 HANDLE hPrinter,
13 HANDLE hProcessHandle,
15 PFILE_INFO_1 pFileInfo,
17 DWORD* dwNeeded )
18{
19 BOOL Ret;
20 HANDLE hHandle, hSourceProcessHandle;
22
23 // Sanity checks.
24 if (!pHandle)
25 {
27 return FALSE;
28 }
29
30 hSourceProcessHandle = GetCurrentProcess();
31
32 // No Local? Ok, what ever...
33
34 Ret = pHandle->pPrintProvider->PrintProvider.fpGetSpoolFileInfo( pHandle->hPrinter,
35 NULL,
36 &hHandle,
37 hProcessHandle,
38 hSourceProcessHandle );
39 if ( Ret )
40 {
41 pFileInfo->hSpoolFileHandle = hHandle;
42 pFileInfo->bInheritHandle = TRUE;
44 }
45
46 return Ret;
47}
48
51 HANDLE hPrinter,
52 HANDLE hProcessHandle,
53 DWORD cbCommit,
55 PFILE_INFO_1 pFileInfo,
57 DWORD* dwNeeded )
58{
60
61 // Sanity checks.
62 if (!pHandle)
63 {
65 return FALSE;
66 }
67
69 pFileInfo->bInheritHandle = TRUE;
71
72 return pHandle->pPrintProvider->PrintProvider.fpCommitSpoolData( hPrinter, cbCommit );
73}
74
77{
79
80 // Sanity checks.
81 if (!pHandle)
82 {
84 return FALSE;
85 }
86
87 return pHandle->pPrintProvider->PrintProvider.fpCloseSpoolFileHandle( pHandle->hPrinter );
88}
BOOL WINAPI SplGetSpoolFileInfo(HANDLE hPrinter, HANDLE hProcessHandle, DWORD Level, PFILE_INFO_1 pFileInfo, DWORD dwSize, DWORD *dwNeeded)
Definition: spoolfile.c:11
BOOL WINAPI SplCommitSpoolData(HANDLE hPrinter, HANDLE hProcessHandle, DWORD cbCommit, DWORD Level, PFILE_INFO_1 pFileInfo, DWORD dwSize, DWORD *dwNeeded)
Definition: spoolfile.c:50
BOOL WINAPI SplCloseSpoolFileHandle(HANDLE hPrinter)
Definition: spoolfile.c:76
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GetCurrentProcess()
Definition: compat.h:759
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
HANDLE hSpoolFileHandle
Definition: spoolss.h:78
DWORD dwOptions
Definition: spoolss.h:79
BOOL bInheritHandle
Definition: spoolss.h:77
PSPOOLSS_PRINT_PROVIDER pPrintProvider
Definition: precomp.h:46
PRINTPROVIDOR PrintProvider
Definition: precomp.h:36
struct _SPOOLSS_PRINTER_HANDLE * PSPOOLSS_PRINTER_HANDLE
#define WINAPI
Definition: msvc.h:6
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
#define DUPLICATE_CLOSE_SOURCE