ReactOS 0.4.15-dev-8344-g0574987
printers.c File Reference
#include "precomp.h"
#include <marshalling/printers.h>
Include dependency graph for printers.c:

Go to the source code of this file.

Functions

DWORD _RpcAbortPrinter (WINSPOOL_PRINTER_HANDLE hPrinter)
 
DWORD _RpcAddPrinter (WINSPOOL_HANDLE pName, WINSPOOL_PRINTER_CONTAINER *pPrinterContainer, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer, WINSPOOL_SECURITY_CONTAINER *pSecurityContainer, WINSPOOL_PRINTER_HANDLE *pHandle)
 
DWORD _RpcAddPrinterEx (WINSPOOL_HANDLE pName, WINSPOOL_PRINTER_CONTAINER *pPrinterContainer, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer, WINSPOOL_SECURITY_CONTAINER *pSecurityContainer, WINSPOOL_SPLCLIENT_CONTAINER *pClientInfo, WINSPOOL_PRINTER_HANDLE *pHandle)
 
DWORD _RpcClosePrinter (WINSPOOL_PRINTER_HANDLE *phPrinter)
 
DWORD _RpcDeletePrinter (WINSPOOL_PRINTER_HANDLE hPrinter)
 
DWORD _RpcEndDocPrinter (WINSPOOL_PRINTER_HANDLE hPrinter)
 
DWORD _RpcEndPagePrinter (WINSPOOL_PRINTER_HANDLE hPrinter)
 
DWORD _RpcEnumPrinters (DWORD Flags, WINSPOOL_HANDLE Name, DWORD Level, BYTE *pPrinterEnum, DWORD cbBuf, DWORD *pcbNeeded, DWORD *pcReturned)
 
DWORD _RpcFlushPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, BYTE *pBuf, DWORD cbBuf, DWORD *pcWritten, DWORD cSleep)
 
DWORD _RpcGetPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, DWORD Level, BYTE *pPrinter, DWORD cbBuf, DWORD *pcbNeeded)
 
DWORD _RpcOpenPrinter (WINSPOOL_HANDLE pPrinterName, WINSPOOL_PRINTER_HANDLE *phPrinter, WCHAR *pDatatype, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer, DWORD AccessRequired)
 
DWORD _RpcOpenPrinterEx (WINSPOOL_HANDLE pPrinterName, WINSPOOL_PRINTER_HANDLE *pHandle, WCHAR *pDatatype, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer, DWORD AccessRequired, WINSPOOL_SPLCLIENT_CONTAINER *pClientInfo)
 
DWORD _RpcReadPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, BYTE *pBuf, DWORD cbBuf, DWORD *pcNoBytesRead)
 
DWORD _RpcResetPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, WCHAR *pDatatype, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer)
 
DWORD _RpcResetPrinterEx (WINSPOOL_PRINTER_HANDLE hPrinter, WCHAR *pDatatype, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer, DWORD dwFlags)
 
DWORD _RpcSeekPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER pliNewPointer, DWORD dwMoveMethod, BOOL bWrite)
 
DWORD _RpcSetPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, WINSPOOL_PRINTER_CONTAINER *pPrinterContainer, WINSPOOL_DEVMODE_CONTAINER *pDevModeContainer, WINSPOOL_SECURITY_CONTAINER *pSecurityContainer, DWORD Command)
 
DWORD _RpcStartDocPrinter (WINSPOOL_PRINTER_HANDLE hPrinter, WINSPOOL_DOC_INFO_CONTAINER *pDocInfoContainer, DWORD *pJobId)
 
DWORD _RpcStartPagePrinter (WINSPOOL_PRINTER_HANDLE hPrinter)
 
DWORD _RpcWritePrinter (WINSPOOL_PRINTER_HANDLE hPrinter, BYTE *pBuf, DWORD cbBuf, DWORD *pcWritten)
 

Function Documentation

◆ _RpcAbortPrinter()

DWORD _RpcAbortPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter)

Definition at line 12 of file printers.c.

