Fix entry point for EnumPrinters (#67081)
authorElinor Fung <elfung@microsoft.com>
Thu, 24 Mar 2022 12:14:34 +0000 (05:14 -0700)
committerGitHub <noreply@github.com>
Thu, 24 Mar 2022 12:14:34 +0000 (06:14 -0600)
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs

index 5d059b6..6623b0f 100644 (file)
@@ -40,7 +40,7 @@ internal static partial class Interop
 #endif
             HandleRef hPrinter, string pDeviceName, IntPtr /*DEVMODE*/ pDevModeOutput, IntPtr /*DEVMODE*/ pDevModeInput, int fMode);
 
-        [LibraryImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Winspool, EntryPoint = "EnumPrintersW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int EnumPrinters(int flags, string? name, int level, IntPtr pPrinterEnum/*buffer*/, int cbBuf, out int pcbNeeded, out int pcReturned);
     }
 }