SplIsSessionZero function determines whether a certain print job (print handle plus job ID) was issued in session zero.
DWORD SplIsSessionZero( _In_ HANDLE hPrinter, _In_ DWORD JobID, _Out_ BOOL *pIsSessionZero );
- hPrinter [in]
Is a handle to the printer.
- JobID [in]
Specifies the print job.
- pIsSessionZero [out]
Pointer to a memory location that is set to TRUE if the SessionID for the session is zero; otherwise, this value is set to FALSE.
On success, the
SplIsSessionZero function returns ERROR_SUCCESS; otherwise this function returns a Win32 error code.
A driver that displays custom user interface elements can use the
SplIsSessionZero function to determine whether the current job was issued in session 0. Such a driver can use this information to enable it to present user interface elements in the user's session, rather than in session zero. A related function, SplPromptUIInUsersSession, displays a standard Windows message box in the user's session.
If you plan to use this function in a driver intended to run under Windows 2000, you must load spoolss.dll by a call to the LoadLibrary function, and then find the address of this function within that DLL by a call to the GetProcAddress function. (LoadLibrary and GetProcAddress are described in the Microsoft Windows SDK documentation.) If the call to GetProcAddress fails, you must use an alternative mechanism to display user interface elements.
|This function is available in Windows XP and later.|