13{
14 DWORD dwErrorCode;
15
16 dwErrorCode = RpcImpersonateClient(NULL);
17 if (dwErrorCode != ERROR_SUCCESS)
18 {
19 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
20 return dwErrorCode;
21 }
22
23 if (!AbortPrinter(hPrinter))
24 dwErrorCode = GetLastError();
25
27 return dwErrorCode;
28}
#define ERR(fmt,...)
Definition: precomp.h:57
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1463
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1056
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
WINBOOL WINAPI AbortPrinter(HANDLE hPrinter)
Definition: printers.c:11

Referenced by AbortPrinter(), and pointer_default().

◆ _RpcAddPrinter()

DWORD _RpcAddPrinter ( WINSPOOL_HANDLE  pName,
WINSPOOL_PRINTER_CONTAINER pPrinterContainer,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer,
WINSPOOL_SECURITY_CONTAINER pSecurityContainer,
WINSPOOL_PRINTER_HANDLE pHandle 
)

Definition at line 31 of file printers.c.

32{
35}
#define UNIMPLEMENTED
Definition: debug.h:118
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6

Referenced by AddPrinterW(), and pointer_default().

◆ _RpcAddPrinterEx()

DWORD _RpcAddPrinterEx ( WINSPOOL_HANDLE  pName,
WINSPOOL_PRINTER_CONTAINER pPrinterContainer,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer,
WINSPOOL_SECURITY_CONTAINER pSecurityContainer,
WINSPOOL_SPLCLIENT_CONTAINER pClientInfo,
WINSPOOL_PRINTER_HANDLE pHandle 
)

Definition at line 38 of file printers.c.

39{
42}

Referenced by pointer_default().

◆ _RpcClosePrinter()

DWORD _RpcClosePrinter ( WINSPOOL_PRINTER_HANDLE phPrinter)

Definition at line 45 of file printers.c.

46{
47 DWORD dwErrorCode;
48
49 dwErrorCode = RpcImpersonateClient(NULL);
50 if (dwErrorCode != ERROR_SUCCESS)
51 {
52 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
53 return dwErrorCode;
54 }
55
56 if (ClosePrinter(*phPrinter))
57 *phPrinter = NULL;
58 else
59 dwErrorCode = GetLastError();
60
62 return dwErrorCode;
63}
WINBOOL WINAPI ClosePrinter(HANDLE hPrinter)
Definition: printers.c:176

Referenced by AddPrinterW(), ClosePrinter(), and pointer_default().

◆ _RpcDeletePrinter()

DWORD _RpcDeletePrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter)

Definition at line 66 of file printers.c.

67{
68 DWORD dwErrorCode;
69
70 dwErrorCode = RpcImpersonateClient(NULL);
71 if (dwErrorCode != ERROR_SUCCESS)
72 {
73 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
74 return dwErrorCode;
75 }
76
77 if (!DeletePrinter(hPrinter))
78 dwErrorCode = GetLastError();
79
81 return dwErrorCode;
82}
WINBOOL WINAPI DeletePrinter(HANDLE hPrinter)
Definition: printers.c:202

Referenced by AddPrinterW(), DeletePrinter(), and pointer_default().

◆ _RpcEndDocPrinter()

DWORD _RpcEndDocPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter)

Definition at line 85 of file printers.c.

86{
87 DWORD dwErrorCode;
88
89 dwErrorCode = RpcImpersonateClient(NULL);
90 if (dwErrorCode != ERROR_SUCCESS)
91 {
92 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
93 return dwErrorCode;
94 }
95
96 if (!EndDocPrinter(hPrinter))
97 dwErrorCode = GetLastError();
98
100 return dwErrorCode;
101}
WINBOOL WINAPI EndDocPrinter(HANDLE hPrinter)
Definition: printers.c:217

Referenced by EndDocPrinter(), and pointer_default().

◆ _RpcEndPagePrinter()

DWORD _RpcEndPagePrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter)

Definition at line 104 of file printers.c.

105{
106 DWORD dwErrorCode;
107
108 dwErrorCode = RpcImpersonateClient(NULL);
109 if (dwErrorCode != ERROR_SUCCESS)
110 {
111 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
112 return dwErrorCode;
113 }
114
115 if (!EndPagePrinter(hPrinter))
116 dwErrorCode = GetLastError();
117
119 return dwErrorCode;
120}
WINBOOL WINAPI EndPagePrinter(HANDLE hPrinter)
Definition: printers.c:232

Referenced by EndPagePrinter(), and pointer_default().

◆ _RpcEnumPrinters()

