diff --git a/src/PrintCore/PrintCore.cs b/src/PrintCore/PrintCore.cs index 6707dbc65032..3295e97dc5f0 100644 --- a/src/PrintCore/PrintCore.cs +++ b/src/PrintCore/PrintCore.cs @@ -753,6 +753,26 @@ public bool IsRemote { } } + [DllImport (Constants.PrintCoreLibrary)] + extern static IntPtr PMPrinterGetID (IntPtr printer); + + public string Id { + get { + return CFString.FetchString (PMPrinterGetID (handle)); + } + } + + [DllImport (Constants.PrintCoreLibrary)] + extern static PMStatusCode PMPrinterCopyHostName (IntPtr printer, out IntPtr hostName); + + public string HostName { + get { + PMStatusCode code = PMPrinterCopyHostName (handle, out IntPtr hostName); + if (code != PMStatusCode.Ok) + return null; + return CFString.FetchString (hostName, true); + } + } } public class PMServer : PMPrintCoreBase { diff --git a/tests/xtro-sharpie/macOS-PrintCore.ignore b/tests/xtro-sharpie/macOS-PrintCore.ignore index 8dc51237478f..1b4c5ffcd801 100644 --- a/tests/xtro-sharpie/macOS-PrintCore.ignore +++ b/tests/xtro-sharpie/macOS-PrintCore.ignore @@ -21,13 +21,11 @@ !missing-pinvoke! PMPresetCreatePrintSettings is not bound !missing-pinvoke! PMPresetGetAttributes is not bound !missing-pinvoke! PMPrinterCopyDescriptionURL is not bound -!missing-pinvoke! PMPrinterCopyHostName is not bound !missing-pinvoke! PMPrinterCopyPresets is not bound !missing-pinvoke! PMPrinterCopyState is not bound !missing-pinvoke! PMPrinterGetCommInfo is not bound !missing-pinvoke! PMPrinterGetDriverCreator is not bound !missing-pinvoke! PMPrinterGetDriverReleaseInfo is not bound -!missing-pinvoke! PMPrinterGetID is not bound !missing-pinvoke! PMPrinterGetIndexedPrinterResolution is not bound !missing-pinvoke! PMPrinterGetLanguageInfo is not bound !missing-pinvoke! PMPrinterGetLocation is not bound