Contents

PMPrinterCopyHostName(_:_:)

Obtains the name of the server hosting the print queue for a given printer.

Declaration

func PMPrinterCopyHostName(_ printer: PMPrinter, _ hostNameP: UnsafeMutablePointer<Unmanaged<CFString>?>) -> OSStatus

Parameters

  • printer:

    The printer whose print queue host name you want to obtain.

  • hostNameP:

    A pointer to your Cfstring variable. On return, the variable refers to a Core Foundation string containing the name of the specified printer’s server. You are responsible for releasing the string.

Return Value

A result code. See Result Codes.

Discussion

This function is typically used to obtain the name of the computer that hosts a shared printer, possibly for display in a user interface. In macOS 10.5 and later, the typical way that users browse and communicate with a shared printer creates a local print queue and PMPrinterCopyHostName for such a print queue will return the name of the local host.

See Also

Accessing Information About a Printer