DWORD _RpcEnumPrinters ( DWORD  Flags,
WINSPOOL_HANDLE  Name,
DWORD  Level,
BYTE pPrinterEnum,
DWORD  cbBuf,
DWORD pcbNeeded,
DWORD pcReturned 
)

Definition at line 123 of file printers.c.

124{
125 DWORD dwErrorCode;
126 PBYTE pPrinterEnumAligned;
127
128 dwErrorCode = RpcImpersonateClient(NULL);
129 if (dwErrorCode != ERROR_SUCCESS)
130 {
131 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
132 return dwErrorCode;
133 }
134
135 pPrinterEnumAligned = AlignRpcPtr(pPrinterEnum, &cbBuf);
136
137 if (EnumPrintersW(Flags, Name, Level, pPrinterEnumAligned, cbBuf, pcbNeeded, pcReturned))
138 {
139 // Replace absolute pointer addresses in the output by relative offsets.
140 ASSERT(Level <= 9);
141 MarshallDownStructuresArray(pPrinterEnumAligned, *pcReturned, pPrinterInfoMarshalling[Level]->pInfo, pPrinterInfoMarshalling[Level]->cbStructureSize, TRUE);
142 }
143 else
144 {
145 dwErrorCode = GetLastError();
146 }
147
149 UndoAlignRpcPtr(pPrinterEnum, pPrinterEnumAligned, cbBuf, pcbNeeded);
150
151 return dwErrorCode;
152}
#define TRUE
Definition: types.h:120
BOOL WINAPI MarshallDownStructuresArray(PVOID pStructuresArray, DWORD cElements, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
Definition: marshalling.c:91
#define ASSERT(a)
Definition: mode.c:44
BYTE * PBYTE
Definition: pedump.c:66
static const MARSHALLING * pPrinterInfoMarshalling[]
Definition: printers.h:146
PVOID WINAPI AlignRpcPtr(PVOID pBuffer, PDWORD pcbBuffer)
Definition: memory.c:29
PDWORD WINAPI UndoAlignRpcPtr(PVOID pDestinationBuffer, PVOID pSourceBuffer, DWORD cbBuffer, PDWORD pcbNeeded)
Definition: memory.c:239
_In_ DWORD _Out_ PDWORD pcbNeeded
Definition: winddi.h:3828
WINBOOL WINAPI EnumPrintersW(DWORD Flags, LPWSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by EnumPrintersW(), and pointer_default().

◆ _RpcFlushPrinter()

DWORD _RpcFlushPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
BYTE pBuf,
DWORD  cbBuf,
DWORD pcWritten,
DWORD  cSleep 
)

Definition at line 155 of file printers.c.

156{
159}

Referenced by pointer_default().

◆ _RpcGetPrinter()

DWORD _RpcGetPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
DWORD  Level,
BYTE pPrinter,
DWORD  cbBuf,
DWORD pcbNeeded 
)

Definition at line 162 of file printers.c.

163{
164 DWORD dwErrorCode;
165 PBYTE pPrinterAligned;
166
167 dwErrorCode = RpcImpersonateClient(NULL);
168 if (dwErrorCode != ERROR_SUCCESS)
169 {
170 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
171 return dwErrorCode;
172 }
173
174 pPrinterAligned = AlignRpcPtr(pPrinter, &cbBuf);
175
176 if (GetPrinterW(hPrinter, Level, pPrinterAligned, cbBuf, pcbNeeded))
177 {
178 // Replace absolute pointer addresses in the output by relative offsets.
179 ASSERT(Level <= 9);
180 MarshallDownStructure(pPrinterAligned, pPrinterInfoMarshalling[Level]->pInfo, pPrinterInfoMarshalling[Level]->cbStructureSize, TRUE);
181 }
182 else
183 {
184 dwErrorCode = GetLastError();
185 }
186
188 UndoAlignRpcPtr(pPrinter, pPrinterAligned, cbBuf, pcbNeeded);
189
190 return dwErrorCode;
191}
BOOL WINAPI MarshallDownStructure(PVOID pStructure, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
Definition: marshalling.c:38
WINBOOL WINAPI GetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, DWORD cbBuf, LPDWORD pcbNeeded)
Definition: printers.c:2533

Referenced by GetPrinterW(), and pointer_default().

