ReactOS 0.4.16-dev-297-gc569aee
printprocessors.c File Reference
Include dependency graph for printprocessors.c:

Go to the source code of this file.

Functions

DWORD _RpcAddPrintProcessor (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, WCHAR *pPathName, WCHAR *pPrintProcessorName)
 
DWORD _RpcDeletePrintProcessor (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, WCHAR *pPrintProcessorName)
 
DWORD _RpcEnumPrintProcessorDatatypes (WINSPOOL_HANDLE pName, WCHAR *pPrintProcessorName, DWORD Level, BYTE *pDatatypes, DWORD cbBuf, DWORD *pcbNeeded, DWORD *pcReturned)
 
DWORD _RpcEnumPrintProcessors (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, DWORD Level, BYTE *pPrintProcessorInfo, DWORD cbBuf, DWORD *pcbNeeded, DWORD *pcReturned)
 
DWORD _RpcGetPrintProcessorDirectory (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, DWORD Level, BYTE *pPrintProcessorDirectory, DWORD cbBuf, DWORD *pcbNeeded)
 

Function Documentation

◆ _RpcAddPrintProcessor()

DWORD _RpcAddPrintProcessor ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
WCHAR pPathName,
WCHAR pPrintProcessorName 
)

Definition at line 12 of file printprocessors.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 (!AddPrintProcessorW(pName, pEnvironment, pPathName, pPrintProcessorName))
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
static LPSTR pName
Definition: security.c:75
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 AddPrintProcessorW(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pPathName, LPWSTR pPrintProcessorName)

Referenced by AddPrintProcessorW(), and pointer_default().

◆ _RpcDeletePrintProcessor()

DWORD _RpcDeletePrintProcessor ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
WCHAR pPrintProcessorName 
)

Definition at line 31 of file printprocessors.c.

32{
33 DWORD dwErrorCode;
34
35 dwErrorCode = RpcImpersonateClient(NULL);
36 if (dwErrorCode != ERROR_SUCCESS)
37 {
38 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
39 return dwErrorCode;
40 }
41
42 if (!DeletePrintProcessorW(pName, pEnvironment, pPrintProcessorName))
43 dwErrorCode = GetLastError();
44
46 return dwErrorCode;
47}
WINBOOL WINAPI DeletePrintProcessorW(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pPrintProcessorName)

Referenced by DeletePrintProcessorW(), and pointer_default().

◆ _RpcEnumPrintProcessorDatatypes()

DWORD _RpcEnumPrintProcessorDatatypes ( WINSPOOL_HANDLE  pName,
WCHAR pPrintProcessorName,
DWORD  Level,
BYTE pDatatypes,
DWORD  cbBuf,
DWORD pcbNeeded,
DWORD pcReturned 
)

Definition at line 50 of file printprocessors.c.

51{
52 DWORD dwErrorCode;
53 PBYTE pDatatypesAligned;
54
55 dwErrorCode = RpcImpersonateClient(NULL);
56 if (dwErrorCode != ERROR_SUCCESS)
57 {
58 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
59 return dwErrorCode;
60 }
61
62 pDatatypesAligned = AlignRpcPtr(pDatatypes, &cbBuf);
63
64 if (EnumPrintProcessorDatatypesW(pName, pPrintProcessorName, Level, pDatatypesAligned, cbBuf, pcbNeeded, pcReturned))
65 {
66 // Replace absolute pointer addresses in the output by relative offsets.
68 }
69 else
70 {
71 dwErrorCode = GetLastError();
72 }
73
75 UndoAlignRpcPtr(pDatatypes, pDatatypesAligned, cbBuf, pcbNeeded);
76
77 return dwErrorCode;
78}
#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
BYTE * PBYTE
Definition: pedump.c:66
static const MARSHALLING DatatypesInfo1Marshalling
MARSHALLING_INFO pInfo[]
Definition: marshalling.h:26
DWORD cbStructureSize
Definition: marshalling.h:25
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 EnumPrintProcessorDatatypesW(LPWSTR pName, LPWSTR pPrintProcessorName, DWORD Level, LPBYTE pDatatypes, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56

Referenced by EnumPrintProcessorDatatypesW(), and pointer_default().

◆ _RpcEnumPrintProcessors()

DWORD _RpcEnumPrintProcessors ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
DWORD  Level,
BYTE pPrintProcessorInfo,
DWORD  cbBuf,
DWORD pcbNeeded,
DWORD pcReturned 
)

Definition at line 81 of file printprocessors.c.

82{
83 DWORD dwErrorCode;
84 PBYTE pPrintProcessorInfoAligned;
85
86 dwErrorCode = RpcImpersonateClient(NULL);
87 if (dwErrorCode != ERROR_SUCCESS)
88 {
89 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
90 return dwErrorCode;
91 }
92
93 pPrintProcessorInfoAligned = AlignRpcPtr(pPrintProcessorInfo, &cbBuf);
94
95 if (EnumPrintProcessorsW(pName, pEnvironment, Level, pPrintProcessorInfoAligned, cbBuf, pcbNeeded, pcReturned))
96 {
97 // Replace absolute pointer addresses in the output by relative offsets.
99 }
100 else
101 {
102 dwErrorCode = GetLastError();
103 }
104
106 UndoAlignRpcPtr(pPrintProcessorInfo, pPrintProcessorInfoAligned, cbBuf, pcbNeeded);
107
108 return dwErrorCode;
109}
static const MARSHALLING PrintProcessorInfo1Marshalling
WINBOOL WINAPI EnumPrintProcessorsW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)

Referenced by EnumPrintProcessorsW(), and pointer_default().

◆ _RpcGetPrintProcessorDirectory()

DWORD _RpcGetPrintProcessorDirectory ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
DWORD  Level,
BYTE pPrintProcessorDirectory,
DWORD  cbBuf,
DWORD pcbNeeded 
)

Definition at line 112 of file printprocessors.c.

113{
114 DWORD dwErrorCode;
115
116 dwErrorCode = RpcImpersonateClient(NULL);
117 if (dwErrorCode != ERROR_SUCCESS)
118 {
119 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
120 return dwErrorCode;
121 }
122
123 if (!GetPrintProcessorDirectoryW(pName, pEnvironment, Level, pPrintProcessorDirectory, cbBuf, pcbNeeded))
124 dwErrorCode = GetLastError();
125
127 return dwErrorCode;
128}
WINBOOL WINAPI GetPrintProcessorDirectoryW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded)

Referenced by GetPrintProcessorDirectoryW(), and pointer_default().