|
BOOL WINAPI | InitializePrintProvidor (_Out_writes_bytes_(cbPrintProvidor) LPPRINTPROVIDOR pPrintProvidor, _In_ DWORD cbPrintProvidor, _In_opt_ LPWSTR pFullRegistryPath) |
|
HANDLE WINAPI | OpenPrintProcessor (_In_ LPWSTR pPrinterName, _In_ PPRINTPROCESSOROPENDATA pPrintProcessorOpenData) |
|
BOOL WINAPI | PrintDocumentOnPrintProcessor (_In_ HANDLE hPrintProcessor, _In_ LPWSTR pDocumentName) |
|
BOOL WINAPI | ClosePrintProcessor (_Inout_ HANDLE hPrintProcessor) |
|
BOOL WINAPI | ControlPrintProcessor (_In_ HANDLE hPrintProcessor, _In_ DWORD Command) |
|
DWORD WINAPI | GetPrintProcessorCapabilities (_In_ LPTSTR pValueName, _In_ DWORD dwAttributes, _Out_writes_bytes_(nSize) LPBYTE pData, _In_ DWORD nSize, _Out_ LPDWORD pcbNeeded) |
|
BOOL WINAPI | InitializeMonitor (_In_ LPWSTR pRegistryRoot) |
|
BOOL WINAPI | OpenPort (_In_ LPWSTR pName, _Out_ PHANDLE pHandle) |
|
BOOL WINAPI | WritePort (_In_ HANDLE hPort, _In_reads_bytes_(cbBuf) LPBYTE pBuffer, _In_ DWORD cbBuf, _Out_ LPDWORD pcbWritten) |
|
BOOL WINAPI | ReadPort (_In_ HANDLE hPort, _Out_writes_bytes_(cbBuffer) LPBYTE pBuffer, _In_ DWORD cbBuffer, _Out_ LPDWORD pcbRead) |
|
BOOL WINAPI | ClosePort (_In_ HANDLE hPort) |
|
BOOL WINAPI | XcvOpenPort (_In_ LPCWSTR pszObject, _In_ ACCESS_MASK GrantedAccess, _Out_ PHANDLE phXcv) |
|
DWORD WINAPI | XcvDataPort (_In_ HANDLE hXcv, _In_ LPCWSTR pszDataName, _In_reads_bytes_(cbInputData) PBYTE pInputData, _In_ DWORD cbInputData, _Out_writes_bytes_(cbOutputData) PBYTE pOutputData, _In_ DWORD cbOutputData, _Out_ PDWORD pcbOutputNeeded) |
|
BOOL WINAPI | XcvClosePort (_In_ HANDLE hXcv) |
|
| _Success_ (return !=0) BOOL WINAPI AddPortUI(_In_opt_ PCWSTR pszServer |
|
BOOL WINAPI | ConfigurePortUI (_In_ PCWSTR pszServer, _In_ HWND hWnd, _In_ PCWSTR pszPortName) |
|
BOOL WINAPI | DeletePortUI (_In_ PCWSTR pszServer, _In_ HWND hWnd, _In_ PCWSTR pszPortName) |
|
BOOL WINAPI | SplDeleteSpoolerPortStart (_In_ PCWSTR pPortName) |
|
BOOL WINAPI | SplDeleteSpoolerPortEnd (_In_ PCWSTR pName, _In_ BOOL bDeletePort) |
|
BOOL WINAPI | SpoolerCopyFileEvent (_In_ LPWSTR pszPrinterName, _In_ LPWSTR pszKey, _In_ DWORD dwCopyFileEvent) |
|
DWORD WINAPI | GenerateCopyFilePaths (_In_ LPCWSTR pszPrinterName, _In_ LPCWSTR pszDirectory, _In_ LPBYTE pSplClientInfo, _In_ DWORD dwLevel, _Inout_updates_(*pcchSourceDirSize) LPWSTR pszSourceDir, _Inout_ LPDWORD pcchSourceDirSize, _Inout_updates_(*pcchTargetDirSize) LPWSTR pszTargetDir, _Inout_ LPDWORD pcchTargetDirSize, _In_ DWORD dwFlags) |
|
HANDLE WINAPI | CreatePrinterIC (_In_ HANDLE hPrinter, _In_opt_ LPDEVMODEW pDevMode) |
|
BOOL WINAPI | PlayGdiScriptOnPrinterIC (_In_ HANDLE hPrinterIC, _In_reads_bytes_(cIn) LPBYTE pIn, _In_ DWORD cIn, _Out_writes_bytes_(cOut) LPBYTE pOut, _In_ DWORD cOut, _In_ DWORD ul) |
|
BOOL WINAPI | DeletePrinterIC (_In_ HANDLE hPrinterIC) |
|
BOOL WINAPI | DevQueryPrint (_In_ HANDLE hPrinter, _In_ LPDEVMODEW pDevMode, _Out_ DWORD *pResID) |
|
HANDLE WINAPI | RevertToPrinterSelf (VOID) |
|
BOOL WINAPI | ImpersonatePrinterClient (_In_ HANDLE hToken) |
|
BOOL WINAPI | ReplyPrinterChangeNotification (_In_ HANDLE hNotify, _In_ DWORD fdwFlags, _Out_opt_ PDWORD pdwResult, _In_opt_ PVOID pPrinterNotifyInfo) |
|
BOOL WINAPI | ReplyPrinterChangeNotificationEx (_In_ HANDLE hNotify, _In_ DWORD dwColor, _In_ DWORD fdwFlags, _Out_ PDWORD pdwResult, _In_ PVOID pPrinterNotifyInfo) |
|
BOOL WINAPI | PartialReplyPrinterChangeNotification (_In_ HANDLE hNotify, _In_opt_ PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc) |
|
PPRINTER_NOTIFY_INFO WINAPI | RouterAllocPrinterNotifyInfo (_In_ DWORD cPrinterNotifyInfoData) |
|
BOOL WINAPI | RouterFreePrinterNotifyInfo (_In_opt_ PPRINTER_NOTIFY_INFO pInfo) |
|
BOOL WINAPI | AppendPrinterNotifyInfoData (_In_ PPRINTER_NOTIFY_INFO pInfoDest, _In_opt_ PPRINTER_NOTIFY_INFO_DATA pInfoDataSrc, _In_ DWORD fdwFlags) |
|
DWORD WINAPI | CallRouterFindFirstPrinterChangeNotification (_In_ HANDLE hPrinter, _In_ DWORD fdwFlags, _In_ DWORD fdwOptions, _In_ HANDLE hNotify, _In_ PPRINTER_NOTIFY_OPTIONS pPrinterNotifyOptions) |
|
BOOL WINAPI | ProvidorFindFirstPrinterChangeNotification (_In_ HANDLE hPrinter, _In_ DWORD fdwFlags, _In_ DWORD fdwOptions, _In_ HANDLE hNotify, _In_opt_ PVOID pvReserved0, _Out_opt_ PVOID pvReserved1) |
|
BOOL WINAPI | ProvidorFindClosePrinterChangeNotification (_In_ HANDLE hPrinter) |
|
BOOL WINAPI | SpoolerFindFirstPrinterChangeNotification (HANDLE hPrinter, DWORD fdwFlags, DWORD fdwOptions, PHANDLE phEvent, PVOID pPrinterNotifyOptions, PVOID pvReserved) |
|
BOOL WINAPI | SpoolerFindNextPrinterChangeNotification (_In_ HANDLE hPrinter, _Out_ LPDWORD pfdwChange, _In_opt_ LPVOID pPrinterNotifyOptions, _Inout_opt_ LPVOID *ppPrinterNotifyInfo) |
|
VOID WINAPI | SpoolerFreePrinterNotifyInfo (_In_ PPRINTER_NOTIFY_INFO pInfo) |
|
BOOL WINAPI | SpoolerFindClosePrinterChangeNotification (_In_ HANDLE hPrinter) |
|
LPMONITOR2 WINAPI | InitializePrintMonitor2 (_In_ PMONITORINIT pMonitorInit, _Out_ PHANDLE phMonitor) |
|
PMONITORUI WINAPI | InitializePrintMonitorUI (VOID) |
|
LPMONITOREX WINAPI | InitializePrintMonitor (_In_ LPWSTR pRegistryRoot) |
|
BOOL WINAPI | InitializeMonitorEx (_In_ LPWSTR pRegistryRoot, _Out_ LPMONITOR pMonitor) |
|
PBIDI_RESPONSE_CONTAINER WINAPI | RouterAllocBidiResponseContainer (_In_ DWORD Count) |
|
PVOID WINAPI | RouterAllocBidiMem (_In_ size_t NumBytes) |
|
DWORD WINAPI | RouterFreeBidiResponseContainer (_In_ PBIDI_RESPONSE_CONTAINER pData) |
|
VOID WINAPI | RouterFreeBidiMem (_In_ PVOID pMemPointer) |
|
BOOL WINAPI | SplPromptUIInUsersSession (_In_ HANDLE hPrinter, _In_ DWORD JobId, _In_ PSHOWUIPARAMS pUIParams, _Out_ DWORD *pResponse) |
|
DWORD WINAPI | SplIsSessionZero (_In_ HANDLE hPrinter, _In_ DWORD JobId, _Out_ BOOL *pIsSessionZero) |
|
BOOL WINAPI | GetJobAttributes (_In_ LPWSTR pPrinterName, _In_ LPDEVMODEW pDevmode, _Out_ PATTRIBUTE_INFO_3 pAttributeInfo) |
|
BOOL WINAPI | GetJobAttributesEx (_In_ LPWSTR pPrinterName, _In_ LPDEVMODEW pDevmode, _In_ DWORD dwLevel, _Out_writes_bytes_(nSize) LPBYTE pAttributeInfo, _In_ DWORD nSize, _In_ DWORD dwFlags) |
|
BOOL WINAPI | SpoolerRefreshPrinterChangeNotification (_In_ HANDLE hPrinter, _In_ DWORD dwColor, _In_ PPRINTER_NOTIFY_OPTIONS pOptions, _Inout_opt_ PPRINTER_NOTIFY_INFO *ppInfo) |
|
BOOL WINAPI | OpenPrinterToken (PHANDLE phToken) |
|
BOOL WINAPI | SetPrinterToken (HANDLE hToken) |
|
BOOL WINAPI | ClosePrinterToken (HANDLE hToken) |
|
BOOL WINAPI | InstallPrintProcessor (HWND hWnd) |
|
RevertToPrinterSelf reverts the security context from the current user's context back to the process context. As spoolss.dll is used by spoolsv.exe, this is usually the SYSTEM security context.
Unlike the traditional ImpersonateClient and then RevertToSelf approach, we do it the other way round here, because spoolss.dll is delay-loaded by spoolsv.exe in the current user's context. Use RevertToPrinterSelf then to return to the SYSTEM context for specific tasks.
Definition at line 64 of file context.c.
65{
69
70
71
72
73
75 {
76
78 {
80 ERR(
"SetThreadToken failed with error %lu!\n", dwErrorCode);
82 }
83 }
85 {
87 ERR(
"OpenProcessToken failed with error %lu!\n", dwErrorCode);
89 }
90
91
93 hReturnValue = hToken;
94
95
97
99 if (hToken)
101
103 return hReturnValue;
104}
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI SetThreadToken(IN PHANDLE ThreadHandle OPTIONAL, IN HANDLE TokenHandle)
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
#define GetCurrentProcess()
static const WCHAR Cleanup[]
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
#define TOKEN_IMPERSONATE
Referenced by _CreateNonspooledPort(), _HandleAddPort(), _HandleConfigureLPTPortCommandOK(), _HandleDeletePort(), and _HandleSetDefaultCommConfig().