◆ _RpcOpenPrinter()

DWORD _RpcOpenPrinter ( WINSPOOL_HANDLE  pPrinterName,
WINSPOOL_PRINTER_HANDLE phPrinter,
WCHAR pDatatype,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer,
DWORD  AccessRequired 
)

Definition at line 194 of file printers.c.

195{
196 DWORD dwErrorCode;
198
199 dwErrorCode = RpcImpersonateClient(NULL);
200 if (dwErrorCode != ERROR_SUCCESS)
201 {
202 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
203 return dwErrorCode;
204 }
205
206 Default.DesiredAccess = AccessRequired;
207 Default.pDatatype = pDatatype;
208 Default.pDevMode = (PDEVMODEW)pDevModeContainer->pDevMode;
209
210 if (!OpenPrinterW(pPrinterName, phPrinter, &Default))
211 dwErrorCode = GetLastError();
212
214 return dwErrorCode;
215}
if(dx< 0)
Definition: linetemp.h:194
@ Default
Definition: stdole2.idl:392
struct _devicemodeW * PDEVMODEW
WINBOOL WINAPI OpenPrinterW(LPWSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSW pDefault)
Definition: printers.c:2653

Referenced by OpenPrinterW(), and pointer_default().

◆ _RpcOpenPrinterEx()

DWORD _RpcOpenPrinterEx ( WINSPOOL_HANDLE  pPrinterName,
WINSPOOL_PRINTER_HANDLE pHandle,
WCHAR pDatatype,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer,
DWORD  AccessRequired,
WINSPOOL_SPLCLIENT_CONTAINER pClientInfo 
)

Definition at line 218 of file printers.c.

219{
222}

Referenced by pointer_default().

◆ _RpcReadPrinter()

DWORD _RpcReadPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
BYTE pBuf,
DWORD  cbBuf,
DWORD pcNoBytesRead 
)

Definition at line 225 of file printers.c.

226{
227 DWORD dwErrorCode;
228
229 dwErrorCode = RpcImpersonateClient(NULL);
230 if (dwErrorCode != ERROR_SUCCESS)
231 {
232 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
233 return dwErrorCode;
234 }
235
236 if (!ReadPrinter(hPrinter, pBuf, cbBuf, pcNoBytesRead))
237 dwErrorCode = GetLastError();
238
240 return dwErrorCode;
241}
WINBOOL WINAPI ReadPrinter(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf, LPDWORD pNoBytesRead)

Referenced by pointer_default(), and ReadPrinter().

◆ _RpcResetPrinter()

DWORD _RpcResetPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
WCHAR pDatatype,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer 
)

Definition at line 244 of file printers.c.

245{
248}

Referenced by pointer_default().

◆ _RpcResetPrinterEx()

DWORD _RpcResetPrinterEx ( WINSPOOL_PRINTER_HANDLE  hPrinter,
WCHAR pDatatype,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer,
DWORD  dwFlags 
)

Definition at line 251 of file printers.c.

252{
253 DWORD dwErrorCode;
255
256 if (pDatatype)
257 {
258 pdw.pDatatype = pDatatype;
259 }
260 else
261 {
263 }
264
265 if (pDevModeContainer->pDevMode)
266 {
267 pdw.pDevMode = (PDEVMODEW)pDevModeContainer->pDevMode;
268 // Fixme : Need to check DevMode before forward call, by copy devmode.c from WinSpool.
269 // Local SV!SplIsValidDevmode((PDW)pDevModeContainer->pDevMode, pDevModeContainer->cbBuf)
270 }
271 else
272 {
274
275 }
276 pdw.DesiredAccess = 0;
277
278 dwErrorCode = RpcImpersonateClient(NULL);
279 if (dwErrorCode != ERROR_SUCCESS)
280 {
281 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
282 return dwErrorCode;
283 }
284
285 if (!ResetPrinterW(hPrinter, &pdw))
286 dwErrorCode = GetLastError();
287
289 return dwErrorCode;
290}
#define RESETPRINTERDEFAULTDATATYPE
Definition: spoolss.h:11
#define RESETPRINTERDEFAULTDEVMODE
Definition: spoolss.h:12
LPDEVMODEW pDevMode
Definition: winspool.h:862
ACCESS_MASK DesiredAccess
Definition: winspool.h:863
uint16_t * PWSTR
Definition: typedefs.h:56
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
WINBOOL WINAPI ResetPrinterW(HANDLE hPrinter, LPPRINTER_DEFAULTSW pDefault)
Definition: printers.c:2965

