Parameter Type and Description

char cShortSessionID
Presentation space short session ID.
PRINTINFO * const pPrintInfo
Pointer to PRINTINFO structure, where the printer settings are specified.
nFlags
Must be set to 0. This is ignored.
nBufSize
Size of the buffer allocated for the following fields:
  • lpPDTFile
  • lpPrtToDskAppFile
  • lpPrtToDskSepFile
  • lpPrinterName
If more than one of these members is retrieved in a single API call, then the caller must allocate the same size for all the buffers and pass that size in this member.

If this member is set to 0, the fields are ignored. The maximum size required for the buffers of the fields is returned in nSizeNeeded.

nSizeNeeded
The value of this member is determined by conditions related to the following fields:
  • lpPDTFile
  • lpPrtToDskAppFile
  • lpPrtToDskSepFile
  • lpPrinterName
The conditions are as follows:
  • The value is the number of bytes needed, if the size of the buffer allocated by the caller is not big enough to return the fields listed above.
  • The value is the maximum size of the required buffer, if more than one of the fields listed above are obtained by the caller.
  • If nBufSize is set to 0 by the caller, this member contains the maximum size required for the buffers of the fields listed above.
bPromptDialog
Possible values are as follows:
  • If TRUE, the Printer Setup dialog is shown before printing.
  • If FALSE, the Printer Setup dialog is not shown before printing.
bPDTMode
Possible values are as follows:
  • If TRUE, the host session is in PDT mode.
  • If FALSE, the host session is in non-PDT mode (GDI mode).
lpPDTFile
Must be set to NULL if the caller is not interested in getting this member. The PDT file is returned if this is not a null pointer. This must point to the buffer of size nBufSize allocated by the caller.
When the API returns, this member contains one of the following:
  • The fully qualified path name of the session PDT file.
  • An empty string ("") if no PDT file is configured in the session.
  • A truncated file name if the buffer size is not sufficient. The member nSizeNeeded contains the size of the buffer needed.
nPrtMode
This is an enumerated value that indicates the PrintMode of the connection. The enum data type PRINTMODE is defined in PCSAPI32.H. The nPrtMode setting must be one of the following:
  • PrtToDskAppend (Print to Disk-Append mode)

    This is equivalent to selecting the Append option in the host session Printer Setup → Printer → Print to Disk dialog.

  • PrtToDskSeparate (Print to Disk-Separate mode)

    This is equivalent to selecting the Separate option in the host session Printer Setup → Printer → Print to Disk dialog.

  • WinDefaultPrinter (Windows Default Printer mode)

    This is equivalent to selecting the Use Windows Default Printer option in the host session Printer Setup dialog.

  • SpecificPrinter (Specific Printer mode)

    This is equivalent to selecting a printer in the host session Printer Setup dialog, while leaving Use Windows Default Printer unchecked.

lpPrtToDskAppFile
Must be set to NULL if the caller is not interested in getting this member. The Print to Disk-Append file is returned if this is not a null pointer. This must point to the buffer of size nBufSize allocated by the caller.
When the API returns, this member contains one of the following:
  • The fully qualified path name of the session Print to Disk-Append file.
  • An empty string ("") if no Print to Disk-Append file is configured for the session.
  • A truncated file name if the buffer size is not sufficient. The nSizeNeeded member contains the size of the buffer needed.
lpPrtToDskSepFile
Must be set to NULL if the caller is not interested in getting this member. The Print to Disk-Separate file is returned if this is not a null pointer. This must point to the buffer of size nBufSize allocated by the caller.
When the API returns, this member contains one of the following:
  • The fully qualified path name of the session Print to Disk-Separate file.
  • An empty string ("") if no Print to Disk-Separate file is configured for the session.
  • A truncated file name if the buffer size is not sufficient. The nSizeNeeded member contains the size of the buffer needed.
lpPrinterName
Must be set to NULL if the caller is not interested in getting this member. The name of the printer is returned if this is not a null pointer. This must point to the buffer of size nBufSize allocated by the caller.
When the API returns, this member has one of the following:
  • The name of the specific printer configured in the session, if the host session nPrtMode is SpecificPrinter.
  • The name of the Windows default printer configured in the session, if the host session nPrtMode is WinDefaultPrinter.
  • An empty string (""), if the host session nPrtMode is PrtToDskAppend or PrtToDskSeparate.
  • A truncated printer name, if the buffer size is not sufficient. nSizeNeeded has the size of the buffer needed.
PrinterName must have the following format:
<Printer name> on <Port Name>
For example:
  • IBM InfoPrint 40 PS on Network Port
  • HP LaserJet 4050 Series PCL 6 on LPT1
ULONG * const pErrorInfo
This is filled with the extended error info when the API fails with the return code of PCS_FAILURE. pErrorInfo must be set to NULL by the caller, if the details of errors are not needed.

The following section describes the flags that are defined in PCSAPI32.H.