SplQueryPath: Difference between revisions
Appearance
Created page with "This function returns the path to get printer drivers or port drivers. When a new printer is being installed that requires a printer driver not yet installed, the print obje..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
This function returns the path to get printer drivers or port drivers. | This function returns the path to get printer drivers or port drivers. | ||
When a new printer is being installed that requires a printer driver not yet installed, the print object calls this function to get the path to the print drivers. | When a new printer is being installed that requires a printer driver not yet installed, the print object calls this function to get the path to the print drivers. | ||
== Syntax == | == Syntax == | ||
SplQueryPath(pszComputerName, pszRemoteQueueName, ulLevel, pBuf, cbBuf, pcbNeeded) | |||
== Parameters == | == Parameters == | ||
;pszComputerName (PSZ) - input | ;pszComputerName (PSZ) - input:Name of the computer for which a network print object is being created. | ||
:Name of the computer for which a network print object is being created. | :This value can be NULL. | ||
;pszRemoteQueueName (PSZ) - input:Name of the remote queue the network print object is referencing. | |||
:This value can be NULL. | :This value can be NULL. | ||
;ulLevel (ULONG) - input:Level of information to return. | |||
;pszRemoteQueueName (PSZ) - input | :This must be 0 (zero). | ||
:Name of the remote queue the network print object is referencing. | ;pBuf (PVOID) - output:Receives the path to printer drivers for level 0. | ||
;cbBuf (ULONG) - input:Length of buffer pointed to by pBuf, in bytes. | |||
:This value can be NULL. | ;pcbNeeded (PULONG) - output:Receives length, in bytes, of buffer needed to return path. | ||
;ulLevel (ULONG) - input | |||
:Level of information to return. | |||
:This must be 0 (zero). | |||
;pBuf (PVOID) - output | |||
:Receives the path to printer drivers for level 0. | |||
;cbBuf (ULONG) - input | |||
:Length of buffer pointed to by pBuf, in bytes. | |||
;pcbNeeded (PULONG) - output | |||
:Receives length, in bytes, of buffer needed to return path. | |||
== Returns == | == Returns == | ||
; rc (ULONG) - returns : Return codes. | ;rc (ULONG) - returns : Return codes. | ||
* 0 Success | *0 Success | ||
*ERROR_NOT_SUPPORTED(50) | *ERROR_NOT_SUPPORTED(50): A path to printer drivers cannot be found. | ||
:A path to printer drivers cannot be found. | *NERR_BufTooSmall(2123): Must call again with a bigger buffer. | ||
*NERR_BufTooSmall(2123) | |||
:Must call again with a bigger buffer. | |||
== Sample == | == Sample == | ||
Line 56: | Line 39: | ||
rc = SplQueryPath(pszComputerName, pszRemoteQueueName, | rc = SplQueryPath(pszComputerName, pszRemoteQueueName, | ||
ulLevel, pBuf, cbBuf, pcbNeeded); | ulLevel, pBuf, cbBuf, pcbNeeded); | ||
</pre> | </pre> | ||
== Remarks == | == Remarks == | ||
The spooler will look in the following places for the path to printer drivers: | The spooler will look in the following places for the path to printer drivers: | ||
# The spooler will first look in the system .INI file for applicationName PM_SPOOLER_DRVSHARE. If found, the spooler will return the keyValue for keyName pszComputerName if it exists, or for the first keyName that exists under the applicationName. | # The spooler will first look in the system .INI file for applicationName PM_SPOOLER_DRVSHARE. If found, the spooler will return the keyValue for keyName pszComputerName if it exists, or for the first keyName that exists under the applicationName. | ||
# The spooler will check the pszComputerName field for a share called PRINTDRV. | # The spooler will check the pszComputerName field for a share called PRINTDRV. | ||
# The spooler will check the user's logon domain LS:\\*ALIAS for a share called PRINTDRV. | # The spooler will check the user's logon domain LS:\\*ALIAS for a share called PRINTDRV. | ||
If a path is found, the spooler will return the path to the caller. The path can be one of the following: | |||
* | *An extended UNC path (LS:\\SERVER1\PRINTDRV) | ||
* | *A UNC path with additional subdirectories defined: (LS:\\SERVER1\PRINTDRV\DIR1\NEXT) | ||
* | *A fully qualified pathname (Z:\OS2\SHARED) | ||
The print object will use the path as follows: | |||
*Look in the root of the path for packed files (.DR_) | |||
*Look in the root of the path for unpacked files (.DRV) | |||
*Look in the subdirectory PMDD_n from path, where n is the OS2 printer driver diskette number. | |||
[[Category:Spl]] | [[Category:Spl]] |
Latest revision as of 12:33, 2 July 2023
This function returns the path to get printer drivers or port drivers.
When a new printer is being installed that requires a printer driver not yet installed, the print object calls this function to get the path to the print drivers.
Syntax
SplQueryPath(pszComputerName, pszRemoteQueueName, ulLevel, pBuf, cbBuf, pcbNeeded)
Parameters
- pszComputerName (PSZ) - input
- Name of the computer for which a network print object is being created.
- This value can be NULL.
- pszRemoteQueueName (PSZ) - input
- Name of the remote queue the network print object is referencing.
- This value can be NULL.
- ulLevel (ULONG) - input
- Level of information to return.
- This must be 0 (zero).
- pBuf (PVOID) - output
- Receives the path to printer drivers for level 0.
- cbBuf (ULONG) - input
- Length of buffer pointed to by pBuf, in bytes.
- pcbNeeded (PULONG) - output
- Receives length, in bytes, of buffer needed to return path.
Returns
- rc (ULONG) - returns
- Return codes.
- 0 Success
- ERROR_NOT_SUPPORTED(50): A path to printer drivers cannot be found.
- NERR_BufTooSmall(2123): Must call again with a bigger buffer.
Sample
#define INCL_SPL #define INCL_SPLBIDI #include <os2.h> PSZ pszComputerName; /* Name of the computer for which a network print object is being created. */ PSZ pszRemoteQueueName; /* Name of the remote queue the network print object is referencing. */ ULONG ulLevel; /* Level of information to return. */ PVOID pBuf; /* Receives the path to printer drivers for level 0. */ ULONG cbBuf; /* Length of buffer pointed to by pBuf, in bytes. */ PULONG pcbNeeded; /* Receives length, in bytes, of buffer needed to return path. */ ULONG rc; /* Return codes. */ rc = SplQueryPath(pszComputerName, pszRemoteQueueName, ulLevel, pBuf, cbBuf, pcbNeeded);
Remarks
The spooler will look in the following places for the path to printer drivers:
- The spooler will first look in the system .INI file for applicationName PM_SPOOLER_DRVSHARE. If found, the spooler will return the keyValue for keyName pszComputerName if it exists, or for the first keyName that exists under the applicationName.
- The spooler will check the pszComputerName field for a share called PRINTDRV.
- The spooler will check the user's logon domain LS:\\*ALIAS for a share called PRINTDRV.
If a path is found, the spooler will return the path to the caller. The path can be one of the following:
- An extended UNC path (LS:\\SERVER1\PRINTDRV)
- A UNC path with additional subdirectories defined: (LS:\\SERVER1\PRINTDRV\DIR1\NEXT)
- A fully qualified pathname (Z:\OS2\SHARED)
The print object will use the path as follows:
- Look in the root of the path for packed files (.DR_)
- Look in the root of the path for unpacked files (.DRV)
- Look in the subdirectory PMDD_n from path, where n is the OS2 printer driver diskette number.