Referenced by pointer_default().

◆ _RpcSeekPrinter()

DWORD _RpcSeekPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
LARGE_INTEGER  liDistanceToMove,
PLARGE_INTEGER  pliNewPointer,
DWORD  dwMoveMethod,
BOOL  bWrite 
)

Definition at line 293 of file printers.c.

294{
295 DWORD dwErrorCode;
296
297 dwErrorCode = RpcImpersonateClient(NULL);
298 if (dwErrorCode != ERROR_SUCCESS)
299 {
300 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
301 return dwErrorCode;
302 }
303
304 if (!SeekPrinter(hPrinter, liDistanceToMove, pliNewPointer, dwMoveMethod, bWrite))
305 dwErrorCode = GetLastError();
306
308 return dwErrorCode;
309}
BOOL WINAPI SeekPrinter(HANDLE hPrinter, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER pliNewPointer, DWORD dwMoveMethod, BOOL bWrite)
Definition: printers.c:412

Referenced by pointer_default(), and SeekPrinter().

◆ _RpcSetPrinter()

DWORD _RpcSetPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
WINSPOOL_PRINTER_CONTAINER pPrinterContainer,
WINSPOOL_DEVMODE_CONTAINER pDevModeContainer,
WINSPOOL_SECURITY_CONTAINER pSecurityContainer,
DWORD  Command 
)

Definition at line 312 of file printers.c.

313{
316}

Referenced by pointer_default(), and SetPrinterW().

◆ _RpcStartDocPrinter()

DWORD _RpcStartDocPrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
WINSPOOL_DOC_INFO_CONTAINER pDocInfoContainer,
DWORD pJobId 
)

Definition at line 319 of file printers.c.

320{
321 DWORD dwErrorCode;
322
323 dwErrorCode = RpcImpersonateClient(NULL);
324 if (dwErrorCode != ERROR_SUCCESS)
325 {
326 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
327 return dwErrorCode;
328 }
329
330 *pJobId = StartDocPrinterW(hPrinter, pDocInfoContainer->Level, (PBYTE)pDocInfoContainer->DocInfo.pDocInfo1);
331 dwErrorCode = GetLastError();
332
334 return dwErrorCode;
335}
WINSPOOL_DOC_INFO_1 * pDocInfo1
Definition: winspool.idl:577
union _WINSPOOL_DOC_INFO_CONTAINER::@3452 DocInfo
DWORD WINAPI StartDocPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo)

Referenced by _StartDocPrinterWithRPC(), and pointer_default().

◆ _RpcStartPagePrinter()

DWORD _RpcStartPagePrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter)

Definition at line 338 of file printers.c.

339{
340 DWORD dwErrorCode;
341
342 dwErrorCode = RpcImpersonateClient(NULL);
343 if (dwErrorCode != ERROR_SUCCESS)
344 {
345 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
346 return dwErrorCode;
347 }
348
349 if (!StartPagePrinter(hPrinter))
350 dwErrorCode = GetLastError();
351
353 return dwErrorCode;
354}
WINBOOL WINAPI StartPagePrinter(HANDLE hPrinter)
Definition: printers.c:457

Referenced by pointer_default(), and StartPagePrinter().

◆ _RpcWritePrinter()

DWORD _RpcWritePrinter ( WINSPOOL_PRINTER_HANDLE  hPrinter,
BYTE pBuf,
DWORD  cbBuf,
DWORD pcWritten 
)

Definition at line 357 of file printers.c.

358{
359 DWORD dwErrorCode;
360
361 dwErrorCode = RpcImpersonateClient(NULL);
362 if (dwErrorCode != ERROR_SUCCESS)
363 {
364 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
365 return dwErrorCode;
366 }
367
368 if (!WritePrinter(hPrinter, pBuf, cbBuf, pcWritten))
369 dwErrorCode = GetLastError();
370
372 return dwErrorCode;
373}
WINBOOL WINAPI WritePrinter(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf, LPDWORD pcWritten)

Referenced by pointer_default(), and WritePrinter().