File: Windows.Win32.PInvoke.winspool.drv.g.cs
Project: src\src\System.Drawing.Common\src\System.Drawing.Common.csproj (System.Drawing.Common)
// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{

	/// <content>
	/// Contains extern methods from "winspool.drv".
	/// </content>
	internal static partial class PInvoke
	{
		/// <summary>The DeviceCapabilities function retrieves the capabilities of a printer driver. (Unicode)</summary>
		/// <param name="pDevice">A pointer to a null-terminated string that contains the name of the printer. Note that this is the name of the printer, not of the printer driver.</param>
		/// <param name="pPort">A pointer to a null-terminated string that contains the name of the port to which the device is connected, such as LPT1.</param>
		/// <param name="fwCapability"></param>
		/// <param name="pOutput">A pointer to an array. The format of the array depends on the setting of the <i>fwCapability</i> parameter. See each capability above to find out what is returned if <i>pOutput</i> is <b>NULL</b>.</param>
		/// <param name="pDevMode">A pointer to a <a href="https://docs.microsoft.com/windows/win32/api/wingdi/ns-wingdi-devmodea">DEVMODE</a> structure. If this parameter is <b>NULL</b>, <b>DeviceCapabilities</b> retrieves the current default initialization values for the specified printer driver. Otherwise, the function retrieves the values contained in the structure to which <i>pDevMode</i> points.</param>
		/// <returns>
		/// <para>If the function succeeds, the return value depends on the setting of the <i>fwCapability</i> parameter. A return value of zero generally indicates that, while the function completed successfully, there was some type of failure, such as a capability that is not supported. For more details, see the descriptions for the <i>fwCapability</i> values. If the function returns -1, this may mean either that the capability is not supported or there was a general function failure.</para>
		/// </returns>
		/// <remarks>
		/// <para><div class="alert"><b>Note</b>  This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> The <a href="https://docs.microsoft.com/windows/win32/api/wingdi/ns-wingdi-devmodea">DEVMODE</a> structure pointed to by the <i>pDevMode</i> parameter may be obtained by calling the <a href="https://docs.microsoft.com/windows/desktop/printdocs/documentproperties">DocumentProperties</a> function. If a printer driver supports custom device capabilities, the driver must call the <a href="https://docs.microsoft.com/windows/desktop/printdocs/setprinterdata">SetPrinterData</a> function for each custom capability. The <b>SetPrinterData</b> function adds the appropriate printer data to the print system, which enables 32-bit applications to access the custom capabilities on 64-bit Windows installations. For each custom capability, you must first add printer data that describes the type of the capability. To do this, when you call <b>SetPrinterData</b>, set the <i>pValueName</i> string to <b>CustomDeviceCapabilityType_Xxx</b>, where "Xxx" is the hexadecimal representation of the capability. For example, you might have "CustomDeviceCapabilityType_1234". The registry data that you set must be of the <b>REG_DWORD</b> type, and you must set its value to one of the following: </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-devicecapabilitiesw#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("winspool.drv", ExactSpelling = true, EntryPoint = "DeviceCapabilitiesW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.0")]
		internal static extern unsafe int DeviceCapabilities(winmdroot.Foundation.PCWSTR pDevice, winmdroot.Foundation.PCWSTR pPort, winmdroot.Storage.Xps.PRINTER_DEVICE_CAPABILITIES fwCapability, winmdroot.Foundation.PWSTR pOutput, [Optional] winmdroot.Graphics.Gdi.DEVMODEW* pDevMode);

		/// <summary>The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer.</summary>
		/// <param name="hWnd">A handle to the parent window of the printer-configuration property sheet.</param>
		/// <param name="hPrinter">A handle to a printer object. Use the [**OpenPrinter**](openprinter.md) or [**AddPrinter**](addprinter.md) function to retrieve a printer handle.</param>
		/// <param name="pDeviceName">A pointer to a null-terminated string that specifies the name of the device for which the printer-configuration property sheet is displayed.</param>
		/// <param name="pDevModeOutput">A pointer to a [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure that receives the printer configuration data specified by the user.</param>
		/// <param name="pDevModeInput">
		/// <para>A pointer to a [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure that the operating system uses to initialize the property sheet controls. This parameter is only used if the **DM\_IN\_BUFFER** flag is set in the *fMode* parameter. If **DM\_IN\_BUFFER** is not set, the operating system uses the printer's default [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea).</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/documentproperties#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="fMode">
		/// <para>The operations the function performs. If this parameter is zero, the **DocumentProperties** function returns the number of bytes required by the printer driver's [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) data structure. Otherwise, use one or more of the following constants to construct a value for this parameter; note, however, that in order to change the print settings, an application must specify at least one input value and one output value.</para>
		/// <para>| Value                                                                                                                                                          | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | |----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <span id="DM_IN_BUFFER"></span><span id="dm_in_buffer"></span><dl> <dt>**DM\_IN\_BUFFER**</dt> </dl>    | Input value. Before prompting, copying, or updating, the function merges the printer driver's current print settings with the settings in the [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure specified by the *pDevModeInput* parameter. The function updates the structure only for those members specified by the **DEVMODE** structure's **dmFields** member. This value is also defined as **DM\_MODIFY**. In cases of conflict during the merge, the settings in the **DEVMODE** structure specified by *pDevModeInput* override the printer driver's current print settings.<br/> | | <span id="DM_IN_PROMPT"></span><span id="dm_in_prompt"></span><dl> <dt>**DM\_IN\_PROMPT**</dt> </dl>    | Input value. The function presents the printer driver's Print Setup property sheet and then changes the settings in the printer's [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) data structure to those values specified by the user. This value is also defined as **DM\_PROMPT**.<br/>                                                                                                                                                                                                                                                                                                         | | <span id="DM_OUT_BUFFER"></span><span id="dm_out_buffer"></span><dl> <dt>**DM\_OUT\_BUFFER**</dt> </dl> | Output value. The function writes the printer driver's current print settings, including private data, to the [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) data structure specified by the *pDevModeOutput* parameter. The caller must allocate a buffer sufficiently large to contain the information. If the bit **DM\_OUT\_BUFFER** sets is clear, the *pDevModeOutput* parameter can be **NULL**. This value is also defined as **DM\_COPY**.<br/>                                                                                                                                          |</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/documentproperties#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the *fMode* parameter is zero, the return value is the size of the buffer required to contain the printer driver initialization data. Note that this buffer can be larger than a [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure if the printer driver appends private data to the structure. If the function displays the property sheet, the return value is either **IDOK** or **IDCANCEL**, depending on which button the user selects. If the function does not display the property sheet and is successful, the return value is **IDOK**. If the function fails, the return value is less than zero.</para>
		/// </returns>
		/// <remarks>
		/// <para>> [!Note] > This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</para>
		/// <para>The string pointed to by the *pDeviceName* parameter can be obtained by calling the [**GetPrinter**](getprinter.md) function. The [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure actually used by a printer driver contains the device-independent part (as defined above) followed by a driver-specific part that varies in size and content with each driver and driver version. Because of this driver dependence, it is very important for applications to query the driver for the correct size of the **DEVMODE** structure before allocating a buffer for it. **To make changes to print settings that are local to an application, an application should follow these steps:** 1.  Get the number of bytes required for the full [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure by calling **DocumentProperties** and specifying zero in the *fMode* parameter. 2.  Allocate memory for the full [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure. 3.  Get the current printer settings by calling **DocumentProperties**. Pass a pointer to the [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure allocated in Step 2 as the *pDevModeOutput* parameter and specify the **DM\_OUT\_BUFFER** value. 4.  Modify the appropriate members of the returned [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure and indicate which members were changed by setting the corresponding bits in the **dmFields** member of the **DEVMODE**. 5.  Call **DocumentProperties** and pass the modified [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) structure back as both the *pDevModeInput* and *pDevModeOutput* parameters and specify both the **DM\_IN\_BUFFER** and **DM\_OUT\_BUFFER** values (which are combined using the OR operator).The **DEVMODE** structure returned by the third call to **DocumentProperties** can be used as an argument in a call to the [**CreateDC**](/windows/desktop/api/wingdi/nf-wingdi-createdca) function. To create a handle to a printer-device context using the current printer settings, you only need to call **DocumentProperties** twice, as described above. The first call gets the size of the full [**DEVMODE**](/windows/win32/api/wingdi/ns-wingdi-devmodea) and the second call initializes the **DEVMODE** with the current printer settings. Pass the initialized **DEVMODE** to [**CreateDC**](/windows/desktop/api/wingdi/nf-wingdi-createdca) to obtain the handle to the printer device context.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/documentproperties#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("winspool.drv", ExactSpelling = true, EntryPoint = "DocumentPropertiesW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe int DocumentProperties(winmdroot.Foundation.HWND hWnd, winmdroot.Foundation.HANDLE hPrinter, winmdroot.Foundation.PWSTR pDeviceName, [Optional] winmdroot.Graphics.Gdi.DEVMODEW* pDevModeOutput, [Optional] winmdroot.Graphics.Gdi.DEVMODEW* pDevModeInput, uint fMode);

		/// <summary>The EnumPrinters function enumerates available printers, print servers, domains, or print providers.</summary>
		/// <param name="Flags">
		/// <para>The types of print objects that the function should enumerate. This value can be one or more of the following values.</para>
		/// <para>| Value                                                                                                                                                                                               | Meaning                                                                                                                                                                                                                                                | |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <span id="PRINTER_ENUM_LOCAL"></span><span id="printer_enum_local"></span><dl> <dt>**PRINTER\_ENUM\_LOCAL**</dt> </dl>                       | If the PRINTER\_ENUM\_NAME flag is not also passed, the function ignores the *Name* parameter, and enumerates the locally installed printers. If PRINTER\_ENUM\_NAME is also passed, the function enumerates the local printers on *Name*. <br/> | | <span id="PRINTER_ENUM_NAME"></span><span id="printer_enum_name"></span><dl> <dt>**PRINTER\_ENUM\_NAME**</dt> </dl>                          | The function enumerates the printer identified by *Name*. This can be a server, a domain, or a print provider. If *Name* is **NULL**, the function enumerates available print providers.<br/>                                                    | | <span id="PRINTER_ENUM_SHARED"></span><span id="printer_enum_shared"></span><dl> <dt>**PRINTER\_ENUM\_SHARED**</dt> </dl>                    | The function enumerates printers that have the shared attribute. Cannot be used in isolation; use an OR operation to combine with another PRINTER\_ENUM type.<br/>                                                                               | | <span id="PRINTER_ENUM_CONNECTIONS"></span><span id="printer_enum_connections"></span><dl> <dt>**PRINTER\_ENUM\_CONNECTIONS**</dt> </dl>     | The function enumerates the list of printers to which the user has made previous connections.<br/>                                                                                                                                               | | <span id="PRINTER_ENUM_NETWORK"></span><span id="printer_enum_network"></span><dl> <dt>**PRINTER\_ENUM\_NETWORK**</dt> </dl>                 | The function enumerates network printers in the computer's domain. This value is valid only if *Level* is 1.<br/>                                                                                                                                | | <span id="PRINTER_ENUM_REMOTE"></span><span id="printer_enum_remote"></span><dl> <dt>**PRINTER\_ENUM\_REMOTE**</dt> </dl>                    | The function enumerates network printers and print servers in the computer's domain. This value is valid only if *Level* is 1.<br/>                                                                                                              | | <span id="PRINTER_ENUM_CATEGORY_3D"></span><span id="printer_enum_category_3d"></span><dl> <dt>**PRINTER\_ENUM\_CATEGORY\_3D**</dt> </dl>    | The function enumerates only 3D printers.<br/>                                                                                                                                                                                                   | | <span id="PRINTER_ENUM_CATEGORY_ALL"></span><span id="printer_enum_category_all"></span><dl> <dt>**PRINTER\_ENUM\_CATEGORY\_ALL**</dt> </dl> | The function enumerates all print devices, including 3D printers.<br/>                                                                                                                                                                           |</para>
		/// <para>If *Level* is 4, you can only use the PRINTER\_ENUM\_CONNECTIONS and PRINTER\_ENUM\_LOCAL constants. > [!Note] > 3D print devices are not enumerated by default. You must include both **PRINTER\_ENUM\_CATEGORY\_3D** and **PRINTER\_ENUM\_LOCAL** to enumerate only 3D printers. To include 3D printers, along with all other local printers, use **PRINTER\_ENUM\_CATEGORY\_ALL** and **PRINTER\_ENUM\_LOCAL**.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/enumprinters#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="Name">
		/// <para>If *Level* is 1, *Flags* contains PRINTER\_ENUM\_NAME, and *Name* is non-**NULL**, then *Name* is a pointer to a null-terminated string that specifies the name of the object to enumerate. This string can be the name of a server, a domain, or a print provider. If *Level* is 1, *Flags* contains PRINTER\_ENUM\_NAME, and *Name* is **NULL**, then the function enumerates the available print providers. If *Level* is 1, *Flags* contains PRINTER\_ENUM\_REMOTE, and *Name* is **NULL**, then the function enumerates the printers in the user's domain. If *Level* is 2 or 5,*Name* is a pointer to a null-terminated string that specifies the name of a server whose printers are to be enumerated. If this string is **NULL**, then the function enumerates the printers installed on the local computer. If *Level* is 4, *Name* should be **NULL**. The function always queries on the local computer. When *Name* is **NULL**, setting *Flags* to PRINTER\_ENUM\_LOCAL \| PRINTER\_ENUM\_CONNECTIONS enumerates printers that are installed on the local machine. These printers include those that are physically attached to the local machine as well as remote printers to which it has a network connection. When *Name* is not **NULL**, setting *Flags* to PRINTER\_ENUM\_LOCAL \| PRINTER\_ENUM\_NAME enumerates the local printers that are installed on the server *Name*.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/enumprinters#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="Level">
		/// <para>The type of data structures pointed to by *pPrinterEnum*. Valid values are 1, 2, 4, and 5, which correspond to the [**PRINTER\_INFO\_1**](printer-info-1.md), [**PRINTER\_INFO\_2**](printer-info-2.md) , [**PRINTER\_INFO\_4**](printer-info-4.md), and [**PRINTER\_INFO\_5**](printer-info-5.md) data structures. This value can be 1, 2, 4, or 5.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/enumprinters#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="pPrinterEnum">
		/// <para>A pointer to a buffer that receives an array of [**PRINTER\_INFO\_1**](printer-info-1.md), [**PRINTER\_INFO\_2**](printer-info-2.md), [**PRINTER\_INFO\_4**](printer-info-4.md), or [**PRINTER\_INFO\_5**](printer-info-5.md) structures. Each structure contains data that describes an available print object. If *Level* is 1, the array contains [**PRINTER\_INFO\_1**](printer-info-1.md) structures. If *Level* is 2, the array contains [**PRINTER\_INFO\_2**](printer-info-2.md) structures. If *Level* is 4, the array contains [**PRINTER\_INFO\_4**](printer-info-4.md) structures. If *Level* is 5, the array contains [**PRINTER\_INFO\_5**](printer-info-5.md) structures. The buffer must be large enough to receive the array of data structures and any strings or other data to which the structure members point. If the buffer is too small, the *pcbNeeded* parameter returns the required buffer size.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/enumprinters#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="cbBuf">The size, in bytes, of the buffer pointed to by *pPrinterEnum*.</param>
		/// <param name="pcbNeeded">A pointer to a value that receives the number of bytes copied if the function succeeds or the number of bytes required if *cbBuf* is too small.</param>
		/// <param name="pcReturned">A pointer to a value that receives the number of [**PRINTER\_INFO\_1**](printer-info-1.md), [**PRINTER\_INFO\_2**](printer-info-2.md) , [**PRINTER\_INFO\_4**](printer-info-4.md), or [**PRINTER\_INFO\_5**](printer-info-5.md) structures that the function returns in the array to which *pPrinterEnum* points.</param>
		/// <returns>
		/// <para>If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero.</para>
		/// </returns>
		/// <remarks>
		/// <para>Do not call this method in [**DllMain**](/windows/desktop/Dlls/dllmain). > [!Note] > This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</para>
		/// <para>If **EnumPrinters** returns a [**PRINTER\_INFO\_1**](printer-info-1.md) structure in which PRINTER\_ENUM\_CONTAINER is specified, this indicates that there is a hierarchy of printer objects. An application can enumerate the hierarchy by calling **EnumPrinters** again, setting *Name* to the value of the **PRINTER\_INFO\_1** structure's **pName** member. The **EnumPrinters** function does not retrieve security information. If [**PRINTER\_INFO\_2**](printer-info-2.md) structures are returned in the array pointed to by *pPrinterEnum*, their *pSecurityDescriptor* members will be set to **NULL**. To get information about the default printer, call [**GetDefaultPrinter**](getdefaultprinter.md). The [**PRINTER\_INFO\_4**](printer-info-4.md) structure provides an easy and extremely fast way to retrieve the names of the printers installed on a local machine, as well as the remote connections that a user has established. When **EnumPrinters** is called with a **PRINTER\_INFO\_4** data structure, that function queries the registry for the specified information, then returns immediately. This differs from the behavior of **EnumPrinters** when called with other levels of **PRINTER\_INFO\_\*** data structures. In particular, when **EnumPrinters** is called with a level 2 ([**PRINTER\_INFO\_2**](printer-info-2.md)) data structure, it performs an [**OpenPrinter**](openprinter.md) call on each remote connection. If a remote connection is down, or the remote server no longer exists, or the remote printer no longer exists, the function must wait for RPC to time out and consequently fail the **OpenPrinter** call. This can take a while. Passing a **PRINTER\_INFO\_4** structure lets an application retrieve a bare minimum of required information; if more detailed information is desired, a subsequent **EnumPrinters** level 2 call can be made. **Windows Vista:** The printer data returned by **EnumPrinters** is retrieved from a local cache when the value of *Level* is 4. The following table shows the **EnumPrinters** output for various *Flags* values when the *Level* parameter is set to 1. In the *Name* parameter column of the table, you should substitute an appropriate name for Print Provider, Domain, and Machine. For example, for "Print Provider," you could use the name of the network print provider or the name of the local print provider. To retrieve print provider names, call **EnumPrinters** with *Name* set to **NULL**.</para>
		/// <para>| *Flags* parameter                                  | *Name* parameter                            | Result                                                                                            | |----------------------------------------------------|---------------------------------------------|---------------------------------------------------------------------------------------------------| | PRINTER\_ENUM\_LOCAL (and not PRINTER\_ENUM\_NAME) | The *Name* parameter is ignored.<br/> | All local printers.<br/>                                                                    | | PRINTER\_ENUM\_NAME                                | "Print Provider"<br/>                 | All domain names<br/>                                                                       | | PRINTER\_ENUM\_NAME                                | "Print Provider!Domain"<br/>          | All printers and print servers in the computer's domain<br/>                                | | PRINTER\_ENUM\_NAME                                | "Print Provider!!\\\\Machine"<br/>    | All printers shared at \\\\Machine<br/>                                                     | | PRINTER\_ENUM\_NAME                                | An empty string, ""<br/>              | All local printers.<br/>                                                                    | | PRINTER\_ENUM\_NAME                                | **NULL**<br/>                         | All print providers in the computer's domain<br/>                                           | | PRINTER\_ENUM\_CONNECTIONS                         | The *Name* parameter is ignored.<br/> | All connected remote printers<br/>                                                          | | PRINTER\_ENUM\_NETWORK                             | The *Name* parameter is ignored.<br/> | All printers in the computer's domain<br/>                                                  | | PRINTER\_ENUM\_REMOTE                              | An empty string, ""<br/>              | All printers and print servers in the computer's domain<br/>                                | | PRINTER\_ENUM\_REMOTE                              | "Print Provider"<br/>                 | Same as PRINTER\_ENUM\_NAME<br/>                                                            | | PRINTER\_ENUM\_REMOTE                              | "Print Provider!Domain"<br/>          | All printers and print servers in computer's domain, regardless of *Domain* specified.<br/> | | PRINTER\_ENUM\_CATEGORY\_3D                        | The *Name* parameter is ignored.<br/> | Only 3D printers are enumerated.<br/>                                                       | | PRINTER\_ENUM\_CATEGORY\_ALL                       | The *Name* parameter is ignored.<br/> | 3D printers are enumerated, along with all other printers.<br/>                             |</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/printdocs/enumprinters#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		internal static unsafe winmdroot.Foundation.BOOL EnumPrinters(uint Flags, winmdroot.Foundation.PWSTR Name, uint Level, [Optional] byte* pPrinterEnum, uint cbBuf, uint* pcbNeeded, uint* pcReturned)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(Flags, Name, Level, pPrinterEnum, cbBuf, pcbNeeded, pcReturned);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("winspool.drv", ExactSpelling = true, EntryPoint = "EnumPrintersW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.BOOL LocalExternFunction(uint Flags, winmdroot.Foundation.PWSTR Name, uint Level, [Optional] byte* pPrinterEnum, uint cbBuf, uint* pcbNeeded, uint* pcReturned);
		}
	}
}