Jump to content

SplGetPortFromQ: Difference between revisions

From EDM2
Created page with "This function gets a list of ports connected to the print queue for the print object or applications. This function is used by the print object to determine if some menu items..."
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function gets a list of ports connected to the print queue for the print object or applications. This function is used by the print object to determine if some menu items can be enabled based on the type of printer port connected to a print queue.  
This function gets a list of ports connected to the print queue for the print object or applications. This function is used by the print object to determine if some menu items can be enabled based on the type of printer port connected to a print queue.
 
== Syntax ==  
== Syntax ==  
  SplGetPortFromQ(pszComputerName, pszQueueName,
  SplGetPortFromQ(pszComputerName, pszQueueName, ulLevel, pBuf, cbBuf, pcbNeeded)
      ulLevel, pBuf, cbBuf, pcbNeeded);


== Parameters ==
== Parameters ==
;pszComputerName (PSZ) - input  
;pszComputerName ([[PSZ]]) - input:Name of the computer on which pszQueueName exists.
:Name of the computer on which pszQueueName exists.  
:This value is NULL if the queue is local or if the queue references a network print queue.
 
;pszQueueName (PSZ) - input:Name of print queue.
:This value is NULL if the queue is local or if the queue references a network print queue.  
:This is the print queue name on pszComputerName or a local print queue name that may reference a network print queue.
 
;ulLevel ([[ULONG]]) - input:Level of information to return.
;pszQueueName (PSZ) - input  
:Only level 1 is supported, which returns the GETPORTFROMQ data structure. See GETPORTFROMQ in Data Types for details on this data structure.
:Name of print queue.  
;pBuf ([[PVOID]]) - output:Receives the GETPORTFROMQ data structure.
 
;cbBuf (ULONG) - input:Length of buffer pointed to by pBuf, in bytes.
:This is the print queue name on pszComputerName or a local print queue name that may reference a network print queue.  
;pcbNeeded (ULONG) - output:Receives length, in bytes, of buffer needed to return all port data.
 
;ulLevel (ULONG) - input  
:Level of information to return.  
 
:Only level 1 is supported, which returns the GETPORTFROMQ data structure. See GETPORTFROMQ in Data Types for details on this data structure.  
 
;pBuf (PVOID) - output  
:Receives the GETPORTFROMQ data structure.  
 
;cbBuf (ULONG) - input  
:Length of buffer pointed to by pBuf, in bytes.  
 
;pcbNeeded (ULONG) - output  
:Receives length, in bytes, of buffer needed to return all port data.
 
== Returns ==
; rc (ULONG) - returns : Return codes.
 
*0 Success
*ERROR_BAD_NET_NAME(67)
:The computer name cannot be found.
*ERROR_BAD_NETPATH(53)
:The computer name specified is not available or is invalid.
*ERROR_INVALID_LEVEL(124)
:ulLevel is not 1.
*ERROR_INVALID_PARAMETER(87)
:An invalid parameter was specified; most likely an invalid pBuf value.
*ERROR_MORE_DATA(234)
:Not all data could fit in pBuf.
*ERROR_NOT_SUPPORTED(50)
:Command not supported on pszComputerName.
*NERR_BufTooSmall(2123)
:No data could fit in pBuf.
*NERR_QNotFound(2150)
:The queue name does not exist.
 
== Sample ==
<pre>
#define INCL_SPL
#define INCL_SPLBIDI
#include <os2.h>
 
PSZ      pszComputerName;  /*  Name of the computer on which pszQueueName exists. */
PSZ      pszQueueName;    /*  Name of print queue. */
ULONG    ulLevel;          /*  Level of information to return. */
PVOID    pBuf;            /*  Receives the GETPORTFROMQ data structure. */
ULONG    cbBuf;            /*  Length of buffer pointed to by pBuf, in bytes. */
ULONG    pcbNeeded;        /*  Receives length, in bytes, of buffer needed to return all port data. */
ULONG    rc;              /*  Return codes. */
 
rc = SplGetPortFromQ(pszComputerName, pszQueueName,
      ulLevel, pBuf, cbBuf, pcbNeeded);
</pre>


==Returns==
;rc (ULONG) - returns : Return codes.
::0 Success
::ERROR_NOT_SUPPORTED(50) Command not supported on pszComputerName.
::ERROR_BAD_NETPATH(53) The computer name specified is not available or is invalid.
::ERROR_BAD_NET_NAME(67) The computer name cannot be found.
::ERROR_INVALID_PARAMETER(87) An invalid parameter was specified; most likely an invalid pBuf value.
::ERROR_INVALID_LEVEL(124) ulLevel is not 1.
::ERROR_MORE_DATA(234) Not all data could fit in pBuf.
::NERR_BufTooSmall(2123) No data could fit in pBuf.
::NERR_QNotFound(2150) The queue name does not exist.


[[Category:Spl]]
[[Category:Spl]]

Latest revision as of 21:35, 10 December 2023

This function gets a list of ports connected to the print queue for the print object or applications. This function is used by the print object to determine if some menu items can be enabled based on the type of printer port connected to a print queue.

Syntax

SplGetPortFromQ(pszComputerName, pszQueueName, ulLevel, pBuf, cbBuf, pcbNeeded)

Parameters

pszComputerName (PSZ) - input
Name of the computer on which pszQueueName exists.
This value is NULL if the queue is local or if the queue references a network print queue.
pszQueueName (PSZ) - input
Name of print queue.
This is the print queue name on pszComputerName or a local print queue name that may reference a network print queue.
ulLevel (ULONG) - input
Level of information to return.
Only level 1 is supported, which returns the GETPORTFROMQ data structure. See GETPORTFROMQ in Data Types for details on this data structure.
pBuf (PVOID) - output
Receives the GETPORTFROMQ data structure.
cbBuf (ULONG) - input
Length of buffer pointed to by pBuf, in bytes.
pcbNeeded (ULONG) - output
Receives length, in bytes, of buffer needed to return all port data.

Returns

rc (ULONG) - returns
Return codes.
0 Success
ERROR_NOT_SUPPORTED(50) Command not supported on pszComputerName.
ERROR_BAD_NETPATH(53) The computer name specified is not available or is invalid.
ERROR_BAD_NET_NAME(67) The computer name cannot be found.
ERROR_INVALID_PARAMETER(87) An invalid parameter was specified; most likely an invalid pBuf value.
ERROR_INVALID_LEVEL(124) ulLevel is not 1.
ERROR_MORE_DATA(234) Not all data could fit in pBuf.
NERR_BufTooSmall(2123) No data could fit in pBuf.
NERR_QNotFound(2150) The queue name does not exist.