package winspool

import (
	"context"
	"fmt"
	"strings"
	"unicode/utf16"

	dcerpc "github.com/oiweiwei/go-msrpc/dcerpc"
	errors "github.com/oiweiwei/go-msrpc/dcerpc/errors"
	uuid "github.com/oiweiwei/go-msrpc/midl/uuid"
	dcetypes "github.com/oiweiwei/go-msrpc/msrpc/dcetypes"
	dtyp "github.com/oiweiwei/go-msrpc/msrpc/dtyp"
	ndr "github.com/oiweiwei/go-msrpc/ndr"
)

var (
	_ = context.Background
	_ = fmt.Errorf
	_ = utf16.Encode
	_ = strings.TrimPrefix
	_ = ndr.ZeroString
	_ = (*uuid.UUID)(nil)
	_ = (*dcerpc.SyntaxID)(nil)
	_ = (*errors.Error)(nil)
	_ = dcetypes.GoPackage
	_ = dtyp.GoPackage
)

var (
	// import guard
	GoPackage = "rprn"
)

var (
	// Syntax UUID
	WinspoolSyntaxUUID = &uuid.UUID{TimeLow: 0x12345678, TimeMid: 0x1234, TimeHiAndVersion: 0xabcd, ClockSeqHiAndReserved: 0xef, ClockSeqLow: 0x0, Node: [6]uint8{0x1, 0x23, 0x45, 0x67, 0x89, 0xab}}
	// Syntax ID
	WinspoolSyntaxV1_0 = &dcerpc.SyntaxID{IfUUID: WinspoolSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 0}
)

// winspool interface.
type WinspoolClient interface {

	// RpcEnumPrinters enumerates available printers, print servers, domains, or print providers.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion and SHOULD<264> return a nonzero Windows error code ([MS-ERREF] section
	// 2.2) to indicate failure.
	EnumPrinters(context.Context, *EnumPrintersRequest, ...dcerpc.CallOption) (*EnumPrintersResponse, error)

	// RpcOpenPrinter retrieves a handle for a printer, port, port monitor, print job, or
	// print server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	OpenPrinter(context.Context, *OpenPrinterRequest, ...dcerpc.CallOption) (*OpenPrinterResponse, error)

	// RpcSetJob pauses, resumes, cancels, or restarts a print job. It also sets print job
	// parameters, such as the job priority and the document name.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetJob(context.Context, *SetJobRequest, ...dcerpc.CallOption) (*SetJobResponse, error)

	// RpcGetJob retrieves information about a specified print job.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetJob(context.Context, *GetJobRequest, ...dcerpc.CallOption) (*GetJobResponse, error)

	// RpcEnumJobs retrieves information about a specified set of print jobs for a specified
	// printer or port.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumJobs(context.Context, *EnumJobsRequest, ...dcerpc.CallOption) (*EnumJobsResponse, error)

	// RpcAddPrinter adds a printer to the list of supported printers for a specified server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPrinter(context.Context, *AddPrinterRequest, ...dcerpc.CallOption) (*AddPrinterResponse, error)

	// RpcDeletePrinter is a method that deletes the specified printer object.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinter(context.Context, *DeletePrinterRequest, ...dcerpc.CallOption) (*DeletePrinterResponse, error)

	// RpcSetPrinter sets the data or state of a specified printer by pausing or resuming
	// printing or by clearing all print jobs.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetPrinter(context.Context, *SetPrinterRequest, ...dcerpc.CallOption) (*SetPrinterResponse, error)

	// RpcGetPrinter retrieves information about a specified printer.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrinter(context.Context, *GetPrinterRequest, ...dcerpc.CallOption) (*GetPrinterResponse, error)

	// RpcAddPrinterDriver installs a printer driver on the print server and links the configuration,
	// data, and printer driver files.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPrinterDriver(context.Context, *AddPrinterDriverRequest, ...dcerpc.CallOption) (*AddPrinterDriverResponse, error)

	// RpcEnumPrinterDrivers enumerates the printer drivers installed on a specified print
	// server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPrinterDrivers(context.Context, *EnumPrinterDriversRequest, ...dcerpc.CallOption) (*EnumPrinterDriversResponse, error)

	// RpcGetPrinterDriver retrieves printer driver data for the specified printer.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrinterDriver(context.Context, *GetPrinterDriverRequest, ...dcerpc.CallOption) (*GetPrinterDriverResponse, error)

	// RpcGetPrinterDriverDirectory retrieves the path of the printer driver directory.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrinterDriverDirectory(context.Context, *GetPrinterDriverDirectoryRequest, ...dcerpc.CallOption) (*GetPrinterDriverDirectoryResponse, error)

	// RpcDeletePrinterDriver removes the specified printer driver from the list of supported
	// drivers for a server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinterDriver(context.Context, *DeletePrinterDriverRequest, ...dcerpc.CallOption) (*DeletePrinterDriverResponse, error)

	// RpcAddPrintProcessor installs a print processor on the specified server and adds
	// its name to an internal list of supported print processors.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPrintProcessor(context.Context, *AddPrintProcessorRequest, ...dcerpc.CallOption) (*AddPrintProcessorResponse, error)

	// RpcEnumPrintProcessors enumerates the print processors installed on a specified server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPrintProcessors(context.Context, *EnumPrintProcessorsRequest, ...dcerpc.CallOption) (*EnumPrintProcessorsResponse, error)

	// RpcGetPrintProcessorDirectory retrieves the path for the print processor on the specified
	// server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrintProcessorDirectory(context.Context, *GetPrintProcessorDirectoryRequest, ...dcerpc.CallOption) (*GetPrintProcessorDirectoryResponse, error)

	// RpcStartDocPrinter notifies the print server that a document is being spooled for
	// printing.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	StartDocPrinter(context.Context, *StartDocPrinterRequest, ...dcerpc.CallOption) (*StartDocPrinterResponse, error)

	// RpcStartPagePrinter notifies the spooler that a page is about to be printed on the
	// specified printer.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	StartPagePrinter(context.Context, *StartPagePrinterRequest, ...dcerpc.CallOption) (*StartPagePrinterResponse, error)

	// RpcWritePrinter sends data to the print server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	WritePrinter(context.Context, *WritePrinterRequest, ...dcerpc.CallOption) (*WritePrinterResponse, error)

	// RpcEndPagePrinter notifies the print server that the application is at the end of
	// a page in a print job.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EndPagePrinter(context.Context, *EndPagePrinterRequest, ...dcerpc.CallOption) (*EndPagePrinterResponse, error)

	// RpcAbortPrinter aborts the currently spooling print document.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AbortPrinter(context.Context, *AbortPrinterRequest, ...dcerpc.CallOption) (*AbortPrinterResponse, error)

	// RpcReadPrinter retrieves data from the specified job or port.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	ReadPrinter(context.Context, *ReadPrinterRequest, ...dcerpc.CallOption) (*ReadPrinterResponse, error)

	// RpcEndDocPrinter notifies the print server that the application is at the end of
	// the current print job.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EndDocPrinter(context.Context, *EndDocPrinterRequest, ...dcerpc.CallOption) (*EndDocPrinterResponse, error)

	// RpcAddJob does not perform any function but returns a nonzero Windows error code
	// to indicate failure.
	//
	// Return Values: This method MUST return a nonzero Windows error code to indicate failure
	// [MS-ERREF].
	AddJob(context.Context, *AddJobRequest, ...dcerpc.CallOption) (*AddJobResponse, error)

	// RpcScheduleJob does not perform any function, but returns a nonzero Windows error
	// code to indicate failure.
	//
	// Return Values: This method MUST return a nonzero Windows error code to indicate failure
	// [MS-ERREF].
	ScheduleJob(context.Context, *ScheduleJobRequest, ...dcerpc.CallOption) (*ScheduleJobResponse, error)

	// RpcGetPrinterData retrieves printer configuration data for a printer or print server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrinterData(context.Context, *GetPrinterDataRequest, ...dcerpc.CallOption) (*GetPrinterDataResponse, error)

	// RpcSetPrinterData sets the configuration data for a printer or print server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetPrinterData(context.Context, *SetPrinterDataRequest, ...dcerpc.CallOption) (*SetPrinterDataResponse, error)

	// RpcWaitForPrinterChange retrieves information about the most recent change notification
	// that is associated with a printer or print server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	WaitForPrinterChange(context.Context, *WaitForPrinterChangeRequest, ...dcerpc.CallOption) (*WaitForPrinterChangeResponse, error)

	// RpcClosePrinter closes a handle to a printer object, server object, job object, or
	// port object.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	ClosePrinter(context.Context, *ClosePrinterRequest, ...dcerpc.CallOption) (*ClosePrinterResponse, error)

	// RpcAddForm adds a form name to the list of supported forms.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddForm(context.Context, *AddFormRequest, ...dcerpc.CallOption) (*AddFormResponse, error)

	// RpcDeleteForm removes a form name from the list of supported forms.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeleteForm(context.Context, *DeleteFormRequest, ...dcerpc.CallOption) (*DeleteFormResponse, error)

	// RpcGetForm retrieves information about a specified form.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetForm(context.Context, *GetFormRequest, ...dcerpc.CallOption) (*GetFormResponse, error)

	// RpcSetForm replaces the form information for the specified form.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetForm(context.Context, *SetFormRequest, ...dcerpc.CallOption) (*SetFormResponse, error)

	// The RpcEnumForms method enumerates the forms that the specified printer supports.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumForms(context.Context, *EnumFormsRequest, ...dcerpc.CallOption) (*EnumFormsResponse, error)

	// RpcEnumPorts enumerates the ports that are available for printing on a specified
	// server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPorts(context.Context, *EnumPortsRequest, ...dcerpc.CallOption) (*EnumPortsResponse, error)

	// The RpcEnumMonitors method retrieves information about the port monitors installed
	// on the specified server.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumMonitors(context.Context, *EnumMonitorsRequest, ...dcerpc.CallOption) (*EnumMonitorsResponse, error)

	// Opnum37NotUsedOnWire operation.
	// Opnum37NotUsedOnWire

	// Opnum38NotUsedOnWire operation.
	// Opnum38NotUsedOnWire

	// Removes a port.<357>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePort(context.Context, *DeletePortRequest, ...dcerpc.CallOption) (*DeletePortResponse, error)

	// RpcCreatePrinterIC is called by the Graphics Device Interface (GDI) to create an
	// information context for a specified printer.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	CreatePrinterIC(context.Context, *CreatePrinterICRequest, ...dcerpc.CallOption) (*CreatePrinterICResponse, error)

	// RpcPlayGdiScriptOnPrinterIC returns font information for a printer connection. UNIVERSAL_FONT_ID
	// (section 2.2.2.12) structures are used to identify the fonts.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	PlayGDIScriptOnPrinterIC(context.Context, *PlayGDIScriptOnPrinterICRequest, ...dcerpc.CallOption) (*PlayGDIScriptOnPrinterICResponse, error)

	// RpcDeletePrinterIC deletes a printer information context.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinterIC(context.Context, *DeletePrinterICRequest, ...dcerpc.CallOption) (*DeletePrinterICResponse, error)

	// Opnum43NotUsedOnWire operation.
	// Opnum43NotUsedOnWire

	// Opnum44NotUsedOnWire operation.
	// Opnum44NotUsedOnWire

	// Opnum45NotUsedOnWire operation.
	// Opnum45NotUsedOnWire

	// RpcAddMonitor installs a local port monitor and links the configuration, data, and
	// monitor files.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddMonitor(context.Context, *AddMonitorRequest, ...dcerpc.CallOption) (*AddMonitorResponse, error)

	// RpcDeleteMonitor removes a port monitor.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeleteMonitor(context.Context, *DeleteMonitorRequest, ...dcerpc.CallOption) (*DeleteMonitorResponse, error)

	// RpcDeletePrintProcessor removes a print processor.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrintProcessor(context.Context, *DeletePrintProcessorRequest, ...dcerpc.CallOption) (*DeletePrintProcessorResponse, error)

	// Opnum49NotUsedOnWire operation.
	// Opnum49NotUsedOnWire

	// Opnum50NotUsedOnWire operation.
	// Opnum50NotUsedOnWire

	// RpcEnumPrintProcessorDatatypes enumerates the data types that a specified print processor
	// supports.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPrintProcessorDataTypes(context.Context, *EnumPrintProcessorDataTypesRequest, ...dcerpc.CallOption) (*EnumPrintProcessorDataTypesResponse, error)

	// RpcResetPrinter resets the data type and device mode (For more information, see [DEVMODE])
	// values to use for printing documents submitted by the RpcStartDocPrinter (section
	// 3.1.4.9.1) method.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	ResetPrinter(context.Context, *ResetPrinterRequest, ...dcerpc.CallOption) (*ResetPrinterResponse, error)

	// RpcGetPrinterDriver2 retrieves printer driver data for the specified printer.<334>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrinterDriver2(context.Context, *GetPrinterDriver2Request, ...dcerpc.CallOption) (*GetPrinterDriver2Response, error)

	// Opnum54NotUsedOnWire operation.
	// Opnum54NotUsedOnWire

	// Opnum55NotUsedOnWire operation.
	// Opnum55NotUsedOnWire

	// The RpcFindClosePrinterChangeNotification method closes a change notification object
	// created by RpcRemoteFindFirstPrinterChangeNotification (section 3.1.4.10.3) or RpcRemoteFindFirstPrinterChangeNotificationEx
	// (section 3.1.4.10.4).<380> The printer or print server associated with the change
	// notification object is no longer monitored by that object.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	FindClosePrinterChangeNotification(context.Context, *FindClosePrinterChangeNotificationRequest, ...dcerpc.CallOption) (*FindClosePrinterChangeNotificationResponse, error)

	// Opnum57NotUsedOnWire operation.
	// Opnum57NotUsedOnWire

	// RpcReplyOpenPrinter establishes a context handle from a print server to a print client.<412>
	// The server uses the RPC context handle returned by this method to send notification
	// data to the client machine.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	ReplyOpenPrinter(context.Context, *ReplyOpenPrinterRequest, ...dcerpc.CallOption) (*ReplyOpenPrinterResponse, error)

	// RpcRouterReplyPrinter handles a notification from a print server.<414>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	RouterReplyPrinter(context.Context, *RouterReplyPrinterRequest, ...dcerpc.CallOption) (*RouterReplyPrinterResponse, error)

	// RpcReplyClosePrinter closes the notification channel between a print server and a
	// print client.<415>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	ReplyClosePrinter(context.Context, *ReplyClosePrinterRequest, ...dcerpc.CallOption) (*ReplyClosePrinterResponse, error)

	// RpcAddPortEx adds a port name to the list of supported ports.<359>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPortEx(context.Context, *AddPortExRequest, ...dcerpc.CallOption) (*AddPortExResponse, error)

	// RpcRemoteFindFirstPrinterChangeNotification creates a remote change notification
	// object that monitors changes to printer objects and sends change notifications to
	// a print client using either RpcRouterReplyPrinter (section 3.2.4.1.2) or RpcRouterReplyPrinterEx
	// (section 3.2.4.1.4).
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	RemoteFindFirstPrinterChangeNotification(context.Context, *RemoteFindFirstPrinterChangeNotificationRequest, ...dcerpc.CallOption) (*RemoteFindFirstPrinterChangeNotificationResponse, error)

	// Opnum63NotUsedOnWire operation.
	// Opnum63NotUsedOnWire

	// Opnum64NotUsedOnWire operation.
	// Opnum64NotUsedOnWire

	// RpcRemoteFindFirstPrinterChangeNotificationEx creates a remote change notification
	// object that monitors changes to printer objects and sends change notifications to
	// a print client using either RpcRouterReplyPrinter (section 3.2.4.1.2) or RpcRouterReplyPrinterEx
	// (section 3.2.4.1.4).
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	RemoteFindFirstPrinterChangeNotificationEx(context.Context, *RemoteFindFirstPrinterChangeNotificationExRequest, ...dcerpc.CallOption) (*RemoteFindFirstPrinterChangeNotificationExResponse, error)

	// RpcRouterReplyPrinterEx handles a notification from a print server.<416>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	RouterReplyPrinterEx(context.Context, *RouterReplyPrinterExRequest, ...dcerpc.CallOption) (*RouterReplyPrinterExResponse, error)

	// RpcRouterRefreshPrinterChangeNotification returns change notification information.<383>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	RouterRefreshPrinterChangeNotification(context.Context, *RouterRefreshPrinterChangeNotificationRequest, ...dcerpc.CallOption) (*RouterRefreshPrinterChangeNotificationResponse, error)

	// Opnum68NotUsedOnWire operation.
	// Opnum68NotUsedOnWire

	// RpcOpenPrinterEx retrieves a handle for a printer, port, port monitor, print job,
	// or print server.<287>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	OpenPrinterEx(context.Context, *OpenPrinterExRequest, ...dcerpc.CallOption) (*OpenPrinterExResponse, error)

	// RpcAddPrinterEx installs a printer on the print server.<288>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPrinterEx(context.Context, *AddPrinterExRequest, ...dcerpc.CallOption) (*AddPrinterExResponse, error)

	// RpcSetPort sets the status associated with a printer port.<361>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetPort(context.Context, *SetPortRequest, ...dcerpc.CallOption) (*SetPortResponse, error)

	// RpcEnumPrinterData enumerates configuration data for a specified printer.<292>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPrinterData(context.Context, *EnumPrinterDataRequest, ...dcerpc.CallOption) (*EnumPrinterDataResponse, error)

	// RpcDeletePrinterData deletes specified configuration data for a printer.<294>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinterData(context.Context, *DeletePrinterDataRequest, ...dcerpc.CallOption) (*DeletePrinterDataResponse, error)

	// Opnum74NotUsedOnWire operation.
	// Opnum74NotUsedOnWire

	// Opnum75NotUsedOnWire operation.
	// Opnum75NotUsedOnWire

	// Opnum76NotUsedOnWire operation.
	// Opnum76NotUsedOnWire

	// RpcSetPrinterDataEx sets the configuration data for a printer or print server.<298>
	// This method is similar to RpcSetPrinterData (section 3.1.4.2.8) but additionally
	// allows the caller to specify the registry key under which to store the data.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetPrinterDataEx(context.Context, *SetPrinterDataExRequest, ...dcerpc.CallOption) (*SetPrinterDataExResponse, error)

	// RpcGetPrinterDataEx retrieves configuration data for the specified printer or print
	// server.<301> This method is similar to RpcGetPrinterData (section 3.1.4.2.7), but
	// it also allows the caller to specify the registry key from which to retrieve the
	// data.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetPrinterDataEx(context.Context, *GetPrinterDataExRequest, ...dcerpc.CallOption) (*GetPrinterDataExResponse, error)

	// RpcEnumPrinterDataEx enumerates all value names and data for a specified printer
	// and key.<304> This method is similar to RpcEnumPrinterData (section 3.1.4.2.16) but
	// also allows the caller to specify the registry key from which to enumerate the data,
	// and allows retrieving several values in a single call.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPrinterDataEx(context.Context, *EnumPrinterDataExRequest, ...dcerpc.CallOption) (*EnumPrinterDataExResponse, error)

	// RpcEnumPrinterKey enumerates the subkeys of a specified key for a specified printer.<305>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPrinterKey(context.Context, *EnumPrinterKeyRequest, ...dcerpc.CallOption) (*EnumPrinterKeyResponse, error)

	// RpcDeletePrinterDataEx deletes a specified value from a printer's configuration data,
	// which consists of a set of named and typed values stored in a hierarchy of registry
	// keys.<306>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinterDataEx(context.Context, *DeletePrinterDataExRequest, ...dcerpc.CallOption) (*DeletePrinterDataExResponse, error)

	// RpcDeletePrinterKey deletes a specified key and all of its subkeys for a specified
	// printer.<309>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinterKey(context.Context, *DeletePrinterKeyRequest, ...dcerpc.CallOption) (*DeletePrinterKeyResponse, error)

	// Opnum83NotUsedOnWire operation.
	// Opnum83NotUsedOnWire

	// RpcDeletePrinterDriverEx removes the specified printer driver from the list of supported
	// drivers for a server and deletes the files associated with it.<339> This method can
	// also be used to delete specific versions of a driver.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePrinterDriverEx(context.Context, *DeletePrinterDriverExRequest, ...dcerpc.CallOption) (*DeletePrinterDriverExResponse, error)

	// RpcAddPerMachineConnection adds a remote printer name to the list of supported printer
	// connections for every user who locally logs onto the computer running the print server.<311>
	//
	// This method is used for remote administration of client computers running the print
	// system.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPerMachineConnection(context.Context, *AddPerMachineConnectionRequest, ...dcerpc.CallOption) (*AddPerMachineConnectionResponse, error)

	// RpcDeletePerMachineConnection deletes information about a printer connection.<314>
	//
	// This method is used for remote administration of client computers running the print
	// system.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeletePerMachineConnection(context.Context, *DeletePerMachineConnectionRequest, ...dcerpc.CallOption) (*DeletePerMachineConnectionResponse, error)

	// Enumerates each of the connections and copies PRINTER_INFO_4 (section 2.2.1.10.5)
	// structures for all the per-machine connections into the buffer pPrinterEnum.<316>
	//
	// This method is used for remote administration of client computers running the print
	// system.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumPerMachineConnections(context.Context, *EnumPerMachineConnectionsRequest, ...dcerpc.CallOption) (*EnumPerMachineConnectionsResponse, error)

	// RpcXcvData provides an extensible mechanism by which a client can control ports on
	// the server and exchange port specific commands and data with the server.<363>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate that the
	// print server successfully called the port monitor's XcvData method, or a nonzero
	// Windows error code to indicate failure [MS-ERREF].
	XcvData(context.Context, *XcvDataRequest, ...dcerpc.CallOption) (*XcvDataResponse, error)

	// RpcAddPrinterDriverEx installs a printer driver on the print server.<342> This method
	// performs a function similar to RpcAddPrinterDriver (section 3.1.4.4.1) and is also
	// used to specify options that permit printer driver upgrade, printer driver downgrade,
	// copying of newer files only, and copying of all files regardless of their time stamps.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	AddPrinterDriverEx(context.Context, *AddPrinterDriverExRequest, ...dcerpc.CallOption) (*AddPrinterDriverExResponse, error)

	// Opnum90NotUsedOnWire operation.
	// Opnum90NotUsedOnWire

	// Opnum91NotUsedOnWire operation.
	// Opnum91NotUsedOnWire

	// Opnum92NotUsedOnWire operation.
	// Opnum92NotUsedOnWire

	// Opnum93NotUsedOnWire operation.
	// Opnum93NotUsedOnWire

	// Opnum94NotUsedOnWire operation.
	// Opnum94NotUsedOnWire

	// Opnum95NotUsedOnWire operation.
	// Opnum95NotUsedOnWire

	// RpcFlushPrinter is used by printer drivers to send a buffer of bytes to a specified
	// port to cleanly abort a print job.<378> It also allows delaying the I/O line to the
	// printer.
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	FlushPrinter(context.Context, *FlushPrinterRequest, ...dcerpc.CallOption) (*FlushPrinterResponse, error)

	// The RpcSendRecvBidiData method sends and receives bidirectional data. This method
	// is used to communicate with port monitors that support such data.<317>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SendRecvBIDIData(context.Context, *SendRecvBIDIDataRequest, ...dcerpc.CallOption) (*SendRecvBIDIDataResponse, error)

	// Opnum98NotUsedOnWire operation.
	// Opnum98NotUsedOnWire

	// Opnum99NotUsedOnWire operation.
	// Opnum99NotUsedOnWire

	// Opnum100NotUsedOnWire operation.
	// Opnum100NotUsedOnWire

	// Opnum101NotUsedOnWire operation.
	// Opnum101NotUsedOnWire

	// RpcGetCorePrinterDrivers gets the GUIDs, versions, and publish dates of the specified
	// core printer drivers, and the paths to their packages.<347>
	//
	// Return Values: This method MUST return zero or an HRESULT success value ([MS-ERREF]
	// section 2.1) to indicate successful completion or an HRESULT error value to indicate
	// failure.
	//
	// Exceptions Thrown: This method MUST NOT throw any exceptions other than those that
	// are thrown by the underlying RPC protocol [MS-RPCE].
	GetCorePrinterDrivers(context.Context, *GetCorePrinterDriversRequest, ...dcerpc.CallOption) (*GetCorePrinterDriversResponse, error)

	// Opnum103NotUsedOnWire operation.
	// Opnum103NotUsedOnWire

	// RpcGetPrinterDriverPackagePath gets the path to the specified printer driver package.<349>
	//
	// Return Values: This method MUST return zero or an HRESULT success value ([MS-ERREF]
	// section 2.1) to indicate successful completion or an HRESULT error value to indicate
	// failure.
	//
	// Exceptions Thrown: This method MUST NOT throw any exceptions other than those that
	// are thrown by the underlying RPC protocol [MS-RPCE].
	GetPrinterDriverPackagePath(context.Context, *GetPrinterDriverPackagePathRequest, ...dcerpc.CallOption) (*GetPrinterDriverPackagePathResponse, error)

	// Opnum105NotUsedOnWire operation.
	// Opnum105NotUsedOnWire

	// Opnum106NotUsedOnWire operation.
	// Opnum106NotUsedOnWire

	// Opnum107NotUsedOnWire operation.
	// Opnum107NotUsedOnWire

	// Opnum108NotUsedOnWire operation.
	// Opnum108NotUsedOnWire

	// Opnum109NotUsedOnWire operation.
	// Opnum109NotUsedOnWire

	// RpcGetJobNamedPropertyValue retrieves the current value of the specified Job Named
	// Property (section 3.1.1).<397>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	GetJobNamedPropertyValue(context.Context, *GetJobNamedPropertyValueRequest, ...dcerpc.CallOption) (*GetJobNamedPropertyValueResponse, error)

	// RpcSetJobNamedProperty creates a new Job Named Property (section 3.1.1), or changes
	// the value of an existing Job Named Property for the specified print job.<398>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	SetJobNamedProperty(context.Context, *SetJobNamedPropertyRequest, ...dcerpc.CallOption) (*SetJobNamedPropertyResponse, error)

	// RpcDeleteJobNamedProperty deletes an existing Job Named Property (section 3.1.1)
	// for the specified print job.<399>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	DeleteJobNamedProperty(context.Context, *DeleteJobNamedPropertyRequest, ...dcerpc.CallOption) (*DeleteJobNamedPropertyResponse, error)

	// RpcEnumJobNamedProperties enumerates the Job Named Properties (section 3.1.1) for
	// the specified print job.<400>
	//
	// Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	EnumJobNamedProperties(context.Context, *EnumJobNamedPropertiesRequest, ...dcerpc.CallOption) (*EnumJobNamedPropertiesResponse, error)

	// Opnum114NotUsedOnWire operation.
	// Opnum114NotUsedOnWire

	// Opnum115NotUsedOnWire operation.
	// Opnum115NotUsedOnWire

	// RpcLogJobInfoForBranchOffice operation.
	LogJobInfoForBranchOffice(context.Context, *LogJobInfoForBranchOfficeRequest, ...dcerpc.CallOption) (*LogJobInfoForBranchOfficeResponse, error)

	// RpcRegeneratePrintDeviceCapabilities operation.
	RegeneratePrintDeviceCapabilities(context.Context, *RegeneratePrintDeviceCapabilitiesRequest, ...dcerpc.CallOption) (*RegeneratePrintDeviceCapabilitiesResponse, error)

	// Opnum118NotUsedOnWire operation.
	// Opnum118NotUsedOnWire

	// RpcIppCreateJobOnPrinter operation.
	CreateJobOnPrinter(context.Context, *CreateJobOnPrinterRequest, ...dcerpc.CallOption) (*CreateJobOnPrinterResponse, error)

	// RpcIppGetJobAttributes operation.
	GetJobAttributes(context.Context, *GetJobAttributesRequest, ...dcerpc.CallOption) (*GetJobAttributesResponse, error)

	// RpcIppSetJobAttributes operation.
	SetJobAttributes(context.Context, *SetJobAttributesRequest, ...dcerpc.CallOption) (*SetJobAttributesResponse, error)

	// RpcIppGetPrinterAttributes operation.
	GetPrinterAttributes(context.Context, *GetPrinterAttributesRequest, ...dcerpc.CallOption) (*GetPrinterAttributesResponse, error)

	// RpcIppSetPrinterAttributes operation.
	SetPrinterAttributes(context.Context, *SetPrinterAttributesRequest, ...dcerpc.CallOption) (*SetPrinterAttributesResponse, error)

	// AlterContext alters the client context.
	AlterContext(context.Context, ...dcerpc.Option) error

	// Conn returns the client connection (unsafe)
	Conn() dcerpc.Conn
}

// TableDword represents the TABLE_DWORD RPC constant
var TableDword = 1

// TableString represents the TABLE_STRING RPC constant
var TableString = 2

// TableDevMode represents the TABLE_DEVMODE RPC constant
var TableDevMode = 3

// TableTime represents the TABLE_TIME RPC constant
var TableTime = 4

// TableSecurityDescriptor represents the TABLE_SECURITYDESCRIPTOR RPC constant
var TableSecurityDescriptor = 5

// SplfileContentTypePropertyName represents the SPLFILE_CONTENT_TYPE_PROP_NAME RPC constant
var SplfileContentTypePropertyName = "Spool File Contents"

// OSType type represents OS_TYPE RPC enumeration.
//
// The OS_TYPE enumeration specifies information about the operating system (OS) type
// for use with Server Handle Key Values (section 2.2.3.10).<184>
type OSType uint16

var (
	// VER_NT_WORKSTATION:  The OS is a Windows NT operating system workstation.
	OSTypeVerNTWorkstation OSType = 1
	// VER_NT_DOMAIN_CONTROLLER:  The OS is a Windows NT domain controller.
	OSTypeVerNTDomainController OSType = 2
	// VER_NT_SERVER:  The OS is a Windows NT server. A server that is also a domain controller
	// is reported as VER_NT_DOMAIN_CONTROLLER, not VER_NT_SERVER.
	OSTypeVerNTServer OSType = 3
)

func (o OSType) String() string {
	switch o {
	case OSTypeVerNTWorkstation:
		return "OSTypeVerNTWorkstation"
	case OSTypeVerNTDomainController:
		return "OSTypeVerNTDomainController"
	case OSTypeVerNTServer:
		return "OSTypeVerNTServer"
	}
	return "Invalid"
}

// BIDIType type represents BIDI_TYPE RPC enumeration.
//
// The BIDI_TYPE enumeration specifies the type of data transferred in a bidirectional
// operation.
type BIDIType uint16

var (
	// BIDI_NULL:  No bidirectional data.
	BIDITypeNull BIDIType = 0
	// BIDI_INT:  Bidirectional data is an integer.
	BIDITypeInt BIDIType = 1
	// BIDI_FLOAT:  Bidirectional data is a floating-point number.
	BIDITypeFloat BIDIType = 2
	// BIDI_BOOL:  Bidirectional data is a Boolean value.
	BIDITypeBool BIDIType = 3
	// BIDI_STRING:  Bidirectional data is a string.
	BIDITypeString BIDIType = 4
	// BIDI_TEXT:  Bidirectional data is text data.
	BIDITypeText BIDIType = 5
	// BIDI_ENUM:  Bidirectional data is an enumeration.
	BIDITypeEnum BIDIType = 6
	// BIDI_BLOB:  Bidirectional data is a data BLOB.
	BIDITypeBlob BIDIType = 7
)

func (o BIDIType) String() string {
	switch o {
	case BIDITypeNull:
		return "BIDITypeNull"
	case BIDITypeInt:
		return "BIDITypeInt"
	case BIDITypeFloat:
		return "BIDITypeFloat"
	case BIDITypeBool:
		return "BIDITypeBool"
	case BIDITypeString:
		return "BIDITypeString"
	case BIDITypeText:
		return "BIDITypeText"
	case BIDITypeEnum:
		return "BIDITypeEnum"
	case BIDITypeBlob:
		return "BIDITypeBlob"
	}
	return "Invalid"
}

// PrintPropertyType type represents RPC_EPrintPropertyType RPC enumeration.
//
// The RPC_EPrintPropertyType enumeration specifies the type of the value contained
// by a Job Named Property (section 3.1.1).<82>
type PrintPropertyType uint16

var (
	// kRpcPropertyTypeString: The property value is a string.
	PrintPropertyTypeString PrintPropertyType = 1
	// kRpcPropertyTypeInt32: The property value is a signed 32-bit integer.
	PrintPropertyTypeInt32 PrintPropertyType = 2
	// kRpcPropertyTypeInt64: The property value is a signed 64-bit integer.
	PrintPropertyTypeInt64 PrintPropertyType = 3
	// kRpcPropertyTypeByte: The property value is a byte.
	PrintPropertyTypeByte PrintPropertyType = 4
	// kRpcPropertyTypeBuffer: The property value consists of an array of bytes contained
	// in a buffer.
	PrintPropertyTypeBuffer PrintPropertyType = 5
)

func (o PrintPropertyType) String() string {
	switch o {
	case PrintPropertyTypeString:
		return "PrintPropertyTypeString"
	case PrintPropertyTypeInt32:
		return "PrintPropertyTypeInt32"
	case PrintPropertyTypeInt64:
		return "PrintPropertyTypeInt64"
	case PrintPropertyTypeByte:
		return "PrintPropertyTypeByte"
	case PrintPropertyTypeBuffer:
		return "PrintPropertyTypeBuffer"
	}
	return "Invalid"
}

// GDI structure represents GDI_HANDLE RPC structure.
type GDI dcetypes.ContextHandle

func (o *GDI) ContextHandle() *dcetypes.ContextHandle { return (*dcetypes.ContextHandle)(o) }

func (o *GDI) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *GDI) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(o.Attributes); err != nil {
		return err
	}
	if o.UUID != nil {
		if err := o.UUID.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *GDI) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData(&o.Attributes); err != nil {
		return err
	}
	if o.UUID == nil {
		o.UUID = &dtyp.GUID{}
	}
	if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// Printer structure represents PRINTER_HANDLE RPC structure.
type Printer dcetypes.ContextHandle

func (o *Printer) ContextHandle() *dcetypes.ContextHandle { return (*dcetypes.ContextHandle)(o) }

func (o *Printer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *Printer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(o.Attributes); err != nil {
		return err
	}
	if o.UUID != nil {
		if err := o.UUID.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *Printer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData(&o.Attributes); err != nil {
		return err
	}
	if o.UUID == nil {
		o.UUID = &dtyp.GUID{}
	}
	if err := o.UUID.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// Size structure represents SIZE RPC structure.
//
// The SIZE structure defines the area of a form, with a width and height in thousandth-of-a-millimeter
// units.
type Size struct {
	// cx: The width, and it MUST be an integer greater than or equal to 0.
	X int32 `idl:"name:cx" json:"x"`
	// cy: The height, and it MUST be an integer greater than or equal to 0.
	Y int32 `idl:"name:cy" json:"y"`
}

func (o *Size) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *Size) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(o.X); err != nil {
		return err
	}
	if err := w.WriteData(o.Y); err != nil {
		return err
	}
	return nil
}
func (o *Size) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData(&o.X); err != nil {
		return err
	}
	if err := w.ReadData(&o.Y); err != nil {
		return err
	}
	return nil
}

// Rectangle structure represents RECTL RPC structure.
//
// The RECTL structure defines a rectangle on a form, with two (x,y) coordinates in
// 1/1000 millimeter units.
type Rectangle struct {
	// left: The x-coordinate of the upper-left corner of the rectangle relative to the
	// left edge of the form. This value MUST be an integer greater than or equal to 0 and
	// it MUST be smaller than or equal to the 'right'.
	Left int32 `idl:"name:left" json:"left"`
	// top: The y-coordinate of the upper-left corner of the rectangle relative to the top
	// edge of the form. This value MUST be an integer greater than or equal to 0 and it
	// MUST be smaller than or equal to the 'bottom'.
	Top int32 `idl:"name:top" json:"top"`
	// right: The x-coordinate of the lower-right corner of the rectangle relative to the
	// left edge of the form. This value MUST be greater than or equal to 'left'.
	Right int32 `idl:"name:right" json:"right"`
	// bottom: The y-coordinate of the lower-right corner of the rectangle relative to the
	// top edge of the form. This value MUST be greater than or equal to 'top'.
	Bottom int32 `idl:"name:bottom" json:"bottom"`
}

func (o *Rectangle) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *Rectangle) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(o.Left); err != nil {
		return err
	}
	if err := w.WriteData(o.Top); err != nil {
		return err
	}
	if err := w.WriteData(o.Right); err != nil {
		return err
	}
	if err := w.WriteData(o.Bottom); err != nil {
		return err
	}
	return nil
}
func (o *Rectangle) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData(&o.Left); err != nil {
		return err
	}
	if err := w.ReadData(&o.Top); err != nil {
		return err
	}
	if err := w.ReadData(&o.Right); err != nil {
		return err
	}
	if err := w.ReadData(&o.Bottom); err != nil {
		return err
	}
	return nil
}

// DevMode structure represents DEVMODE RPC structure.
//
// The DEVMODE structure is a truncated form of the variable-length, custom-marshaled
// _DEVMODE structure (section 2.2.2.1), which is version-specific and implementation-specific
// and cannot be expressed using IDL attributes.
//
// All members of this structure are specified in section 2.2.2.1.
//
// The _DEVMODE structure defines initialization data for a printer. Although the _DEVMODE
// structure does not contain any pointers, it is still custom-marshaled, because the
// size of the structure is version-specific and implementation-specific, and cannot
// be expressed using IDL attributes. It has the following message format.
//
// The print server MUST accept _DEVMODE structures with truncated public information.
// A truncated _DEVMODE structure contains a subset of fields, from dmDeviceName up
// to and including dmFields, plus at least those fields that are initialized as specified
// by dmFields. It is followed by private, printer driver–specific data, the size
// of which is specified by the dmDriverExtra field.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmDeviceName (64 bytes)                                                                                                       |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmSpecVersion                                                 | dmDriverVersion                                               |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmSize                                                        | dmDriverExtra                                                 |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmFields                                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmOrientation                                                 | dmPaperSize                                                   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmPaperLength                                                 | dmPaperWidth                                                  |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmScale                                                       | dmCopies                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmDefaultSource                                               | dmPrintQuality                                                |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmColor                                                       | dmDuplex                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmYResolution                                                 | dmTTOption                                                    |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmCollate                                                     | dmFormName (64 bytes)                                         |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                           | reserved0                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved1                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved2                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved3                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmNup                                                                                                                         |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved4                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmICMMethod                                                                                                                   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmICMIntent                                                                                                                   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmMediaType                                                                                                                   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmDitherType                                                                                                                  |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved5                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved6                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved7                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| reserved8                                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dmDriverExtraData (variable)                                                                                                  |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type DevMode struct {
	// dmDeviceName (64 bytes): A 32-element array of 16-bit Unicode characters that form
	// a null-terminated string that specifies the name of the printer. Printer name strings
	// that are longer than 32 characters are truncated to fit the array. For more rules
	// governing printer names, see section 2.2.4.14.
	DeviceName []uint16 `idl:"name:dmDeviceName" json:"device_name"`
	// dmSpecVersion (2 bytes): The version of initialization data specification on which
	// the _DEVMODE structure is based. This value SHOULD be 0x0401.<93>
	SpecVersion uint16 `idl:"name:dmSpecVersion" json:"spec_version"`
	// dmDriverVersion (2 bytes): For printers, an optional, implementation-defined version
	// of the printer driver.<94>
	DriverVersion uint16 `idl:"name:dmDriverVersion" json:"driver_version"`
	// dmSize (2 bytes): The size, in bytes, of the _DEVMODE structure, which MUST be a
	// multiple of 4. This value does not include the length of any private, printer driver–specific
	// data that follows the _DEVMODE structure's public fields. The size of private data
	// is specified by the dmDriverExtra value.
	Size uint16 `idl:"name:dmSize" json:"size"`
	// dmDriverExtra (2 bytes): The size, in bytes, of the private, printer driver–specific
	// data that follows this structure.
	DriverExtra uint16 `idl:"name:dmDriverExtra" json:"driver_extra"`
	// dmFields (4 bytes): A bitfield that specifies the fields of the _DEVMODE structure
	// that have been initialized. If a bit is set, the corresponding field MUST be initialized
	// and MUST be processed on receipt. If a bit is not set, the value of the corresponding
	// field SHOULD be zero when sent and MUST be ignored on receipt.
	//
	// The value of this field is the result of a bitwise OR of the following bits.
	//
	//	+---+-----+---+-----+-----+-----+-----+-----+-----+-----+---+-----+-----+-----+-----+-----+-----+---+---+---+---+---+---+-----+---+---+---+---+---+-----+-----+-----+
	//	| 0 |  1  | 2 |  3  |  4  |  5  |  6  |  7  |  8  |  9  | 1 |  1  |  2  |  3  |  4  |  5  |  6  | 7 | 8 | 9 | 2 | 1 | 2 |  3  | 4 | 5 | 6 | 7 | 8 |  9  |  3  |  1  |
	//	|   |     |   |     |     |     |     |     |     |     | 0 |     |     |     |     |     |     |   |   |   | 0 |   |   |     |   |   |   |   |   |     |  0  |     |
	//	+---+-----+---+-----+-----+-----+-----+-----+-----+-----+---+-----+-----+-----+-----+-----+-----+---+---+---+---+---+---+-----+---+---+---+---+---+-----+-----+-----+
	//	+---+-----+---+-----+-----+-----+-----+-----+-----+-----+---+-----+-----+-----+-----+-----+-----+---+---+---+---+---+---+-----+---+---+---+---+---+-----+-----+-----+
	//	| 0 | U P | 0 | S C | P W | P L | P S | O R | C L | T T | Y | D X | C R | P Q | D S | C P | C M | 0 | 0 | 0 | 0 | 0 | 0 | F M | 0 | 0 | 0 | 0 | 0 | D T | M T | C I |
	//	+---+-----+---+-----+-----+-----+-----+-----+-----+-----+---+-----+-----+-----+-----+-----+-----+---+---+---+---+---+---+-----+---+---+---+---+---+-----+-----+-----+
	//
	//
	//	+---------------------+----------------------------------------------------------------------------------+
	//	|                     |                                                                                  |
	//	|        NAME         |                                   DESCRIPTION                                    |
	//	|                     |                                                                                  |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_ICMINTENT CI     | If this bit is set, the dmICMIntent field MUST be initialized.                   |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_MEDIATYPE MT     | If this bit is set, the dmMediaType field MUST be initialized.                   |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_DITHERTYPE DT    | If this bit is set, the dmDitherType field MUST be initialized.                  |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_FORMNAME FM      | If this bit is set, the dmFormName field MUST be initialized.                    |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_ICMMETHOD CM     | If this bit is set, the dmICMMethod field MUST be initialized.                   |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_COPIES CP        | If this bit is set, the dmCopies field MUST be initialized.                      |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_DEFAULTSOURCE DS | If this bit is set, the dmDefaultSource field MUST be initialized.               |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_PRINTQUALITY PQ  | If this bit is set, the dmPrintQuality field MUST be initialized.                |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_COLOR CR         | If this bit is set, the dmColor field MUST be initialized.                       |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_DUPLEX DX        | If this bit is set, the dmDuplex field MUST be initialized.                      |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_YRESOLUTION Y    | If this bit is set, the dmYResolution field MUST be initialized.                 |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_TTOPTION TT      | If this bit is set, the dmTTOption field MUST be initialized.                    |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_COLLATE CL       | If this bit is set, the dmCollate field MUST be initialized.                     |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_ORIENTATION OR   | If this bit is set, the dmOrientation field MUST be initialized.                 |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_PAPERSIZE PS     | If this bit is set, the dmPaperSize field MUST be initialized. This bit MUST NOT |
	//	|                     | be set if either DM_PAPERLENGTH or DM_PAPERWIDTH are set.                        |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_PAPERLENGTH PL   | If this bit is set, the dmPaperLength field MUST be initialized. This bit MUST   |
	//	|                     | NOT be set if DM_PAPERSIZE is set.                                               |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_PAPERWIDTH PW    | If this bit is set, the dmPaperWidth field MUST be initialized. This bit MUST    |
	//	|                     | NOT be set if DM_PAPERSIZE is set.                                               |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_SCALE SC         | If this bit is set, the dmScale field MUST be initialized.                       |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| DM_NUP UP           | If this bit is set, the dmNup field MUST be initialized.                         |
	//	+---------------------+----------------------------------------------------------------------------------+
	Fields uint32 `idl:"name:dmFields" json:"fields"`
	// dmOrientation (2 bytes): For printers, the orientation for output. If the DM_ORIENTATION
	// bit is set in dmFields, the value of this field SHOULD be one of the following.
	//
	//	+---------------------------+--------------------------+
	//	|                           |                          |
	//	|        NAME/VALUE         |       DESCRIPTION        |
	//	|                           |                          |
	//	+---------------------------+--------------------------+
	//	+---------------------------+--------------------------+
	//	| DMORIENT_POTRAIT 0x0001   | "Portrait" orientation.  |
	//	+---------------------------+--------------------------+
	//	| DMORIENT_LANDSCAPE 0x0002 | "Landscape" orientation. |
	//	+---------------------------+--------------------------+
	Orientation int16 `idl:"name:dmOrientation" json:"orientation"`
	// dmPaperSize (2 bytes): For printers, the size of the output media. If the DM_PAPERSIZE
	// bit is set in dmFields, the value of this field SHOULD<95> be one of the following,
	// or it MAY be a device-specific value that is greater than or equal to 0x0100.
	//
	//	+----------------------------------------------+---------------------------------------------------------+
	//	|                                              |                                                         |
	//	|                  NAME/VALUE                  |                       DESCRIPTION                       |
	//	|                                              |                                                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_LETTER 0x0001                        | Letter, 8 1/2 x 11 inches                               |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_LEGAL 0x0005                         | Legal, 8 1/2 x 14 inches                                |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_10X14 0x0010                         | 10 x 14-inch sheet                                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_11X17 0x0011                         | 11 x 17-inch sheet                                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_12X11 0x005A                         | 12 x 11-inch sheet                                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A3 0x0008                            | A3 sheet, 297 x 420 millimeters                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A3_ROTATED 0x004C                    | A3 rotated sheet, 420 x 297 millimeters                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A4 0x0009                            | A4 sheet, 210 x 297 millimeters                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A4_ROTATED 0x004D                    | A4 rotated sheet, 297 x 210 millimeters                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A4SMALL 0x000A                       | A4 small sheet, 210 x 297 millimeters                   |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A5 0x000B                            | A5 sheet, 148 x 210 millimeters                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A5_ROTATED 0x004E                    | A5 rotated sheet, 210 x 148 millimeters                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A6 0x0046                            | A6 sheet, 105 x 148 millimeters                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_A6_ROTATED 0x0053                    | A6 rotated sheet, 148 x 105 millimeters                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_B4 0x000C                            | B4 sheet, 250 x 354 millimeters                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_B4_JIS_ROTATED 0x004F                | B4 (JIS) rotated sheet, 364 x 257 millimeters           |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_B5 0x000D                            | B5 sheet, 182 x 257-millimeter paper                    |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_B5_JIS_ROTATED 0x0050                | B5 (JIS) rotated sheet, 257 x 182 millimeters           |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_B6_JIS 0x0058                        | B6 (JIS) sheet, 128 x 182 millimeters                   |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_B6_JIS_ROTATED 0x0059                | B6 (JIS) rotated sheet, 182 x 128 millimeters           |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_CSHEET 0x0018                        | C Sheet, 17 x 22 inches                                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_DBL_JAPANESE_POSTCARD 0x0045         | Double Japanese Postcard, 200 x 148 millimeters         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED 0x0052 | Double Japanese Postcard Rotated, 148 x 200 millimeters |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_DSHEET 0x0019                        | D Sheet, 22 x 34 inches                                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_9 0x0013                         | #9 Envelope, 3 7/8 x 8 7/8 inches                       |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_10 0x0014                        | #10 Envelope, 4 1/8 x 9 1/2 inches                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_11 0x0015                        | #11 Envelope, 4 1/2 x 10 3/8 inches                     |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_12 0x0016                        | #12 Envelope, 4 3/4 x 11 inches                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_14 0x0017                        | #14 Envelope, 5 x 11 1/2 inches                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_C5 0x001C                        | C5 Envelope, 162 x 229 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_C3 0x001D                        | C3 Envelope, 324 x 458 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_C4 0x001E                        | C4 Envelope, 229 x 324 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_C6 0x001F                        | C6 Envelope, 114 x 162 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_C65 0x0020                       | C65 Envelope, 114 x 229 millimeters                     |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_B4 0x0021                        | B4 Envelope, 250 x 353 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_B5 0x0022                        | B5 Envelope, 176 x 250 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_B6 0x0023                        | B6 Envelope, 176 x 125 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_DL 0x001B                        | DL Envelope, 110 x 220 millimeters                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_ITALY 0x0024                     | Italy Envelope, 110 x 230 millimeters                   |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_MONARCH 0x0025                   | Monarch Envelope, 3 7/8 x 7 1/2 inches                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ENV_PERSONAL 0x0026                  | 6 3/4 Envelope, 3 5/8 x 6 1/2 inches                    |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_ESHEET 0x001A                        | E Sheet, 34 x 44 inches                                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_EXECUTIVE 0x0007                     | Executive, 7 1/4 x 10 1/2 inches                        |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_FANFOLD_US 0x0027                    | US Std Fanfold, 14 7/8 x 11 inches                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_FANFOLD_STD_GERMAN 0x0028            | German Std Fanfold, 8 1/2 x 12 inches                   |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_FANFOLD_LGL_GERMAN 0x0029            | German Legal Fanfold, 8 x 13 inches                     |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_FOLIO 0x000E                         | Folio, 8 1/2 x 13-inch paper                            |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JAPANESE_POSTCARD_ROTATED 0x0051     | Japanese Postcard Rotated, 148 x 100 millimeters        |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_CHOU3 0x0049                    | Japanese Envelope Chou #3                               |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_CHOU3_ROTATED 0x0056            | Japanese Envelope Chou #3 Rotated                       |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_CHOU4 0x004A                    | Japanese Envelope Chou #4                               |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_CHOU4_ROTATED 0x0057            | Japanese Envelope Chou #4 Rotated                       |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_KAKU2 0x0047                    | Japanese Envelope Kaku #2                               |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_KAKU2_ROTATED 0x0054            | Japanese Envelope Kaku #2 Rotated                       |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_KAKU3 0x0048                    | Japanese Envelope Kaku #3                               |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_KAKU3_ROTATED 0x0055            | Japanese Envelope Kaku #3 Rotated                       |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_YOU4 0x005B                     | Japanese Envelope You #4                                |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_JENV_YOU4_ROTATED 0x005C             | Japanese Envelope You #4 Rotated                        |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_LEDGER 0x0004                        | Ledger, 17 x 11 inches                                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_LETTER_ROTATED 0x004B                | Letter Rotated, 11 by 8 1/2 inches                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_LETTERSMALL 0x0002                   | Letter Small, 8 1/2 x 11 inches                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_NOTE 0x0012                          | Note, 8 1/2 x 11-inches                                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_P16K 0x005D                          | PRC 16K, 146 x 215 millimeters                          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_P16K_ROTATED 0x006A                  | PRC 16K Rotated, 215 x 146 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_P32K 0x005E                          | PRC 32K, 97 x 151 millimeters                           |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_P32K_ROTATED 0x006B                  | PRC 32K Rotated, 151 x 97 millimeters                   |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_P32KBIG 0x005F                       | PRC 32K(Big) 97 x 151 millimeters                       |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_P32KBIG_ROTATED 0x006C               | PRC 32K(Big) Rotated, 151 x 97 millimeters              |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_1 0x0060                        | PRC Envelope #1, 102 by 165 millimeters                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_1_ROTATED 0x006D                | PRC Envelope #1 Rotated, 165 x 102 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_2 0x0061                        | PRC Envelope #2, 102 x 176 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_2_ROTATED 0x006E                | PRC Envelope #2 Rotated, 176 x 102 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_3 0x0062                        | PRC Envelope #3, 125 x 176 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_3_ROTATED 0x006F                | PRC Envelope #3 Rotated, 176 x 125 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_4 0x0063                        | PRC Envelope #4, 110 x 208 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_4_ROTATED 0x0070                | PRC Envelope #4 Rotated, 208 x 110 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_5 0x0064                        | PRC Envelope #5, 110 x 220 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_5_ROTATED 0x0071                | PRC Envelope #5 Rotated, 220 x 110 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_6 0x0065                        | PRC Envelope #6, 120 x 230 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_6_ROTATED 0x0072                | PRC Envelope #6 Rotated, 230 x 120 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_7 0x0066                        | PRC Envelope #7, 160 x 230 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_7_ROTATED 0x0073                | PRC Envelope #7 Rotated, 230 x 160 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_8 0x0067                        | PRC Envelope #8, 120 x 309 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_8_ROTATED 0x0074                | PRC Envelope #8 Rotated, 309 x 120 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_9 0x0068                        | PRC Envelope #9, 229 x 324 millimeters                  |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_9_ROTATED 0x0075                | PRC Envelope #9 Rotated, 324 x 229 millimeters          |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_10 0x0069                       | PRC Envelope #10, 324 x 458 millimeters                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_PENV_10_ROTATED 0x0076               | PRC Envelope #10 Rotated, 458 x 324 millimeters         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_QUARTO 0x000F                        | Quarto, 215 x 275 millimeter paper                      |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_STATEMENT 0x0006                     | Statement, 5 1/2 x 8 1/2 inches                         |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| DMPAPER_TABLOID 0x0003                       | Tabloid, 11 x 17 inches                                 |
	//	+----------------------------------------------+---------------------------------------------------------+
	//	| 0x0100 ≤ value                               | The value is device-specific.                           |
	//	+----------------------------------------------+---------------------------------------------------------+
	PaperSize int16 `idl:"name:dmPaperSize" json:"paper_size"`
	// dmPaperLength (2 bytes): If the DM_PAPERLENGTH bit is set in the dmFields field,
	// this field specifies the length of the paper, in tenths of a millimeter, to use in
	// the printer for which the job is destined.
	PaperLength int16 `idl:"name:dmPaperLength" json:"paper_length"`
	// dmPaperWidth (2 bytes): If the DM_PAPERWIDTH bit is set in the dmFields field, this
	// field specifies the width of the paper, in tenths of a millimeter, to use in the
	// printer for which the job is destined.
	PaperWidth int16 `idl:"name:dmPaperWidth" json:"paper_width"`
	// dmScale (2 bytes): If the DM_SCALE bit is set in the dmFields field, this field specifies
	// the percentage factor by which the printed output is to be scaled.
	Scale int16 `idl:"name:dmScale" json:"scale"`
	// dmCopies (2 bytes): If the DM_COPIES bit is set in the dmFields field, this field
	// specifies the number of copies to be printed, if the device supports multiple-page
	// copies.
	Copies int16 `idl:"name:dmCopies" json:"copies"`
	// dmDefaultSource (2 bytes): If the DM_DEFAULTSOURCE bit is set in the dmFields field,
	// this field specifies the paper source.
	//
	// The value of this field SHOULD be one of the following, or it MAY be a device-specific
	// value that is greater than or equal to 0x0100.
	//
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	|                            |                                                                                  |
	//	|         NAME/VALUE         |                                   DESCRIPTION                                    |
	//	|                            |                                                                                  |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_UPPER 0x0001         | Select the upper paper bin. This value is also used for the paper source for     |
	//	|                            | printers that only have one paper bin.                                           |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_LOWER 0x0002         | Select the lower bin.                                                            |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_MIDDLE 0x0003        | Select the middle paper bin.                                                     |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_MANUAL 0x0004        | Manually select the paper bin.                                                   |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_ENVELOPE 0x0005      | Select the auto envelope bin.                                                    |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_ENVMANUAL 0x0006     | Select the manual envelope bin.                                                  |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_AUTO 0x0007          | Auto-select the bin.                                                             |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_TRACTOR 0x0008       | Select the bin with the tractor paper.                                           |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_SMALLFMT 0x0009      | Select the bin with the smaller paper format.                                    |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_LARGEFMT 0x000A      | Select the bin with the larger paper format.                                     |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_LARGECAPACITY 0x000B | Select the bin with large capacity.                                              |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_CASSETTE 0x000E      | Select the cassette bin.                                                         |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| DMBIN_FORMSOURCE 0x000F    | Select the bin with the required form.                                           |
	//	+----------------------------+----------------------------------------------------------------------------------+
	DefaultSource int16 `idl:"name:dmDefaultSource" json:"default_source"`
	// dmPrintQuality (2 bytes): If the DM_PRINTQUALITY bit is set in the dmFields field,
	// this field specifies the printer resolution. The value of this field MUST be either
	// a positive value that specifies a device-dependent resolution in dots per inch (DPI)
	// or one of the following four predefined device-independent values that are mapped
	// to a device-specific resolution in an implementation-specific manner.
	//
	//	+---------------------+-----------------------------+
	//	|                     |                             |
	//	|     NAME/VALUE      |         DESCRIPTION         |
	//	|                     |                             |
	//	+---------------------+-----------------------------+
	//	+---------------------+-----------------------------+
	//	| DMRES_HIGH 0xFFFC   | High-resolution printouts   |
	//	+---------------------+-----------------------------+
	//	| DMRES_MEDIUM 0xFFFD | Medium-resolution printouts |
	//	+---------------------+-----------------------------+
	//	| DMRES_LOW 0xFFFE    | Low-resolution printouts    |
	//	+---------------------+-----------------------------+
	//	| DMRES_DRAFT 0xFFFF  | Draft-resolution printouts  |
	//	+---------------------+-----------------------------+
	PrintQuality int16 `idl:"name:dmPrintQuality" json:"print_quality"`
	// dmColor (2 bytes): If the DM_COLOR bit is set in the dmFields field, this field specifies
	// the color mode to use with color printers. The value of this field MUST be one of
	// the following.
	//
	//	+-------------------------+-------------------------------+
	//	|                         |                               |
	//	|       NAME/VALUE        |          DESCRIPTION          |
	//	|                         |                               |
	//	+-------------------------+-------------------------------+
	//	+-------------------------+-------------------------------+
	//	| DMRES_MONOCHROME 0x0001 | Use monochrome printing mode. |
	//	+-------------------------+-------------------------------+
	//	| DMRES_COLOR 0x0002      | Use color printing mode.      |
	//	+-------------------------+-------------------------------+
	Color int16 `idl:"name:dmColor" json:"color"`
	// dmDuplex (2 bytes): If the DM_DUPLEX bit is set in the dmFields field, this field
	// specifies duplex or double-sided printing for printers that are capable of duplex
	// printing. The value of this field MUST be one of the following.
	//
	//	+-------------------------+-----------------------------------------------------------------------+
	//	|                         |                                                                       |
	//	|       NAME/VALUE        |                              DESCRIPTION                              |
	//	|                         |                                                                       |
	//	+-------------------------+-----------------------------------------------------------------------+
	//	+-------------------------+-----------------------------------------------------------------------+
	//	| DMDUP_SIMPLEX 0x0001    | Normal (non-duplex) printing.                                         |
	//	+-------------------------+-----------------------------------------------------------------------+
	//	| DMDUP_VERTICAL 0x0002   | Long-edge binding; that is, the long edge of the page is vertical.    |
	//	+-------------------------+-----------------------------------------------------------------------+
	//	| DMDUP_HORIZONTAL 0x0003 | Short-edge binding; that is, the long edge of the page is horizontal. |
	//	+-------------------------+-----------------------------------------------------------------------+
	Duplex int16 `idl:"name:dmDuplex" json:"duplex"`
	// dmYResolution (2 bytes): If the DM_YRESOLUTION bit is set in the dmFields, this field
	// specifies the y-resolution, in dots per inch, of the printer.
	YResolution int16 `idl:"name:dmYResolution" json:"y_resolution"`
	// dmTTOption (2 bytes): If the DM_TTOPTION bit is set in the dmFields field, this field
	// specifies how TrueType fonts MUST be printed. The value of this field MUST be one
	// of the following.
	//
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	|                              |                                                                                  |
	//	|          NAME/VALUE          |                                   DESCRIPTION                                    |
	//	|                              |                                                                                  |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DMTT_BITMAP 0x0001           | Prints TrueType fonts as graphics. This is the default action for dot-matrix     |
	//	|                              | printers.                                                                        |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DMTT_DOWNLOAD 0x0002         | Downloads TrueType fonts as soft fonts. This is the default action for           |
	//	|                              | Hewlett-Packard printers that use printer control language (PCL).                |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DMTT_SUBDEV 0x0003           | Substitutes device fonts for TrueType fonts. This is the default action for      |
	//	|                              | PostScript printers.                                                             |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DMTT_DOWNLOAD_OUTLINE 0x0004 | Downloads TrueType fonts as outline soft fonts.<96>                              |
	//	+------------------------------+----------------------------------------------------------------------------------+
	TTOption int16 `idl:"name:dmTTOption" json:"tt_option"`
	// dmCollate (2 bytes): If the DM_COLLATE bit is set in the dmFields field, this field
	// specifies whether collation is used when printing multiple copies. The value of this
	// field is one of the following:
	//
	//	+------------------------+-----------------------------------------------+
	//	|                        |                                               |
	//	|       NAME/VALUE       |                  DESCRIPTION                  |
	//	|                        |                                               |
	//	+------------------------+-----------------------------------------------+
	//	+------------------------+-----------------------------------------------+
	//	| DMCOLLATE_FALSE 0x0000 | Do not collate when printing multiple copies. |
	//	+------------------------+-----------------------------------------------+
	//	| DMCOLLATE_TRUE 0x0001  | Collate when printing multiple copies.        |
	//	+------------------------+-----------------------------------------------+
	Collate int16 `idl:"name:dmCollate" json:"collate"`
	// dmFormName (64 bytes): This field is a 32-element array of 16-bit Unicode characters.
	// If the DM_FORMNAME bit is set in the dmFields field, this field specifies the name
	// of the form to use, for example, "Letter" or "Legal". The value of this field is
	// restricted to 32 characters, including the trailing null. Form names that are longer
	// than 32 characters, including the trailing null, are truncated to fit the array.
	FormName []uint16 `idl:"name:dmFormName" json:"form_name"`
	// reserved0 (2 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint16 `idl:"name:reserved0"`
	// reserved1 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved1"`
	// reserved2 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved2"`
	// reserved3 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved3"`
	// dmNup (4 bytes): If the DM_NUP bit is set in the dmFields, this field specifies the
	// responsibility for performing page layout for N-Up Printing. It is one of the following
	// values:
	//
	//	+-------------------------+----------------------------------------+
	//	|                         |                                        |
	//	|       NAME/VALUE        |              DESCRIPTION               |
	//	|                         |                                        |
	//	+-------------------------+----------------------------------------+
	//	+-------------------------+----------------------------------------+
	//	| DMNUP_SYSTEM 0x00000001 | The print server does the page layout. |
	//	+-------------------------+----------------------------------------+
	//	| DMNUP_ONEUP 0x00000002  | The application does the page layout.  |
	//	+-------------------------+----------------------------------------+
	NUp uint32 `idl:"name:dmNup" json:"nup"`
	// reserved4 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved4"`
	// dmICMMethod (4 bytes): If the DM_ICMMETHOD bit is set in the dmFields field, this
	// field specifies how Image Color Management (ICM) is handled. For a non-ICM application,
	// this field determines if ICM is enabled or disabled. For ICM applications, the system
	// examines this field to determine how to handle ICM support. The value of this field
	// is one of the following predefined values or a printer driver-defined value greater
	// than or equal to 0x00000100.
	//
	//	+-------------------------------+----------------------------------------------------------------------------------+
	//	|                               |                                                                                  |
	//	|          NAME/VALUE           |                                   DESCRIPTION                                    |
	//	|                               |                                                                                  |
	//	+-------------------------------+----------------------------------------------------------------------------------+
	//	+-------------------------------+----------------------------------------------------------------------------------+
	//	| DMICMMETHOD_NONE 0x00000001   | Specifies that ICM is disabled.                                                  |
	//	+-------------------------------+----------------------------------------------------------------------------------+
	//	| DMICMMETHOD_SYSTEM 0x00000002 | Specifies that ICM is handled by the system on which the page description        |
	//	|                               | language (PDL) data is generated.                                                |
	//	+-------------------------------+----------------------------------------------------------------------------------+
	//	| DMICMMETHOD_DRIVER 0x00000003 | Specifies that ICM is handled by the printer driver.                             |
	//	+-------------------------------+----------------------------------------------------------------------------------+
	//	| DMICMMETHOD_DEVICE 0x00000004 | Specifies that ICM is handled by the destination device.                         |
	//	+-------------------------------+----------------------------------------------------------------------------------+
	ICMMethod uint32 `idl:"name:dmICMMethod" json:"icm_method"`
	// dmICMIntent (4 bytes): If the DM_ICMINTENT bit is set in the dmFields field, this
	// field specifies which color matching method, or intent, is used by default. This
	// field is primarily for non-ICM applications. ICM applications can establish intents
	// by using the ICM functions. The value of this field is one of the following predefined
	// values, or a printer driver defined value greater than or equal to 0x00000100.
	//
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	//	|                                   |                                                                                  |
	//	|            NAME/VALUE             |                                   DESCRIPTION                                    |
	//	|                                   |                                                                                  |
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	//	| DMICM_SATURATE 0x00000001         | Color matching SHOULD be optimized for color saturation.                         |
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	//	| DMICM_CONTRAST 0x00000002         | Color matching SHOULD optimize for color contrast.                               |
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	//	| DMICM_COLORIMETRIC 0x00000003     | Color matching SHOULD optimize to match the exact color requested.               |
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	//	| DMICM_ABS_COLORIMETRIC 0x00000004 | Color matching SHOULD optimize to match the exact color requested without white  |
	//	|                                   | point mapping.                                                                   |
	//	+-----------------------------------+----------------------------------------------------------------------------------+
	ICMIntent uint32 `idl:"name:dmICMIntent" json:"icm_intent"`
	// dmMediaType (4 bytes): If the DM_MEDIATYPE bit is set in the dmFields field, this
	// field specifies the type of media to print on. The value of this field is one of
	// the following predefined values or else a printer driver-defined value greater than
	// or equal to 0x00000100.
	//
	//	+---------------------------------+------------------+
	//	|                                 |                  |
	//	|           NAME/VALUE            |   DESCRIPTION    |
	//	|                                 |                  |
	//	+---------------------------------+------------------+
	//	+---------------------------------+------------------+
	//	| DMMEDIA_STANDARD 0x00000001     | Plain paper      |
	//	+---------------------------------+------------------+
	//	| DMMEDIA_TRANSPARENCY 0x00000002 | Transparent film |
	//	+---------------------------------+------------------+
	//	| DMMEDIA_GLOSSY 0x00000003       | Glossy paper     |
	//	+---------------------------------+------------------+
	MediaType uint32 `idl:"name:dmMediaType" json:"media_type"`
	// dmDitherType (4 bytes): If the DM_DITHERTYPE bit is set in the dmFields field, this
	// field specifies how dithering is to be done. The value of this field is one of the
	// following predefined values or else a printer driver-defined value greater than or
	// equal to 0x00000100.
	//
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	|                                    |                                                                                  |
	//	|             NAME/VALUE             |                                   DESCRIPTION                                    |
	//	|                                    |                                                                                  |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_NONE 0x00000001           | No dithering.                                                                    |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_COARSE 0x00000002         | Dithering with a coarse brush.                                                   |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_FINE 0x00000003           | Dithering with a fine brush.                                                     |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_LINEART 0x00000004        | Line art dithering, a special dithering method that produces well defined        |
	//	|                                    | borders between black, white, and gray scaling.                                  |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_ERRORDIFFUSION 0x00000005 | Error diffusion dithering.<97>                                                   |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_RESERVED6 0x00000006      | Same as DMDITHER_LINEART.                                                        |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_RESERVED7 0x00000007      | Same as DMDITHER_LINEART.                                                        |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_RESERVED8 0x00000008      | Same as DMDITHER_LINEART.                                                        |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_RESERVED9 0x00000009      | Same as DMDITHER_LINEART.                                                        |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	//	| DMDITHER_GRAYSCALE 0x0000000A      | Device does gray scaling.                                                        |
	//	+------------------------------------+----------------------------------------------------------------------------------+
	DitherType uint32 `idl:"name:dmDitherType" json:"dither_type"`
	// reserved5 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved5"`
	// reserved6 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved6"`
	// reserved7 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved7"`
	// reserved8 (4 bytes): A value that SHOULD be zero when sent and MUST be ignored on
	// receipt.
	_ uint32 `idl:"name:reserved8"`
}

func (o *DevMode) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DevMode) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	for i1 := range o.DeviceName {
		i1 := i1
		if uint64(i1) >= 32 {
			break
		}
		if err := w.WriteData(o.DeviceName[i1]); err != nil {
			return err
		}
	}
	for i1 := len(o.DeviceName); uint64(i1) < 32; i1++ {
		if err := w.WriteData(uint16(0)); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.SpecVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.DriverVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if err := w.WriteData(o.DriverExtra); err != nil {
		return err
	}
	if err := w.WriteData(o.Fields); err != nil {
		return err
	}
	if err := w.WriteData(o.Orientation); err != nil {
		return err
	}
	if err := w.WriteData(o.PaperSize); err != nil {
		return err
	}
	if err := w.WriteData(o.PaperLength); err != nil {
		return err
	}
	if err := w.WriteData(o.PaperWidth); err != nil {
		return err
	}
	if err := w.WriteData(o.Scale); err != nil {
		return err
	}
	if err := w.WriteData(o.Copies); err != nil {
		return err
	}
	if err := w.WriteData(o.DefaultSource); err != nil {
		return err
	}
	if err := w.WriteData(o.PrintQuality); err != nil {
		return err
	}
	if err := w.WriteData(o.Color); err != nil {
		return err
	}
	if err := w.WriteData(o.Duplex); err != nil {
		return err
	}
	if err := w.WriteData(o.YResolution); err != nil {
		return err
	}
	if err := w.WriteData(o.TTOption); err != nil {
		return err
	}
	if err := w.WriteData(o.Collate); err != nil {
		return err
	}
	for i1 := range o.FormName {
		i1 := i1
		if uint64(i1) >= 32 {
			break
		}
		if err := w.WriteData(o.FormName[i1]); err != nil {
			return err
		}
	}
	for i1 := len(o.FormName); uint64(i1) < 32; i1++ {
		if err := w.WriteData(uint16(0)); err != nil {
			return err
		}
	}
	// reserved reserved0
	if err := w.WriteData(uint16(0)); err != nil {
		return err
	}
	// reserved reserved1
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved reserved2
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved reserved3
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	if err := w.WriteData(o.NUp); err != nil {
		return err
	}
	// reserved reserved4
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	if err := w.WriteData(o.ICMMethod); err != nil {
		return err
	}
	if err := w.WriteData(o.ICMIntent); err != nil {
		return err
	}
	if err := w.WriteData(o.MediaType); err != nil {
		return err
	}
	if err := w.WriteData(o.DitherType); err != nil {
		return err
	}
	// reserved reserved5
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved reserved6
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved reserved7
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved reserved8
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	return nil
}
func (o *DevMode) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	o.DeviceName = make([]uint16, 32)
	for i1 := range o.DeviceName {
		i1 := i1
		if err := w.ReadData(&o.DeviceName[i1]); err != nil {
			return err
		}
	}
	if err := w.ReadData(&o.SpecVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.DriverVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	if err := w.ReadData(&o.DriverExtra); err != nil {
		return err
	}
	if err := w.ReadData(&o.Fields); err != nil {
		return err
	}
	if err := w.ReadData(&o.Orientation); err != nil {
		return err
	}
	if err := w.ReadData(&o.PaperSize); err != nil {
		return err
	}
	if err := w.ReadData(&o.PaperLength); err != nil {
		return err
	}
	if err := w.ReadData(&o.PaperWidth); err != nil {
		return err
	}
	if err := w.ReadData(&o.Scale); err != nil {
		return err
	}
	if err := w.ReadData(&o.Copies); err != nil {
		return err
	}
	if err := w.ReadData(&o.DefaultSource); err != nil {
		return err
	}
	if err := w.ReadData(&o.PrintQuality); err != nil {
		return err
	}
	if err := w.ReadData(&o.Color); err != nil {
		return err
	}
	if err := w.ReadData(&o.Duplex); err != nil {
		return err
	}
	if err := w.ReadData(&o.YResolution); err != nil {
		return err
	}
	if err := w.ReadData(&o.TTOption); err != nil {
		return err
	}
	if err := w.ReadData(&o.Collate); err != nil {
		return err
	}
	o.FormName = make([]uint16, 32)
	for i1 := range o.FormName {
		i1 := i1
		if err := w.ReadData(&o.FormName[i1]); err != nil {
			return err
		}
	}
	// reserved reserved0
	var _reserved0 uint16
	if err := w.ReadData(&_reserved0); err != nil {
		return err
	}
	// reserved reserved1
	var _reserved1 uint32
	if err := w.ReadData(&_reserved1); err != nil {
		return err
	}
	// reserved reserved2
	var _reserved2 uint32
	if err := w.ReadData(&_reserved2); err != nil {
		return err
	}
	// reserved reserved3
	var _reserved3 uint32
	if err := w.ReadData(&_reserved3); err != nil {
		return err
	}
	if err := w.ReadData(&o.NUp); err != nil {
		return err
	}
	// reserved reserved4
	var _reserved4 uint32
	if err := w.ReadData(&_reserved4); err != nil {
		return err
	}
	if err := w.ReadData(&o.ICMMethod); err != nil {
		return err
	}
	if err := w.ReadData(&o.ICMIntent); err != nil {
		return err
	}
	if err := w.ReadData(&o.MediaType); err != nil {
		return err
	}
	if err := w.ReadData(&o.DitherType); err != nil {
		return err
	}
	// reserved reserved5
	var _reserved5 uint32
	if err := w.ReadData(&_reserved5); err != nil {
		return err
	}
	// reserved reserved6
	var _reserved6 uint32
	if err := w.ReadData(&_reserved6); err != nil {
		return err
	}
	// reserved reserved7
	var _reserved7 uint32
	if err := w.ReadData(&_reserved7); err != nil {
		return err
	}
	// reserved reserved8
	var _reserved8 uint32
	if err := w.ReadData(&_reserved8); err != nil {
		return err
	}
	return nil
}

// DocInfo1 structure represents DOC_INFO_1 RPC structure.
//
// The DOC_INFO_1 structure describes a document that is printed.
type DocInfo1 struct {
	// pDocName: An optional pointer to a string that provides the name of the document.
	// If this member is NULL, the print server SHOULD use an implementation-specific default
	// job name.<22>
	DocName string `idl:"name:pDocName;string" json:"doc_name"`
	// pOutputFile: An optional pointer to a string that specifies the name of an output
	// file. For rules governing path names, see section 2.2.4.9.
	OutputFile string `idl:"name:pOutputFile;string" json:"output_file"`
	// pDatatype: An optional pointer to a string that identifies the type of data used
	// to record the document. For rules governing data type names, see section 2.2.4.2.
	DataType string `idl:"name:pDatatype;string" json:"data_type"`
}

func (o *DocInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DocInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.DocName != "" {
		_ptr_pDocName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DocName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DocName, _ptr_pDocName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.OutputFile != "" {
		_ptr_pOutputFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.OutputFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.OutputFile, _ptr_pOutputFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataType != "" {
		_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DocInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pDocName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DocName); err != nil {
			return err
		}
		return nil
	})
	_s_pDocName := func(ptr interface{}) { o.DocName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DocName, _s_pDocName, _ptr_pDocName); err != nil {
		return err
	}
	_ptr_pOutputFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.OutputFile); err != nil {
			return err
		}
		return nil
	})
	_s_pOutputFile := func(ptr interface{}) { o.OutputFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.OutputFile, _s_pOutputFile, _ptr_pOutputFile); err != nil {
		return err
	}
	_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
		return err
	}
	return nil
}

// DriverInfo1 structure represents DRIVER_INFO_1 RPC structure.
//
// The _DRIVER_INFO_1 structure specifies printer driver information. It is a custom-marshaled
// form of the _DRIVER_INFO_1 (section 2.2.1.5.1) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The DRIVER_INFO_1 structure provides information about a printer driver.
//
// All members not defined in this section are specified in sections 2.2.1.3.1 and 2.2.1.3.
type DriverInfo1 struct {
	Name string `idl:"name:pName;string" json:"name"`
}

func (o *DriverInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	return nil
}

// DriverInfo2 structure represents DRIVER_INFO_2 RPC structure.
//
// The _DRIVER_INFO_2 structure specifies printer driver information. It is a custom-marshaled
// form of the _DRIVER_INFO_2 (section 2.2.1.5.2) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The DRIVER_INFO_2 structure provides information about a printer driver.
//
// All members not defined in this section are specified in sections 2.2.1.3.1 and 2.2.1.3.
type DriverInfo2 struct {
	VersionCount uint32 `idl:"name:cVersion" json:"version_count"`
	Name         string `idl:"name:pName;string" json:"name"`
	Environment  string `idl:"name:pEnvironment;string" json:"environment"`
	DriverPath   string `idl:"name:pDriverPath;string" json:"driver_path"`
	DataFile     string `idl:"name:pDataFile;string" json:"data_file"`
	ConfigFile   string `idl:"name:pConfigFile;string" json:"config_file"`
}

func (o *DriverInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.VersionCount); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Environment != "" {
		_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverPath != "" {
		_ptr_pDriverPath := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverPath); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverPath, _ptr_pDriverPath); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataFile != "" {
		_ptr_pDataFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataFile, _ptr_pDataFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ConfigFile != "" {
		_ptr_pConfigFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ConfigFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ConfigFile, _ptr_pConfigFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.VersionCount); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
		return nil
	})
	_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
		return err
	}
	_ptr_pDriverPath := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverPath); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverPath := func(ptr interface{}) { o.DriverPath = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverPath, _s_pDriverPath, _ptr_pDriverPath); err != nil {
		return err
	}
	_ptr_pDataFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataFile); err != nil {
			return err
		}
		return nil
	})
	_s_pDataFile := func(ptr interface{}) { o.DataFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataFile, _s_pDataFile, _ptr_pDataFile); err != nil {
		return err
	}
	_ptr_pConfigFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ConfigFile); err != nil {
			return err
		}
		return nil
	})
	_s_pConfigFile := func(ptr interface{}) { o.ConfigFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.ConfigFile, _s_pConfigFile, _ptr_pConfigFile); err != nil {
		return err
	}
	return nil
}

// DriverInfo3 structure represents RPC_DRIVER_INFO_3 RPC structure.
//
// The RPC_DRIVER_INFO_3 structure provides information about a printer driver.<23>
//
// All members not defined in this section are specified in sections 2.2.1.3.1 and 2.2.1.3.
type DriverInfo3 struct {
	VersionCount         uint32 `idl:"name:cVersion" json:"version_count"`
	Name                 string `idl:"name:pName;string" json:"name"`
	Environment          string `idl:"name:pEnvironment;string" json:"environment"`
	DriverPath           string `idl:"name:pDriverPath;string" json:"driver_path"`
	DataFile             string `idl:"name:pDataFile;string" json:"data_file"`
	ConfigFile           string `idl:"name:pConfigFile;string" json:"config_file"`
	HelpFile             string `idl:"name:pHelpFile;string" json:"help_file"`
	MonitorName          string `idl:"name:pMonitorName;string" json:"monitor_name"`
	DefaultDataType      string `idl:"name:pDefaultDataType;string" json:"default_data_type"`
	DependentFilesLength uint32 `idl:"name:cchDependentFiles" json:"dependent_files_length"`
	DependentFiles       string `idl:"name:pDependentFiles;size_is:(cchDependentFiles);pointer:unique" json:"dependent_files"`
}

func (o *DriverInfo3) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.DependentFiles != "" && o.DependentFilesLength == 0 {
		o.DependentFilesLength = uint32(ndr.UTF16Len(o.DependentFiles))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.VersionCount); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Environment != "" {
		_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverPath != "" {
		_ptr_pDriverPath := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverPath); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverPath, _ptr_pDriverPath); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataFile != "" {
		_ptr_pDataFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataFile, _ptr_pDataFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ConfigFile != "" {
		_ptr_pConfigFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ConfigFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ConfigFile, _ptr_pConfigFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.HelpFile != "" {
		_ptr_pHelpFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.HelpFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.HelpFile, _ptr_pHelpFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MonitorName != "" {
		_ptr_pMonitorName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorName, _ptr_pMonitorName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DefaultDataType != "" {
		_ptr_pDefaultDataType := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DefaultDataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DefaultDataType, _ptr_pDefaultDataType); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DependentFilesLength); err != nil {
		return err
	}
	if o.DependentFiles != "" || o.DependentFilesLength > 0 {
		_ptr_pDependentFiles := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.DependentFilesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_DependentFiles_buf := utf16.Encode([]rune(o.DependentFiles))
			if uint64(len(_DependentFiles_buf)) > sizeInfo[0] {
				_DependentFiles_buf = _DependentFiles_buf[:sizeInfo[0]]
			}
			for i1 := range _DependentFiles_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_DependentFiles_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_DependentFiles_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.DependentFiles, _ptr_pDependentFiles); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.VersionCount); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
		return nil
	})
	_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
		return err
	}
	_ptr_pDriverPath := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverPath); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverPath := func(ptr interface{}) { o.DriverPath = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverPath, _s_pDriverPath, _ptr_pDriverPath); err != nil {
		return err
	}
	_ptr_pDataFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataFile); err != nil {
			return err
		}
		return nil
	})
	_s_pDataFile := func(ptr interface{}) { o.DataFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataFile, _s_pDataFile, _ptr_pDataFile); err != nil {
		return err
	}
	_ptr_pConfigFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ConfigFile); err != nil {
			return err
		}
		return nil
	})
	_s_pConfigFile := func(ptr interface{}) { o.ConfigFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.ConfigFile, _s_pConfigFile, _ptr_pConfigFile); err != nil {
		return err
	}
	_ptr_pHelpFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.HelpFile); err != nil {
			return err
		}
		return nil
	})
	_s_pHelpFile := func(ptr interface{}) { o.HelpFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.HelpFile, _s_pHelpFile, _ptr_pHelpFile); err != nil {
		return err
	}
	_ptr_pMonitorName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorName := func(ptr interface{}) { o.MonitorName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MonitorName, _s_pMonitorName, _ptr_pMonitorName); err != nil {
		return err
	}
	_ptr_pDefaultDataType := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DefaultDataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDefaultDataType := func(ptr interface{}) { o.DefaultDataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DefaultDataType, _s_pDefaultDataType, _ptr_pDefaultDataType); err != nil {
		return err
	}
	if err := w.ReadData(&o.DependentFilesLength); err != nil {
		return err
	}
	_ptr_pDependentFiles := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.DependentFilesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.DependentFilesLength)
		}
		var _DependentFiles_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _DependentFiles_buf", sizeInfo[0])
		}
		_DependentFiles_buf = make([]uint16, sizeInfo[0])
		for i1 := range _DependentFiles_buf {
			i1 := i1
			if err := w.ReadData(&_DependentFiles_buf[i1]); err != nil {
				return err
			}
		}
		o.DependentFiles = strings.TrimRight(string(utf16.Decode(_DependentFiles_buf)), ndr.ZeroString)
		return nil
	})
	_s_pDependentFiles := func(ptr interface{}) { o.DependentFiles = *ptr.(*string) }
	if err := w.ReadPointer(&o.DependentFiles, _s_pDependentFiles, _ptr_pDependentFiles); err != nil {
		return err
	}
	return nil
}

// DriverInfo4 structure represents RPC_DRIVER_INFO_4 RPC structure.
//
// The RPC_DRIVER_INFO_4 structure provides information about a printer driver.<24>
//
// All members not defined in this section are specified in sections 2.2.1.3.1 and 2.2.1.3.
type DriverInfo4 struct {
	VersionCount         uint32 `idl:"name:cVersion" json:"version_count"`
	Name                 string `idl:"name:pName;string" json:"name"`
	Environment          string `idl:"name:pEnvironment;string" json:"environment"`
	DriverPath           string `idl:"name:pDriverPath;string" json:"driver_path"`
	DataFile             string `idl:"name:pDataFile;string" json:"data_file"`
	ConfigFile           string `idl:"name:pConfigFile;string" json:"config_file"`
	HelpFile             string `idl:"name:pHelpFile;string" json:"help_file"`
	MonitorName          string `idl:"name:pMonitorName;string" json:"monitor_name"`
	DefaultDataType      string `idl:"name:pDefaultDataType;string" json:"default_data_type"`
	DependentFilesLength uint32 `idl:"name:cchDependentFiles" json:"dependent_files_length"`
	DependentFiles       string `idl:"name:pDependentFiles;size_is:(cchDependentFiles);pointer:unique" json:"dependent_files"`
	PreviousNamesLength  uint32 `idl:"name:cchPreviousNames" json:"previous_names_length"`
	PreviousNames        string `idl:"name:pszzPreviousNames;size_is:(cchPreviousNames);pointer:unique" json:"previous_names"`
}

func (o *DriverInfo4) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.DependentFiles != "" && o.DependentFilesLength == 0 {
		o.DependentFilesLength = uint32(ndr.UTF16Len(o.DependentFiles))
	}
	if o.PreviousNames != "" && o.PreviousNamesLength == 0 {
		o.PreviousNamesLength = uint32(ndr.UTF16Len(o.PreviousNames))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo4) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.VersionCount); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Environment != "" {
		_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverPath != "" {
		_ptr_pDriverPath := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverPath); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverPath, _ptr_pDriverPath); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataFile != "" {
		_ptr_pDataFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataFile, _ptr_pDataFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ConfigFile != "" {
		_ptr_pConfigFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ConfigFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ConfigFile, _ptr_pConfigFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.HelpFile != "" {
		_ptr_pHelpFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.HelpFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.HelpFile, _ptr_pHelpFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MonitorName != "" {
		_ptr_pMonitorName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorName, _ptr_pMonitorName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DefaultDataType != "" {
		_ptr_pDefaultDataType := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DefaultDataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DefaultDataType, _ptr_pDefaultDataType); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DependentFilesLength); err != nil {
		return err
	}
	if o.DependentFiles != "" || o.DependentFilesLength > 0 {
		_ptr_pDependentFiles := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.DependentFilesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_DependentFiles_buf := utf16.Encode([]rune(o.DependentFiles))
			if uint64(len(_DependentFiles_buf)) > sizeInfo[0] {
				_DependentFiles_buf = _DependentFiles_buf[:sizeInfo[0]]
			}
			for i1 := range _DependentFiles_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_DependentFiles_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_DependentFiles_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.DependentFiles, _ptr_pDependentFiles); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.PreviousNamesLength); err != nil {
		return err
	}
	if o.PreviousNames != "" || o.PreviousNamesLength > 0 {
		_ptr_pszzPreviousNames := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.PreviousNamesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_PreviousNames_buf := utf16.Encode([]rune(o.PreviousNames))
			if uint64(len(_PreviousNames_buf)) > sizeInfo[0] {
				_PreviousNames_buf = _PreviousNames_buf[:sizeInfo[0]]
			}
			for i1 := range _PreviousNames_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_PreviousNames_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_PreviousNames_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PreviousNames, _ptr_pszzPreviousNames); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverInfo4) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.VersionCount); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
		return nil
	})
	_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
		return err
	}
	_ptr_pDriverPath := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverPath); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverPath := func(ptr interface{}) { o.DriverPath = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverPath, _s_pDriverPath, _ptr_pDriverPath); err != nil {
		return err
	}
	_ptr_pDataFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataFile); err != nil {
			return err
		}
		return nil
	})
	_s_pDataFile := func(ptr interface{}) { o.DataFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataFile, _s_pDataFile, _ptr_pDataFile); err != nil {
		return err
	}
	_ptr_pConfigFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ConfigFile); err != nil {
			return err
		}
		return nil
	})
	_s_pConfigFile := func(ptr interface{}) { o.ConfigFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.ConfigFile, _s_pConfigFile, _ptr_pConfigFile); err != nil {
		return err
	}
	_ptr_pHelpFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.HelpFile); err != nil {
			return err
		}
		return nil
	})
	_s_pHelpFile := func(ptr interface{}) { o.HelpFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.HelpFile, _s_pHelpFile, _ptr_pHelpFile); err != nil {
		return err
	}
	_ptr_pMonitorName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorName := func(ptr interface{}) { o.MonitorName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MonitorName, _s_pMonitorName, _ptr_pMonitorName); err != nil {
		return err
	}
	_ptr_pDefaultDataType := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DefaultDataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDefaultDataType := func(ptr interface{}) { o.DefaultDataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DefaultDataType, _s_pDefaultDataType, _ptr_pDefaultDataType); err != nil {
		return err
	}
	if err := w.ReadData(&o.DependentFilesLength); err != nil {
		return err
	}
	_ptr_pDependentFiles := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.DependentFilesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.DependentFilesLength)
		}
		var _DependentFiles_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _DependentFiles_buf", sizeInfo[0])
		}
		_DependentFiles_buf = make([]uint16, sizeInfo[0])
		for i1 := range _DependentFiles_buf {
			i1 := i1
			if err := w.ReadData(&_DependentFiles_buf[i1]); err != nil {
				return err
			}
		}
		o.DependentFiles = strings.TrimRight(string(utf16.Decode(_DependentFiles_buf)), ndr.ZeroString)
		return nil
	})
	_s_pDependentFiles := func(ptr interface{}) { o.DependentFiles = *ptr.(*string) }
	if err := w.ReadPointer(&o.DependentFiles, _s_pDependentFiles, _ptr_pDependentFiles); err != nil {
		return err
	}
	if err := w.ReadData(&o.PreviousNamesLength); err != nil {
		return err
	}
	_ptr_pszzPreviousNames := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.PreviousNamesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.PreviousNamesLength)
		}
		var _PreviousNames_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _PreviousNames_buf", sizeInfo[0])
		}
		_PreviousNames_buf = make([]uint16, sizeInfo[0])
		for i1 := range _PreviousNames_buf {
			i1 := i1
			if err := w.ReadData(&_PreviousNames_buf[i1]); err != nil {
				return err
			}
		}
		o.PreviousNames = strings.TrimRight(string(utf16.Decode(_PreviousNames_buf)), ndr.ZeroString)
		return nil
	})
	_s_pszzPreviousNames := func(ptr interface{}) { o.PreviousNames = *ptr.(*string) }
	if err := w.ReadPointer(&o.PreviousNames, _s_pszzPreviousNames, _ptr_pszzPreviousNames); err != nil {
		return err
	}
	return nil
}

// DriverInfo6 structure represents RPC_DRIVER_INFO_6 RPC structure.
//
// The RPC_DRIVER_INFO_6 structure provides extended printer driver information.<25>
//
// All members not defined in this section are specified in sections 2.2.1.3.1 and 2.2.1.3.
type DriverInfo6 struct {
	VersionCount         uint32         `idl:"name:cVersion" json:"version_count"`
	Name                 string         `idl:"name:pName;string" json:"name"`
	Environment          string         `idl:"name:pEnvironment;string" json:"environment"`
	DriverPath           string         `idl:"name:pDriverPath;string" json:"driver_path"`
	DataFile             string         `idl:"name:pDataFile;string" json:"data_file"`
	ConfigFile           string         `idl:"name:pConfigFile;string" json:"config_file"`
	HelpFile             string         `idl:"name:pHelpFile;string" json:"help_file"`
	MonitorName          string         `idl:"name:pMonitorName;string" json:"monitor_name"`
	DefaultDataType      string         `idl:"name:pDefaultDataType;string" json:"default_data_type"`
	DependentFilesLength uint32         `idl:"name:cchDependentFiles" json:"dependent_files_length"`
	DependentFiles       string         `idl:"name:pDependentFiles;size_is:(cchDependentFiles);pointer:unique" json:"dependent_files"`
	PreviousNamesLength  uint32         `idl:"name:cchPreviousNames" json:"previous_names_length"`
	PreviousNames        string         `idl:"name:pszzPreviousNames;size_is:(cchPreviousNames);pointer:unique" json:"previous_names"`
	DriverDate           *dtyp.Filetime `idl:"name:ftDriverDate" json:"driver_date"`
	DriverVersion        uint64         `idl:"name:dwlDriverVersion" json:"driver_version"`
	ManufacturerName     string         `idl:"name:pMfgName;string" json:"manufacturer_name"`
	OEMURL               string         `idl:"name:pOEMUrl;string" json:"oem_url"`
	HardwareID           string         `idl:"name:pHardwareID;string" json:"hardware_id"`
	Provider             string         `idl:"name:pProvider;string" json:"provider"`
}

func (o *DriverInfo6) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.DependentFiles != "" && o.DependentFilesLength == 0 {
		o.DependentFilesLength = uint32(ndr.UTF16Len(o.DependentFiles))
	}
	if o.PreviousNames != "" && o.PreviousNamesLength == 0 {
		o.PreviousNamesLength = uint32(ndr.UTF16Len(o.PreviousNames))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo6) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteData(o.VersionCount); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Environment != "" {
		_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverPath != "" {
		_ptr_pDriverPath := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverPath); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverPath, _ptr_pDriverPath); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataFile != "" {
		_ptr_pDataFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataFile, _ptr_pDataFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ConfigFile != "" {
		_ptr_pConfigFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ConfigFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ConfigFile, _ptr_pConfigFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.HelpFile != "" {
		_ptr_pHelpFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.HelpFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.HelpFile, _ptr_pHelpFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MonitorName != "" {
		_ptr_pMonitorName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorName, _ptr_pMonitorName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DefaultDataType != "" {
		_ptr_pDefaultDataType := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DefaultDataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DefaultDataType, _ptr_pDefaultDataType); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DependentFilesLength); err != nil {
		return err
	}
	if o.DependentFiles != "" || o.DependentFilesLength > 0 {
		_ptr_pDependentFiles := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.DependentFilesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_DependentFiles_buf := utf16.Encode([]rune(o.DependentFiles))
			if uint64(len(_DependentFiles_buf)) > sizeInfo[0] {
				_DependentFiles_buf = _DependentFiles_buf[:sizeInfo[0]]
			}
			for i1 := range _DependentFiles_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_DependentFiles_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_DependentFiles_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.DependentFiles, _ptr_pDependentFiles); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.PreviousNamesLength); err != nil {
		return err
	}
	if o.PreviousNames != "" || o.PreviousNamesLength > 0 {
		_ptr_pszzPreviousNames := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.PreviousNamesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_PreviousNames_buf := utf16.Encode([]rune(o.PreviousNames))
			if uint64(len(_PreviousNames_buf)) > sizeInfo[0] {
				_PreviousNames_buf = _PreviousNames_buf[:sizeInfo[0]]
			}
			for i1 := range _PreviousNames_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_PreviousNames_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_PreviousNames_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PreviousNames, _ptr_pszzPreviousNames); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverDate != nil {
		if err := o.DriverDate.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.Filetime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DriverVersion); err != nil {
		return err
	}
	if o.ManufacturerName != "" {
		_ptr_pMfgName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ManufacturerName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ManufacturerName, _ptr_pMfgName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.OEMURL != "" {
		_ptr_pOEMUrl := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.OEMURL); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.OEMURL, _ptr_pOEMUrl); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.HardwareID != "" {
		_ptr_pHardwareID := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.HardwareID); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.HardwareID, _ptr_pHardwareID); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Provider != "" {
		_ptr_pProvider := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Provider); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Provider, _ptr_pProvider); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteTrailingGap(8); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo6) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadData(&o.VersionCount); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
		return nil
	})
	_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
		return err
	}
	_ptr_pDriverPath := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverPath); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverPath := func(ptr interface{}) { o.DriverPath = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverPath, _s_pDriverPath, _ptr_pDriverPath); err != nil {
		return err
	}
	_ptr_pDataFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataFile); err != nil {
			return err
		}
		return nil
	})
	_s_pDataFile := func(ptr interface{}) { o.DataFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataFile, _s_pDataFile, _ptr_pDataFile); err != nil {
		return err
	}
	_ptr_pConfigFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ConfigFile); err != nil {
			return err
		}
		return nil
	})
	_s_pConfigFile := func(ptr interface{}) { o.ConfigFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.ConfigFile, _s_pConfigFile, _ptr_pConfigFile); err != nil {
		return err
	}
	_ptr_pHelpFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.HelpFile); err != nil {
			return err
		}
		return nil
	})
	_s_pHelpFile := func(ptr interface{}) { o.HelpFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.HelpFile, _s_pHelpFile, _ptr_pHelpFile); err != nil {
		return err
	}
	_ptr_pMonitorName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorName := func(ptr interface{}) { o.MonitorName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MonitorName, _s_pMonitorName, _ptr_pMonitorName); err != nil {
		return err
	}
	_ptr_pDefaultDataType := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DefaultDataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDefaultDataType := func(ptr interface{}) { o.DefaultDataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DefaultDataType, _s_pDefaultDataType, _ptr_pDefaultDataType); err != nil {
		return err
	}
	if err := w.ReadData(&o.DependentFilesLength); err != nil {
		return err
	}
	_ptr_pDependentFiles := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.DependentFilesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.DependentFilesLength)
		}
		var _DependentFiles_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _DependentFiles_buf", sizeInfo[0])
		}
		_DependentFiles_buf = make([]uint16, sizeInfo[0])
		for i1 := range _DependentFiles_buf {
			i1 := i1
			if err := w.ReadData(&_DependentFiles_buf[i1]); err != nil {
				return err
			}
		}
		o.DependentFiles = strings.TrimRight(string(utf16.Decode(_DependentFiles_buf)), ndr.ZeroString)
		return nil
	})
	_s_pDependentFiles := func(ptr interface{}) { o.DependentFiles = *ptr.(*string) }
	if err := w.ReadPointer(&o.DependentFiles, _s_pDependentFiles, _ptr_pDependentFiles); err != nil {
		return err
	}
	if err := w.ReadData(&o.PreviousNamesLength); err != nil {
		return err
	}
	_ptr_pszzPreviousNames := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.PreviousNamesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.PreviousNamesLength)
		}
		var _PreviousNames_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _PreviousNames_buf", sizeInfo[0])
		}
		_PreviousNames_buf = make([]uint16, sizeInfo[0])
		for i1 := range _PreviousNames_buf {
			i1 := i1
			if err := w.ReadData(&_PreviousNames_buf[i1]); err != nil {
				return err
			}
		}
		o.PreviousNames = strings.TrimRight(string(utf16.Decode(_PreviousNames_buf)), ndr.ZeroString)
		return nil
	})
	_s_pszzPreviousNames := func(ptr interface{}) { o.PreviousNames = *ptr.(*string) }
	if err := w.ReadPointer(&o.PreviousNames, _s_pszzPreviousNames, _ptr_pszzPreviousNames); err != nil {
		return err
	}
	if o.DriverDate == nil {
		o.DriverDate = &dtyp.Filetime{}
	}
	if err := o.DriverDate.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.DriverVersion); err != nil {
		return err
	}
	_ptr_pMfgName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ManufacturerName); err != nil {
			return err
		}
		return nil
	})
	_s_pMfgName := func(ptr interface{}) { o.ManufacturerName = *ptr.(*string) }
	if err := w.ReadPointer(&o.ManufacturerName, _s_pMfgName, _ptr_pMfgName); err != nil {
		return err
	}
	_ptr_pOEMUrl := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.OEMURL); err != nil {
			return err
		}
		return nil
	})
	_s_pOEMUrl := func(ptr interface{}) { o.OEMURL = *ptr.(*string) }
	if err := w.ReadPointer(&o.OEMURL, _s_pOEMUrl, _ptr_pOEMUrl); err != nil {
		return err
	}
	_ptr_pHardwareID := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.HardwareID); err != nil {
			return err
		}
		return nil
	})
	_s_pHardwareID := func(ptr interface{}) { o.HardwareID = *ptr.(*string) }
	if err := w.ReadPointer(&o.HardwareID, _s_pHardwareID, _ptr_pHardwareID); err != nil {
		return err
	}
	_ptr_pProvider := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Provider); err != nil {
			return err
		}
		return nil
	})
	_s_pProvider := func(ptr interface{}) { o.Provider = *ptr.(*string) }
	if err := w.ReadPointer(&o.Provider, _s_pProvider, _ptr_pProvider); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(8); err != nil {
		return err
	}
	return nil
}

// DriverInfo8 structure represents RPC_DRIVER_INFO_8 RPC structure.
//
// The RPC_DRIVER_INFO_8 structure specifies extended printer driver information.<26>
type DriverInfo8 struct {
	VersionCount         uint32         `idl:"name:cVersion" json:"version_count"`
	Name                 string         `idl:"name:pName;string" json:"name"`
	Environment          string         `idl:"name:pEnvironment;string" json:"environment"`
	DriverPath           string         `idl:"name:pDriverPath;string" json:"driver_path"`
	DataFile             string         `idl:"name:pDataFile;string" json:"data_file"`
	ConfigFile           string         `idl:"name:pConfigFile;string" json:"config_file"`
	HelpFile             string         `idl:"name:pHelpFile;string" json:"help_file"`
	MonitorName          string         `idl:"name:pMonitorName;string" json:"monitor_name"`
	DefaultDataType      string         `idl:"name:pDefaultDataType;string" json:"default_data_type"`
	DependentFilesLength uint32         `idl:"name:cchDependentFiles" json:"dependent_files_length"`
	DependentFiles       string         `idl:"name:pDependentFiles;size_is:(cchDependentFiles);pointer:unique" json:"dependent_files"`
	PreviousNamesLength  uint32         `idl:"name:cchPreviousNames" json:"previous_names_length"`
	PreviousNames        string         `idl:"name:pszzPreviousNames;size_is:(cchPreviousNames);pointer:unique" json:"previous_names"`
	DriverDate           *dtyp.Filetime `idl:"name:ftDriverDate" json:"driver_date"`
	DriverVersion        uint64         `idl:"name:dwlDriverVersion" json:"driver_version"`
	ManufacturerName     string         `idl:"name:pMfgName;string" json:"manufacturer_name"`
	OEMURL               string         `idl:"name:pOEMUrl;string" json:"oem_url"`
	HardwareID           string         `idl:"name:pHardwareID;string" json:"hardware_id"`
	Provider             string         `idl:"name:pProvider;string" json:"provider"`
	// pPrintProcessor: A pointer to a string that specifies the print processor for this
	// printer. For rules governing print processor names, see section 2.2.4.11.
	PrintProcessor string `idl:"name:pPrintProcessor;string" json:"print_processor"`
	// pVendorSetup: An optional pointer to a string that specifies the name of the vendor
	// setup file used for hardware vendor-provided custom setup.
	VendorSetup string `idl:"name:pVendorSetup;string" json:"vendor_setup"`
	// cchColorProfiles: The number of characters in the multisz structure pointed to by
	// the pszzColorProfiles member.
	ColorProfilesLength uint32 `idl:"name:cchColorProfiles" json:"color_profiles_length"`
	// pszzColorProfiles: An optional pointer to a multisz structure that contains the names
	// of all color profile files for this driver.
	ColorProfiles string `idl:"name:pszzColorProfiles;size_is:(cchColorProfiles);pointer:unique" json:"color_profiles"`
	// pInfPath: An optional pointer to a string that specifies the path to the installation
	// configuration file in the driver store that identifies the printer driver for installation.<27>
	InfPath string `idl:"name:pInfPath;string" json:"inf_path"`
	// dwPrinterDriverAttributes: A bit field that specifies attributes of the printer driver.
	//
	// When used as an input parameter in a call to RpcAddPrinterDriverEx, this value MUST
	// be zero. When used as output in the custom-marshaled form of this structure (_DRIVER_INFO_8),
	// this bit field is defined as one or more of the bit flags described in the following
	// table.
	//
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	|                                               |                                                                                  |
	//	|                  NAME/VALUE                   |                                   DESCRIPTION                                    |
	//	|                                               |                                                                                  |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_PACKAGE_AWARE 0x00000001       | The printer driver is part of a driver package.<28>                              |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_XPS 0x00000002                 | The printer driver supports the Microsoft XML Paper Specification (XPS) format   |
	//	|                                               | described in [MSFT-XMLPAPER].<29>                                                |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_SANDBOX_ENABLED 0x00000004     | The printer driver is compatible with printer driver isolation.<30>              |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_CLASS 0x00000008               | The printer driver is a class printer driver.<31>                                |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_DERIVED 0x00000010             | The printer driver is a derived printer driver.<32>                              |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_NOT_SHAREABLE 0x00000020       | Printers using the printer driver cannot be shared.<33>                          |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_CATEGORY_FAX 0x00000040        | The printer driver is intended for use with fax printers.<34>                    |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_CATEGORY_FILE 00x00000080      | The printer driver is intended for use with file printers.<35>                   |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_CATEGORY_VIRTUAL 0x00000100    | The printer driver is intended for use with virtual printers.<36>                |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_CATEGORY_SERVICE 0x00000200    | The printer driver is intended for use with service printers.<37>                |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_SOFT_RESET_REQUIRED 0x00000400 | Printers using this printer driver SHOULD use an implementation-specific         |
	//	|                                               | mechanism to reset the printer when a print job is canceled.<38>                 |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_DRIVER_CATEGORY_3D 0x00001000         | The printer driver is intended for use with 3D printers.<39>                     |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	PrinterDriverAttributes uint32 `idl:"name:dwPrinterDriverAttributes" json:"printer_driver_attributes"`
	// cchCoreDependencies: The number of characters in the multisz structure pointed to
	// by the pszzCoreDriverDependencies member.
	CoreDependenciesLength uint32 `idl:"name:cchCoreDependencies" json:"core_dependencies_length"`
	// pszzCoreDriverDependencies: An optional pointer to a multisz structure that contains
	// the names of the core dependencies as specified by the installation configuration
	// file. These names specify the core sections of the installation configuration file
	// that are required by the printer driver.<40>
	CoreDriverDependencies string `idl:"name:pszzCoreDriverDependencies;size_is:(cchCoreDependencies);pointer:unique" json:"core_driver_dependencies"`
	// ftMinInboxDriverVerDate: A FILETIME value ([MS-DTYP] section 2.3.3) that specifies
	// the minimum date version that is required in order for any core printer driver to
	// be used as a dependency as listed in the multisz structure pointed to by the pszzCoreDriverDependencies
	// member. The value of this member MUST be specified in the same format as the ftDriverDate
	// member.<41>
	MinInboxDriverVerDate *dtyp.Filetime `idl:"name:ftMinInboxDriverVerDate" json:"min_inbox_driver_ver_date"`
	// dwlMinInboxDriverVerVersion: The minimum file version that is required for any core
	// printer driver to be used as a dependency as listed in the multisz structure pointed
	// to by the pszzCoreDriverDependencies member. The value of this member MUST be specified
	// in the same format as the dwlDriverVersion member.<42>
	//
	// All members not defined in this section are specified in sections 2.2.1.3.1 and 2.2.1.3.
	MinInboxDriverVerVersion uint64 `idl:"name:dwlMinInboxDriverVerVersion" json:"min_inbox_driver_ver_version"`
}

func (o *DriverInfo8) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.DependentFiles != "" && o.DependentFilesLength == 0 {
		o.DependentFilesLength = uint32(ndr.UTF16Len(o.DependentFiles))
	}
	if o.PreviousNames != "" && o.PreviousNamesLength == 0 {
		o.PreviousNamesLength = uint32(ndr.UTF16Len(o.PreviousNames))
	}
	if o.ColorProfiles != "" && o.ColorProfilesLength == 0 {
		o.ColorProfilesLength = uint32(ndr.UTF16Len(o.ColorProfiles))
	}
	if o.CoreDriverDependencies != "" && o.CoreDependenciesLength == 0 {
		o.CoreDependenciesLength = uint32(ndr.UTF16Len(o.CoreDriverDependencies))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo8) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteData(o.VersionCount); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Environment != "" {
		_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverPath != "" {
		_ptr_pDriverPath := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverPath); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverPath, _ptr_pDriverPath); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataFile != "" {
		_ptr_pDataFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataFile, _ptr_pDataFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ConfigFile != "" {
		_ptr_pConfigFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ConfigFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ConfigFile, _ptr_pConfigFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.HelpFile != "" {
		_ptr_pHelpFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.HelpFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.HelpFile, _ptr_pHelpFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MonitorName != "" {
		_ptr_pMonitorName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorName, _ptr_pMonitorName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DefaultDataType != "" {
		_ptr_pDefaultDataType := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DefaultDataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DefaultDataType, _ptr_pDefaultDataType); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DependentFilesLength); err != nil {
		return err
	}
	if o.DependentFiles != "" || o.DependentFilesLength > 0 {
		_ptr_pDependentFiles := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.DependentFilesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_DependentFiles_buf := utf16.Encode([]rune(o.DependentFiles))
			if uint64(len(_DependentFiles_buf)) > sizeInfo[0] {
				_DependentFiles_buf = _DependentFiles_buf[:sizeInfo[0]]
			}
			for i1 := range _DependentFiles_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_DependentFiles_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_DependentFiles_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.DependentFiles, _ptr_pDependentFiles); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.PreviousNamesLength); err != nil {
		return err
	}
	if o.PreviousNames != "" || o.PreviousNamesLength > 0 {
		_ptr_pszzPreviousNames := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.PreviousNamesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_PreviousNames_buf := utf16.Encode([]rune(o.PreviousNames))
			if uint64(len(_PreviousNames_buf)) > sizeInfo[0] {
				_PreviousNames_buf = _PreviousNames_buf[:sizeInfo[0]]
			}
			for i1 := range _PreviousNames_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_PreviousNames_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_PreviousNames_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PreviousNames, _ptr_pszzPreviousNames); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverDate != nil {
		if err := o.DriverDate.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.Filetime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DriverVersion); err != nil {
		return err
	}
	if o.ManufacturerName != "" {
		_ptr_pMfgName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ManufacturerName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ManufacturerName, _ptr_pMfgName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.OEMURL != "" {
		_ptr_pOEMUrl := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.OEMURL); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.OEMURL, _ptr_pOEMUrl); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.HardwareID != "" {
		_ptr_pHardwareID := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.HardwareID); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.HardwareID, _ptr_pHardwareID); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Provider != "" {
		_ptr_pProvider := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Provider); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Provider, _ptr_pProvider); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrintProcessor != "" {
		_ptr_pPrintProcessor := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessor); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrintProcessor, _ptr_pPrintProcessor); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.VendorSetup != "" {
		_ptr_pVendorSetup := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.VendorSetup); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.VendorSetup, _ptr_pVendorSetup); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.ColorProfilesLength); err != nil {
		return err
	}
	if o.ColorProfiles != "" || o.ColorProfilesLength > 0 {
		_ptr_pszzColorProfiles := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.ColorProfilesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_ColorProfiles_buf := utf16.Encode([]rune(o.ColorProfiles))
			if uint64(len(_ColorProfiles_buf)) > sizeInfo[0] {
				_ColorProfiles_buf = _ColorProfiles_buf[:sizeInfo[0]]
			}
			for i1 := range _ColorProfiles_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_ColorProfiles_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_ColorProfiles_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.ColorProfiles, _ptr_pszzColorProfiles); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.InfPath != "" {
		_ptr_pInfPath := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.InfPath); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.InfPath, _ptr_pInfPath); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.PrinterDriverAttributes); err != nil {
		return err
	}
	if err := w.WriteData(o.CoreDependenciesLength); err != nil {
		return err
	}
	if o.CoreDriverDependencies != "" || o.CoreDependenciesLength > 0 {
		_ptr_pszzCoreDriverDependencies := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.CoreDependenciesLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_CoreDriverDependencies_buf := utf16.Encode([]rune(o.CoreDriverDependencies))
			if uint64(len(_CoreDriverDependencies_buf)) > sizeInfo[0] {
				_CoreDriverDependencies_buf = _CoreDriverDependencies_buf[:sizeInfo[0]]
			}
			for i1 := range _CoreDriverDependencies_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_CoreDriverDependencies_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_CoreDriverDependencies_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.CoreDriverDependencies, _ptr_pszzCoreDriverDependencies); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MinInboxDriverVerDate != nil {
		if err := o.MinInboxDriverVerDate.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.Filetime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.MinInboxDriverVerVersion); err != nil {
		return err
	}
	return nil
}
func (o *DriverInfo8) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadData(&o.VersionCount); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
		return nil
	})
	_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
		return err
	}
	_ptr_pDriverPath := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverPath); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverPath := func(ptr interface{}) { o.DriverPath = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverPath, _s_pDriverPath, _ptr_pDriverPath); err != nil {
		return err
	}
	_ptr_pDataFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataFile); err != nil {
			return err
		}
		return nil
	})
	_s_pDataFile := func(ptr interface{}) { o.DataFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataFile, _s_pDataFile, _ptr_pDataFile); err != nil {
		return err
	}
	_ptr_pConfigFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ConfigFile); err != nil {
			return err
		}
		return nil
	})
	_s_pConfigFile := func(ptr interface{}) { o.ConfigFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.ConfigFile, _s_pConfigFile, _ptr_pConfigFile); err != nil {
		return err
	}
	_ptr_pHelpFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.HelpFile); err != nil {
			return err
		}
		return nil
	})
	_s_pHelpFile := func(ptr interface{}) { o.HelpFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.HelpFile, _s_pHelpFile, _ptr_pHelpFile); err != nil {
		return err
	}
	_ptr_pMonitorName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorName := func(ptr interface{}) { o.MonitorName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MonitorName, _s_pMonitorName, _ptr_pMonitorName); err != nil {
		return err
	}
	_ptr_pDefaultDataType := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DefaultDataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDefaultDataType := func(ptr interface{}) { o.DefaultDataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DefaultDataType, _s_pDefaultDataType, _ptr_pDefaultDataType); err != nil {
		return err
	}
	if err := w.ReadData(&o.DependentFilesLength); err != nil {
		return err
	}
	_ptr_pDependentFiles := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.DependentFilesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.DependentFilesLength)
		}
		var _DependentFiles_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _DependentFiles_buf", sizeInfo[0])
		}
		_DependentFiles_buf = make([]uint16, sizeInfo[0])
		for i1 := range _DependentFiles_buf {
			i1 := i1
			if err := w.ReadData(&_DependentFiles_buf[i1]); err != nil {
				return err
			}
		}
		o.DependentFiles = strings.TrimRight(string(utf16.Decode(_DependentFiles_buf)), ndr.ZeroString)
		return nil
	})
	_s_pDependentFiles := func(ptr interface{}) { o.DependentFiles = *ptr.(*string) }
	if err := w.ReadPointer(&o.DependentFiles, _s_pDependentFiles, _ptr_pDependentFiles); err != nil {
		return err
	}
	if err := w.ReadData(&o.PreviousNamesLength); err != nil {
		return err
	}
	_ptr_pszzPreviousNames := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.PreviousNamesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.PreviousNamesLength)
		}
		var _PreviousNames_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _PreviousNames_buf", sizeInfo[0])
		}
		_PreviousNames_buf = make([]uint16, sizeInfo[0])
		for i1 := range _PreviousNames_buf {
			i1 := i1
			if err := w.ReadData(&_PreviousNames_buf[i1]); err != nil {
				return err
			}
		}
		o.PreviousNames = strings.TrimRight(string(utf16.Decode(_PreviousNames_buf)), ndr.ZeroString)
		return nil
	})
	_s_pszzPreviousNames := func(ptr interface{}) { o.PreviousNames = *ptr.(*string) }
	if err := w.ReadPointer(&o.PreviousNames, _s_pszzPreviousNames, _ptr_pszzPreviousNames); err != nil {
		return err
	}
	if o.DriverDate == nil {
		o.DriverDate = &dtyp.Filetime{}
	}
	if err := o.DriverDate.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.DriverVersion); err != nil {
		return err
	}
	_ptr_pMfgName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ManufacturerName); err != nil {
			return err
		}
		return nil
	})
	_s_pMfgName := func(ptr interface{}) { o.ManufacturerName = *ptr.(*string) }
	if err := w.ReadPointer(&o.ManufacturerName, _s_pMfgName, _ptr_pMfgName); err != nil {
		return err
	}
	_ptr_pOEMUrl := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.OEMURL); err != nil {
			return err
		}
		return nil
	})
	_s_pOEMUrl := func(ptr interface{}) { o.OEMURL = *ptr.(*string) }
	if err := w.ReadPointer(&o.OEMURL, _s_pOEMUrl, _ptr_pOEMUrl); err != nil {
		return err
	}
	_ptr_pHardwareID := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.HardwareID); err != nil {
			return err
		}
		return nil
	})
	_s_pHardwareID := func(ptr interface{}) { o.HardwareID = *ptr.(*string) }
	if err := w.ReadPointer(&o.HardwareID, _s_pHardwareID, _ptr_pHardwareID); err != nil {
		return err
	}
	_ptr_pProvider := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Provider); err != nil {
			return err
		}
		return nil
	})
	_s_pProvider := func(ptr interface{}) { o.Provider = *ptr.(*string) }
	if err := w.ReadPointer(&o.Provider, _s_pProvider, _ptr_pProvider); err != nil {
		return err
	}
	_ptr_pPrintProcessor := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessor); err != nil {
			return err
		}
		return nil
	})
	_s_pPrintProcessor := func(ptr interface{}) { o.PrintProcessor = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrintProcessor, _s_pPrintProcessor, _ptr_pPrintProcessor); err != nil {
		return err
	}
	_ptr_pVendorSetup := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.VendorSetup); err != nil {
			return err
		}
		return nil
	})
	_s_pVendorSetup := func(ptr interface{}) { o.VendorSetup = *ptr.(*string) }
	if err := w.ReadPointer(&o.VendorSetup, _s_pVendorSetup, _ptr_pVendorSetup); err != nil {
		return err
	}
	if err := w.ReadData(&o.ColorProfilesLength); err != nil {
		return err
	}
	_ptr_pszzColorProfiles := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.ColorProfilesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.ColorProfilesLength)
		}
		var _ColorProfiles_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _ColorProfiles_buf", sizeInfo[0])
		}
		_ColorProfiles_buf = make([]uint16, sizeInfo[0])
		for i1 := range _ColorProfiles_buf {
			i1 := i1
			if err := w.ReadData(&_ColorProfiles_buf[i1]); err != nil {
				return err
			}
		}
		o.ColorProfiles = strings.TrimRight(string(utf16.Decode(_ColorProfiles_buf)), ndr.ZeroString)
		return nil
	})
	_s_pszzColorProfiles := func(ptr interface{}) { o.ColorProfiles = *ptr.(*string) }
	if err := w.ReadPointer(&o.ColorProfiles, _s_pszzColorProfiles, _ptr_pszzColorProfiles); err != nil {
		return err
	}
	_ptr_pInfPath := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.InfPath); err != nil {
			return err
		}
		return nil
	})
	_s_pInfPath := func(ptr interface{}) { o.InfPath = *ptr.(*string) }
	if err := w.ReadPointer(&o.InfPath, _s_pInfPath, _ptr_pInfPath); err != nil {
		return err
	}
	if err := w.ReadData(&o.PrinterDriverAttributes); err != nil {
		return err
	}
	if err := w.ReadData(&o.CoreDependenciesLength); err != nil {
		return err
	}
	_ptr_pszzCoreDriverDependencies := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.CoreDependenciesLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.CoreDependenciesLength)
		}
		var _CoreDriverDependencies_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _CoreDriverDependencies_buf", sizeInfo[0])
		}
		_CoreDriverDependencies_buf = make([]uint16, sizeInfo[0])
		for i1 := range _CoreDriverDependencies_buf {
			i1 := i1
			if err := w.ReadData(&_CoreDriverDependencies_buf[i1]); err != nil {
				return err
			}
		}
		o.CoreDriverDependencies = strings.TrimRight(string(utf16.Decode(_CoreDriverDependencies_buf)), ndr.ZeroString)
		return nil
	})
	_s_pszzCoreDriverDependencies := func(ptr interface{}) { o.CoreDriverDependencies = *ptr.(*string) }
	if err := w.ReadPointer(&o.CoreDriverDependencies, _s_pszzCoreDriverDependencies, _ptr_pszzCoreDriverDependencies); err != nil {
		return err
	}
	if o.MinInboxDriverVerDate == nil {
		o.MinInboxDriverVerDate = &dtyp.Filetime{}
	}
	if err := o.MinInboxDriverVerDate.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.MinInboxDriverVerVersion); err != nil {
		return err
	}
	return nil
}

// FormInfo1 structure represents FORM_INFO_1 RPC structure.
//
// The FORM_INFO_1 structure provides information about a printer form.
//
// All members not defined in this section are specified in sections 2.2.1.3.2 and 2.2.1.3.
//
// The _FORM_INFO_1 structure specifies printer media information. It is a custom-marshaled
// form of the _FORM_INFO_1 (section 2.2.1.6.1) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type FormInfo1 struct {
	Flags         uint32     `idl:"name:Flags" json:"flags"`
	Name          string     `idl:"name:pName;string" json:"name"`
	Size          *Size      `idl:"name:Size" json:"size"`
	ImageableArea *Rectangle `idl:"name:ImageableArea" json:"imageable_area"`
}

func (o *FormInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *FormInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Size != nil {
		if err := o.Size.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&Size{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if o.ImageableArea != nil {
		if err := o.ImageableArea.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&Rectangle{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *FormInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	if o.Size == nil {
		o.Size = &Size{}
	}
	if err := o.Size.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if o.ImageableArea == nil {
		o.ImageableArea = &Rectangle{}
	}
	if err := o.ImageableArea.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// FormInfo2 structure represents RPC_FORM_INFO_2 RPC structure.
//
// The RPC_FORM_INFO_2 structure provides information about a printer form that includes
// its origin, dimensions, the dimensions of its printable area, and its display name.<43>
type FormInfo2 struct {
	Flags         uint32     `idl:"name:Flags" json:"flags"`
	Name          string     `idl:"name:pName;string;pointer:unique" json:"name"`
	Size          *Size      `idl:"name:Size" json:"size"`
	ImageableArea *Rectangle `idl:"name:ImageableArea" json:"imageable_area"`
	// pKeyword: This member MUST be set to NULL by the client if the value of the Flags
	// member is set to FORM_BUILTIN; otherwise, this member is a pointer to a string that
	// specifies a unique, localization-independent identifier for this form.<44>
	Keyword string `idl:"name:pKeyword;string;pointer:unique" json:"keyword"`
	// StringType: A value that specifies how a form's display name is passed. The value
	// of this member MUST be a value from the following table.
	//
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	|                            |                                                                                  |
	//	|         NAME/VALUE         |                                   DESCRIPTION                                    |
	//	|                            |                                                                                  |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| STRING_NONE 0x00000001     | Use the default display name, a string that is pointed to by the pName member.   |
	//	|                            | No localized display name exists.                                                |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| STRING_MUIDLL 0x00000002   | Load the form name from the library of string resources that is identified by    |
	//	|                            | the pMuiDll member. The dwResourceId member specifies the ID of the form name    |
	//	|                            | string in that library.                                                          |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| STRING_LANGPAIR 0x00000004 | Use the form name, a string that is pointed to by the pDisplayName member, and   |
	//	|                            | the language that is identified by the wLangID member.                           |
	//	+----------------------------+----------------------------------------------------------------------------------+
	StringType uint32 `idl:"name:StringType" json:"string_type"`
	// pMuiDll: A NULL pointer and MUST be ignored on receipt if StringType is not equal
	// to STRING_MUIDLL, or it is a pointer to a string that contains the name of a library
	// of string resources. String resources can be localized into multiple languages.<45>
	MUIDLL string `idl:"name:pMuiDll;string;pointer:unique" json:"mui_dll"`
	// dwResourceId: The value of this member SHOULD be set to zero when sent and ignored
	// on receipt if the value of the StringType member is not equal to STRING_MUIDLL; otherwise,
	// the value of this member specifies the string resource ID of the form name in the
	// library that is identified by the string that is pointed to by the pMuiDll member.
	ResourceID uint32 `idl:"name:dwResourceId" json:"resource_id"`
	// pDisplayName: A NULL pointer and ignored on receipt if StringType is not equal to
	// STRING_LANGPAIR; otherwise, this member is a pointer to a string that specifies the
	// form name.
	DisplayName string `idl:"name:pDisplayName;string;pointer:unique" json:"display_name"`
	// wLangID: The value of this member SHOULD be set to zero when sent and ignored on
	// receipt if StringType is not equal to STRING_LANGPAIR; otherwise, the value of this
	// member MUST be the Language Identifier of the pDisplayName member [MS-LCID].
	//
	// All members not defined in this section are specified in sections 2.2.1.3.2 and 2.2.1.3.
	LangID uint16 `idl:"name:wLangID" json:"lang_id"`
}

func (o *FormInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *FormInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Size != nil {
		if err := o.Size.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&Size{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if o.ImageableArea != nil {
		if err := o.ImageableArea.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&Rectangle{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if o.Keyword != "" {
		_ptr_pKeyword := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteCharNString(ctx, w, o.Keyword); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Keyword, _ptr_pKeyword); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.StringType); err != nil {
		return err
	}
	if o.MUIDLL != "" {
		_ptr_pMuiDll := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MUIDLL); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MUIDLL, _ptr_pMuiDll); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.ResourceID); err != nil {
		return err
	}
	if o.DisplayName != "" {
		_ptr_pDisplayName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DisplayName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DisplayName, _ptr_pDisplayName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.LangID); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *FormInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	if o.Size == nil {
		o.Size = &Size{}
	}
	if err := o.Size.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if o.ImageableArea == nil {
		o.ImageableArea = &Rectangle{}
	}
	if err := o.ImageableArea.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	_ptr_pKeyword := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadCharNString(ctx, w, &o.Keyword); err != nil {
			return err
		}
		return nil
	})
	_s_pKeyword := func(ptr interface{}) { o.Keyword = *ptr.(*string) }
	if err := w.ReadPointer(&o.Keyword, _s_pKeyword, _ptr_pKeyword); err != nil {
		return err
	}
	if err := w.ReadData(&o.StringType); err != nil {
		return err
	}
	_ptr_pMuiDll := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MUIDLL); err != nil {
			return err
		}
		return nil
	})
	_s_pMuiDll := func(ptr interface{}) { o.MUIDLL = *ptr.(*string) }
	if err := w.ReadPointer(&o.MUIDLL, _s_pMuiDll, _ptr_pMuiDll); err != nil {
		return err
	}
	if err := w.ReadData(&o.ResourceID); err != nil {
		return err
	}
	_ptr_pDisplayName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DisplayName); err != nil {
			return err
		}
		return nil
	})
	_s_pDisplayName := func(ptr interface{}) { o.DisplayName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DisplayName, _s_pDisplayName, _ptr_pDisplayName); err != nil {
		return err
	}
	if err := w.ReadData(&o.LangID); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// JobInfo1 structure represents JOB_INFO_1 RPC structure.
//
// The _JOB_INFO_1 structure specifies print job information. It is a custom-marshaled
// form of the _JOB_INFO_1 (section 2.2.1.7.1) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The JOB_INFO_1 structure provides information about a print job.
//
// All members not defined in this section are specified in sections 2.2.1.3.3 and 2.2.1.3.
type JobInfo1 struct {
	JobID        uint32           `idl:"name:JobId" json:"job_id"`
	PrinterName  string           `idl:"name:pPrinterName;string" json:"printer_name"`
	MachineName  string           `idl:"name:pMachineName;string" json:"machine_name"`
	UserName     string           `idl:"name:pUserName;string" json:"user_name"`
	Document     string           `idl:"name:pDocument;string" json:"document"`
	DataType     string           `idl:"name:pDatatype;string" json:"data_type"`
	StatusString string           `idl:"name:__pStatus;string" json:"status_string"`
	Status       uint32           `idl:"name:Status" json:"status"`
	Priority     uint32           `idl:"name:Priority" json:"priority"`
	Position     uint32           `idl:"name:Position" json:"position"`
	TotalPages   uint32           `idl:"name:TotalPages" json:"total_pages"`
	PagesPrinted uint32           `idl:"name:PagesPrinted" json:"pages_printed"`
	Submitted    *dtyp.SystemTime `idl:"name:Submitted" json:"submitted"`
}

func (o *JobInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.JobID); err != nil {
		return err
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Document != "" {
		_ptr_pDocument := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Document); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Document, _ptr_pDocument); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataType != "" {
		_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.StatusString != "" {
		_ptr___pStatus := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.StatusString); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.StatusString, _ptr___pStatus); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if err := w.WriteData(o.Priority); err != nil {
		return err
	}
	if err := w.WriteData(o.Position); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalPages); err != nil {
		return err
	}
	if err := w.WriteData(o.PagesPrinted); err != nil {
		return err
	}
	if o.Submitted != nil {
		if err := o.Submitted.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.SystemTime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobID); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	_ptr_pDocument := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Document); err != nil {
			return err
		}
		return nil
	})
	_s_pDocument := func(ptr interface{}) { o.Document = *ptr.(*string) }
	if err := w.ReadPointer(&o.Document, _s_pDocument, _ptr_pDocument); err != nil {
		return err
	}
	_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
		return err
	}
	_ptr___pStatus := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.StatusString); err != nil {
			return err
		}
		return nil
	})
	_s___pStatus := func(ptr interface{}) { o.StatusString = *ptr.(*string) }
	if err := w.ReadPointer(&o.StatusString, _s___pStatus, _ptr___pStatus); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	if err := w.ReadData(&o.Priority); err != nil {
		return err
	}
	if err := w.ReadData(&o.Position); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalPages); err != nil {
		return err
	}
	if err := w.ReadData(&o.PagesPrinted); err != nil {
		return err
	}
	if o.Submitted == nil {
		o.Submitted = &dtyp.SystemTime{}
	}
	if err := o.Submitted.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// JobInfo2 structure represents JOB_INFO_2 RPC structure.
//
// The _JOB_INFO_2 structure specifies print job information. It is a custom-marshaled
// form of the _JOB_INFO_2 (section 2.2.1.7.2) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The JOB_INFO_2 structure provides information about a print job.
//
// All members not defined in this section are specified in sections 2.2.1.3.3 and 2.2.1.3.
type JobInfo2 struct {
	JobID              uint32           `idl:"name:JobId" json:"job_id"`
	PrinterName        string           `idl:"name:pPrinterName;string" json:"printer_name"`
	MachineName        string           `idl:"name:pMachineName;string" json:"machine_name"`
	UserName           string           `idl:"name:pUserName;string" json:"user_name"`
	Document           string           `idl:"name:pDocument;string" json:"document"`
	NotifyName         string           `idl:"name:pNotifyName;string" json:"notify_name"`
	DataType           string           `idl:"name:pDatatype;string" json:"data_type"`
	PrintProcessor     string           `idl:"name:pPrintProcessor;string" json:"print_processor"`
	Parameters         string           `idl:"name:pParameters;string" json:"parameters"`
	DriverName         string           `idl:"name:pDriverName;string" json:"driver_name"`
	DevMode            uint64           `idl:"name:pDevMode" json:"dev_mode"`
	StatusString       string           `idl:"name:__pStatus;string" json:"status_string"`
	SecurityDescriptor uint64           `idl:"name:pSecurityDescriptor" json:"security_descriptor"`
	Status             uint32           `idl:"name:Status" json:"status"`
	Priority           uint32           `idl:"name:Priority" json:"priority"`
	Position           uint32           `idl:"name:Position" json:"position"`
	StartTime          uint32           `idl:"name:StartTime" json:"start_time"`
	UntilTime          uint32           `idl:"name:UntilTime" json:"until_time"`
	TotalPages         uint32           `idl:"name:TotalPages" json:"total_pages"`
	Size               uint32           `idl:"name:Size" json:"size"`
	Submitted          *dtyp.SystemTime `idl:"name:Submitted" json:"submitted"`
	Time               uint32           `idl:"name:Time" json:"time"`
	PagesPrinted       uint32           `idl:"name:PagesPrinted" json:"pages_printed"`
}

func (o *JobInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.JobID); err != nil {
		return err
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Document != "" {
		_ptr_pDocument := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Document); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Document, _ptr_pDocument); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.NotifyName != "" {
		_ptr_pNotifyName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.NotifyName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.NotifyName, _ptr_pNotifyName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataType != "" {
		_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrintProcessor != "" {
		_ptr_pPrintProcessor := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessor); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrintProcessor, _ptr_pPrintProcessor); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Parameters != "" {
		_ptr_pParameters := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Parameters); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Parameters, _ptr_pParameters); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverName != "" {
		_ptr_pDriverName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverName, _ptr_pDriverName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(ndr.Uint3264(o.DevMode)); err != nil {
		return err
	}
	if o.StatusString != "" {
		_ptr___pStatus := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.StatusString); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.StatusString, _ptr___pStatus); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(ndr.Uint3264(o.SecurityDescriptor)); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if err := w.WriteData(o.Priority); err != nil {
		return err
	}
	if err := w.WriteData(o.Position); err != nil {
		return err
	}
	if err := w.WriteData(o.StartTime); err != nil {
		return err
	}
	if err := w.WriteData(o.UntilTime); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalPages); err != nil {
		return err
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if o.Submitted != nil {
		if err := o.Submitted.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.SystemTime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Time); err != nil {
		return err
	}
	if err := w.WriteData(o.PagesPrinted); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobID); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	_ptr_pDocument := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Document); err != nil {
			return err
		}
		return nil
	})
	_s_pDocument := func(ptr interface{}) { o.Document = *ptr.(*string) }
	if err := w.ReadPointer(&o.Document, _s_pDocument, _ptr_pDocument); err != nil {
		return err
	}
	_ptr_pNotifyName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.NotifyName); err != nil {
			return err
		}
		return nil
	})
	_s_pNotifyName := func(ptr interface{}) { o.NotifyName = *ptr.(*string) }
	if err := w.ReadPointer(&o.NotifyName, _s_pNotifyName, _ptr_pNotifyName); err != nil {
		return err
	}
	_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
		return err
	}
	_ptr_pPrintProcessor := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessor); err != nil {
			return err
		}
		return nil
	})
	_s_pPrintProcessor := func(ptr interface{}) { o.PrintProcessor = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrintProcessor, _s_pPrintProcessor, _ptr_pPrintProcessor); err != nil {
		return err
	}
	_ptr_pParameters := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Parameters); err != nil {
			return err
		}
		return nil
	})
	_s_pParameters := func(ptr interface{}) { o.Parameters = *ptr.(*string) }
	if err := w.ReadPointer(&o.Parameters, _s_pParameters, _ptr_pParameters); err != nil {
		return err
	}
	_ptr_pDriverName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverName); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverName := func(ptr interface{}) { o.DriverName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverName, _s_pDriverName, _ptr_pDriverName); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.DevMode)); err != nil {
		return err
	}
	_ptr___pStatus := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.StatusString); err != nil {
			return err
		}
		return nil
	})
	_s___pStatus := func(ptr interface{}) { o.StatusString = *ptr.(*string) }
	if err := w.ReadPointer(&o.StatusString, _s___pStatus, _ptr___pStatus); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.SecurityDescriptor)); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	if err := w.ReadData(&o.Priority); err != nil {
		return err
	}
	if err := w.ReadData(&o.Position); err != nil {
		return err
	}
	if err := w.ReadData(&o.StartTime); err != nil {
		return err
	}
	if err := w.ReadData(&o.UntilTime); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalPages); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	if o.Submitted == nil {
		o.Submitted = &dtyp.SystemTime{}
	}
	if err := o.Submitted.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.Time); err != nil {
		return err
	}
	if err := w.ReadData(&o.PagesPrinted); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// JobInfo3 structure represents JOB_INFO_3 RPC structure.
//
// The JOB_INFO_3 structure provides information about a print job.<46>
//
// The _JOB_INFO_3 structure specifies information about the order of print jobs, and
// it is used to alter the order of print jobs.<118> It is a custom-marshaled form of
// the _JOB_INFO_3 (section 2.2.1.7.3) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type JobInfo3 struct {
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// NextJobId: An identifier that specifies the print job in the queue following the
	// job identified by the JobId member. A value of zero indicates that there are no jobs
	// following the job identified by the JobId member.
	//
	// When used as input to RpcSetJob (section 3.1.4.3.1) to alter the order of print jobs
	// and link them together, JobId and NextJobId MUST be nonzero and SHOULD be obtained
	// through RpcEnumJobs (section 3.1.4.3.3) or RpcGetJob (section 3.1.4.3.2).
	//
	// All members not defined in this section are specified in sections 2.2.1.3.3 and 2.2.1.3.
	NextJobID uint32 `idl:"name:NextJobId" json:"next_job_id"`
	_         uint32 `idl:"name:Reserved"`
}

func (o *JobInfo3) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(o.JobID); err != nil {
		return err
	}
	if err := w.WriteData(o.NextJobID); err != nil {
		return err
	}
	// reserved Reserved
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobID); err != nil {
		return err
	}
	if err := w.ReadData(&o.NextJobID); err != nil {
		return err
	}
	// reserved Reserved
	var _Reserved uint32
	if err := w.ReadData(&_Reserved); err != nil {
		return err
	}
	return nil
}

// JobInfo4 structure represents JOB_INFO_4 RPC structure.
//
// The JOB_INFO_4 structure provides information about a print job.<47>
//
// The _JOB_INFO_4 structure specifies print job information.<119> It is a custom-marshaled
// form of the _JOB_INFO_4 (section 2.2.1.7.4) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type JobInfo4 struct {
	JobID              uint32           `idl:"name:JobId" json:"job_id"`
	PrinterName        string           `idl:"name:pPrinterName;string" json:"printer_name"`
	MachineName        string           `idl:"name:pMachineName;string" json:"machine_name"`
	UserName           string           `idl:"name:pUserName;string" json:"user_name"`
	Document           string           `idl:"name:pDocument;string" json:"document"`
	NotifyName         string           `idl:"name:pNotifyName;string" json:"notify_name"`
	DataType           string           `idl:"name:pDatatype;string" json:"data_type"`
	PrintProcessor     string           `idl:"name:pPrintProcessor;string" json:"print_processor"`
	Parameters         string           `idl:"name:pParameters;string" json:"parameters"`
	DriverName         string           `idl:"name:pDriverName;string" json:"driver_name"`
	DevMode            uint64           `idl:"name:pDevMode" json:"dev_mode"`
	StatusString       string           `idl:"name:__pStatus;string" json:"status_string"`
	SecurityDescriptor uint64           `idl:"name:pSecurityDescriptor" json:"security_descriptor"`
	Status             uint32           `idl:"name:Status" json:"status"`
	Priority           uint32           `idl:"name:Priority" json:"priority"`
	Position           uint32           `idl:"name:Position" json:"position"`
	StartTime          uint32           `idl:"name:StartTime" json:"start_time"`
	UntilTime          uint32           `idl:"name:UntilTime" json:"until_time"`
	TotalPages         uint32           `idl:"name:TotalPages" json:"total_pages"`
	Size               uint32           `idl:"name:Size" json:"size"`
	Submitted          *dtyp.SystemTime `idl:"name:Submitted" json:"submitted"`
	Time               uint32           `idl:"name:Time" json:"time"`
	PagesPrinted       uint32           `idl:"name:PagesPrinted" json:"pages_printed"`
	// SizeHigh: This member specifies the high-order 32 bits of a 64-bit unsigned integer
	// that specifies the size of the job, in bytes.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.3 and 2.2.1.3.
	SizeHigh int32 `idl:"name:SizeHigh" json:"size_high"`
}

func (o *JobInfo4) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo4) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.JobID); err != nil {
		return err
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Document != "" {
		_ptr_pDocument := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Document); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Document, _ptr_pDocument); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.NotifyName != "" {
		_ptr_pNotifyName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.NotifyName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.NotifyName, _ptr_pNotifyName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataType != "" {
		_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrintProcessor != "" {
		_ptr_pPrintProcessor := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessor); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrintProcessor, _ptr_pPrintProcessor); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Parameters != "" {
		_ptr_pParameters := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Parameters); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Parameters, _ptr_pParameters); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverName != "" {
		_ptr_pDriverName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverName, _ptr_pDriverName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(ndr.Uint3264(o.DevMode)); err != nil {
		return err
	}
	if o.StatusString != "" {
		_ptr___pStatus := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.StatusString); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.StatusString, _ptr___pStatus); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(ndr.Uint3264(o.SecurityDescriptor)); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if err := w.WriteData(o.Priority); err != nil {
		return err
	}
	if err := w.WriteData(o.Position); err != nil {
		return err
	}
	if err := w.WriteData(o.StartTime); err != nil {
		return err
	}
	if err := w.WriteData(o.UntilTime); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalPages); err != nil {
		return err
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if o.Submitted != nil {
		if err := o.Submitted.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.SystemTime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Time); err != nil {
		return err
	}
	if err := w.WriteData(o.PagesPrinted); err != nil {
		return err
	}
	if err := w.WriteData(o.SizeHigh); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *JobInfo4) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobID); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	_ptr_pDocument := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Document); err != nil {
			return err
		}
		return nil
	})
	_s_pDocument := func(ptr interface{}) { o.Document = *ptr.(*string) }
	if err := w.ReadPointer(&o.Document, _s_pDocument, _ptr_pDocument); err != nil {
		return err
	}
	_ptr_pNotifyName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.NotifyName); err != nil {
			return err
		}
		return nil
	})
	_s_pNotifyName := func(ptr interface{}) { o.NotifyName = *ptr.(*string) }
	if err := w.ReadPointer(&o.NotifyName, _s_pNotifyName, _ptr_pNotifyName); err != nil {
		return err
	}
	_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
		return err
	}
	_ptr_pPrintProcessor := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessor); err != nil {
			return err
		}
		return nil
	})
	_s_pPrintProcessor := func(ptr interface{}) { o.PrintProcessor = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrintProcessor, _s_pPrintProcessor, _ptr_pPrintProcessor); err != nil {
		return err
	}
	_ptr_pParameters := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Parameters); err != nil {
			return err
		}
		return nil
	})
	_s_pParameters := func(ptr interface{}) { o.Parameters = *ptr.(*string) }
	if err := w.ReadPointer(&o.Parameters, _s_pParameters, _ptr_pParameters); err != nil {
		return err
	}
	_ptr_pDriverName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverName); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverName := func(ptr interface{}) { o.DriverName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverName, _s_pDriverName, _ptr_pDriverName); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.DevMode)); err != nil {
		return err
	}
	_ptr___pStatus := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.StatusString); err != nil {
			return err
		}
		return nil
	})
	_s___pStatus := func(ptr interface{}) { o.StatusString = *ptr.(*string) }
	if err := w.ReadPointer(&o.StatusString, _s___pStatus, _ptr___pStatus); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.SecurityDescriptor)); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	if err := w.ReadData(&o.Priority); err != nil {
		return err
	}
	if err := w.ReadData(&o.Position); err != nil {
		return err
	}
	if err := w.ReadData(&o.StartTime); err != nil {
		return err
	}
	if err := w.ReadData(&o.UntilTime); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalPages); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	if o.Submitted == nil {
		o.Submitted = &dtyp.SystemTime{}
	}
	if err := o.Submitted.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.Time); err != nil {
		return err
	}
	if err := w.ReadData(&o.PagesPrinted); err != nil {
		return err
	}
	if err := w.ReadData(&o.SizeHigh); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// MonitorInfo1 structure represents MONITOR_INFO_1 RPC structure.
//
// The _MONITOR_INFO_1 structure identifies an installed port monitor. It is a custom-marshaled
// form of the _MONITOR_INFO_1 (section 2.2.1.8.1) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The MONITOR_INFO_1 structure provides information about a monitor.
//
// All members not defined in this section are specified in sections 2.2.1.3.4 and 2.2.1.3.
type MonitorInfo1 struct {
	Name string `idl:"name:pName;string" json:"name"`
}

func (o *MonitorInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *MonitorInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *MonitorInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	return nil
}

// MonitorInfo2 structure represents MONITOR_INFO_2 RPC structure.
//
// The _MONITOR_INFO_2 structure is used to identify a port monitor. It is a custom-marshaled
// form of the _MONITOR_INFO_2 (section 2.2.1.8.2) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The MONITOR_INFO_2 structure provides information about a monitor.
type MonitorInfo2 struct {
	Name string `idl:"name:pName;string" json:"name"`
	// pEnvironment: A pointer to a string that specifies the environment that the monitor
	// supports. The environment specified MUST match the print server's operating system.
	// For rules governing environment names and Windows behaviors, see section 2.2.4.4.
	Environment string `idl:"name:pEnvironment;string" json:"environment"`
	// pDLLName: A pointer to a string that specifies the name of the port monitor executable
	// object.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.4 and 2.2.1.3.
	DLLName string `idl:"name:pDLLName;string" json:"dll_name"`
}

func (o *MonitorInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *MonitorInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Environment != "" {
		_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DLLName != "" {
		_ptr_pDLLName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DLLName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DLLName, _ptr_pDLLName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *MonitorInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
		return nil
	})
	_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
		return err
	}
	_ptr_pDLLName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DLLName); err != nil {
			return err
		}
		return nil
	})
	_s_pDLLName := func(ptr interface{}) { o.DLLName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DLLName, _s_pDLLName, _ptr_pDLLName); err != nil {
		return err
	}
	return nil
}

// PortInfo1 structure represents PORT_INFO_1 RPC structure.
//
// The _PORT_INFO_1 structure specifies information about a printer port. It is a custom-marshaled
// form of the _PORT_INFO_1 (section 2.2.1.9.1) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The PORT_INFO_1 structure provides information about a port.
//
// All members not defined in this section are specified in sections 2.2.1.3.5 and 2.2.1.3.
type PortInfo1 struct {
	PortName string `idl:"name:pPortName;string" json:"port_name"`
}

func (o *PortInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.PortName != "" {
		_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
		return nil
	})
	_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
		return err
	}
	return nil
}

// PortInfo2 structure represents PORT_INFO_2 RPC structure.
//
// The PORT_INFO_2 structure provides information about a port.
//
// The _PORT_INFO_2 structure specifies information about a printer port. It is a custom-marshaled
// form of the _PORT_INFO_2 (section 2.2.1.9.2) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type PortInfo2 struct {
	PortName string `idl:"name:pPortName;string" json:"port_name"`
	// pMonitorName: A pointer to a string that specifies an installed port monitor. For
	// rules governing port monitor names, see section 2.2.4.8.
	MonitorName string `idl:"name:pMonitorName;string" json:"monitor_name"`
	// pDescription: An optional pointer to a string that specifies additional implementation-specific
	// information about the printer port.<48>
	Description string `idl:"name:pDescription;string" json:"description"`
	// fPortType: A bit field that specifies attributes of the printer port. These flags
	// can be combined to specify multiple attributes.
	//
	//	+-----------------------------------+--------------------------------------------------+
	//	|                                   |                                                  |
	//	|            NAME/VALUE             |                   DESCRIPTION                    |
	//	|                                   |                                                  |
	//	+-----------------------------------+--------------------------------------------------+
	//	+-----------------------------------+--------------------------------------------------+
	//	| PORT_TYPE_WRITE 0x00000001        | The port can be written to.                      |
	//	+-----------------------------------+--------------------------------------------------+
	//	| PORT_TYPE_READ 0x00000002         | The port can be read from.                       |
	//	+-----------------------------------+--------------------------------------------------+
	//	| PORT_TYPE_REDIRECTED 0x00000004   | The port is a Terminal Services redirected port. |
	//	+-----------------------------------+--------------------------------------------------+
	//	| PORT_TYPE_NET_ATTACHED 0x00000008 | The port is a network TCP/IP port.               |
	//	+-----------------------------------+--------------------------------------------------+
	//
	// All members not defined in this section are specified in sections 2.2.1.3.5 and 2.2.1.3.
	PortType uint32 `idl:"name:fPortType" json:"port_type"`
	_        uint32 `idl:"name:Reserved"`
}

func (o *PortInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.PortName != "" {
		_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MonitorName != "" {
		_ptr_pMonitorName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorName, _ptr_pMonitorName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Description != "" {
		_ptr_pDescription := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Description); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Description, _ptr_pDescription); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.PortType); err != nil {
		return err
	}
	// reserved Reserved
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
		return nil
	})
	_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
		return err
	}
	_ptr_pMonitorName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorName := func(ptr interface{}) { o.MonitorName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MonitorName, _s_pMonitorName, _ptr_pMonitorName); err != nil {
		return err
	}
	_ptr_pDescription := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Description); err != nil {
			return err
		}
		return nil
	})
	_s_pDescription := func(ptr interface{}) { o.Description = *ptr.(*string) }
	if err := w.ReadPointer(&o.Description, _s_pDescription, _ptr_pDescription); err != nil {
		return err
	}
	if err := w.ReadData(&o.PortType); err != nil {
		return err
	}
	// reserved Reserved
	var _Reserved uint32
	if err := w.ReadData(&_Reserved); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PortInfo3 structure represents PORT_INFO_3 RPC structure.
//
// The PORT_INFO_3 structure provides information about a port.<49>
type PortInfo3 struct {
	// dwStatus: The new port status. This value MUST be one of the following.
	//
	//	+------------------------------------------+-----------------------------------------------------+
	//	|                                          |                                                     |
	//	|                NAME/VALUE                |                     DESCRIPTION                     |
	//	|                                          |                                                     |
	//	+------------------------------------------+-----------------------------------------------------+
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_CLEAR 0x00000000             | Clears the printer port status.                     |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_OFFLINE 0x00000001           | The port’s printer is offline.                      |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_PAPER_JAM 0x00000002         | The port’s printer has a paper jam.                 |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_PAPER_OUT 0x00000003         | The port’s printer is out of paper.                 |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_OUTPUT_BIN_FULL 0x00000004   | The port’s printer's output bin is full.            |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_PAPER_PROBLEM 0x00000005     | The port’s printer has a paper problem.             |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_NO_TONER 0x00000006          | The port’s printer is out of toner.                 |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_DOOR_OPEN 0x00000007         | The door of the port’s printer is open.             |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_USER_INTERVENTION 0x00000008 | The port’s printer requires user intervention.      |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_OUT_OF_MEMORY 0x00000009     | The port’s printer is out of memory.                |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_TONER_LOW 0x0000000A         | The port’s printer is low on toner.                 |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_WARMING_UP 0x0000000B        | The port’s printer is warming up.                   |
	//	+------------------------------------------+-----------------------------------------------------+
	//	| PORT_STATUS_POWER_SAVE 0x0000000C        | The port’s printer is in a power-conservation mode. |
	//	+------------------------------------------+-----------------------------------------------------+
	Status uint32 `idl:"name:dwStatus" json:"status"`
	// pszStatus: An optional pointer to a string that specifies a status description.
	StatusString string `idl:"name:pszStatus;string" json:"status_string"`
	// dwSeverity: The severity of the port status value. This value MUST be one of the
	// following.
	//
	//	+-------------------------------------+-------------------------------------------+
	//	|                                     |                                           |
	//	|             NAME/VALUE              |                DESCRIPTION                |
	//	|                                     |                                           |
	//	+-------------------------------------+-------------------------------------------+
	//	+-------------------------------------+-------------------------------------------+
	//	| PORT_STATUS_TYPE_ERROR 0x00000001   | The port status value indicates an error. |
	//	+-------------------------------------+-------------------------------------------+
	//	| PORT_STATUS_TYPE_WARNING 0x00000002 | The port status value is a warning.       |
	//	+-------------------------------------+-------------------------------------------+
	//	| PORT_STATUS_TYPE_INFO 0x00000003    | The port status value is informational.   |
	//	+-------------------------------------+-------------------------------------------+
	//
	// All members not defined in this section are specified in sections 2.2.1.3.5 and 2.2.1.3.
	Severity uint32 `idl:"name:dwSeverity" json:"severity"`
}

func (o *PortInfo3) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if o.StatusString != "" {
		_ptr_pszStatus := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.StatusString); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.StatusString, _ptr_pszStatus); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Severity); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	_ptr_pszStatus := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.StatusString); err != nil {
			return err
		}
		return nil
	})
	_s_pszStatus := func(ptr interface{}) { o.StatusString = *ptr.(*string) }
	if err := w.ReadPointer(&o.StatusString, _s_pszStatus, _ptr_pszStatus); err != nil {
		return err
	}
	if err := w.ReadData(&o.Severity); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PortInfo255 structure represents PORT_INFO_FF RPC structure.
//
// The PORT_INFO_FF structure is used to communicate port information to a local port
// monitor.<50>
type PortInfo255 struct {
	PortName string `idl:"name:pPortName;string" json:"port_name"`
	// cbMonitorData: A value that SHOULD be set to zero when sent and MUST be ignored on
	// receipt.
	MonitorDataLength uint32 `idl:"name:cbMonitorData" json:"monitor_data_length"`
	// pMonitorData: A pointer that SHOULD be set to NULL when sent and MUST be ignored
	// on receipt.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.5 and 2.2.1.3.
	MonitorData uint8 `idl:"name:pMonitorData" json:"monitor_data"`
}

func (o *PortInfo255) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo255) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.PortName != "" {
		_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.MonitorDataLength); err != nil {
		return err
	}
	// XXX pointer to primitive type, default behavior is to write non-null pointer.
	// if this behavior is not desired, use goext_default_null([cond]) attribute.
	_ptr_pMonitorData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
		if err := w.WriteData(o.MonitorData); err != nil {
			return err
		}
		return nil
	})
	if err := w.WritePointer(&o.MonitorData, _ptr_pMonitorData); err != nil {
		return err
	}
	return nil
}
func (o *PortInfo255) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
		return nil
	})
	_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
		return err
	}
	if err := w.ReadData(&o.MonitorDataLength); err != nil {
		return err
	}
	_ptr_pMonitorData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := w.ReadData(&o.MonitorData); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorData := func(ptr interface{}) { o.MonitorData = *ptr.(*uint8) }
	if err := w.ReadPointer(&o.MonitorData, _s_pMonitorData, _ptr_pMonitorData); err != nil {
		return err
	}
	return nil
}

// PrinterInfoStress structure represents PRINTER_INFO_STRESS RPC structure.
//
// The PRINTER_INFO_STRESS structure provides diagnostic printer information used for
// print system remote protocol stress analysis.<51>
//
// The _PRINTER_INFO_STRESS structure specifies printer diagnostic information.<120>
// It is a custom-marshaled form of the _PRINTER_INFO_STRESS (section 2.2.1.10.1) structure.
// This form of the _PRINTER_INFO_STRESS structure corresponds to an information Level
// value of 0x00000000.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type PrinterInfoStress struct {
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	ServerName  string `idl:"name:pServerName;string" json:"server_name"`
	// cJobs: The number of jobs that are currently in the print queue.
	JobsCount uint32 `idl:"name:cJobs" json:"jobs_count"`
	// cTotalJobs: The total number of jobs that have been spooled since the print server
	// was started.
	TotalJobsCount uint32 `idl:"name:cTotalJobs" json:"total_jobs_count"`
	// cTotalBytes: The low-order 32 bits of an unsigned 64-bit value that specifies the
	// total number of bytes that have been printed since system startup. The high-order
	// 32 bits are specified by the dwHighPartTotalBytes member.
	TotalBytesCount uint32 `idl:"name:cTotalBytes" json:"total_bytes_count"`
	// stUpTime: The time the printer data structure was created, in SYSTEMTIME format ([MS-DTYP]
	// section 2.3.13).
	UpTime *dtyp.SystemTime `idl:"name:stUpTime" json:"up_time"`
	// MaxcRef: The historic maximum value of the cRef member.
	MaxcReference uint32 `idl:"name:MaxcRef" json:"maxc_reference"`
	// cTotalPagesPrinted: The total number of pages printed.
	TotalPagesPrintedCount uint32 `idl:"name:cTotalPagesPrinted" json:"total_pages_printed_count"`
	// dwGetVersion: An implementation-specific value that specifies the version of the
	// operating system.<52>
	GetVersion uint32 `idl:"name:dwGetVersion" json:"get_version"`
	// fFreeBuild: An implementation-specific value that MUST be ignored on receipt.<53>
	FreeBuild uint32 `idl:"name:fFreeBuild" json:"free_build"`
	// cSpooling: The number of actively spooling jobs.
	SpoolingCount uint32 `idl:"name:cSpooling" json:"spooling_count"`
	// cMaxSpooling: The historic maximum number of actively spooling jobs.
	MaxSpoolingCount uint32 `idl:"name:cMaxSpooling" json:"max_spooling_count"`
	// cRef: The reference count for opened printer objects.
	ReferenceCount uint32 `idl:"name:cRef" json:"reference_count"`
	// cErrorOutOfPaper: The total number of out-of-paper errors.
	ErrorOutOfPaperCount uint32 `idl:"name:cErrorOutOfPaper" json:"error_out_of_paper_count"`
	// cErrorNotReady: The total number of not-ready errors.
	ErrorNotReadyCount uint32 `idl:"name:cErrorNotReady" json:"error_not_ready_count"`
	// cJobError: The total number of job errors.
	JobErrorCount uint32 `idl:"name:cJobError" json:"job_error_count"`
	// dwNumberOfProcessors: The number of processors in the computer on which the print
	// server is running.
	NumberOfProcessors uint32 `idl:"name:dwNumberOfProcessors" json:"number_of_processors"`
	// dwProcessorType: An implementation-specific value that identifies the type of processor
	// in the computer.<54>
	ProcessorType uint32 `idl:"name:dwProcessorType" json:"processor_type"`
	// dwHighPartTotalBytes: The high-order 32 bits of an unsigned 64-bit value that specifies
	// the total number of bytes that have been printed since system startup. The low-order
	// 32 bits are specified by the cTotalBytes member.
	HighPartTotalBytes uint32 `idl:"name:dwHighPartTotalBytes" json:"high_part_total_bytes"`
	// cChangeID: A unique number that identifies the last change.
	ChangeIDCount uint32 `idl:"name:cChangeID" json:"change_id_count"`
	// dwLastError: An implementation-specific error code for the last error that occurred
	// with this printer.<55>
	LastError uint32 `idl:"name:dwLastError" json:"last_error"`
	// Status: The current printer status (section 2.2.3.12).
	Status uint32 `idl:"name:Status" json:"status"`
	// cEnumerateNetworkPrinters: The number of times the network printers in the "List
	// of Known Printers" have been requested.
	EnumerateNetworkPrintersCount uint32 `idl:"name:cEnumerateNetworkPrinters" json:"enumerate_network_printers_count"`
	// cAddNetPrinters: The number of network printers added, per server.
	AddNetPrintersCount uint32 `idl:"name:cAddNetPrinters" json:"add_net_printers_count"`
	// wProcessorArchitecture: An implementation-specific value that identifies the system's
	// processor architecture. This value SHOULD be ignored on receipt.<56>
	ProcessorArchitecture uint16 `idl:"name:wProcessorArchitecture" json:"processor_architecture"`
	// wProcessorLevel: An implementation-specific value that identifies the system's architecture-dependent
	// processor level. This value SHOULD be ignored on receipt.<57>
	ProcessorLevel uint16 `idl:"name:wProcessorLevel" json:"processor_level"`
	// cRefIC: The number of open information context handles.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
	ReferenceICCount uint32 `idl:"name:cRefIC" json:"reference_ic_count"`
	_                uint32 `idl:"name:dwReserved2"`
	_                uint32 `idl:"name:dwReserved3"`
}

func (o *PrinterInfoStress) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfoStress) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ServerName != "" {
		_ptr_pServerName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ServerName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ServerName, _ptr_pServerName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.JobsCount); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalJobsCount); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalBytesCount); err != nil {
		return err
	}
	if o.UpTime != nil {
		if err := o.UpTime.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.SystemTime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.MaxcReference); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalPagesPrintedCount); err != nil {
		return err
	}
	if err := w.WriteData(o.GetVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.FreeBuild); err != nil {
		return err
	}
	if err := w.WriteData(o.SpoolingCount); err != nil {
		return err
	}
	if err := w.WriteData(o.MaxSpoolingCount); err != nil {
		return err
	}
	if err := w.WriteData(o.ReferenceCount); err != nil {
		return err
	}
	if err := w.WriteData(o.ErrorOutOfPaperCount); err != nil {
		return err
	}
	if err := w.WriteData(o.ErrorNotReadyCount); err != nil {
		return err
	}
	if err := w.WriteData(o.JobErrorCount); err != nil {
		return err
	}
	if err := w.WriteData(o.NumberOfProcessors); err != nil {
		return err
	}
	if err := w.WriteData(o.ProcessorType); err != nil {
		return err
	}
	if err := w.WriteData(o.HighPartTotalBytes); err != nil {
		return err
	}
	if err := w.WriteData(o.ChangeIDCount); err != nil {
		return err
	}
	if err := w.WriteData(o.LastError); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if err := w.WriteData(o.EnumerateNetworkPrintersCount); err != nil {
		return err
	}
	if err := w.WriteData(o.AddNetPrintersCount); err != nil {
		return err
	}
	if err := w.WriteData(o.ProcessorArchitecture); err != nil {
		return err
	}
	if err := w.WriteData(o.ProcessorLevel); err != nil {
		return err
	}
	if err := w.WriteData(o.ReferenceICCount); err != nil {
		return err
	}
	// reserved dwReserved2
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved dwReserved3
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfoStress) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pServerName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ServerName); err != nil {
			return err
		}
		return nil
	})
	_s_pServerName := func(ptr interface{}) { o.ServerName = *ptr.(*string) }
	if err := w.ReadPointer(&o.ServerName, _s_pServerName, _ptr_pServerName); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobsCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalJobsCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalBytesCount); err != nil {
		return err
	}
	if o.UpTime == nil {
		o.UpTime = &dtyp.SystemTime{}
	}
	if err := o.UpTime.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.MaxcReference); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalPagesPrintedCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.GetVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.FreeBuild); err != nil {
		return err
	}
	if err := w.ReadData(&o.SpoolingCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.MaxSpoolingCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.ReferenceCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.ErrorOutOfPaperCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.ErrorNotReadyCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobErrorCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.NumberOfProcessors); err != nil {
		return err
	}
	if err := w.ReadData(&o.ProcessorType); err != nil {
		return err
	}
	if err := w.ReadData(&o.HighPartTotalBytes); err != nil {
		return err
	}
	if err := w.ReadData(&o.ChangeIDCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.LastError); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	if err := w.ReadData(&o.EnumerateNetworkPrintersCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.AddNetPrintersCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.ProcessorArchitecture); err != nil {
		return err
	}
	if err := w.ReadData(&o.ProcessorLevel); err != nil {
		return err
	}
	if err := w.ReadData(&o.ReferenceICCount); err != nil {
		return err
	}
	// reserved dwReserved2
	var _dwReserved2 uint32
	if err := w.ReadData(&_dwReserved2); err != nil {
		return err
	}
	// reserved dwReserved3
	var _dwReserved3 uint32
	if err := w.ReadData(&_dwReserved3); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PrinterInfo1 structure represents PRINTER_INFO_1 RPC structure.
//
// The PRINTER_INFO_1 structure provides information about a printer.
//
// The _PRINTER_INFO_1 structure specifies printer information. It is a custom-marshaled
// form of the _PRINTER_INFO_1 (section 2.2.1.10.2) structure. See _PRINTER_INFO_1 for
// the definition of Flags.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type PrinterInfo1 struct {
	// Flags: The value of this member MUST be the result of a bitwise OR of zero or more
	// of the Printer Enumeration Flags (section 2.2.3.7).
	Flags       uint32 `idl:"name:Flags" json:"flags"`
	Description string `idl:"name:pDescription;string" json:"description"`
	// pName: This member is synonymous with pPrinterName (section 3.1.4.1.5).
	//
	// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
	Name    string `idl:"name:pName;string" json:"name"`
	Comment string `idl:"name:pComment;string" json:"comment"`
}

func (o *PrinterInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if o.Description != "" {
		_ptr_pDescription := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Description); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Description, _ptr_pDescription); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Name != "" {
		_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Comment != "" {
		_ptr_pComment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Comment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Comment, _ptr_pComment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	_ptr_pDescription := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Description); err != nil {
			return err
		}
		return nil
	})
	_s_pDescription := func(ptr interface{}) { o.Description = *ptr.(*string) }
	if err := w.ReadPointer(&o.Description, _s_pDescription, _ptr_pDescription); err != nil {
		return err
	}
	_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
		return nil
	})
	_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
	if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
		return err
	}
	_ptr_pComment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Comment); err != nil {
			return err
		}
		return nil
	})
	_s_pComment := func(ptr interface{}) { o.Comment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Comment, _s_pComment, _ptr_pComment); err != nil {
		return err
	}
	return nil
}

// PrinterInfo2 structure represents PRINTER_INFO_2 RPC structure.
//
// The _PRINTER_INFO_2 structure specifies printer information. It is a custom-marshaled
// form of the _PRINTER_INFO_2 (section 2.2.1.10.3) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The PRINTER_INFO_2 structure provides information about a printer.
type PrinterInfo2 struct {
	ServerName  string `idl:"name:pServerName;string" json:"server_name"`
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	// pShareName: An optional pointer to a string that specifies the share name for the
	// printer. This string MUST be ignored unless the Attributes member contains the PRINTER_ATTRIBUTE_SHARED
	// flag. For rules governing path names, see section 2.2.4.9.
	ShareName string `idl:"name:pShareName;string" json:"share_name"`
	PortName  string `idl:"name:pPortName;string" json:"port_name"`
	// pDriverName: This member is a pointer to a string that specifies the name of the
	// printer driver. For rules governing printer driver names, see section 2.2.4.3.
	DriverName string `idl:"name:pDriverName;string" json:"driver_name"`
	Comment    string `idl:"name:pComment;string" json:"comment"`
	// pLocation: An optional pointer to a string that specifies the location of the printer.
	Location string `idl:"name:pLocation;string" json:"location"`
	DevMode  uint64 `idl:"name:pDevMode" json:"dev_mode"`
	// pSepFile: An optional pointer to a string that specifies the name of a file whose
	// contents are used to create a separator page. This page is used to separate print
	// jobs sent to the printer. For rules governing path names, see section 2.2.4.9.
	SepFile string `idl:"name:pSepFile;string" json:"sep_file"`
	// pPrintProcessor: An optional pointer to a string that specifies the name of the print
	// processor used by the printer. For rules governing print processor names, see section
	// 2.2.4.11.
	PrintProcessor string `idl:"name:pPrintProcessor;string" json:"print_processor"`
	// pDatatype: An optional pointer to a string that specifies the default data format
	// used to record print jobs on the printer. For rules governing data type names, see
	// section 2.2.4.2.
	DataType string `idl:"name:pDatatype;string" json:"data_type"`
	// pParameters: An optional pointer to a string that specifies the default print processor
	// parameters.
	Parameters         string `idl:"name:pParameters;string" json:"parameters"`
	SecurityDescriptor uint64 `idl:"name:pSecurityDescriptor" json:"security_descriptor"`
	Attributes         uint32 `idl:"name:Attributes" json:"attributes"`
	// Priority: The value of this member specifies a priority value that the spooler uses
	// to route each print job. The value of this member MUST be from 0 through 99, inclusive.
	Priority uint32 `idl:"name:Priority" json:"priority"`
	// DefaultPriority: The value of this member specifies the default priority value assigned
	// to each print job. The value of this member MUST be from 0 through 99, inclusive.
	DefaultPriority uint32 `idl:"name:DefaultPriority" json:"default_priority"`
	// StartTime: The value of this member specifies the earliest time that a job can be
	// printed. The time is expressed as the number of minutes after 12:00 AM GMT within
	// a 24-hour boundary.
	StartTime uint32 `idl:"name:StartTime" json:"start_time"`
	// UntilTime: The value of this member specifies the latest time that a job can be printed.
	// The time is expressed as the number of minutes after 12:00 AM GMT within a 24-hour
	// boundary.
	UntilTime uint32 `idl:"name:UntilTime" json:"until_time"`
	Status    uint32 `idl:"name:Status" json:"status"`
	// cJobs: The value of this member specifies the number of print jobs that have been
	// queued for the printer.
	JobsCount uint32 `idl:"name:cJobs" json:"jobs_count"`
	// AveragePPM: The value of this member specifies the average pages per minute that
	// have been printed on the printer.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
	AveragePpm uint32 `idl:"name:AveragePPM" json:"average_ppm"`
}

func (o *PrinterInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.ServerName != "" {
		_ptr_pServerName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ServerName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ServerName, _ptr_pServerName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ShareName != "" {
		_ptr_pShareName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ShareName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ShareName, _ptr_pShareName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PortName != "" {
		_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DriverName != "" {
		_ptr_pDriverName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DriverName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DriverName, _ptr_pDriverName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Comment != "" {
		_ptr_pComment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Comment); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Comment, _ptr_pComment); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Location != "" {
		_ptr_pLocation := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Location); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Location, _ptr_pLocation); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(ndr.Uint3264(o.DevMode)); err != nil {
		return err
	}
	if o.SepFile != "" {
		_ptr_pSepFile := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.SepFile); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.SepFile, _ptr_pSepFile); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrintProcessor != "" {
		_ptr_pPrintProcessor := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessor); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrintProcessor, _ptr_pPrintProcessor); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataType != "" {
		_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Parameters != "" {
		_ptr_pParameters := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Parameters); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Parameters, _ptr_pParameters); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(ndr.Uint3264(o.SecurityDescriptor)); err != nil {
		return err
	}
	if err := w.WriteData(o.Attributes); err != nil {
		return err
	}
	if err := w.WriteData(o.Priority); err != nil {
		return err
	}
	if err := w.WriteData(o.DefaultPriority); err != nil {
		return err
	}
	if err := w.WriteData(o.StartTime); err != nil {
		return err
	}
	if err := w.WriteData(o.UntilTime); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if err := w.WriteData(o.JobsCount); err != nil {
		return err
	}
	if err := w.WriteData(o.AveragePpm); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pServerName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ServerName); err != nil {
			return err
		}
		return nil
	})
	_s_pServerName := func(ptr interface{}) { o.ServerName = *ptr.(*string) }
	if err := w.ReadPointer(&o.ServerName, _s_pServerName, _ptr_pServerName); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pShareName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ShareName); err != nil {
			return err
		}
		return nil
	})
	_s_pShareName := func(ptr interface{}) { o.ShareName = *ptr.(*string) }
	if err := w.ReadPointer(&o.ShareName, _s_pShareName, _ptr_pShareName); err != nil {
		return err
	}
	_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
		return nil
	})
	_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
		return err
	}
	_ptr_pDriverName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverName); err != nil {
			return err
		}
		return nil
	})
	_s_pDriverName := func(ptr interface{}) { o.DriverName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DriverName, _s_pDriverName, _ptr_pDriverName); err != nil {
		return err
	}
	_ptr_pComment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Comment); err != nil {
			return err
		}
		return nil
	})
	_s_pComment := func(ptr interface{}) { o.Comment = *ptr.(*string) }
	if err := w.ReadPointer(&o.Comment, _s_pComment, _ptr_pComment); err != nil {
		return err
	}
	_ptr_pLocation := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Location); err != nil {
			return err
		}
		return nil
	})
	_s_pLocation := func(ptr interface{}) { o.Location = *ptr.(*string) }
	if err := w.ReadPointer(&o.Location, _s_pLocation, _ptr_pLocation); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.DevMode)); err != nil {
		return err
	}
	_ptr_pSepFile := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.SepFile); err != nil {
			return err
		}
		return nil
	})
	_s_pSepFile := func(ptr interface{}) { o.SepFile = *ptr.(*string) }
	if err := w.ReadPointer(&o.SepFile, _s_pSepFile, _ptr_pSepFile); err != nil {
		return err
	}
	_ptr_pPrintProcessor := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessor); err != nil {
			return err
		}
		return nil
	})
	_s_pPrintProcessor := func(ptr interface{}) { o.PrintProcessor = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrintProcessor, _s_pPrintProcessor, _ptr_pPrintProcessor); err != nil {
		return err
	}
	_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
		return err
	}
	_ptr_pParameters := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Parameters); err != nil {
			return err
		}
		return nil
	})
	_s_pParameters := func(ptr interface{}) { o.Parameters = *ptr.(*string) }
	if err := w.ReadPointer(&o.Parameters, _s_pParameters, _ptr_pParameters); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.SecurityDescriptor)); err != nil {
		return err
	}
	if err := w.ReadData(&o.Attributes); err != nil {
		return err
	}
	if err := w.ReadData(&o.Priority); err != nil {
		return err
	}
	if err := w.ReadData(&o.DefaultPriority); err != nil {
		return err
	}
	if err := w.ReadData(&o.StartTime); err != nil {
		return err
	}
	if err := w.ReadData(&o.UntilTime); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobsCount); err != nil {
		return err
	}
	if err := w.ReadData(&o.AveragePpm); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PrinterInfo3 structure represents PRINTER_INFO_3 RPC structure.
//
// The PRINTER_INFO_3 structure provides information about a printer.
//
// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
//
// The _PRINTER_INFO_3 structure specifies printer information. It is a custom-marshaled
// form of the _PRINTER_INFO_3 (section 2.2.1.10.4) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type PrinterInfo3 struct {
	SecurityDescriptor uint64 `idl:"name:pSecurityDescriptor" json:"security_descriptor"`
}

func (o *PrinterInfo3) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(ndr.Uint3264(o.SecurityDescriptor)); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.SecurityDescriptor)); err != nil {
		return err
	}
	return nil
}

// PrinterInfo4 structure represents PRINTER_INFO_4 RPC structure.
//
// The PRINTER_INFO_4 structure provides information about a printer.<59>
//
// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
//
// The _PRINTER_INFO_4 structure specifies printer information.<127> It is a custom-marshaled
// form of the _PRINTER_INFO_4 (section 2.2.1.10.5) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type PrinterInfo4 struct {
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	ServerName  string `idl:"name:pServerName;string" json:"server_name"`
	Attributes  uint32 `idl:"name:Attributes" json:"attributes"`
}

func (o *PrinterInfo4) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo4) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ServerName != "" {
		_ptr_pServerName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ServerName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ServerName, _ptr_pServerName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Attributes); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo4) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pServerName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ServerName); err != nil {
			return err
		}
		return nil
	})
	_s_pServerName := func(ptr interface{}) { o.ServerName = *ptr.(*string) }
	if err := w.ReadPointer(&o.ServerName, _s_pServerName, _ptr_pServerName); err != nil {
		return err
	}
	if err := w.ReadData(&o.Attributes); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PrinterInfo5 structure represents PRINTER_INFO_5 RPC structure.
//
// The _PRINTER_INFO_5 structure specifies printer information.<128> It is a custom-marshaled
// form of the _PRINTER_INFO_5 (section 2.2.1.10.6) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The PRINTER_INFO_5 structure provides information about a printer.<60>
type PrinterInfo5 struct {
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	PortName    string `idl:"name:pPortName;string" json:"port_name"`
	Attributes  uint32 `idl:"name:Attributes" json:"attributes"`
	// DeviceNotSelectedTimeout: The maximum number of milliseconds between select attempts.
	// The DeviceNotSelectedTimeout value controls communication between the print server
	// and a print device. It does not have any effect on communication between the print
	// client and the print server.
	DeviceNotSelectedTimeout uint32 `idl:"name:DeviceNotSelectedTimeout" json:"device_not_selected_timeout"`
	// TransmissionRetryTimeout: The maximum number of milliseconds between retransmission
	// attempts. The TransmissionRetryTimeout value controls communication between the print
	// server and a print device. It does not have any effect on communication between the
	// print client and the print server.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
	TransmissionRetryTimeout uint32 `idl:"name:TransmissionRetryTimeout" json:"transmission_retry_timeout"`
}

func (o *PrinterInfo5) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo5) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PortName != "" {
		_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Attributes); err != nil {
		return err
	}
	if err := w.WriteData(o.DeviceNotSelectedTimeout); err != nil {
		return err
	}
	if err := w.WriteData(o.TransmissionRetryTimeout); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo5) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
		return nil
	})
	_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
		return err
	}
	if err := w.ReadData(&o.Attributes); err != nil {
		return err
	}
	if err := w.ReadData(&o.DeviceNotSelectedTimeout); err != nil {
		return err
	}
	if err := w.ReadData(&o.TransmissionRetryTimeout); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PrinterInfo6 structure represents PRINTER_INFO_6 RPC structure.
//
// The PRINTER_INFO_6 structure provides information about a printer.<61>
//
// The _PRINTER_INFO_6 structure specifies printer information.<129> It is a custom-marshaled
// form of the _PRINTER_INFO_6 (section 2.2.1.10.7) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type PrinterInfo6 struct {
	// dwStatus: The printer status. It MUST be the result of a bitwise OR of zero or more
	// of the printer status values defined in section 2.2.3.12.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
	Status uint32 `idl:"name:dwStatus" json:"status"`
}

func (o *PrinterInfo6) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo6) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo6) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	return nil
}

// PrinterInfo7 structure represents PRINTER_INFO_7 RPC structure.
//
// The _PRINTER_INFO_7 structure specifies printer information.<130> It is a custom-marshaled
// form of the _PRINTER_INFO_7 (section 2.2.1.10.8) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The PRINTER_INFO_7 structure provides directory service (DS) information about a
// printer.<62>
type PrinterInfo7 struct {
	// pszObjectGUID: A pointer to a curly braced GUID string that specifies the GUID used
	// by the DS to identify this printer, if it is used in a response to RpcGetPrinter
	// (section 3.1.4.2.6). The string MUST conform to the curly braced GUID string format
	// ([MS-DTYP] section 2.3.4.3).
	ObjectGUID string `idl:"name:pszObjectGUID;string" json:"object_guid"`
	// dwAction: An action for the printer to perform if it used by the client in a call
	// to RpcSetPrinter.
	//
	// The value of this member represents a DS-specific publishing state by the server
	// if it is used in a response to RpcGetPrinter.
	//
	// The value of this member MUST be a constant from the following table:
	//
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	|                              |                                                                                  |
	//	|          NAME/VALUE          |                                   DESCRIPTION                                    |
	//	|                              |                                                                                  |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DSPRINT_PUBLISH 0x00000001   | RpcSetPrinter: The server MUST publish the printer's data in the DS (section     |
	//	|                              | 2.3.3.1). RpcGetPrinter: The server MUST set this value to indicate the printer  |
	//	|                              | is published in the DS.                                                          |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DSPRINT_UPDATE 0x00000002    | RpcSetPrinter: The server MUST update the printer's published data in the DS     |
	//	|                              | (section 2.3.3.2). RpcGetPrinter: This value MUST NOT be returned by the server. |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DSPRINT_UNPUBLISH 0x00000004 | RpcSetPrinter: The server MUST remove the printer's published data from the DS   |
	//	|                              | (section 2.3.3.2). RpcGetPrinter: The server MUST set this value to indicate the |
	//	|                              | printer is not published.                                                        |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DSPRINT_REPUBLISH 0x00000008 | RpcSetPrinter: The server MUST unpublish (section 2.3.3.2) and publish again     |
	//	|                              | (section 2.3.3.1) the DS data for the printer. Republishing also MUST change     |
	//	|                              | the GUID of the published printer. RpcGetPrinter: The server MUST NOT set this   |
	//	|                              | value.                                                                           |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//	| DSPRINT_PENDING 0x80000000   | RpcSetPrinter: This value MUST NOT be used by the client. RpcGetPrinter:         |
	//	|                              | The server MUST return this value, if a previous publish or unpublish action     |
	//	|                              | initiated by RpcSetPrinter is still in progress.                                 |
	//	+------------------------------+----------------------------------------------------------------------------------+
	//
	// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
	Action uint32 `idl:"name:dwAction" json:"action"`
}

func (o *PrinterInfo7) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo7) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if o.ObjectGUID != "" {
		_ptr_pszObjectGUID := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ObjectGUID); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ObjectGUID, _ptr_pszObjectGUID); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Action); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo7) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	_ptr_pszObjectGUID := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ObjectGUID); err != nil {
			return err
		}
		return nil
	})
	_s_pszObjectGUID := func(ptr interface{}) { o.ObjectGUID = *ptr.(*string) }
	if err := w.ReadPointer(&o.ObjectGUID, _s_pszObjectGUID, _ptr_pszObjectGUID); err != nil {
		return err
	}
	if err := w.ReadData(&o.Action); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// PrinterInfo8 structure represents PRINTER_INFO_8 RPC structure.
//
// The _PRINTER_INFO_8 structure specifies printer information.<131> It is a custom-marshaled
// form of the _PRINTER_INFO_8 (section 2.2.1.10.9) structure.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Fixed_Portion (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| Variable_Data (variable)                                                                                                      |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//
// The PRINTER_INFO_8 structure provides information about a printer.<63>
//
// This structure is used for the global default settings of a printer.
//
// All members not defined in this section are specified in sections 2.2.1.3.6 and 2.2.1.3.
type PrinterInfo8 struct {
	DevMode uint64 `idl:"name:pDevMode" json:"dev_mode"`
}

func (o *PrinterInfo8) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo8) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(ndr.Uint3264(o.DevMode)); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo8) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.DevMode)); err != nil {
		return err
	}
	return nil
}

// PrinterInfo9 structure represents PRINTER_INFO_9 RPC structure.
//
// The PRINTER_INFO_9 structure is not used remotely.<64>
type PrinterInfo9 struct {
	DevMode uint64 `idl:"name:pDevMode" json:"dev_mode"`
}

func (o *PrinterInfo9) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo9) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(ndr.Uint3264(o.DevMode)); err != nil {
		return err
	}
	return nil
}
func (o *PrinterInfo9) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Uint3264)(&o.DevMode)); err != nil {
		return err
	}
	return nil
}

// ClientInfo1 structure represents SPLCLIENT_INFO_1 RPC structure.
//
// The SPLCLIENT_INFO_1 structure provides information about the calling client of the
// print server.<65>
type ClientInfo1 struct {
	// dwSize: The size, in bytes, of the structure.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.7 and 2.2.1.3.
	Size                  uint32 `idl:"name:dwSize" json:"size"`
	MachineName           string `idl:"name:pMachineName;string" json:"machine_name"`
	UserName              string `idl:"name:pUserName;string" json:"user_name"`
	BuildNum              uint32 `idl:"name:dwBuildNum" json:"build_num"`
	MajorVersion          uint32 `idl:"name:dwMajorVersion" json:"major_version"`
	MinorVersion          uint32 `idl:"name:dwMinorVersion" json:"minor_version"`
	ProcessorArchitecture uint16 `idl:"name:wProcessorArchitecture" json:"processor_architecture"`
}

func (o *ClientInfo1) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *ClientInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.BuildNum); err != nil {
		return err
	}
	if err := w.WriteData(o.MajorVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.MinorVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.ProcessorArchitecture); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(9); err != nil {
		return err
	}
	return nil
}
func (o *ClientInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	if err := w.ReadData(&o.BuildNum); err != nil {
		return err
	}
	if err := w.ReadData(&o.MajorVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.MinorVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.ProcessorArchitecture); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(9); err != nil {
		return err
	}
	return nil
}

// ClientInfo2 structure represents SPLCLIENT_INFO_2 RPC structure.
//
// The SPLCLIENT_INFO_2 structure is specified only as a placeholder in the IDL. It
// is not sent over the wire.
type ClientInfo2 struct {
	// notUsed: A value that MUST be ignored.
	NotUsed int64 `idl:"name:notUsed" json:"not_used"`
}

func (o *ClientInfo2) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *ClientInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(4); err != nil {
		return err
	}
	if err := w.WriteData(ndr.Int3264(o.NotUsed)); err != nil {
		return err
	}
	return nil
}
func (o *ClientInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(4); err != nil {
		return err
	}
	if err := w.ReadData((*ndr.Int3264)(&o.NotUsed)); err != nil {
		return err
	}
	return nil
}

// ClientInfo3 structure represents SPLCLIENT_INFO_3 RPC structure.
//
// The SPLCLIENT_INFO_3 structure provides information about the calling client of the
// print server.<66>
type ClientInfo3 struct {
	// cbSize: The size, in bytes, of the structure.
	Length uint32 `idl:"name:cbSize" json:"length"`
	// dwFlags: This member is reserved for future use. The value of this member SHOULD
	// be set to zero when sent and MUST be ignored on receipt.
	Flags uint32 `idl:"name:dwFlags" json:"flags"`
	// dwSize: This member is reserved for future use. The value of this member SHOULD be
	// set to zero when sent and MUST be ignored on receipt.
	Size                  uint32 `idl:"name:dwSize" json:"size"`
	MachineName           string `idl:"name:pMachineName;string" json:"machine_name"`
	UserName              string `idl:"name:pUserName;string" json:"user_name"`
	BuildNum              uint32 `idl:"name:dwBuildNum" json:"build_num"`
	MajorVersion          uint32 `idl:"name:dwMajorVersion" json:"major_version"`
	MinorVersion          uint32 `idl:"name:dwMinorVersion" json:"minor_version"`
	ProcessorArchitecture uint16 `idl:"name:wProcessorArchitecture" json:"processor_architecture"`
	// hSplPrinter: This member MUST NOT be used remotely and the value of this member SHOULD
	// be set to zero for calls that are made remotely.
	//
	// All members not defined in this section are specified in sections 2.2.1.3.7 and 2.2.1.3.
	Printer uint64 `idl:"name:hSplPrinter" json:"printer"`
}

func (o *ClientInfo3) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *ClientInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteData(o.Length); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.BuildNum); err != nil {
		return err
	}
	if err := w.WriteData(o.MajorVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.MinorVersion); err != nil {
		return err
	}
	if err := w.WriteData(o.ProcessorArchitecture); err != nil {
		return err
	}
	if err := w.WriteData(o.Printer); err != nil {
		return err
	}
	return nil
}
func (o *ClientInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadData(&o.Length); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	if err := w.ReadData(&o.BuildNum); err != nil {
		return err
	}
	if err := w.ReadData(&o.MajorVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.MinorVersion); err != nil {
		return err
	}
	if err := w.ReadData(&o.ProcessorArchitecture); err != nil {
		return err
	}
	if err := w.ReadData(&o.Printer); err != nil {
		return err
	}
	return nil
}

// DevModeContainer structure represents DEVMODE_CONTAINER RPC structure.
//
// The DEVMODE_CONTAINER structure specifies a _DEVMODE structure (section 2.2.2.1),
// which contains data for the initialization of a print device by a printer driver.
type DevModeContainer struct {
	// cbBuf: The size, in bytes, of the buffer pointed to by the pDevMode member.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// pDevMode: An optional pointer to a variable-length, custom-marshaled _DEVMODE structure.
	// The NULL value MUST be used to indicate that the default initialization data for
	// the printer driver SHOULD be used.
	DevMode []byte `idl:"name:pDevMode;size_is:(cbBuf);pointer:unique" json:"dev_mode"`
}

func (o *DevModeContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.DevMode != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.DevMode))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DevModeContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BufferLength); err != nil {
		return err
	}
	if o.DevMode != nil || o.BufferLength > 0 {
		_ptr_pDevMode := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.BufferLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.DevMode {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(o.DevMode[i1]); err != nil {
					return err
				}
			}
			for i1 := len(o.DevMode); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint8(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.DevMode, _ptr_pDevMode); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DevModeContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BufferLength); err != nil {
		return err
	}
	_ptr_pDevMode := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.BufferLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.BufferLength)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.DevMode", sizeInfo[0])
		}
		o.DevMode = make([]byte, sizeInfo[0])
		for i1 := range o.DevMode {
			i1 := i1
			if err := w.ReadData(&o.DevMode[i1]); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pDevMode := func(ptr interface{}) { o.DevMode = *ptr.(*[]byte) }
	if err := w.ReadPointer(&o.DevMode, _s_pDevMode, _ptr_pDevMode); err != nil {
		return err
	}
	return nil
}

// DocInfoContainer structure represents DOC_INFO_CONTAINER RPC structure.
//
// The DOC_INFO_CONTAINER structure provides information about the document to be printed,
// using the DOC_INFO_1 structure.
type DocInfoContainer struct {
	// Level: This member specifies the information level of the DocInfo member data. The
	// value of this member MUST be set to 0x00000001.
	Level uint32 `idl:"name:Level" json:"level"`
	// DocInfo: This member MUST define document properties, using an information structure
	// that MUST correspond to the value of the Level member.
	DocInfo *DocInfoContainer_DocInfo `idl:"name:DocInfo;switch_is:Level" json:"doc_info"`
}

func (o *DocInfoContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DocInfoContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swDocInfo := uint32(o.Level)
	if o.DocInfo != nil {
		if err := o.DocInfo.MarshalUnionNDR(ctx, w, _swDocInfo); err != nil {
			return err
		}
	} else {
		if err := (&DocInfoContainer_DocInfo{}).MarshalUnionNDR(ctx, w, _swDocInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *DocInfoContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.DocInfo == nil {
		o.DocInfo = &DocInfoContainer_DocInfo{}
	}
	_swDocInfo := uint32(o.Level)
	if err := o.DocInfo.UnmarshalUnionNDR(ctx, w, _swDocInfo); err != nil {
		return err
	}
	return nil
}

// DocInfoContainer_DocInfo structure represents DOC_INFO_CONTAINER union anonymous member.
//
// The DOC_INFO_CONTAINER structure provides information about the document to be printed,
// using the DOC_INFO_1 structure.
type DocInfoContainer_DocInfo struct {
	// Types that are assignable to Value
	//
	// *DocInfoContainer_DocInfo1
	Value is_DocInfoContainer_DocInfo `json:"value"`
}

func (o *DocInfoContainer_DocInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *DocInfoContainer_DocInfo1:
		if value != nil {
			return value.DocInfo1
		}
	}
	return nil
}

type is_DocInfoContainer_DocInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_DocInfoContainer_DocInfo()
}

func (o *DocInfoContainer_DocInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *DocInfoContainer_DocInfo1:
		return uint32(1)
	}
	return uint32(0)
}

func (o *DocInfoContainer_DocInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*DocInfoContainer_DocInfo1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DocInfoContainer_DocInfo1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *DocInfoContainer_DocInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &DocInfoContainer_DocInfo1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// DocInfoContainer_DocInfo1 structure represents DocInfoContainer_DocInfo RPC union arm.
//
// It has following labels: 1
type DocInfoContainer_DocInfo1 struct {
	// pDocInfo1: A pointer to a DOC_INFO_1 structure (section 2.2.1.4) that describes the
	// document that is printed.
	DocInfo1 *DocInfo1 `idl:"name:pDocInfo1" json:"doc_info1"`
}

func (*DocInfoContainer_DocInfo1) is_DocInfoContainer_DocInfo() {}

func (o *DocInfoContainer_DocInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.DocInfo1 != nil {
		_ptr_pDocInfo1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.DocInfo1 != nil {
				if err := o.DocInfo1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DocInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.DocInfo1, _ptr_pDocInfo1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DocInfoContainer_DocInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pDocInfo1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.DocInfo1 == nil {
			o.DocInfo1 = &DocInfo1{}
		}
		if err := o.DocInfo1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pDocInfo1 := func(ptr interface{}) { o.DocInfo1 = *ptr.(**DocInfo1) }
	if err := w.ReadPointer(&o.DocInfo1, _s_pDocInfo1, _ptr_pDocInfo1); err != nil {
		return err
	}
	return nil
}

// DriverContainer structure represents DRIVER_CONTAINER RPC structure.
//
// The DRIVER_CONTAINER structure provides information about printer drivers by using
// DRIVER_INFO structures (section 2.2.1.5). The DriverInfo member specifies the structure
// that defines the properties of a printer driver.
type DriverContainer struct {
	// Level: Specifies the information level of the DriverInfo data. The value of this
	// member MUST be in the range 0x00000002 to 0x00000004 inclusive, 0x00000006, or 0x00000008.
	Level uint32 `idl:"name:Level" json:"level"`
	// DriverInfo: Defines printer driver properties by using an information structure that
	// corresponds to the value of the Level member.
	DriverInfo *DriverContainer_DriverInfo `idl:"name:DriverInfo;switch_is:Level" json:"driver_info"`
}

func (o *DriverContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *DriverContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swDriverInfo := uint32(o.Level)
	if o.DriverInfo != nil {
		if err := o.DriverInfo.MarshalUnionNDR(ctx, w, _swDriverInfo); err != nil {
			return err
		}
	} else {
		if err := (&DriverContainer_DriverInfo{}).MarshalUnionNDR(ctx, w, _swDriverInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.DriverInfo == nil {
		o.DriverInfo = &DriverContainer_DriverInfo{}
	}
	_swDriverInfo := uint32(o.Level)
	if err := o.DriverInfo.UnmarshalUnionNDR(ctx, w, _swDriverInfo); err != nil {
		return err
	}
	return nil
}

// DriverContainer_DriverInfo structure represents DRIVER_CONTAINER union anonymous member.
//
// The DRIVER_CONTAINER structure provides information about printer drivers by using
// DRIVER_INFO structures (section 2.2.1.5). The DriverInfo member specifies the structure
// that defines the properties of a printer driver.
type DriverContainer_DriverInfo struct {
	// Types that are assignable to Value
	//
	// *DriverContainer_DriverInfo_NotUsed
	// *DriverContainer_DriverInfo_Level2
	// *DriverContainer_DriverInfo_Level3
	// *DriverContainer_DriverInfo_Level4
	// *DriverContainer_DriverInfo_Level6
	// *DriverContainer_DriverInfo_Level8
	Value is_DriverContainer_DriverInfo `json:"value"`
}

func (o *DriverContainer_DriverInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *DriverContainer_DriverInfo_NotUsed:
		if value != nil {
			return value.NotUsed
		}
	case *DriverContainer_DriverInfo_Level2:
		if value != nil {
			return value.Level2
		}
	case *DriverContainer_DriverInfo_Level3:
		if value != nil {
			return value.Level3
		}
	case *DriverContainer_DriverInfo_Level4:
		if value != nil {
			return value.Level4
		}
	case *DriverContainer_DriverInfo_Level6:
		if value != nil {
			return value.Level6
		}
	case *DriverContainer_DriverInfo_Level8:
		if value != nil {
			return value.Level8
		}
	}
	return nil
}

type is_DriverContainer_DriverInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_DriverContainer_DriverInfo()
}

func (o *DriverContainer_DriverInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *DriverContainer_DriverInfo_NotUsed:
		return uint32(1)
	case *DriverContainer_DriverInfo_Level2:
		return uint32(2)
	case *DriverContainer_DriverInfo_Level3:
		return uint32(3)
	case *DriverContainer_DriverInfo_Level4:
		return uint32(4)
	case *DriverContainer_DriverInfo_Level6:
		return uint32(6)
	case *DriverContainer_DriverInfo_Level8:
		return uint32(8)
	}
	return uint32(0)
}

func (o *DriverContainer_DriverInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*DriverContainer_DriverInfo_NotUsed)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer_DriverInfo_NotUsed{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*DriverContainer_DriverInfo_Level2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer_DriverInfo_Level2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(3):
		_o, _ := o.Value.(*DriverContainer_DriverInfo_Level3)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer_DriverInfo_Level3{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(4):
		_o, _ := o.Value.(*DriverContainer_DriverInfo_Level4)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer_DriverInfo_Level4{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(6):
		_o, _ := o.Value.(*DriverContainer_DriverInfo_Level6)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer_DriverInfo_Level6{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(8):
		_o, _ := o.Value.(*DriverContainer_DriverInfo_Level8)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer_DriverInfo_Level8{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *DriverContainer_DriverInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &DriverContainer_DriverInfo_NotUsed{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &DriverContainer_DriverInfo_Level2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(3):
		o.Value = &DriverContainer_DriverInfo_Level3{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(4):
		o.Value = &DriverContainer_DriverInfo_Level4{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(6):
		o.Value = &DriverContainer_DriverInfo_Level6{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(8):
		o.Value = &DriverContainer_DriverInfo_Level8{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// DriverContainer_DriverInfo_NotUsed structure represents DriverContainer_DriverInfo RPC union arm.
//
// It has following labels: 1
type DriverContainer_DriverInfo_NotUsed struct {
	// pNotUsed: A pointer to a structure that is specified only as a placeholder in the
	// IDL and MUST be ignored.
	NotUsed *DriverInfo1 `idl:"name:pNotUsed" json:"not_used"`
}

func (*DriverContainer_DriverInfo_NotUsed) is_DriverContainer_DriverInfo() {}

func (o *DriverContainer_DriverInfo_NotUsed) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.NotUsed != nil {
		_ptr_pNotUsed := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.NotUsed != nil {
				if err := o.NotUsed.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DriverInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.NotUsed, _ptr_pNotUsed); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer_DriverInfo_NotUsed) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pNotUsed := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.NotUsed == nil {
			o.NotUsed = &DriverInfo1{}
		}
		if err := o.NotUsed.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pNotUsed := func(ptr interface{}) { o.NotUsed = *ptr.(**DriverInfo1) }
	if err := w.ReadPointer(&o.NotUsed, _s_pNotUsed, _ptr_pNotUsed); err != nil {
		return err
	}
	return nil
}

// DriverContainer_DriverInfo_Level2 structure represents DriverContainer_DriverInfo RPC union arm.
//
// It has following labels: 2
type DriverContainer_DriverInfo_Level2 struct {
	// Level2: If the Level member is 0x00000002, this member is a pointer to a DRIVER_INFO_2
	// structure that provides printer driver information. For details, see section 2.2.1.5.2.
	Level2 *DriverInfo2 `idl:"name:Level2" json:"level2"`
}

func (*DriverContainer_DriverInfo_Level2) is_DriverContainer_DriverInfo() {}

func (o *DriverContainer_DriverInfo_Level2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level2 != nil {
		_ptr_Level2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level2 != nil {
				if err := o.Level2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DriverInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level2, _ptr_Level2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer_DriverInfo_Level2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level2 == nil {
			o.Level2 = &DriverInfo2{}
		}
		if err := o.Level2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level2 := func(ptr interface{}) { o.Level2 = *ptr.(**DriverInfo2) }
	if err := w.ReadPointer(&o.Level2, _s_Level2, _ptr_Level2); err != nil {
		return err
	}
	return nil
}

// DriverContainer_DriverInfo_Level3 structure represents DriverContainer_DriverInfo RPC union arm.
//
// It has following labels: 3
type DriverContainer_DriverInfo_Level3 struct {
	// Level3: If the Level member is 0x00000003, this member is a pointer to an RPC_DRIVER_INFO_3
	// structure that provides printer driver information. For details, see section 2.2.1.5.3.
	Level3 *DriverInfo3 `idl:"name:Level3" json:"level3"`
}

func (*DriverContainer_DriverInfo_Level3) is_DriverContainer_DriverInfo() {}

func (o *DriverContainer_DriverInfo_Level3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level3 != nil {
		_ptr_Level3 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level3 != nil {
				if err := o.Level3.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DriverInfo3{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level3, _ptr_Level3); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer_DriverInfo_Level3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level3 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level3 == nil {
			o.Level3 = &DriverInfo3{}
		}
		if err := o.Level3.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level3 := func(ptr interface{}) { o.Level3 = *ptr.(**DriverInfo3) }
	if err := w.ReadPointer(&o.Level3, _s_Level3, _ptr_Level3); err != nil {
		return err
	}
	return nil
}

// DriverContainer_DriverInfo_Level4 structure represents DriverContainer_DriverInfo RPC union arm.
//
// It has following labels: 4
type DriverContainer_DriverInfo_Level4 struct {
	// Level4: If the Level member is 0x00000004, this member is a pointer to an RPC_DRIVER_INFO_4
	// structure that provides printer driver information. For details, see section 2.2.1.5.4.
	Level4 *DriverInfo4 `idl:"name:Level4" json:"level4"`
}

func (*DriverContainer_DriverInfo_Level4) is_DriverContainer_DriverInfo() {}

func (o *DriverContainer_DriverInfo_Level4) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level4 != nil {
		_ptr_Level4 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level4 != nil {
				if err := o.Level4.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DriverInfo4{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level4, _ptr_Level4); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer_DriverInfo_Level4) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level4 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level4 == nil {
			o.Level4 = &DriverInfo4{}
		}
		if err := o.Level4.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level4 := func(ptr interface{}) { o.Level4 = *ptr.(**DriverInfo4) }
	if err := w.ReadPointer(&o.Level4, _s_Level4, _ptr_Level4); err != nil {
		return err
	}
	return nil
}

// DriverContainer_DriverInfo_Level6 structure represents DriverContainer_DriverInfo RPC union arm.
//
// It has following labels: 6
type DriverContainer_DriverInfo_Level6 struct {
	// Level6: If the Level member is 0x00000006, this member is a pointer to an RPC_DRIVER_INFO_6
	// structure that provides printer driver information. For details, see section 2.2.1.5.5.
	Level6 *DriverInfo6 `idl:"name:Level6" json:"level6"`
}

func (*DriverContainer_DriverInfo_Level6) is_DriverContainer_DriverInfo() {}

func (o *DriverContainer_DriverInfo_Level6) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level6 != nil {
		_ptr_Level6 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level6 != nil {
				if err := o.Level6.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DriverInfo6{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level6, _ptr_Level6); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer_DriverInfo_Level6) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level6 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level6 == nil {
			o.Level6 = &DriverInfo6{}
		}
		if err := o.Level6.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level6 := func(ptr interface{}) { o.Level6 = *ptr.(**DriverInfo6) }
	if err := w.ReadPointer(&o.Level6, _s_Level6, _ptr_Level6); err != nil {
		return err
	}
	return nil
}

// DriverContainer_DriverInfo_Level8 structure represents DriverContainer_DriverInfo RPC union arm.
//
// It has following labels: 8
type DriverContainer_DriverInfo_Level8 struct {
	// Level8: If the Level member is 0x00000008, this member is a pointer to an RPC_DRIVER_INFO_8
	// structure that provides printer driver information. For details, see section 2.2.1.5.6.
	Level8 *DriverInfo8 `idl:"name:Level8" json:"level8"`
}

func (*DriverContainer_DriverInfo_Level8) is_DriverContainer_DriverInfo() {}

func (o *DriverContainer_DriverInfo_Level8) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level8 != nil {
		_ptr_Level8 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level8 != nil {
				if err := o.Level8.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&DriverInfo8{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level8, _ptr_Level8); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *DriverContainer_DriverInfo_Level8) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level8 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level8 == nil {
			o.Level8 = &DriverInfo8{}
		}
		if err := o.Level8.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level8 := func(ptr interface{}) { o.Level8 = *ptr.(**DriverInfo8) }
	if err := w.ReadPointer(&o.Level8, _s_Level8, _ptr_Level8); err != nil {
		return err
	}
	return nil
}

// FormContainer structure represents FORM_CONTAINER RPC structure.
//
// The FORM_CONTAINER structure provides information about printer forms, using FORM_INFO
// structures. The FormInfo member specifies the structure that defines the printer
// form properties.
type FormContainer struct {
	// Level: The information level of the FormInfo data. The value of this member MUST
	// be 0x00000001 or 0x00000002.
	Level uint32 `idl:"name:Level" json:"level"`
	// FormInfo: This member MUST define printer form properties, using an information structure
	// that MUST correspond to the value of the Level member.
	FormInfo *FormContainer_FormInfo `idl:"name:FormInfo;switch_is:Level" json:"form_info"`
}

func (o *FormContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *FormContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swFormInfo := uint32(o.Level)
	if o.FormInfo != nil {
		if err := o.FormInfo.MarshalUnionNDR(ctx, w, _swFormInfo); err != nil {
			return err
		}
	} else {
		if err := (&FormContainer_FormInfo{}).MarshalUnionNDR(ctx, w, _swFormInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *FormContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.FormInfo == nil {
		o.FormInfo = &FormContainer_FormInfo{}
	}
	_swFormInfo := uint32(o.Level)
	if err := o.FormInfo.UnmarshalUnionNDR(ctx, w, _swFormInfo); err != nil {
		return err
	}
	return nil
}

// FormContainer_FormInfo structure represents FORM_CONTAINER union anonymous member.
//
// The FORM_CONTAINER structure provides information about printer forms, using FORM_INFO
// structures. The FormInfo member specifies the structure that defines the printer
// form properties.
type FormContainer_FormInfo struct {
	// Types that are assignable to Value
	//
	// *FormContainer_FormInfo_FormInfo1
	// *FormContainer_FormInfo_FormInfo2
	Value is_FormContainer_FormInfo `json:"value"`
}

func (o *FormContainer_FormInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *FormContainer_FormInfo_FormInfo1:
		if value != nil {
			return value.FormInfo1
		}
	case *FormContainer_FormInfo_FormInfo2:
		if value != nil {
			return value.FormInfo2
		}
	}
	return nil
}

type is_FormContainer_FormInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_FormContainer_FormInfo()
}

func (o *FormContainer_FormInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *FormContainer_FormInfo_FormInfo1:
		return uint32(1)
	case *FormContainer_FormInfo_FormInfo2:
		return uint32(2)
	}
	return uint32(0)
}

func (o *FormContainer_FormInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*FormContainer_FormInfo_FormInfo1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&FormContainer_FormInfo_FormInfo1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*FormContainer_FormInfo_FormInfo2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&FormContainer_FormInfo_FormInfo2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *FormContainer_FormInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &FormContainer_FormInfo_FormInfo1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &FormContainer_FormInfo_FormInfo2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// FormContainer_FormInfo_FormInfo1 structure represents FormContainer_FormInfo RPC union arm.
//
// It has following labels: 1
type FormContainer_FormInfo_FormInfo1 struct {
	// pFormInfo1: If the Level member is 0x00000001, this member is a pointer to a FORM_INFO_1
	// structure, which provides information about a printer form. For details, see section
	// 2.2.1.6.1.
	FormInfo1 *FormInfo1 `idl:"name:pFormInfo1" json:"form_info1"`
}

func (*FormContainer_FormInfo_FormInfo1) is_FormContainer_FormInfo() {}

func (o *FormContainer_FormInfo_FormInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.FormInfo1 != nil {
		_ptr_pFormInfo1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.FormInfo1 != nil {
				if err := o.FormInfo1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&FormInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.FormInfo1, _ptr_pFormInfo1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *FormContainer_FormInfo_FormInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pFormInfo1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.FormInfo1 == nil {
			o.FormInfo1 = &FormInfo1{}
		}
		if err := o.FormInfo1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pFormInfo1 := func(ptr interface{}) { o.FormInfo1 = *ptr.(**FormInfo1) }
	if err := w.ReadPointer(&o.FormInfo1, _s_pFormInfo1, _ptr_pFormInfo1); err != nil {
		return err
	}
	return nil
}

// FormContainer_FormInfo_FormInfo2 structure represents FormContainer_FormInfo RPC union arm.
//
// It has following labels: 2
type FormContainer_FormInfo_FormInfo2 struct {
	// pFormInfo2: If the Level member is 0x00000002, this member is a pointer to a RPC_FORM_INFO_2
	// structure, which provides information about a printer form. For details, see section
	// 2.2.1.6.2.
	FormInfo2 *FormInfo2 `idl:"name:pFormInfo2" json:"form_info2"`
}

func (*FormContainer_FormInfo_FormInfo2) is_FormContainer_FormInfo() {}

func (o *FormContainer_FormInfo_FormInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.FormInfo2 != nil {
		_ptr_pFormInfo2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.FormInfo2 != nil {
				if err := o.FormInfo2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&FormInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.FormInfo2, _ptr_pFormInfo2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *FormContainer_FormInfo_FormInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pFormInfo2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.FormInfo2 == nil {
			o.FormInfo2 = &FormInfo2{}
		}
		if err := o.FormInfo2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pFormInfo2 := func(ptr interface{}) { o.FormInfo2 = *ptr.(**FormInfo2) }
	if err := w.ReadPointer(&o.FormInfo2, _s_pFormInfo2, _ptr_pFormInfo2); err != nil {
		return err
	}
	return nil
}

// JobContainer structure represents JOB_CONTAINER RPC structure.
//
// The JOB_CONTAINER structure provides information about print jobs, using JOB_INFO
// structures. The JobInfo member specifies the structure that defines the print job
// properties.
type JobContainer struct {
	// Level: Specifies the information level of the JobInfo data. The value of this member
	// MUST be in the range 0x00000001 to 0x00000004 inclusive.
	Level uint32 `idl:"name:Level" json:"level"`
	// JobInfo: Defines print job properties, using an information structure that corresponds
	// to the value of the Level member.
	JobInfo *JobContainer_JobInfo `idl:"name:JobInfo;switch_is:Level" json:"job_info"`
}

func (o *JobContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *JobContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swJobInfo := uint32(o.Level)
	if o.JobInfo != nil {
		if err := o.JobInfo.MarshalUnionNDR(ctx, w, _swJobInfo); err != nil {
			return err
		}
	} else {
		if err := (&JobContainer_JobInfo{}).MarshalUnionNDR(ctx, w, _swJobInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *JobContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.JobInfo == nil {
		o.JobInfo = &JobContainer_JobInfo{}
	}
	_swJobInfo := uint32(o.Level)
	if err := o.JobInfo.UnmarshalUnionNDR(ctx, w, _swJobInfo); err != nil {
		return err
	}
	return nil
}

// JobContainer_JobInfo structure represents JOB_CONTAINER union anonymous member.
//
// The JOB_CONTAINER structure provides information about print jobs, using JOB_INFO
// structures. The JobInfo member specifies the structure that defines the print job
// properties.
type JobContainer_JobInfo struct {
	// Types that are assignable to Value
	//
	// *JobContainer_JobInfo_Level1
	// *JobContainer_JobInfo_Level2
	// *JobContainer_JobInfo_Level3
	// *JobContainer_JobInfo_Level4
	Value is_JobContainer_JobInfo `json:"value"`
}

func (o *JobContainer_JobInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *JobContainer_JobInfo_Level1:
		if value != nil {
			return value.Level1
		}
	case *JobContainer_JobInfo_Level2:
		if value != nil {
			return value.Level2
		}
	case *JobContainer_JobInfo_Level3:
		if value != nil {
			return value.Level3
		}
	case *JobContainer_JobInfo_Level4:
		if value != nil {
			return value.Level4
		}
	}
	return nil
}

type is_JobContainer_JobInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_JobContainer_JobInfo()
}

func (o *JobContainer_JobInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *JobContainer_JobInfo_Level1:
		return uint32(1)
	case *JobContainer_JobInfo_Level2:
		return uint32(2)
	case *JobContainer_JobInfo_Level3:
		return uint32(3)
	case *JobContainer_JobInfo_Level4:
		return uint32(4)
	}
	return uint32(0)
}

func (o *JobContainer_JobInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*JobContainer_JobInfo_Level1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&JobContainer_JobInfo_Level1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*JobContainer_JobInfo_Level2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&JobContainer_JobInfo_Level2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(3):
		_o, _ := o.Value.(*JobContainer_JobInfo_Level3)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&JobContainer_JobInfo_Level3{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(4):
		_o, _ := o.Value.(*JobContainer_JobInfo_Level4)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&JobContainer_JobInfo_Level4{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *JobContainer_JobInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &JobContainer_JobInfo_Level1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &JobContainer_JobInfo_Level2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(3):
		o.Value = &JobContainer_JobInfo_Level3{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(4):
		o.Value = &JobContainer_JobInfo_Level4{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// JobContainer_JobInfo_Level1 structure represents JobContainer_JobInfo RPC union arm.
//
// It has following labels: 1
type JobContainer_JobInfo_Level1 struct {
	// Level1: If the Level member is 0x00000001, this member is a pointer to a JOB_INFO_1
	// structure that provides print job information. For details, see section 2.2.1.7.1.
	Level1 *JobInfo1 `idl:"name:Level1" json:"level1"`
}

func (*JobContainer_JobInfo_Level1) is_JobContainer_JobInfo() {}

func (o *JobContainer_JobInfo_Level1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level1 != nil {
		_ptr_Level1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level1 != nil {
				if err := o.Level1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&JobInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level1, _ptr_Level1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *JobContainer_JobInfo_Level1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level1 == nil {
			o.Level1 = &JobInfo1{}
		}
		if err := o.Level1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level1 := func(ptr interface{}) { o.Level1 = *ptr.(**JobInfo1) }
	if err := w.ReadPointer(&o.Level1, _s_Level1, _ptr_Level1); err != nil {
		return err
	}
	return nil
}

// JobContainer_JobInfo_Level2 structure represents JobContainer_JobInfo RPC union arm.
//
// It has following labels: 2
type JobContainer_JobInfo_Level2 struct {
	// Level2: If the Level member is 0x00000002, this member is a pointer to a JOB_INFO_2
	// structure that provides print job information. For details, see section 2.2.1.7.2.
	Level2 *JobInfo2 `idl:"name:Level2" json:"level2"`
}

func (*JobContainer_JobInfo_Level2) is_JobContainer_JobInfo() {}

func (o *JobContainer_JobInfo_Level2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level2 != nil {
		_ptr_Level2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level2 != nil {
				if err := o.Level2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&JobInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level2, _ptr_Level2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *JobContainer_JobInfo_Level2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level2 == nil {
			o.Level2 = &JobInfo2{}
		}
		if err := o.Level2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level2 := func(ptr interface{}) { o.Level2 = *ptr.(**JobInfo2) }
	if err := w.ReadPointer(&o.Level2, _s_Level2, _ptr_Level2); err != nil {
		return err
	}
	return nil
}

// JobContainer_JobInfo_Level3 structure represents JobContainer_JobInfo RPC union arm.
//
// It has following labels: 3
type JobContainer_JobInfo_Level3 struct {
	// Level3: If the Level member is 0x00000003, this member is a pointer to a JOB_INFO_3
	// structure that provides print job information. For details, see section 2.2.1.7.3.
	Level3 *JobInfo3 `idl:"name:Level3" json:"level3"`
}

func (*JobContainer_JobInfo_Level3) is_JobContainer_JobInfo() {}

func (o *JobContainer_JobInfo_Level3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level3 != nil {
		_ptr_Level3 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level3 != nil {
				if err := o.Level3.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&JobInfo3{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level3, _ptr_Level3); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *JobContainer_JobInfo_Level3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level3 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level3 == nil {
			o.Level3 = &JobInfo3{}
		}
		if err := o.Level3.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level3 := func(ptr interface{}) { o.Level3 = *ptr.(**JobInfo3) }
	if err := w.ReadPointer(&o.Level3, _s_Level3, _ptr_Level3); err != nil {
		return err
	}
	return nil
}

// JobContainer_JobInfo_Level4 structure represents JobContainer_JobInfo RPC union arm.
//
// It has following labels: 4
type JobContainer_JobInfo_Level4 struct {
	// Level4: If the Level member is 0x00000004, this member is a pointer to a JOB_INFO_4
	// structure that provides print job information. For details, see section 2.2.1.7.4.
	Level4 *JobInfo4 `idl:"name:Level4" json:"level4"`
}

func (*JobContainer_JobInfo_Level4) is_JobContainer_JobInfo() {}

func (o *JobContainer_JobInfo_Level4) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Level4 != nil {
		_ptr_Level4 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Level4 != nil {
				if err := o.Level4.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&JobInfo4{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Level4, _ptr_Level4); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *JobContainer_JobInfo_Level4) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_Level4 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Level4 == nil {
			o.Level4 = &JobInfo4{}
		}
		if err := o.Level4.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_Level4 := func(ptr interface{}) { o.Level4 = *ptr.(**JobInfo4) }
	if err := w.ReadPointer(&o.Level4, _s_Level4, _ptr_Level4); err != nil {
		return err
	}
	return nil
}

// MonitorContainer structure represents MONITOR_CONTAINER RPC structure.
//
// The MONITOR_CONTAINER structure provides information about port monitors, using MONITOR_INFO
// structures. The MonitorInfo member specifies the structure that defines the port
// monitor properties.
type MonitorContainer struct {
	// Level: Specifies the information level of the MonitorInfo data. The value of this
	// member MUST be 0x00000001 or 0x00000002.
	Level uint32 `idl:"name:Level" json:"level"`
	// MonitorInfo: Defines port monitor properties, using an information structure that
	// corresponds to the value of the Level member.
	MonitorInfo *MonitorContainer_MonitorInfo `idl:"name:MonitorInfo;switch_is:Level" json:"monitor_info"`
}

func (o *MonitorContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *MonitorContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swMonitorInfo := uint32(o.Level)
	if o.MonitorInfo != nil {
		if err := o.MonitorInfo.MarshalUnionNDR(ctx, w, _swMonitorInfo); err != nil {
			return err
		}
	} else {
		if err := (&MonitorContainer_MonitorInfo{}).MarshalUnionNDR(ctx, w, _swMonitorInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *MonitorContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.MonitorInfo == nil {
		o.MonitorInfo = &MonitorContainer_MonitorInfo{}
	}
	_swMonitorInfo := uint32(o.Level)
	if err := o.MonitorInfo.UnmarshalUnionNDR(ctx, w, _swMonitorInfo); err != nil {
		return err
	}
	return nil
}

// MonitorContainer_MonitorInfo structure represents MONITOR_CONTAINER union anonymous member.
//
// The MONITOR_CONTAINER structure provides information about port monitors, using MONITOR_INFO
// structures. The MonitorInfo member specifies the structure that defines the port
// monitor properties.
type MonitorContainer_MonitorInfo struct {
	// Types that are assignable to Value
	//
	// *MonitorContainer_MonitorInfo_MonitorInfo1
	// *MonitorContainer_MonitorInfo_MonitorInfo2
	Value is_MonitorContainer_MonitorInfo `json:"value"`
}

func (o *MonitorContainer_MonitorInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *MonitorContainer_MonitorInfo_MonitorInfo1:
		if value != nil {
			return value.MonitorInfo1
		}
	case *MonitorContainer_MonitorInfo_MonitorInfo2:
		if value != nil {
			return value.MonitorInfo2
		}
	}
	return nil
}

type is_MonitorContainer_MonitorInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_MonitorContainer_MonitorInfo()
}

func (o *MonitorContainer_MonitorInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *MonitorContainer_MonitorInfo_MonitorInfo1:
		return uint32(1)
	case *MonitorContainer_MonitorInfo_MonitorInfo2:
		return uint32(2)
	}
	return uint32(0)
}

func (o *MonitorContainer_MonitorInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*MonitorContainer_MonitorInfo_MonitorInfo1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&MonitorContainer_MonitorInfo_MonitorInfo1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*MonitorContainer_MonitorInfo_MonitorInfo2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&MonitorContainer_MonitorInfo_MonitorInfo2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *MonitorContainer_MonitorInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &MonitorContainer_MonitorInfo_MonitorInfo1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &MonitorContainer_MonitorInfo_MonitorInfo2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// MonitorContainer_MonitorInfo_MonitorInfo1 structure represents MonitorContainer_MonitorInfo RPC union arm.
//
// It has following labels: 1
type MonitorContainer_MonitorInfo_MonitorInfo1 struct {
	// pMonitorInfo1: If the Level member is 0x00000001, this member is a pointer to a MONITOR_INFO_1
	// structure that provides information about a port monitor. For details, see section
	// 2.2.1.8.1.
	MonitorInfo1 *MonitorInfo1 `idl:"name:pMonitorInfo1" json:"monitor_info1"`
}

func (*MonitorContainer_MonitorInfo_MonitorInfo1) is_MonitorContainer_MonitorInfo() {}

func (o *MonitorContainer_MonitorInfo_MonitorInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.MonitorInfo1 != nil {
		_ptr_pMonitorInfo1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.MonitorInfo1 != nil {
				if err := o.MonitorInfo1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&MonitorInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorInfo1, _ptr_pMonitorInfo1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *MonitorContainer_MonitorInfo_MonitorInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pMonitorInfo1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.MonitorInfo1 == nil {
			o.MonitorInfo1 = &MonitorInfo1{}
		}
		if err := o.MonitorInfo1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorInfo1 := func(ptr interface{}) { o.MonitorInfo1 = *ptr.(**MonitorInfo1) }
	if err := w.ReadPointer(&o.MonitorInfo1, _s_pMonitorInfo1, _ptr_pMonitorInfo1); err != nil {
		return err
	}
	return nil
}

// MonitorContainer_MonitorInfo_MonitorInfo2 structure represents MonitorContainer_MonitorInfo RPC union arm.
//
// It has following labels: 2
type MonitorContainer_MonitorInfo_MonitorInfo2 struct {
	// pMonitorInfo2: If the Level member is 0x00000002, this member is a pointer to a MONITOR_INFO_2
	// structure that provides information about a port monitor. For details, see section
	// 2.2.1.8.2.
	MonitorInfo2 *MonitorInfo2 `idl:"name:pMonitorInfo2" json:"monitor_info2"`
}

func (*MonitorContainer_MonitorInfo_MonitorInfo2) is_MonitorContainer_MonitorInfo() {}

func (o *MonitorContainer_MonitorInfo_MonitorInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.MonitorInfo2 != nil {
		_ptr_pMonitorInfo2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.MonitorInfo2 != nil {
				if err := o.MonitorInfo2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&MonitorInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorInfo2, _ptr_pMonitorInfo2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *MonitorContainer_MonitorInfo_MonitorInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pMonitorInfo2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.MonitorInfo2 == nil {
			o.MonitorInfo2 = &MonitorInfo2{}
		}
		if err := o.MonitorInfo2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pMonitorInfo2 := func(ptr interface{}) { o.MonitorInfo2 = *ptr.(**MonitorInfo2) }
	if err := w.ReadPointer(&o.MonitorInfo2, _s_pMonitorInfo2, _ptr_pMonitorInfo2); err != nil {
		return err
	}
	return nil
}

// PortContainer structure represents PORT_CONTAINER RPC structure.
//
// The PORT_CONTAINER structure provides information about printer ports, using PORT_INFO
// structures.<4> The PortInfo member specifies the structure that defines the port
// properties.
type PortContainer struct {
	// Level: Specifies the information level of the PortInfo data. The value of this member
	// MUST be in the range 0x00000001 to 0x00000003 inclusive, or 0xFFFFFFFF.
	Level uint32 `idl:"name:Level" json:"level"`
	// PortInfo: Defines port properties, using an information structure that corresponds
	// to the value of the Level member.
	PortInfo *PortContainer_PortInfo `idl:"name:PortInfo;switch_is:(16777215 Level &)" json:"port_info"`
}

func (o *PortContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PortContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swPortInfo := uint32((16777215 & o.Level))
	if o.PortInfo != nil {
		if err := o.PortInfo.MarshalUnionNDR(ctx, w, _swPortInfo); err != nil {
			return err
		}
	} else {
		if err := (&PortContainer_PortInfo{}).MarshalUnionNDR(ctx, w, _swPortInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.PortInfo == nil {
		o.PortInfo = &PortContainer_PortInfo{}
	}
	_swPortInfo := uint32((16777215 & o.Level))
	if err := o.PortInfo.UnmarshalUnionNDR(ctx, w, _swPortInfo); err != nil {
		return err
	}
	return nil
}

// PortContainer_PortInfo structure represents PORT_CONTAINER union anonymous member.
//
// The PORT_CONTAINER structure provides information about printer ports, using PORT_INFO
// structures.<4> The PortInfo member specifies the structure that defines the port
// properties.
type PortContainer_PortInfo struct {
	// Types that are assignable to Value
	//
	// *PortContainer_PortInfo_PortInfo1
	// *PortContainer_PortInfo_PortInfo2
	// *PortContainer_PortInfo_PortInfo3
	// *PortContainer_PortInfo_PortInfo255
	Value is_PortContainer_PortInfo `json:"value"`
}

func (o *PortContainer_PortInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *PortContainer_PortInfo_PortInfo1:
		if value != nil {
			return value.PortInfo1
		}
	case *PortContainer_PortInfo_PortInfo2:
		if value != nil {
			return value.PortInfo2
		}
	case *PortContainer_PortInfo_PortInfo3:
		if value != nil {
			return value.PortInfo3
		}
	case *PortContainer_PortInfo_PortInfo255:
		if value != nil {
			return value.PortInfo255
		}
	}
	return nil
}

type is_PortContainer_PortInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_PortContainer_PortInfo()
}

func (o *PortContainer_PortInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *PortContainer_PortInfo_PortInfo1:
		return uint32(1)
	case *PortContainer_PortInfo_PortInfo2:
		return uint32(2)
	case *PortContainer_PortInfo_PortInfo3:
		return uint32(3)
	case *PortContainer_PortInfo_PortInfo255:
		return uint32(16777215)
	}
	return uint32(0)
}

func (o *PortContainer_PortInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*PortContainer_PortInfo_PortInfo1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortContainer_PortInfo_PortInfo1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*PortContainer_PortInfo_PortInfo2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortContainer_PortInfo_PortInfo2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(3):
		_o, _ := o.Value.(*PortContainer_PortInfo_PortInfo3)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortContainer_PortInfo_PortInfo3{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(16777215):
		_o, _ := o.Value.(*PortContainer_PortInfo_PortInfo255)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortContainer_PortInfo_PortInfo255{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *PortContainer_PortInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &PortContainer_PortInfo_PortInfo1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &PortContainer_PortInfo_PortInfo2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(3):
		o.Value = &PortContainer_PortInfo_PortInfo3{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(16777215):
		o.Value = &PortContainer_PortInfo_PortInfo255{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// PortContainer_PortInfo_PortInfo1 structure represents PortContainer_PortInfo RPC union arm.
//
// It has following labels: 1
type PortContainer_PortInfo_PortInfo1 struct {
	// pPortInfo1: If the Level member is 0x00000001, this member is a pointer to a PORT_INFO_1
	// structure that provides information about the printer port. For details, see section
	// 2.2.1.9.1.
	PortInfo1 *PortInfo1 `idl:"name:pPortInfo1" json:"port_info1"`
}

func (*PortContainer_PortInfo_PortInfo1) is_PortContainer_PortInfo() {}

func (o *PortContainer_PortInfo_PortInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PortInfo1 != nil {
		_ptr_pPortInfo1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PortInfo1 != nil {
				if err := o.PortInfo1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PortInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PortInfo1, _ptr_pPortInfo1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortContainer_PortInfo_PortInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPortInfo1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PortInfo1 == nil {
			o.PortInfo1 = &PortInfo1{}
		}
		if err := o.PortInfo1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPortInfo1 := func(ptr interface{}) { o.PortInfo1 = *ptr.(**PortInfo1) }
	if err := w.ReadPointer(&o.PortInfo1, _s_pPortInfo1, _ptr_pPortInfo1); err != nil {
		return err
	}
	return nil
}

// PortContainer_PortInfo_PortInfo2 structure represents PortContainer_PortInfo RPC union arm.
//
// It has following labels: 2
type PortContainer_PortInfo_PortInfo2 struct {
	// pPortInfo2: If the Level member is 0x00000002, this member is a pointer to a PORT_INFO_2
	// structure that provides information about the printer port. For details, see section
	// 2.2.1.9.2.
	PortInfo2 *PortInfo2 `idl:"name:pPortInfo2" json:"port_info2"`
}

func (*PortContainer_PortInfo_PortInfo2) is_PortContainer_PortInfo() {}

func (o *PortContainer_PortInfo_PortInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PortInfo2 != nil {
		_ptr_pPortInfo2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PortInfo2 != nil {
				if err := o.PortInfo2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PortInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PortInfo2, _ptr_pPortInfo2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortContainer_PortInfo_PortInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPortInfo2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PortInfo2 == nil {
			o.PortInfo2 = &PortInfo2{}
		}
		if err := o.PortInfo2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPortInfo2 := func(ptr interface{}) { o.PortInfo2 = *ptr.(**PortInfo2) }
	if err := w.ReadPointer(&o.PortInfo2, _s_pPortInfo2, _ptr_pPortInfo2); err != nil {
		return err
	}
	return nil
}

// PortContainer_PortInfo_PortInfo3 structure represents PortContainer_PortInfo RPC union arm.
//
// It has following labels: 3
type PortContainer_PortInfo_PortInfo3 struct {
	// pPortInfo3: If the Level member is 0x00000003, this member is a pointer to a PORT_INFO_3
	// structure that provides information about the printer port. For details, see section
	// 2.2.1.9.3.
	PortInfo3 *PortInfo3 `idl:"name:pPortInfo3" json:"port_info3"`
}

func (*PortContainer_PortInfo_PortInfo3) is_PortContainer_PortInfo() {}

func (o *PortContainer_PortInfo_PortInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PortInfo3 != nil {
		_ptr_pPortInfo3 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PortInfo3 != nil {
				if err := o.PortInfo3.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PortInfo3{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PortInfo3, _ptr_pPortInfo3); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortContainer_PortInfo_PortInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPortInfo3 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PortInfo3 == nil {
			o.PortInfo3 = &PortInfo3{}
		}
		if err := o.PortInfo3.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPortInfo3 := func(ptr interface{}) { o.PortInfo3 = *ptr.(**PortInfo3) }
	if err := w.ReadPointer(&o.PortInfo3, _s_pPortInfo3, _ptr_pPortInfo3); err != nil {
		return err
	}
	return nil
}

// PortContainer_PortInfo_PortInfo255 structure represents PortContainer_PortInfo RPC union arm.
//
// It has following labels: 16777215
type PortContainer_PortInfo_PortInfo255 struct {
	// pPortInfoFF: If the Level member is 0xFFFFFFFF, this member is a pointer to a PORT_INFO_FF
	// structure that provides information about the printer port. For details, see section
	// 2.2.1.9.4.
	PortInfo255 *PortInfo255 `idl:"name:pPortInfoFF" json:"port_info255"`
}

func (*PortContainer_PortInfo_PortInfo255) is_PortContainer_PortInfo() {}

func (o *PortContainer_PortInfo_PortInfo255) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PortInfo255 != nil {
		_ptr_pPortInfoFF := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PortInfo255 != nil {
				if err := o.PortInfo255.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PortInfo255{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PortInfo255, _ptr_pPortInfoFF); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortContainer_PortInfo_PortInfo255) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPortInfoFF := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PortInfo255 == nil {
			o.PortInfo255 = &PortInfo255{}
		}
		if err := o.PortInfo255.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPortInfoFF := func(ptr interface{}) { o.PortInfo255 = *ptr.(**PortInfo255) }
	if err := w.ReadPointer(&o.PortInfo255, _s_pPortInfoFF, _ptr_pPortInfoFF); err != nil {
		return err
	}
	return nil
}

// PortVarContainer structure represents PORT_VAR_CONTAINER RPC structure.
//
// The PORT_VAR_CONTAINER structure provides information for supported printer port
// monitors.<5>
type PortVarContainer struct {
	// cbMonitorData: The size, in bytes, of the buffer that is pointed to by the pMonitorData
	// member.
	MonitorDataLength uint32 `idl:"name:cbMonitorData" json:"monitor_data_length"`
	// pMonitorData: An optional pointer to a block of data that is passed to the port monitor.
	MonitorData []byte `idl:"name:pMonitorData;size_is:(cbMonitorData);pointer:unique" json:"monitor_data"`
}

func (o *PortVarContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.MonitorData != nil && o.MonitorDataLength == 0 {
		o.MonitorDataLength = uint32(len(o.MonitorData))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PortVarContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.MonitorDataLength); err != nil {
		return err
	}
	if o.MonitorData != nil || o.MonitorDataLength > 0 {
		_ptr_pMonitorData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.MonitorDataLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.MonitorData {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(o.MonitorData[i1]); err != nil {
					return err
				}
			}
			for i1 := len(o.MonitorData); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint8(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.MonitorData, _ptr_pMonitorData); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PortVarContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.MonitorDataLength); err != nil {
		return err
	}
	_ptr_pMonitorData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.MonitorDataLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.MonitorDataLength)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.MonitorData", sizeInfo[0])
		}
		o.MonitorData = make([]byte, sizeInfo[0])
		for i1 := range o.MonitorData {
			i1 := i1
			if err := w.ReadData(&o.MonitorData[i1]); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pMonitorData := func(ptr interface{}) { o.MonitorData = *ptr.(*[]byte) }
	if err := w.ReadPointer(&o.MonitorData, _s_pMonitorData, _ptr_pMonitorData); err != nil {
		return err
	}
	return nil
}

// PrinterContainer structure represents PRINTER_CONTAINER RPC structure.
//
// The PRINTER_CONTAINER structure provides information about printer properties and
// state information, using PRINTER_INFO structures (section 2.2.1.10). The PrinterInfo
// member specifies the structure that defines the printer properties.
type PrinterContainer struct {
	// Level: Specifies the information level of the PrinterInfo data. The value of this
	// member MUST be in the range 0x00000000 to 0x00000009 inclusive.
	Level uint32 `idl:"name:Level" json:"level"`
	// PrinterInfo: Provides printer information using a container structure that corresponds
	// to the value specified by the Level member.
	PrinterInfo *PrinterContainer_PrinterInfo `idl:"name:PrinterInfo;switch_is:Level" json:"printer_info"`
}

func (o *PrinterContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrinterContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swPrinterInfo := uint32(o.Level)
	if o.PrinterInfo != nil {
		if err := o.PrinterInfo.MarshalUnionNDR(ctx, w, _swPrinterInfo); err != nil {
			return err
		}
	} else {
		if err := (&PrinterContainer_PrinterInfo{}).MarshalUnionNDR(ctx, w, _swPrinterInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.PrinterInfo == nil {
		o.PrinterInfo = &PrinterContainer_PrinterInfo{}
	}
	_swPrinterInfo := uint32(o.Level)
	if err := o.PrinterInfo.UnmarshalUnionNDR(ctx, w, _swPrinterInfo); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo structure represents PRINTER_CONTAINER union anonymous member.
//
// The PRINTER_CONTAINER structure provides information about printer properties and
// state information, using PRINTER_INFO structures (section 2.2.1.10). The PrinterInfo
// member specifies the structure that defines the printer properties.
type PrinterContainer_PrinterInfo struct {
	// Types that are assignable to Value
	//
	// *PrinterContainer_PrinterInfo_PrinterInfoStress
	// *PrinterContainer_PrinterInfo_PrinterInfo1
	// *PrinterContainer_PrinterInfo_PrinterInfo2
	// *PrinterContainer_PrinterInfo_PrinterInfo3
	// *PrinterContainer_PrinterInfo_PrinterInfo4
	// *PrinterContainer_PrinterInfo_PrinterInfo5
	// *PrinterContainer_PrinterInfo_PrinterInfo6
	// *PrinterContainer_PrinterInfo_PrinterInfo7
	// *PrinterContainer_PrinterInfo_PrinterInfo8
	// *PrinterContainer_PrinterInfo_PrinterInfo9
	Value is_PrinterContainer_PrinterInfo `json:"value"`
}

func (o *PrinterContainer_PrinterInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *PrinterContainer_PrinterInfo_PrinterInfoStress:
		if value != nil {
			return value.PrinterInfoStress
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo1:
		if value != nil {
			return value.PrinterInfo1
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo2:
		if value != nil {
			return value.PrinterInfo2
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo3:
		if value != nil {
			return value.PrinterInfo3
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo4:
		if value != nil {
			return value.PrinterInfo4
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo5:
		if value != nil {
			return value.PrinterInfo5
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo6:
		if value != nil {
			return value.PrinterInfo6
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo7:
		if value != nil {
			return value.PrinterInfo7
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo8:
		if value != nil {
			return value.PrinterInfo8
		}
	case *PrinterContainer_PrinterInfo_PrinterInfo9:
		if value != nil {
			return value.PrinterInfo9
		}
	}
	return nil
}

type is_PrinterContainer_PrinterInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_PrinterContainer_PrinterInfo()
}

func (o *PrinterContainer_PrinterInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *PrinterContainer_PrinterInfo_PrinterInfoStress:
		return uint32(0)
	case *PrinterContainer_PrinterInfo_PrinterInfo1:
		return uint32(1)
	case *PrinterContainer_PrinterInfo_PrinterInfo2:
		return uint32(2)
	case *PrinterContainer_PrinterInfo_PrinterInfo3:
		return uint32(3)
	case *PrinterContainer_PrinterInfo_PrinterInfo4:
		return uint32(4)
	case *PrinterContainer_PrinterInfo_PrinterInfo5:
		return uint32(5)
	case *PrinterContainer_PrinterInfo_PrinterInfo6:
		return uint32(6)
	case *PrinterContainer_PrinterInfo_PrinterInfo7:
		return uint32(7)
	case *PrinterContainer_PrinterInfo_PrinterInfo8:
		return uint32(8)
	case *PrinterContainer_PrinterInfo_PrinterInfo9:
		return uint32(9)
	}
	return uint32(0)
}

func (o *PrinterContainer_PrinterInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(0):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfoStress)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfoStress{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(1):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(3):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo3)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo3{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(4):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo4)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo4{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(5):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo5)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo5{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(6):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo6)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo6{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(7):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo7)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo7{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(8):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo8)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo8{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(9):
		_o, _ := o.Value.(*PrinterContainer_PrinterInfo_PrinterInfo9)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer_PrinterInfo_PrinterInfo9{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *PrinterContainer_PrinterInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(0):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfoStress{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(1):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(3):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo3{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(4):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo4{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(5):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo5{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(6):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo6{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(7):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo7{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(8):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo8{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(9):
		o.Value = &PrinterContainer_PrinterInfo_PrinterInfo9{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfoStress structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 0
type PrinterContainer_PrinterInfo_PrinterInfoStress struct {
	// pPrinterInfoStress: If the Level member is 0x00000000, this member is a pointer to
	// a PRINTER_INFO_STRESS structure (section 2.2.1.10.1), which provides diagnostic printer
	// information.
	PrinterInfoStress *PrinterInfoStress `idl:"name:pPrinterInfoStress" json:"printer_info_stress"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfoStress) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfoStress) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfoStress != nil {
		_ptr_pPrinterInfoStress := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfoStress != nil {
				if err := o.PrinterInfoStress.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfoStress{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfoStress, _ptr_pPrinterInfoStress); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfoStress) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfoStress := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfoStress == nil {
			o.PrinterInfoStress = &PrinterInfoStress{}
		}
		if err := o.PrinterInfoStress.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfoStress := func(ptr interface{}) { o.PrinterInfoStress = *ptr.(**PrinterInfoStress) }
	if err := w.ReadPointer(&o.PrinterInfoStress, _s_pPrinterInfoStress, _ptr_pPrinterInfoStress); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo1 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 1
type PrinterContainer_PrinterInfo_PrinterInfo1 struct {
	// pPrinterInfo1: If the Level member is 0x00000001, this member is a pointer to a PRINTER_INFO_1
	// (section 2.2.1.10.2) structure, which provides printer information.
	PrinterInfo1 *PrinterInfo1 `idl:"name:pPrinterInfo1" json:"printer_info1"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo1) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo1 != nil {
		_ptr_pPrinterInfo1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo1 != nil {
				if err := o.PrinterInfo1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo1, _ptr_pPrinterInfo1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo1 == nil {
			o.PrinterInfo1 = &PrinterInfo1{}
		}
		if err := o.PrinterInfo1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo1 := func(ptr interface{}) { o.PrinterInfo1 = *ptr.(**PrinterInfo1) }
	if err := w.ReadPointer(&o.PrinterInfo1, _s_pPrinterInfo1, _ptr_pPrinterInfo1); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo2 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 2
type PrinterContainer_PrinterInfo_PrinterInfo2 struct {
	// pPrinterInfo2:If the Level member is 0x00000002, this member is a pointer to a PRINTER_INFO_2
	// (section 2.2.1.10.3) structure, which provides detailed printer information.
	PrinterInfo2 *PrinterInfo2 `idl:"name:pPrinterInfo2" json:"printer_info2"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo2) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo2 != nil {
		_ptr_pPrinterInfo2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo2 != nil {
				if err := o.PrinterInfo2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo2, _ptr_pPrinterInfo2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo2 == nil {
			o.PrinterInfo2 = &PrinterInfo2{}
		}
		if err := o.PrinterInfo2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo2 := func(ptr interface{}) { o.PrinterInfo2 = *ptr.(**PrinterInfo2) }
	if err := w.ReadPointer(&o.PrinterInfo2, _s_pPrinterInfo2, _ptr_pPrinterInfo2); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo3 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 3
type PrinterContainer_PrinterInfo_PrinterInfo3 struct {
	// pPrinterInfo3: If the Level member is 0x00000003, this member is a pointer to a PRINTER_INFO_3
	// (section 2.2.1.10.4) structure, which provides printer security information.
	PrinterInfo3 *PrinterInfo3 `idl:"name:pPrinterInfo3" json:"printer_info3"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo3) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo3) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo3 != nil {
		_ptr_pPrinterInfo3 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo3 != nil {
				if err := o.PrinterInfo3.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo3{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo3, _ptr_pPrinterInfo3); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo3) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo3 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo3 == nil {
			o.PrinterInfo3 = &PrinterInfo3{}
		}
		if err := o.PrinterInfo3.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo3 := func(ptr interface{}) { o.PrinterInfo3 = *ptr.(**PrinterInfo3) }
	if err := w.ReadPointer(&o.PrinterInfo3, _s_pPrinterInfo3, _ptr_pPrinterInfo3); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo4 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 4
type PrinterContainer_PrinterInfo_PrinterInfo4 struct {
	// pPrinterInfo4: If the Level member is 0x00000004, this member is a pointer to a PRINTER_INFO_4
	// (section 2.2.1.10.5) structure, which provides a subset of the printer information.
	PrinterInfo4 *PrinterInfo4 `idl:"name:pPrinterInfo4" json:"printer_info4"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo4) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo4) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo4 != nil {
		_ptr_pPrinterInfo4 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo4 != nil {
				if err := o.PrinterInfo4.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo4{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo4, _ptr_pPrinterInfo4); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo4) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo4 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo4 == nil {
			o.PrinterInfo4 = &PrinterInfo4{}
		}
		if err := o.PrinterInfo4.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo4 := func(ptr interface{}) { o.PrinterInfo4 = *ptr.(**PrinterInfo4) }
	if err := w.ReadPointer(&o.PrinterInfo4, _s_pPrinterInfo4, _ptr_pPrinterInfo4); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo5 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 5
type PrinterContainer_PrinterInfo_PrinterInfo5 struct {
	// pPrinterInfo5: If the Level member is 0x00000005, this member is a pointer to a PRINTER_INFO_5
	// (section 2.2.1.10.6) structure, which provides information about the printer attributes.
	PrinterInfo5 *PrinterInfo5 `idl:"name:pPrinterInfo5" json:"printer_info5"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo5) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo5) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo5 != nil {
		_ptr_pPrinterInfo5 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo5 != nil {
				if err := o.PrinterInfo5.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo5{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo5, _ptr_pPrinterInfo5); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo5) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo5 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo5 == nil {
			o.PrinterInfo5 = &PrinterInfo5{}
		}
		if err := o.PrinterInfo5.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo5 := func(ptr interface{}) { o.PrinterInfo5 = *ptr.(**PrinterInfo5) }
	if err := w.ReadPointer(&o.PrinterInfo5, _s_pPrinterInfo5, _ptr_pPrinterInfo5); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo6 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 6
type PrinterContainer_PrinterInfo_PrinterInfo6 struct {
	// pPrinterInfo6: If the Level member is 0x00000006, this member is a pointer to a PRINTER_INFO_6
	// (section 2.2.1.10.7) structure, which provides information about the status of the
	// printer.
	PrinterInfo6 *PrinterInfo6 `idl:"name:pPrinterInfo6" json:"printer_info6"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo6) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo6) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo6 != nil {
		_ptr_pPrinterInfo6 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo6 != nil {
				if err := o.PrinterInfo6.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo6{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo6, _ptr_pPrinterInfo6); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo6) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo6 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo6 == nil {
			o.PrinterInfo6 = &PrinterInfo6{}
		}
		if err := o.PrinterInfo6.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo6 := func(ptr interface{}) { o.PrinterInfo6 = *ptr.(**PrinterInfo6) }
	if err := w.ReadPointer(&o.PrinterInfo6, _s_pPrinterInfo6, _ptr_pPrinterInfo6); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo7 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 7
type PrinterContainer_PrinterInfo_PrinterInfo7 struct {
	// pPrinterInfo7: If the Level member is 0x00000007, this member is a pointer to a PRINTER_INFO_7
	// (section 2.2.1.10.8) structure, which provides directory service (DS) information.
	PrinterInfo7 *PrinterInfo7 `idl:"name:pPrinterInfo7" json:"printer_info7"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo7) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo7) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo7 != nil {
		_ptr_pPrinterInfo7 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo7 != nil {
				if err := o.PrinterInfo7.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo7{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo7, _ptr_pPrinterInfo7); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo7) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo7 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo7 == nil {
			o.PrinterInfo7 = &PrinterInfo7{}
		}
		if err := o.PrinterInfo7.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo7 := func(ptr interface{}) { o.PrinterInfo7 = *ptr.(**PrinterInfo7) }
	if err := w.ReadPointer(&o.PrinterInfo7, _s_pPrinterInfo7, _ptr_pPrinterInfo7); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo8 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 8
type PrinterContainer_PrinterInfo_PrinterInfo8 struct {
	// pPrinterInfo8: If the Level member is 0x00000008, this member is a pointer to a PRINTER_INFO_8
	// (section 2.2.1.10.9) structure, which provides information about the global printer
	// driver settings for a printer.
	PrinterInfo8 *PrinterInfo8 `idl:"name:pPrinterInfo8" json:"printer_info8"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo8) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo8) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo8 != nil {
		_ptr_pPrinterInfo8 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo8 != nil {
				if err := o.PrinterInfo8.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo8{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo8, _ptr_pPrinterInfo8); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo8) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo8 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo8 == nil {
			o.PrinterInfo8 = &PrinterInfo8{}
		}
		if err := o.PrinterInfo8.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo8 := func(ptr interface{}) { o.PrinterInfo8 = *ptr.(**PrinterInfo8) }
	if err := w.ReadPointer(&o.PrinterInfo8, _s_pPrinterInfo8, _ptr_pPrinterInfo8); err != nil {
		return err
	}
	return nil
}

// PrinterContainer_PrinterInfo_PrinterInfo9 structure represents PrinterContainer_PrinterInfo RPC union arm.
//
// It has following labels: 9
type PrinterContainer_PrinterInfo_PrinterInfo9 struct {
	// pPrinterInfo9: If the Level member is 0x00000009, this member is a pointer to a PRINTER_INFO_9
	// (section 2.2.1.10.10) structure. The PRINTER_INFO_9 structure is not used remotely,
	// but it is included in this structure to yield a compatible IDL file. The print server
	// MUST respond with ERROR_NOT_SUPPORTED if it receives a PRINTER_CONTAINER structure
	// with a Level value equal to 0x00000009.
	PrinterInfo9 *PrinterInfo9 `idl:"name:pPrinterInfo9" json:"printer_info9"`
}

func (*PrinterContainer_PrinterInfo_PrinterInfo9) is_PrinterContainer_PrinterInfo() {}

func (o *PrinterContainer_PrinterInfo_PrinterInfo9) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PrinterInfo9 != nil {
		_ptr_pPrinterInfo9 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.PrinterInfo9 != nil {
				if err := o.PrinterInfo9.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&PrinterInfo9{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterInfo9, _ptr_pPrinterInfo9); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrinterContainer_PrinterInfo_PrinterInfo9) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pPrinterInfo9 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.PrinterInfo9 == nil {
			o.PrinterInfo9 = &PrinterInfo9{}
		}
		if err := o.PrinterInfo9.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterInfo9 := func(ptr interface{}) { o.PrinterInfo9 = *ptr.(**PrinterInfo9) }
	if err := w.ReadPointer(&o.PrinterInfo9, _s_pPrinterInfo9, _ptr_pPrinterInfo9); err != nil {
		return err
	}
	return nil
}

// BinaryContainer structure represents RPC_BINARY_CONTAINER RPC structure.
//
// The RPC_BINARY_CONTAINER structure is a container for binary printer data and is
// used in the RPC_BIDI_DATA (section 2.2.1.12.3) structure.<8>
type BinaryContainer struct {
	// cbBuf: This member specifies the size, in bytes, of the buffer that is pointed to
	// by the pszString member.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// pszString: A pointer to an array of bytes that contain binary printer data.
	String []byte `idl:"name:pszString;size_is:(cbBuf);pointer:unique" json:"string"`
}

func (o *BinaryContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.String != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.String))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BinaryContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BufferLength); err != nil {
		return err
	}
	if o.String != nil || o.BufferLength > 0 {
		_ptr_pszString := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.BufferLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.String {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(o.String[i1]); err != nil {
					return err
				}
			}
			for i1 := len(o.String); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint8(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.String, _ptr_pszString); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BinaryContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BufferLength); err != nil {
		return err
	}
	_ptr_pszString := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.BufferLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.BufferLength)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.String", sizeInfo[0])
		}
		o.String = make([]byte, sizeInfo[0])
		for i1 := range o.String {
			i1 := i1
			if err := w.ReadData(&o.String[i1]); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pszString := func(ptr interface{}) { o.String = *ptr.(*[]byte) }
	if err := w.ReadPointer(&o.String, _s_pszString, _ptr_pszString); err != nil {
		return err
	}
	return nil
}

// BIDIData structure represents RPC_BIDI_DATA RPC structure.
//
// The RPC_BIDI_DATA structure is used to store the values of a bidirectional schema.<72>
type BIDIData struct {
	// dwBidiType: The type of data in a bidirectional request. The value of this member
	// specifies a valid structure for the u union. The value of this member MUST be one
	// of the BIDI_TYPE enumeration values specified in section 2.2.3.13.
	BIDIType uint32 `idl:"name:dwBidiType" json:"bidi_type"`
	// u: The bidirectional data in the format specified by the value of the dwBidiType
	// member.
	Union *BIDIData_Union `idl:"name:u;switch_is:dwBidiType" json:"union"`
}

func (o *BIDIData) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BIDIData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BIDIType); err != nil {
		return err
	}
	_swUnion := uint32(o.BIDIType)
	if o.Union != nil {
		if err := o.Union.MarshalUnionNDR(ctx, w, _swUnion); err != nil {
			return err
		}
	} else {
		if err := (&BIDIData_Union{}).MarshalUnionNDR(ctx, w, _swUnion); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BIDIType); err != nil {
		return err
	}
	if o.Union == nil {
		o.Union = &BIDIData_Union{}
	}
	_swUnion := uint32(o.BIDIType)
	if err := o.Union.UnmarshalUnionNDR(ctx, w, _swUnion); err != nil {
		return err
	}
	return nil
}

// BIDIData_Union structure represents RPC_BIDI_DATA union anonymous member.
//
// The RPC_BIDI_DATA structure is used to store the values of a bidirectional schema.<72>
type BIDIData_Union struct {
	// Types that are assignable to Value
	//
	// *BIDIData_Union_BoolData
	// *BIDIData_Union_IntData
	// *BIDIData_Union_StringData
	// *BIDIData_Union_FloatData
	// *BIDIData_Union_BinaryData
	Value is_BIDIData_Union `json:"value"`
}

func (o *BIDIData_Union) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *BIDIData_Union_BoolData:
		if value != nil {
			return value.BoolData
		}
	case *BIDIData_Union_IntData:
		if value != nil {
			return value.IntData
		}
	case *BIDIData_Union_StringData:
		if value != nil {
			return value.StringData
		}
	case *BIDIData_Union_FloatData:
		if value != nil {
			return value.FloatData
		}
	case *BIDIData_Union_BinaryData:
		if value != nil {
			return value.BinaryData
		}
	}
	return nil
}

type is_BIDIData_Union interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_BIDIData_Union()
}

func (o *BIDIData_Union) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *BIDIData_Union_BoolData:
		switch sw {
		case uint32(0),
			uint32(3):
			return sw
		}
		return uint32(0)
	case *BIDIData_Union_IntData:
		return uint32(1)
	case *BIDIData_Union_StringData:
		switch sw {
		case uint32(4),
			uint32(5),
			uint32(6):
			return sw
		}
		return uint32(4)
	case *BIDIData_Union_FloatData:
		return uint32(2)
	case *BIDIData_Union_BinaryData:
		return uint32(7)
	}
	return uint32(0)
}

func (o *BIDIData_Union) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(0),
		uint32(3):
		_o, _ := o.Value.(*BIDIData_Union_BoolData)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BIDIData_Union_BoolData{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(1):
		_o, _ := o.Value.(*BIDIData_Union_IntData)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BIDIData_Union_IntData{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(4),
		uint32(5),
		uint32(6):
		_o, _ := o.Value.(*BIDIData_Union_StringData)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BIDIData_Union_StringData{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*BIDIData_Union_FloatData)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BIDIData_Union_FloatData{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(7):
		_o, _ := o.Value.(*BIDIData_Union_BinaryData)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BIDIData_Union_BinaryData{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *BIDIData_Union) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(0),
		uint32(3):
		o.Value = &BIDIData_Union_BoolData{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(1):
		o.Value = &BIDIData_Union_IntData{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(4),
		uint32(5),
		uint32(6):
		o.Value = &BIDIData_Union_StringData{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &BIDIData_Union_FloatData{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(7):
		o.Value = &BIDIData_Union_BinaryData{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// BIDIData_Union_BoolData structure represents BIDIData_Union RPC union arm.
//
// It has following labels: 0, 3
type BIDIData_Union_BoolData struct {
	BoolData int32 `idl:"name:boolData" json:"bool_data"`
}

func (*BIDIData_Union_BoolData) is_BIDIData_Union() {}

func (o *BIDIData_Union_BoolData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := w.WriteData(o.BoolData); err != nil {
		return err
	}
	return nil
}
func (o *BIDIData_Union_BoolData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadData(&o.BoolData); err != nil {
		return err
	}
	return nil
}

// BIDIData_Union_IntData structure represents BIDIData_Union RPC union arm.
//
// It has following labels: 1
type BIDIData_Union_IntData struct {
	IntData int32 `idl:"name:intData" json:"int_data"`
}

func (*BIDIData_Union_IntData) is_BIDIData_Union() {}

func (o *BIDIData_Union_IntData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := w.WriteData(o.IntData); err != nil {
		return err
	}
	return nil
}
func (o *BIDIData_Union_IntData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadData(&o.IntData); err != nil {
		return err
	}
	return nil
}

// BIDIData_Union_StringData structure represents BIDIData_Union RPC union arm.
//
// It has following labels: 4, 5, 6
type BIDIData_Union_StringData struct {
	StringData string `idl:"name:stringData;string;pointer:unique" json:"string_data"`
}

func (*BIDIData_Union_StringData) is_BIDIData_Union() {}

func (o *BIDIData_Union_StringData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.StringData != "" {
		_ptr_stringData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.StringData); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.StringData, _ptr_stringData); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIData_Union_StringData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_stringData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.StringData); err != nil {
			return err
		}
		return nil
	})
	_s_stringData := func(ptr interface{}) { o.StringData = *ptr.(*string) }
	if err := w.ReadPointer(&o.StringData, _s_stringData, _ptr_stringData); err != nil {
		return err
	}
	return nil
}

// BIDIData_Union_FloatData structure represents BIDIData_Union RPC union arm.
//
// It has following labels: 2
type BIDIData_Union_FloatData struct {
	FloatData float32 `idl:"name:floatData" json:"float_data"`
}

func (*BIDIData_Union_FloatData) is_BIDIData_Union() {}

func (o *BIDIData_Union_FloatData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := w.WriteData(o.FloatData); err != nil {
		return err
	}
	return nil
}
func (o *BIDIData_Union_FloatData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadData(&o.FloatData); err != nil {
		return err
	}
	return nil
}

// BIDIData_Union_BinaryData structure represents BIDIData_Union RPC union arm.
//
// It has following labels: 7
type BIDIData_Union_BinaryData struct {
	BinaryData *BinaryContainer `idl:"name:binaryData" json:"binary_data"`
}

func (*BIDIData_Union_BinaryData) is_BIDIData_Union() {}

func (o *BIDIData_Union_BinaryData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.BinaryData != nil {
		if err := o.BinaryData.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BinaryContainer{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIData_Union_BinaryData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.BinaryData == nil {
		o.BinaryData = &BinaryContainer{}
	}
	if err := o.BinaryData.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BIDIRequestData structure represents RPC_BIDI_REQUEST_DATA RPC structure.
//
// The RPC_BIDI_REQUEST_DATA structure holds a single bidirectional request.<67> The
// request is part of a bidirectional communication request using the RpcSendRecvBidiData
// (section 3.1.4.2.27) method. One or more RPC_BIDI_REQUEST_DATA structures MUST be
// contained in a RPC_BIDI_REQUEST_CONTAINER (section 2.2.1.2.10).
type BIDIRequestData struct {
	// dwReqNumber: The index of the request, which is used to match a response to a request
	// in a multirequest operation.
	RequestNumber uint32 `idl:"name:dwReqNumber" json:"request_number"`
	// pSchema: A pointer to the schema string that identifies the requested information.<68>
	Schema string `idl:"name:pSchema;string;pointer:unique" json:"schema"`
	// data: The data that is associated with the schema.
	Data *BIDIData `idl:"name:data" json:"data"`
}

func (o *BIDIRequestData) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BIDIRequestData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.RequestNumber); err != nil {
		return err
	}
	if o.Schema != "" {
		_ptr_pSchema := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Schema); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Schema, _ptr_pSchema); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Data != nil {
		if err := o.Data.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BIDIData{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIRequestData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.RequestNumber); err != nil {
		return err
	}
	_ptr_pSchema := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Schema); err != nil {
			return err
		}
		return nil
	})
	_s_pSchema := func(ptr interface{}) { o.Schema = *ptr.(*string) }
	if err := w.ReadPointer(&o.Schema, _s_pSchema, _ptr_pSchema); err != nil {
		return err
	}
	if o.Data == nil {
		o.Data = &BIDIData{}
	}
	if err := o.Data.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BIDIResponseData structure represents RPC_BIDI_RESPONSE_DATA RPC structure.
//
// The RPC_BIDI_RESPONSE_DATA structure holds a single bidirectional response.<69>
type BIDIResponseData struct {
	// dwResult: The result of the operation that used this structure. If the operation
	// was successful, the value of this member MUST be set to zero; otherwise, the value
	// of this member MUST be set to a nonzero value.<70>
	Result uint32 `idl:"name:dwResult" json:"result"`
	// dwReqNumber: The index of the response, which is used to match the response to the
	// request in a multi-request operation.
	RequestNumber uint32 `idl:"name:dwReqNumber" json:"request_number"`
	// pSchema: A pointer to the schema string that identifies the requested information.<71>
	Schema string `idl:"name:pSchema;string;pointer:unique" json:"schema"`
	// data: The data that is associated with the schema. This can be a single piece of
	// data or a homogeneous data list. The data MUST be composed of a name, a type, and
	// a value; for example, "\Printer.Stapler:CurrentValue". It is referenced by its name
	// under Properties.
	Data *BIDIData `idl:"name:data" json:"data"`
}

func (o *BIDIResponseData) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BIDIResponseData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Result); err != nil {
		return err
	}
	if err := w.WriteData(o.RequestNumber); err != nil {
		return err
	}
	if o.Schema != "" {
		_ptr_pSchema := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.Schema); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.Schema, _ptr_pSchema); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.Data != nil {
		if err := o.Data.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BIDIData{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIResponseData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Result); err != nil {
		return err
	}
	if err := w.ReadData(&o.RequestNumber); err != nil {
		return err
	}
	_ptr_pSchema := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.Schema); err != nil {
			return err
		}
		return nil
	})
	_s_pSchema := func(ptr interface{}) { o.Schema = *ptr.(*string) }
	if err := w.ReadPointer(&o.Schema, _s_pSchema, _ptr_pSchema); err != nil {
		return err
	}
	if o.Data == nil {
		o.Data = &BIDIData{}
	}
	if err := o.Data.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BIDIRequestContainer structure represents RPC_BIDI_REQUEST_CONTAINER RPC structure.
//
// The RPC_BIDI_REQUEST_CONTAINER structure is a container for a list of bidirectional
// requests.<6>
type BIDIRequestContainer struct {
	// Version: The version of the bidirectional API schema. The value of this member MUST
	// be 0x00000001.
	Version uint32 `idl:"name:Version" json:"version"`
	// Flags: A value that MUST be set to zero when sent and MUST be ignored on receipt.
	Flags uint32 `idl:"name:Flags" json:"flags"`
	// Count: The number of bidirectional requests in the aData member.
	Count uint32 `idl:"name:Count" json:"count"`
	// aData: An array of RPC_BIDI_REQUEST_DATA structures. Each structure in this member
	// contains a single bidirectional request. For details, see section 2.2.1.12.1.
	Data []*BIDIRequestData `idl:"name:aData;size_is:(Count);pointer:unique" json:"data"`
}

func (o *BIDIRequestContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Data != nil && o.Count == 0 {
		o.Count = uint32(len(o.Data))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BIDIRequestContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Version); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if err := w.WriteData(o.Count); err != nil {
		return err
	}
	if o.Data != nil || o.Count > 0 {
		_ptr_aData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.Count)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Data {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if o.Data[i1] != nil {
					if err := o.Data[i1].MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&BIDIRequestData{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
			}
			for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
				if err := (&BIDIRequestData{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Data, _ptr_aData); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIRequestContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Version); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	if err := w.ReadData(&o.Count); err != nil {
		return err
	}
	_ptr_aData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.Count > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.Count)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]*BIDIRequestData, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if o.Data[i1] == nil {
				o.Data[i1] = &BIDIRequestData{}
			}
			if err := o.Data[i1].UnmarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		return nil
	})
	_s_aData := func(ptr interface{}) { o.Data = *ptr.(*[]*BIDIRequestData) }
	if err := w.ReadPointer(&o.Data, _s_aData, _ptr_aData); err != nil {
		return err
	}
	return nil
}

// BIDIResponseContainer structure represents RPC_BIDI_RESPONSE_CONTAINER RPC structure.
//
// The RPC_BIDI_RESPONSE_CONTAINER structure is a container for a list of bidirectional
// responses.<7>
type BIDIResponseContainer struct {
	// Version: This member MUST contain the value that specifies the version of the bidirectional
	// API schema. The value of this member MUST be 0x00000001.
	Version uint32 `idl:"name:Version" json:"version"`
	// Flags: This member is a set of flags that are reserved for system use. The value
	// of this member MUST be set to zero when sent and MUST be ignored on receipt.
	Flags uint32 `idl:"name:Flags" json:"flags"`
	// Count: This member specifies the number of bidirectional responses in the aData member.
	Count uint32 `idl:"name:Count" json:"count"`
	// aData: This member is an array of RPC_BIDI_RESPONSE_DATA structures. Each structure
	// in this member MUST contain a single bidirectional response. For more information,
	// see section 2.2.1.12.2.
	Data []*BIDIResponseData `idl:"name:aData;size_is:(Count);pointer:unique" json:"data"`
}

func (o *BIDIResponseContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Data != nil && o.Count == 0 {
		o.Count = uint32(len(o.Data))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BIDIResponseContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Version); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if err := w.WriteData(o.Count); err != nil {
		return err
	}
	if o.Data != nil || o.Count > 0 {
		_ptr_aData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.Count)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Data {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if o.Data[i1] != nil {
					if err := o.Data[i1].MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&BIDIResponseData{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
			}
			for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
				if err := (&BIDIResponseData{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Data, _ptr_aData); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BIDIResponseContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Version); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	if err := w.ReadData(&o.Count); err != nil {
		return err
	}
	_ptr_aData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.Count > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.Count)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]*BIDIResponseData, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if o.Data[i1] == nil {
				o.Data[i1] = &BIDIResponseData{}
			}
			if err := o.Data[i1].UnmarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		return nil
	})
	_s_aData := func(ptr interface{}) { o.Data = *ptr.(*[]*BIDIResponseData) }
	if err := w.ReadPointer(&o.Data, _s_aData, _ptr_aData); err != nil {
		return err
	}
	return nil
}

// SecurityContainer structure represents SECURITY_CONTAINER RPC structure.
//
// The SECURITY_CONTAINER structure specifies a SECURITY_DESCRIPTOR structure ([MS-DTYP]
// section 2.4.6), which contains security information.
type SecurityContainer struct {
	// cbBuf: The size, in bytes, of the buffer that is pointed to by the pSecurity member.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// pSecurity: An optional pointer to a self-relative SECURITY_DESCRIPTOR structure.
	Security []byte `idl:"name:pSecurity;size_is:(cbBuf);pointer:unique" json:"security"`
}

func (o *SecurityContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Security != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Security))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *SecurityContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BufferLength); err != nil {
		return err
	}
	if o.Security != nil || o.BufferLength > 0 {
		_ptr_pSecurity := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.BufferLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Security {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(o.Security[i1]); err != nil {
					return err
				}
			}
			for i1 := len(o.Security); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint8(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Security, _ptr_pSecurity); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *SecurityContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BufferLength); err != nil {
		return err
	}
	_ptr_pSecurity := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.BufferLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.BufferLength)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Security", sizeInfo[0])
		}
		o.Security = make([]byte, sizeInfo[0])
		for i1 := range o.Security {
			i1 := i1
			if err := w.ReadData(&o.Security[i1]); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pSecurity := func(ptr interface{}) { o.Security = *ptr.(*[]byte) }
	if err := w.ReadPointer(&o.Security, _s_pSecurity, _ptr_pSecurity); err != nil {
		return err
	}
	return nil
}

// ClientContainer structure represents SPLCLIENT_CONTAINER RPC structure.
//
// The SPLCLIENT_CONTAINER structure contains an information structure that provides
// data about the connecting client.<9>
type ClientContainer struct {
	// Level: The information level that is used by the ClientInfo member to determine the
	// information structure. The value MUST be 0x00000001.
	Level uint32 `idl:"name:Level" json:"level"`
	// ClientInfo: Client information in a structure that corresponds to the information
	// level specified by the Level member.
	ClientInfo *ClientContainer_ClientInfo `idl:"name:ClientInfo;switch_is:Level" json:"client_info"`
}

func (o *ClientContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *ClientContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Level); err != nil {
		return err
	}
	_swClientInfo := uint32(o.Level)
	if o.ClientInfo != nil {
		if err := o.ClientInfo.MarshalUnionNDR(ctx, w, _swClientInfo); err != nil {
			return err
		}
	} else {
		if err := (&ClientContainer_ClientInfo{}).MarshalUnionNDR(ctx, w, _swClientInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *ClientContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Level); err != nil {
		return err
	}
	if o.ClientInfo == nil {
		o.ClientInfo = &ClientContainer_ClientInfo{}
	}
	_swClientInfo := uint32(o.Level)
	if err := o.ClientInfo.UnmarshalUnionNDR(ctx, w, _swClientInfo); err != nil {
		return err
	}
	return nil
}

// ClientContainer_ClientInfo structure represents SPLCLIENT_CONTAINER union anonymous member.
//
// The SPLCLIENT_CONTAINER structure contains an information structure that provides
// data about the connecting client.<9>
type ClientContainer_ClientInfo struct {
	// Types that are assignable to Value
	//
	// *ClientContainer_ClientInfo_ClientInfo1
	// *ClientContainer_ClientInfo_NotUsed1
	// *ClientContainer_ClientInfo_NotUsed2
	Value is_ClientContainer_ClientInfo `json:"value"`
}

func (o *ClientContainer_ClientInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *ClientContainer_ClientInfo_ClientInfo1:
		if value != nil {
			return value.ClientInfo1
		}
	case *ClientContainer_ClientInfo_NotUsed1:
		if value != nil {
			return value.NotUsed1
		}
	case *ClientContainer_ClientInfo_NotUsed2:
		if value != nil {
			return value.NotUsed2
		}
	}
	return nil
}

type is_ClientContainer_ClientInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_ClientContainer_ClientInfo()
}

func (o *ClientContainer_ClientInfo) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *ClientContainer_ClientInfo_ClientInfo1:
		return uint32(1)
	case *ClientContainer_ClientInfo_NotUsed1:
		return uint32(2)
	case *ClientContainer_ClientInfo_NotUsed2:
		return uint32(3)
	}
	return uint32(0)
}

func (o *ClientContainer_ClientInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		_o, _ := o.Value.(*ClientContainer_ClientInfo_ClientInfo1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&ClientContainer_ClientInfo_ClientInfo1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(2):
		_o, _ := o.Value.(*ClientContainer_ClientInfo_NotUsed1)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&ClientContainer_ClientInfo_NotUsed1{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(3):
		_o, _ := o.Value.(*ClientContainer_ClientInfo_NotUsed2)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&ClientContainer_ClientInfo_NotUsed2{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *ClientContainer_ClientInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(1):
		o.Value = &ClientContainer_ClientInfo_ClientInfo1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(2):
		o.Value = &ClientContainer_ClientInfo_NotUsed1{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(3):
		o.Value = &ClientContainer_ClientInfo_NotUsed2{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// ClientContainer_ClientInfo_ClientInfo1 structure represents ClientContainer_ClientInfo RPC union arm.
//
// It has following labels: 1
type ClientContainer_ClientInfo_ClientInfo1 struct {
	// pClientInfo1: A pointer to an SPLCLIENT_INFO_1 structure (section 2.2.1.11.1) information.
	ClientInfo1 *ClientInfo1 `idl:"name:pClientInfo1" json:"client_info1"`
}

func (*ClientContainer_ClientInfo_ClientInfo1) is_ClientContainer_ClientInfo() {}

func (o *ClientContainer_ClientInfo_ClientInfo1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.ClientInfo1 != nil {
		_ptr_pClientInfo1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.ClientInfo1 != nil {
				if err := o.ClientInfo1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&ClientInfo1{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.ClientInfo1, _ptr_pClientInfo1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *ClientContainer_ClientInfo_ClientInfo1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pClientInfo1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.ClientInfo1 == nil {
			o.ClientInfo1 = &ClientInfo1{}
		}
		if err := o.ClientInfo1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pClientInfo1 := func(ptr interface{}) { o.ClientInfo1 = *ptr.(**ClientInfo1) }
	if err := w.ReadPointer(&o.ClientInfo1, _s_pClientInfo1, _ptr_pClientInfo1); err != nil {
		return err
	}
	return nil
}

// ClientContainer_ClientInfo_NotUsed1 structure represents ClientContainer_ClientInfo RPC union arm.
//
// It has following labels: 2
type ClientContainer_ClientInfo_NotUsed1 struct {
	// pNotUsed1: A pointer to a structure that is specified only as a placeholder in the
	// IDL and MUST be ignored.
	NotUsed1 *ClientInfo2 `idl:"name:pNotUsed1" json:"not_used1"`
}

func (*ClientContainer_ClientInfo_NotUsed1) is_ClientContainer_ClientInfo() {}

func (o *ClientContainer_ClientInfo_NotUsed1) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.NotUsed1 != nil {
		_ptr_pNotUsed1 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.NotUsed1 != nil {
				if err := o.NotUsed1.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&ClientInfo2{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.NotUsed1, _ptr_pNotUsed1); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *ClientContainer_ClientInfo_NotUsed1) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pNotUsed1 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.NotUsed1 == nil {
			o.NotUsed1 = &ClientInfo2{}
		}
		if err := o.NotUsed1.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pNotUsed1 := func(ptr interface{}) { o.NotUsed1 = *ptr.(**ClientInfo2) }
	if err := w.ReadPointer(&o.NotUsed1, _s_pNotUsed1, _ptr_pNotUsed1); err != nil {
		return err
	}
	return nil
}

// ClientContainer_ClientInfo_NotUsed2 structure represents ClientContainer_ClientInfo RPC union arm.
//
// It has following labels: 3
type ClientContainer_ClientInfo_NotUsed2 struct {
	// pNotUsed2: A pointer to a structure that is specified only as a placeholder in the
	// IDL and MUST be ignored.
	NotUsed2 *ClientInfo3 `idl:"name:pNotUsed2" json:"not_used2"`
}

func (*ClientContainer_ClientInfo_NotUsed2) is_ClientContainer_ClientInfo() {}

func (o *ClientContainer_ClientInfo_NotUsed2) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.NotUsed2 != nil {
		_ptr_pNotUsed2 := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.NotUsed2 != nil {
				if err := o.NotUsed2.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&ClientInfo3{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.NotUsed2, _ptr_pNotUsed2); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *ClientContainer_ClientInfo_NotUsed2) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pNotUsed2 := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.NotUsed2 == nil {
			o.NotUsed2 = &ClientInfo3{}
		}
		if err := o.NotUsed2.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pNotUsed2 := func(ptr interface{}) { o.NotUsed2 = *ptr.(**ClientInfo3) }
	if err := w.ReadPointer(&o.NotUsed2, _s_pNotUsed2, _ptr_pNotUsed2); err != nil {
		return err
	}
	return nil
}

// StringContainer structure represents STRING_CONTAINER RPC structure.
//
// The STRING_CONTAINER structure contains a string.<10>
type StringContainer struct {
	// cbBuf: This member specifies the size, in bytes, of the buffer that is pointed to
	// by the pszString member. The value of this number MUST be an even number.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// pszString: A pointer to a string. The string that is referenced by this member MUST
	// NOT be empty.
	String string `idl:"name:pszString;size_is:((cbBuf/2));pointer:unique" json:"string"`
}

func (o *StringContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.String != "" && o.BufferLength == 0 {
		o.BufferLength = uint32((ndr.UTF16Len(o.String) * 2))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *StringContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BufferLength); err != nil {
		return err
	}
	if o.String != "" || (o.BufferLength/2) > 0 {
		_ptr_pszString := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64((o.BufferLength / 2))
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			_String_buf := utf16.Encode([]rune(o.String))
			if uint64(len(_String_buf)) > sizeInfo[0] {
				_String_buf = _String_buf[:sizeInfo[0]]
			}
			for i1 := range _String_buf {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(_String_buf[i1]); err != nil {
					return err
				}
			}
			for i1 := len(_String_buf); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.String, _ptr_pszString); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *StringContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BufferLength); err != nil {
		return err
	}
	_ptr_pszString := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if (o.BufferLength/2) > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64((o.BufferLength / 2))
		}
		var _String_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _String_buf", sizeInfo[0])
		}
		_String_buf = make([]uint16, sizeInfo[0])
		for i1 := range _String_buf {
			i1 := i1
			if err := w.ReadData(&_String_buf[i1]); err != nil {
				return err
			}
		}
		o.String = strings.TrimRight(string(utf16.Decode(_String_buf)), ndr.ZeroString)
		return nil
	})
	_s_pszString := func(ptr interface{}) { o.String = *ptr.(*string) }
	if err := w.ReadPointer(&o.String, _s_pszString, _ptr_pszString); err != nil {
		return err
	}
	return nil
}

// SystemTimeContainer structure represents SYSTEMTIME_CONTAINER RPC structure.
//
// The SYSTEMTIME_CONTAINER structure is a container for a SYSTEMTIME structure ([MS-DTYP]
// section 2.3.13) that specifies a date and time using individual members for the month,
// day, year, weekday, hour, minute, second, and millisecond.<11>
type SystemTimeContainer struct {
	// cbBuf: The size, in bytes, of the buffer that is pointed to by the pSystemTime member.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// pSystemTime: A pointer to a SYSTEMTIME structure.
	SystemTime *dtyp.SystemTime `idl:"name:pSystemTime" json:"system_time"`
}

func (o *SystemTimeContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *SystemTimeContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BufferLength); err != nil {
		return err
	}
	if o.SystemTime != nil {
		_ptr_pSystemTime := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.SystemTime != nil {
				if err := o.SystemTime.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&dtyp.SystemTime{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.SystemTime, _ptr_pSystemTime); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *SystemTimeContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BufferLength); err != nil {
		return err
	}
	_ptr_pSystemTime := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.SystemTime == nil {
			o.SystemTime = &dtyp.SystemTime{}
		}
		if err := o.SystemTime.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pSystemTime := func(ptr interface{}) { o.SystemTime = *ptr.(**dtyp.SystemTime) }
	if err := w.ReadPointer(&o.SystemTime, _s_pSystemTime, _ptr_pSystemTime); err != nil {
		return err
	}
	return nil
}

// V2NotifyOptionsType structure represents RPC_V2_NOTIFY_OPTIONS_TYPE RPC structure.
//
// The RPC_V2_NOTIFY_OPTIONS_TYPE structure specifies the set of printer or job information
// members to be monitored by a printer change notification object.<74>
type V2NotifyOptionsType struct {
	// Type: The value of this member specifies the type of notification to watch for. The
	// value of this member MUST be one of the constant values from the following table.
	//
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	|                            |                                                                                  |
	//	|         NAME/VALUE         |                                   DESCRIPTION                                    |
	//	|                            |                                                                                  |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_NOTIFY_TYPE 0x0000 | Indicates that the members specified in the array that is pointed to by the      |
	//	|                            | pFields member are printer notification constants.                               |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| JOB_NOTIFY_TYPE 0x0001     | Indicates that the members specified in the array that is pointed to by the      |
	//	|                            | pFields member are job notification constants.                                   |
	//	+----------------------------+----------------------------------------------------------------------------------+
	//	| SERVER_NOTIFY_TYPE 0x0002  | Indicates that the members specified in the array that is pointed to by the      |
	//	|                            | pFields member are server notification constants.<75>                            |
	//	+----------------------------+----------------------------------------------------------------------------------+
	Type uint16 `idl:"name:Type" json:"type"`
	// Reserved0: The value of this member MUST be set to zero when sent and MUST be ignored
	// on receipt.
	_ uint16 `idl:"name:Reserved0"`
	// Reserved1: The value of this member MUST be set to zero when sent and MUST be ignored
	// on receipt.
	_ uint32 `idl:"name:Reserved1"`
	// Reserved2: The value of this member MUST be set to zero when sent and MUST be ignored
	// on receipt.
	_ uint32 `idl:"name:Reserved2"`
	// Count: The number of elements in the pFields array.
	Count uint32 `idl:"name:Count" json:"count"`
	// pFields: A pointer to an array that MUST identify the job or printer information
	// members to be monitored. The array MUST consist entirely of elements that are either
	// job notification values (section 2.2.3.3) or printer notification values (section
	// 2.2.3.8), depending on the value of the Type member. The two types of notification
	// values MUST NOT be mixed within a given instance of the array.
	Fields []uint16 `idl:"name:pFields;size_is:(Count);pointer:unique" json:"fields"`
}

func (o *V2NotifyOptionsType) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Fields != nil && o.Count == 0 {
		o.Count = uint32(len(o.Fields))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *V2NotifyOptionsType) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Type); err != nil {
		return err
	}
	// reserved Reserved0
	if err := w.WriteData(uint16(0)); err != nil {
		return err
	}
	// reserved Reserved1
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	// reserved Reserved2
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	if err := w.WriteData(o.Count); err != nil {
		return err
	}
	if o.Fields != nil || o.Count > 0 {
		_ptr_pFields := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.Count)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Fields {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(o.Fields[i1]); err != nil {
					return err
				}
			}
			for i1 := len(o.Fields); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint16(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Fields, _ptr_pFields); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyOptionsType) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Type); err != nil {
		return err
	}
	// reserved Reserved0
	var _Reserved0 uint16
	if err := w.ReadData(&_Reserved0); err != nil {
		return err
	}
	// reserved Reserved1
	var _Reserved1 uint32
	if err := w.ReadData(&_Reserved1); err != nil {
		return err
	}
	// reserved Reserved2
	var _Reserved2 uint32
	if err := w.ReadData(&_Reserved2); err != nil {
		return err
	}
	if err := w.ReadData(&o.Count); err != nil {
		return err
	}
	_ptr_pFields := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.Count > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.Count)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Fields", sizeInfo[0])
		}
		o.Fields = make([]uint16, sizeInfo[0])
		for i1 := range o.Fields {
			i1 := i1
			if err := w.ReadData(&o.Fields[i1]); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pFields := func(ptr interface{}) { o.Fields = *ptr.(*[]uint16) }
	if err := w.ReadPointer(&o.Fields, _s_pFields, _ptr_pFields); err != nil {
		return err
	}
	return nil
}

// V2NotifyOptions structure represents RPC_V2_NOTIFY_OPTIONS RPC structure.
//
// The RPC_V2_NOTIFY_OPTIONS structure specifies options for a change notification object
// that monitors a printer or print server for any changes in state.<73>
type V2NotifyOptions struct {
	// Version: The version of the structure. The value of this member MUST be 0x00000002.
	Version uint32 `idl:"name:Version" json:"version"`
	// Reserved: A bit field that specifies attributes of the change notification. The name
	// "Reserved" is intentional.
	//
	//	+-------------------------------------------+------------------------------------------------------------------------+
	//	|                                           |                                                                        |
	//	|                NAME/VALUE                 |                              DESCRIPTION                               |
	//	|                                           |                                                                        |
	//	+-------------------------------------------+------------------------------------------------------------------------+
	//	+-------------------------------------------+------------------------------------------------------------------------+
	//	| PRINTER_NOTIFY_OPTIONS_REFRESH 0x00000001 | Refreshed data is requested from the server for all monitored members. |
	//	+-------------------------------------------+------------------------------------------------------------------------+
	_ uint32 `idl:"name:Reserved"`
	// Count: The number of RPC_V2_NOTIFY_OPTIONS_TYPE structures (section 2.2.1.13.2) in
	// the array pointed to by the pTypes member.
	Count uint32 `idl:"name:Count" json:"count"`
	// pTypes: A pointer to an array of RPC_V2_NOTIFY_OPTIONS_TYPE structures, each of which
	// identifies a set of print job or printer information members to be monitored by a
	// printer change notification object.
	Types []*V2NotifyOptionsType `idl:"name:pTypes;size_is:(Count);pointer:unique" json:"types"`
}

func (o *V2NotifyOptions) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Types != nil && o.Count == 0 {
		o.Count = uint32(len(o.Types))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *V2NotifyOptions) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Version); err != nil {
		return err
	}
	// reserved Reserved
	if err := w.WriteData(uint32(0)); err != nil {
		return err
	}
	if err := w.WriteData(o.Count); err != nil {
		return err
	}
	if o.Types != nil || o.Count > 0 {
		_ptr_pTypes := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.Count)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Types {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if o.Types[i1] != nil {
					if err := o.Types[i1].MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&V2NotifyOptionsType{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
			}
			for i1 := len(o.Types); uint64(i1) < sizeInfo[0]; i1++ {
				if err := (&V2NotifyOptionsType{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Types, _ptr_pTypes); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyOptions) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Version); err != nil {
		return err
	}
	// reserved Reserved
	var _Reserved uint32
	if err := w.ReadData(&_Reserved); err != nil {
		return err
	}
	if err := w.ReadData(&o.Count); err != nil {
		return err
	}
	_ptr_pTypes := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.Count > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.Count)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Types", sizeInfo[0])
		}
		o.Types = make([]*V2NotifyOptionsType, sizeInfo[0])
		for i1 := range o.Types {
			i1 := i1
			if o.Types[i1] == nil {
				o.Types[i1] = &V2NotifyOptionsType{}
			}
			if err := o.Types[i1].UnmarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pTypes := func(ptr interface{}) { o.Types = *ptr.(*[]*V2NotifyOptionsType) }
	if err := w.ReadPointer(&o.Types, _s_pTypes, _ptr_pTypes); err != nil {
		return err
	}
	return nil
}

// V2NotifyInfoDataData structure represents RPC_V2_NOTIFY_INFO_DATA_DATA RPC union.
type V2NotifyInfoDataData struct {
	// Types that are assignable to Value
	//
	// *V2NotifyInfoDataData_String
	// *V2NotifyInfoDataData_Data
	// *V2NotifyInfoDataData_SystemTime
	// *V2NotifyInfoDataData_DevMode
	// *V2NotifyInfoDataData_SecurityDescriptor
	Value is_V2NotifyInfoDataData `json:"value"`
}

func (o *V2NotifyInfoDataData) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *V2NotifyInfoDataData_String:
		if value != nil {
			return value.String
		}
	case *V2NotifyInfoDataData_Data:
		if value != nil {
			return value.Data
		}
	case *V2NotifyInfoDataData_SystemTime:
		if value != nil {
			return value.SystemTime
		}
	case *V2NotifyInfoDataData_DevMode:
		if value != nil {
			return value.DevMode
		}
	case *V2NotifyInfoDataData_SecurityDescriptor:
		if value != nil {
			return value.SecurityDescriptor
		}
	}
	return nil
}

type is_V2NotifyInfoDataData interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_V2NotifyInfoDataData()
}

func (o *V2NotifyInfoDataData) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *V2NotifyInfoDataData_String:
		return uint32(2)
	case *V2NotifyInfoDataData_Data:
		return uint32(1)
	case *V2NotifyInfoDataData_SystemTime:
		return uint32(4)
	case *V2NotifyInfoDataData_DevMode:
		return uint32(3)
	case *V2NotifyInfoDataData_SecurityDescriptor:
		return uint32(5)
	}
	return uint32(0)
}

func (o *V2NotifyInfoDataData) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(2):
		_o, _ := o.Value.(*V2NotifyInfoDataData_String)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&V2NotifyInfoDataData_String{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(1):
		_o, _ := o.Value.(*V2NotifyInfoDataData_Data)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&V2NotifyInfoDataData_Data{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(4):
		_o, _ := o.Value.(*V2NotifyInfoDataData_SystemTime)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&V2NotifyInfoDataData_SystemTime{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(3):
		_o, _ := o.Value.(*V2NotifyInfoDataData_DevMode)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&V2NotifyInfoDataData_DevMode{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint32(5):
		_o, _ := o.Value.(*V2NotifyInfoDataData_SecurityDescriptor)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&V2NotifyInfoDataData_SecurityDescriptor{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *V2NotifyInfoDataData) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(2):
		o.Value = &V2NotifyInfoDataData_String{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(1):
		o.Value = &V2NotifyInfoDataData_Data{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(4):
		o.Value = &V2NotifyInfoDataData_SystemTime{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(3):
		o.Value = &V2NotifyInfoDataData_DevMode{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint32(5):
		o.Value = &V2NotifyInfoDataData_SecurityDescriptor{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// V2NotifyInfoDataData_String structure represents RPC_V2_NOTIFY_INFO_DATA_DATA RPC union arm.
//
// It has following labels: 2
type V2NotifyInfoDataData_String struct {
	String *StringContainer `idl:"name:String" json:"string"`
}

func (*V2NotifyInfoDataData_String) is_V2NotifyInfoDataData() {}

func (o *V2NotifyInfoDataData_String) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.String != nil {
		if err := o.String.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&StringContainer{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfoDataData_String) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.String == nil {
		o.String = &StringContainer{}
	}
	if err := o.String.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// V2NotifyInfoDataData_Data structure represents RPC_V2_NOTIFY_INFO_DATA_DATA RPC union arm.
//
// It has following labels: 1
type V2NotifyInfoDataData_Data struct {
	Data []uint32 `idl:"name:dwData" json:"data"`
}

func (*V2NotifyInfoDataData_Data) is_V2NotifyInfoDataData() {}

func (o *V2NotifyInfoDataData_Data) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	for i1 := range o.Data {
		i1 := i1
		if uint64(i1) >= 2 {
			break
		}
		if err := w.WriteData(o.Data[i1]); err != nil {
			return err
		}
	}
	for i1 := len(o.Data); uint64(i1) < 2; i1++ {
		if err := w.WriteData(uint32(0)); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfoDataData_Data) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	o.Data = make([]uint32, 2)
	for i1 := range o.Data {
		i1 := i1
		if err := w.ReadData(&o.Data[i1]); err != nil {
			return err
		}
	}
	return nil
}

// V2NotifyInfoDataData_SystemTime structure represents RPC_V2_NOTIFY_INFO_DATA_DATA RPC union arm.
//
// It has following labels: 4
type V2NotifyInfoDataData_SystemTime struct {
	SystemTime *SystemTimeContainer `idl:"name:SystemTime" json:"system_time"`
}

func (*V2NotifyInfoDataData_SystemTime) is_V2NotifyInfoDataData() {}

func (o *V2NotifyInfoDataData_SystemTime) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.SystemTime != nil {
		if err := o.SystemTime.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&SystemTimeContainer{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfoDataData_SystemTime) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.SystemTime == nil {
		o.SystemTime = &SystemTimeContainer{}
	}
	if err := o.SystemTime.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// V2NotifyInfoDataData_DevMode structure represents RPC_V2_NOTIFY_INFO_DATA_DATA RPC union arm.
//
// It has following labels: 3
type V2NotifyInfoDataData_DevMode struct {
	DevMode *DevModeContainer `idl:"name:DevMode" json:"dev_mode"`
}

func (*V2NotifyInfoDataData_DevMode) is_V2NotifyInfoDataData() {}

func (o *V2NotifyInfoDataData_DevMode) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.DevMode != nil {
		if err := o.DevMode.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfoDataData_DevMode) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.DevMode == nil {
		o.DevMode = &DevModeContainer{}
	}
	if err := o.DevMode.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// V2NotifyInfoDataData_SecurityDescriptor structure represents RPC_V2_NOTIFY_INFO_DATA_DATA RPC union arm.
//
// It has following labels: 5
type V2NotifyInfoDataData_SecurityDescriptor struct {
	SecurityDescriptor *SecurityContainer `idl:"name:SecurityDescriptor" json:"security_descriptor"`
}

func (*V2NotifyInfoDataData_SecurityDescriptor) is_V2NotifyInfoDataData() {}

func (o *V2NotifyInfoDataData_SecurityDescriptor) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.SecurityDescriptor != nil {
		if err := o.SecurityDescriptor.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&SecurityContainer{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfoDataData_SecurityDescriptor) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.SecurityDescriptor == nil {
		o.SecurityDescriptor = &SecurityContainer{}
	}
	if err := o.SecurityDescriptor.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// V2NotifyInfoData structure represents RPC_V2_NOTIFY_INFO_DATA RPC structure.
//
// The RPC_V2_NOTIFY_INFO_DATA structure specifies printer or print job notification
// information data.<77>
type V2NotifyInfoData struct {
	// Type: The type of notification information that is contained in this structure. This
	// MUST be one of the following values:
	//
	//	+----------------------------+-------------------------------+
	//	|                            |                               |
	//	|         NAME/VALUE         |          DESCRIPTION          |
	//	|                            |                               |
	//	+----------------------------+-------------------------------+
	//	+----------------------------+-------------------------------+
	//	| PRINTER_NOTIFY_TYPE 0x0000 | Printer-related notifications |
	//	+----------------------------+-------------------------------+
	//	| JOB_NOTIFY_TYPE 0x0001     | Job-related notifications     |
	//	+----------------------------+-------------------------------+
	Type uint16 `idl:"name:Type" json:"type"`
	// Field: The member that changed using the printer notification values and job notification
	// values in sections 2.2.3.8 and 2.2.3.3.
	Field              uint16 `idl:"name:Field" json:"field"`
	NotifyInfoDataType uint32 `idl:"name:NotifyInfoDataType" json:"notify_info_data_type"`
	// Id: The job identifier if the Type member specifies JOB_NOTIFY_TYPE; otherwise, this
	// value MUST be ignored.
	ID uint32 `idl:"name:Id" json:"id"`
	// Data: The data determined by the values of the Type and Reserved members of this
	// structure. The data is in an RPC_V2_NOTIFY_INFO_DATA_DATA structure using the data
	// type specified by the value of the Reserved member.
	Data *V2NotifyInfoDataData `idl:"name:Data;switch_is:(NotifyInfoDataType 65535 &)" json:"data"`
}

func (o *V2NotifyInfoData) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *V2NotifyInfoData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Type); err != nil {
		return err
	}
	if err := w.WriteData(o.Field); err != nil {
		return err
	}
	if err := w.WriteData(o.NotifyInfoDataType); err != nil {
		return err
	}
	if err := w.WriteData(o.ID); err != nil {
		return err
	}
	_swData := uint32((o.NotifyInfoDataType & 65535))
	if o.Data != nil {
		if err := o.Data.MarshalUnionNDR(ctx, w, _swData); err != nil {
			return err
		}
	} else {
		if err := (&V2NotifyInfoDataData{}).MarshalUnionNDR(ctx, w, _swData); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfoData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Type); err != nil {
		return err
	}
	if err := w.ReadData(&o.Field); err != nil {
		return err
	}
	if err := w.ReadData(&o.NotifyInfoDataType); err != nil {
		return err
	}
	if err := w.ReadData(&o.ID); err != nil {
		return err
	}
	if o.Data == nil {
		o.Data = &V2NotifyInfoDataData{}
	}
	_swData := uint32((o.NotifyInfoDataType & 65535))
	if err := o.Data.UnmarshalUnionNDR(ctx, w, _swData); err != nil {
		return err
	}
	return nil
}

// V2NotifyInfo structure represents RPC_V2_NOTIFY_INFO RPC structure.
//
// The RPC_V2_NOTIFY_INFO structure specifies printer or print job notification information.<76>
type V2NotifyInfo struct {
	// Version: The version of the structure. The value of this member MUST be 0x00000002.
	Version uint32 `idl:"name:Version" json:"version"`
	// Flags: A bit field that specifies the state of the notification structure.
	//
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	|                                          |                                                                                  |
	//	|                NAME/VALUE                |                                   DESCRIPTION                                    |
	//	|                                          |                                                                                  |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| PRINTER_NOTIFY_INFO_DISCARDED 0x00000001 | An overflow or error has occurred, and notifications have been lost. The print   |
	//	|                                          | server MUST NOT send additional notifications until the client has made a call   |
	//	|                                          | to RpcRouterRefreshPrinterChangeNotification (section 3.1.4.10.5).               |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	Flags uint32 `idl:"name:Flags" json:"flags"`
	// Count: The number of RPC_V2_NOTIFY_INFO_DATA structures (section 2.2.1.13.4) in the
	// aData array.
	Count uint32 `idl:"name:Count" json:"count"`
	// aData: An array of RPC_V2_NOTIFY_INFO_DATA structures, each of which identifies a
	// single print job or printer information member and specifies the current data for
	// that member.
	Data []*V2NotifyInfoData `idl:"name:aData;size_is:(Count);pointer:unique" json:"data"`
}

func (o *V2NotifyInfo) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Data != nil && o.Count == 0 {
		o.Count = uint32(len(o.Data))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *V2NotifyInfo) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.Version); err != nil {
		return err
	}
	if err := w.WriteData(o.Flags); err != nil {
		return err
	}
	if err := w.WriteData(o.Count); err != nil {
		return err
	}
	if o.Data != nil || o.Count > 0 {
		_ptr_aData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.Count)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Data {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if o.Data[i1] != nil {
					if err := o.Data[i1].MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&V2NotifyInfoData{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
			}
			for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
				if err := (&V2NotifyInfoData{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Data, _ptr_aData); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2NotifyInfo) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.Version); err != nil {
		return err
	}
	if err := w.ReadData(&o.Flags); err != nil {
		return err
	}
	if err := w.ReadData(&o.Count); err != nil {
		return err
	}
	_ptr_aData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.Count > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.Count)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]*V2NotifyInfoData, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if o.Data[i1] == nil {
				o.Data[i1] = &V2NotifyInfoData{}
			}
			if err := o.Data[i1].UnmarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		return nil
	})
	_s_aData := func(ptr interface{}) { o.Data = *ptr.(*[]*V2NotifyInfoData) }
	if err := w.ReadPointer(&o.Data, _s_aData, _ptr_aData); err != nil {
		return err
	}
	return nil
}

// V2ReplyPrinter structure represents RPC_V2_UREPLY_PRINTER RPC union.
//
// The RPC_V2_UREPLY_PRINTER union defines printer notification responses.<79>
type V2ReplyPrinter struct {
	// Types that are assignable to Value
	//
	// *V2ReplyPrinter_Info
	Value is_V2ReplyPrinter `json:"value"`
}

func (o *V2ReplyPrinter) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *V2ReplyPrinter_Info:
		if value != nil {
			return value.Info
		}
	}
	return nil
}

type is_V2ReplyPrinter interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_V2ReplyPrinter()
}

func (o *V2ReplyPrinter) NDRSwitchValue(sw uint32) uint32 {
	if o == nil {
		return uint32(0)
	}
	switch (interface{})(o.Value).(type) {
	case *V2ReplyPrinter_Info:
		return uint32(0)
	}
	return uint32(0)
}

func (o *V2ReplyPrinter) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint32) error {
	if err := w.WriteUnionAlign(9); err != nil {
		return err
	}
	if err := w.WriteSwitch(uint32(sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(0):
		_o, _ := o.Value.(*V2ReplyPrinter_Info)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&V2ReplyPrinter_Info{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *V2ReplyPrinter) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint32) error {
	if err := w.ReadUnionAlign(9); err != nil {
		return err
	}
	if err := w.ReadSwitch((*uint32)(&sw)); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	switch sw {
	case uint32(0):
		o.Value = &V2ReplyPrinter_Info{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// V2ReplyPrinter_Info structure represents RPC_V2_UREPLY_PRINTER RPC union arm.
//
// It has following labels: 0
type V2ReplyPrinter_Info struct {
	// pInfo: A pointer to an RPC_V2_NOTIFY_INFO structure, which MUST contain notification
	// information.
	Info *V2NotifyInfo `idl:"name:pInfo" json:"info"`
}

func (*V2ReplyPrinter_Info) is_V2ReplyPrinter() {}

func (o *V2ReplyPrinter_Info) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.Info != nil {
		_ptr_pInfo := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if o.Info != nil {
				if err := o.Info.MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&V2NotifyInfo{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Info, _ptr_pInfo); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *V2ReplyPrinter_Info) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_pInfo := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if o.Info == nil {
			o.Info = &V2NotifyInfo{}
		}
		if err := o.Info.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		return nil
	})
	_s_pInfo := func(ptr interface{}) { o.Info = *ptr.(**V2NotifyInfo) }
	if err := w.ReadPointer(&o.Info, _s_pInfo, _ptr_pInfo); err != nil {
		return err
	}
	return nil
}

// CorePrinterDriver structure represents CORE_PRINTER_DRIVER RPC structure.
//
// The CORE_PRINTER_DRIVER structure defines information that identifies a specific
// core printer driver.<134> See the RpcGetCorePrinterDrivers method (section 3.1.4.4.9)
// for an example of its use.
//
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 | 1 |
//	|   |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |   |   |   |   |   |   |   |   | 0 |   |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| CoreDriverGUID (16 bytes)                                                                                                     |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ftDriverDate                                                                                                                  |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| dwlDriverVersion                                                                                                              |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| szPackageID (520 bytes)                                                                                                       |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
//	| ...                                                                                                                           |
//	+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
type CorePrinterDriver struct {
	// CoreDriverGUID (16 bytes): A GUID that uniquely identifies the package.
	CoreDriverGUID *dtyp.GUID `idl:"name:CoreDriverGUID" json:"core_driver_guid"`
	// ftDriverDate (8 bytes): A FILETIME value ([MS-DTYP] section 2.3.3) that specifies
	// the date this package was published.<135>
	DriverDate *dtyp.Filetime `idl:"name:ftDriverDate" json:"driver_date"`
	// dwlDriverVersion (8 bytes): A 64-bit value that specifies the version of the core
	// printer driver that can be used to match the driver version in the driver installation
	// control file.<136>
	DriverVersion uint64 `idl:"name:dwlDriverVersion" json:"driver_version"`
	// szPackageID (520 bytes): A string that specifies the package name.
	PackageID []uint16 `idl:"name:szPackageID" json:"package_id"`
}

func (o *CorePrinterDriver) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *CorePrinterDriver) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if o.CoreDriverGUID != nil {
		if err := o.CoreDriverGUID.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if o.DriverDate != nil {
		if err := o.DriverDate.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&dtyp.Filetime{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.DriverVersion); err != nil {
		return err
	}
	for i1 := range o.PackageID {
		i1 := i1
		if uint64(i1) >= 260 {
			break
		}
		if err := w.WriteData(o.PackageID[i1]); err != nil {
			return err
		}
	}
	for i1 := len(o.PackageID); uint64(i1) < 260; i1++ {
		if err := w.WriteData(uint16(0)); err != nil {
			return err
		}
	}
	if err := w.WriteTrailingGap(8); err != nil {
		return err
	}
	return nil
}
func (o *CorePrinterDriver) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if o.CoreDriverGUID == nil {
		o.CoreDriverGUID = &dtyp.GUID{}
	}
	if err := o.CoreDriverGUID.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if o.DriverDate == nil {
		o.DriverDate = &dtyp.Filetime{}
	}
	if err := o.DriverDate.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	if err := w.ReadData(&o.DriverVersion); err != nil {
		return err
	}
	o.PackageID = make([]uint16, 260)
	for i1 := range o.PackageID {
		i1 := i1
		if err := w.ReadData(&o.PackageID[i1]); err != nil {
			return err
		}
	}
	if err := w.ReadTrailingGap(8); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue structure represents RPC_PrintPropertyValue RPC structure.
//
// The RPC_PrintPropertyValue structure specifies the value of a Job Named Property
// (section 3.1.1).<80>
type PrintPropertyValue struct {
	// ePropertyType: The type of the value. All enumeration values specified in section
	// 2.2.1.14.3 are valid.
	PropertyType PrintPropertyType         `idl:"name:ePropertyType" json:"property_type"`
	Value        *PrintPropertyValue_Value `idl:"name:value;switch_is:ePropertyType" json:"value"`
}

func (o *PrintPropertyValue) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrintPropertyValue) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteEnum(uint16(o.PropertyType)); err != nil {
		return err
	}
	_swValue := uint16(o.PropertyType)
	if o.Value != nil {
		if err := o.Value.MarshalUnionNDR(ctx, w, _swValue); err != nil {
			return err
		}
	} else {
		if err := (&PrintPropertyValue_Value{}).MarshalUnionNDR(ctx, w, _swValue); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrintPropertyValue) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadEnum((*uint16)(&o.PropertyType)); err != nil {
		return err
	}
	if o.Value == nil {
		o.Value = &PrintPropertyValue_Value{}
	}
	_swValue := uint16(o.PropertyType)
	if err := o.Value.UnmarshalUnionNDR(ctx, w, _swValue); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue_Value structure represents RPC_PrintPropertyValue union anonymous member.
//
// The RPC_PrintPropertyValue structure specifies the value of a Job Named Property
// (section 3.1.1).<80>
type PrintPropertyValue_Value struct {
	// Types that are assignable to Value
	//
	// *PrintPropertyValue_PropertyString
	// *PrintPropertyValue_PropertyInt32
	// *PrintPropertyValue_PropertyInt64
	// *PrintPropertyValue_PropertyByte
	// *PrintPropertyValue_PropertyBlob
	Value is_PrintPropertyValue_Value `json:"value"`
}

func (o *PrintPropertyValue_Value) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *PrintPropertyValue_PropertyString:
		if value != nil {
			return value.PropertyString
		}
	case *PrintPropertyValue_PropertyInt32:
		if value != nil {
			return value.PropertyInt32
		}
	case *PrintPropertyValue_PropertyInt64:
		if value != nil {
			return value.PropertyInt64
		}
	case *PrintPropertyValue_PropertyByte:
		if value != nil {
			return value.PropertyByte
		}
	case *PrintPropertyValue_PropertyBlob:
		if value != nil {
			return value.PropertyBlob
		}
	}
	return nil
}

type is_PrintPropertyValue_Value interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_PrintPropertyValue_Value()
}

func (o *PrintPropertyValue_Value) NDRSwitchValue(sw uint16) uint16 {
	if o == nil {
		return uint16(0)
	}
	switch (interface{})(o.Value).(type) {
	case *PrintPropertyValue_PropertyString:
		return uint16(1)
	case *PrintPropertyValue_PropertyInt32:
		return uint16(2)
	case *PrintPropertyValue_PropertyInt64:
		return uint16(3)
	case *PrintPropertyValue_PropertyByte:
		return uint16(4)
	case *PrintPropertyValue_PropertyBlob:
		return uint16(5)
	}
	return uint16(0)
}

func (o *PrintPropertyValue_Value) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint16) error {
	if err := w.WriteUnionAlign(8); err != nil {
		return err
	}
	if err := w.WriteSwitch(ndr.Enum(uint16(sw))); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	switch sw {
	case uint16(1):
		_o, _ := o.Value.(*PrintPropertyValue_PropertyString)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintPropertyValue_PropertyString{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(2):
		_o, _ := o.Value.(*PrintPropertyValue_PropertyInt32)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintPropertyValue_PropertyInt32{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(3):
		_o, _ := o.Value.(*PrintPropertyValue_PropertyInt64)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintPropertyValue_PropertyInt64{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(4):
		_o, _ := o.Value.(*PrintPropertyValue_PropertyByte)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintPropertyValue_PropertyByte{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(5):
		_o, _ := o.Value.(*PrintPropertyValue_PropertyBlob)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintPropertyValue_PropertyBlob{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *PrintPropertyValue_Value) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint16) error {
	if err := w.ReadUnionAlign(8); err != nil {
		return err
	}
	if err := w.ReadSwitch(ndr.Enum((*uint16)(&sw))); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	switch sw {
	case uint16(1):
		o.Value = &PrintPropertyValue_PropertyString{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(2):
		o.Value = &PrintPropertyValue_PropertyInt32{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(3):
		o.Value = &PrintPropertyValue_PropertyInt64{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(4):
		o.Value = &PrintPropertyValue_PropertyByte{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(5):
		o.Value = &PrintPropertyValue_PropertyBlob{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// PrintPropertyValue_PropertyString structure represents PrintPropertyValue_Value RPC union arm.
//
// It has following labels: 1
type PrintPropertyValue_PropertyString struct {
	// propertyString: A pointer to a string containing the property value. Valid only if
	// ePropertyType is set to kRpcPropertyTypeString.
	PropertyString string `idl:"name:propertyString;string" json:"property_string"`
}

func (*PrintPropertyValue_PropertyString) is_PrintPropertyValue_Value() {}

func (o *PrintPropertyValue_PropertyString) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PropertyString != "" {
		_ptr_propertyString := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PropertyString); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PropertyString, _ptr_propertyString); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrintPropertyValue_PropertyString) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	_ptr_propertyString := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PropertyString); err != nil {
			return err
		}
		return nil
	})
	_s_propertyString := func(ptr interface{}) { o.PropertyString = *ptr.(*string) }
	if err := w.ReadPointer(&o.PropertyString, _s_propertyString, _ptr_propertyString); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue_PropertyInt32 structure represents PrintPropertyValue_Value RPC union arm.
//
// It has following labels: 2
type PrintPropertyValue_PropertyInt32 struct {
	// propertyInt32: The property value as a signed 32-bit integer. Valid only if ePropertyType
	// is set to kRpcPropertyTypeInt32.
	PropertyInt32 int32 `idl:"name:propertyInt32" json:"property_int32"`
}

func (*PrintPropertyValue_PropertyInt32) is_PrintPropertyValue_Value() {}

func (o *PrintPropertyValue_PropertyInt32) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := w.WriteData(o.PropertyInt32); err != nil {
		return err
	}
	return nil
}
func (o *PrintPropertyValue_PropertyInt32) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadData(&o.PropertyInt32); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue_PropertyInt64 structure represents PrintPropertyValue_Value RPC union arm.
//
// It has following labels: 3
type PrintPropertyValue_PropertyInt64 struct {
	// propertyInt64: The property value as a signed 64-bit integer. Valid only if ePropertyType
	// is set to kRpcPropertyTypeInt64.
	PropertyInt64 int64 `idl:"name:propertyInt64" json:"property_int64"`
}

func (*PrintPropertyValue_PropertyInt64) is_PrintPropertyValue_Value() {}

func (o *PrintPropertyValue_PropertyInt64) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := w.WriteData(o.PropertyInt64); err != nil {
		return err
	}
	return nil
}
func (o *PrintPropertyValue_PropertyInt64) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadData(&o.PropertyInt64); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue_PropertyByte structure represents PrintPropertyValue_Value RPC union arm.
//
// It has following labels: 4
type PrintPropertyValue_PropertyByte struct {
	// propertyByte: The property value as a byte. Valid only if ePropertyType is set to
	// kRpcPropertyTypeByte.
	PropertyByte uint8 `idl:"name:propertyByte" json:"property_byte"`
}

func (*PrintPropertyValue_PropertyByte) is_PrintPropertyValue_Value() {}

func (o *PrintPropertyValue_PropertyByte) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := w.WriteData(o.PropertyByte); err != nil {
		return err
	}
	return nil
}
func (o *PrintPropertyValue_PropertyByte) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadData(&o.PropertyByte); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue_PropertyBlob structure represents PrintPropertyValue_Value RPC union arm.
//
// It has following labels: 5
type PrintPropertyValue_PropertyBlob struct {
	// propertyBlob: An embedded structure that describes the buffer containing the property
	// value as an array of bytes. Valid only if ePropertyType is set to kRpcPropertyTypeBuffer.
	PropertyBlob *PrintPropertyValue_Value_PropertyBlob `idl:"name:propertyBlob" json:"property_blob"`
}

func (*PrintPropertyValue_PropertyBlob) is_PrintPropertyValue_Value() {}

func (o *PrintPropertyValue_PropertyBlob) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.PropertyBlob != nil {
		if err := o.PropertyBlob.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&PrintPropertyValue_Value_PropertyBlob{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrintPropertyValue_PropertyBlob) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.PropertyBlob == nil {
		o.PropertyBlob = &PrintPropertyValue_Value_PropertyBlob{}
	}
	if err := o.PropertyBlob.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// PrintPropertyValue_Value_PropertyBlob structure represents RPC_PrintPropertyValue structure anonymous member.
//
// The RPC_PrintPropertyValue structure specifies the value of a Job Named Property
// (section 3.1.1).<80>
type PrintPropertyValue_Value_PropertyBlob struct {
	// cbBuf: Member of the propertyBlob structure that specifies the length, in bytes,
	// of the property value contained in the pBuf buffer when ePropertyType is set to kRpcPropertyTypeBuffer.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// pBuf: Member of the propertyBlob structure that contains a pointer to the buffer
	// containing the property value when ePropertyType is set to kRpcPropertyTypeBuffer.
	Buffer []byte `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
}

func (o *PrintPropertyValue_Value_PropertyBlob) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.Buffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Buffer))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrintPropertyValue_Value_PropertyBlob) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.BufferLength); err != nil {
		return err
	}
	if o.Buffer != nil || o.BufferLength > 0 {
		_ptr_pBuf := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.BufferLength)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.Buffer {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if err := w.WriteData(o.Buffer[i1]); err != nil {
					return err
				}
			}
			for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
				if err := w.WriteData(uint8(0)); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.Buffer, _ptr_pBuf); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrintPropertyValue_Value_PropertyBlob) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.BufferLength); err != nil {
		return err
	}
	_ptr_pBuf := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.BufferLength > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.BufferLength)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
		}
		o.Buffer = make([]byte, sizeInfo[0])
		for i1 := range o.Buffer {
			i1 := i1
			if err := w.ReadData(&o.Buffer[i1]); err != nil {
				return err
			}
		}
		return nil
	})
	_s_pBuf := func(ptr interface{}) { o.Buffer = *ptr.(*[]byte) }
	if err := w.ReadPointer(&o.Buffer, _s_pBuf, _ptr_pBuf); err != nil {
		return err
	}
	return nil
}

// PrintNamedProperty structure represents RPC_PrintNamedProperty RPC structure.
//
// The RPC_PrintNamedProperty structure specifies a Job Named Property (section 3.1.1).<81>
type PrintNamedProperty struct {
	// propertyName: A pointer to a string containing the name of the property.
	PropertyName string `idl:"name:propertyName;string" json:"property_name"`
	// propertyValue: An RPC_PrintPropertyValue structure (section 2.2.1.14.1) containing
	// the value of the property.
	PropertyValue *PrintPropertyValue `idl:"name:propertyValue" json:"property_value"`
}

func (o *PrintNamedProperty) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *PrintNamedProperty) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if o.PropertyName != "" {
		_ptr_propertyName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PropertyName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PropertyName, _ptr_propertyName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PropertyValue != nil {
		if err := o.PropertyValue.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&PrintPropertyValue{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *PrintNamedProperty) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	_ptr_propertyName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PropertyName); err != nil {
			return err
		}
		return nil
	})
	_s_propertyName := func(ptr interface{}) { o.PropertyName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PropertyName, _s_propertyName, _ptr_propertyName); err != nil {
		return err
	}
	if o.PropertyValue == nil {
		o.PropertyValue = &PrintPropertyValue{}
	}
	if err := o.PropertyValue.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobEventType type represents EBranchOfficeJobEventType RPC enumeration.
//
// The EBranchOfficeJobEventType enumeration specifies the type of Windows Event contained
// by a Branch Office Print Remote Log Entry (section 3.1.1).<84>
type BranchOfficeJobEventType uint16

var (
	// kInvalidJobState: The Windows Event is an unknown type.
	BranchOfficeJobEventTypeInvalidJobState BranchOfficeJobEventType = 0
	// kLogJobPrinted: The Branch Office Print Remote Log Entry contains a Windows Event
	// that corresponds to event ID 307.
	BranchOfficeJobEventTypeLogJobPrinted BranchOfficeJobEventType = 1
	// kLogJobRendered: The Branch Office Print Remote Log Entry contains a Windows Event
	// that corresponds to event ID 805.
	BranchOfficeJobEventTypeLogJobRendered BranchOfficeJobEventType = 2
	// kLogJobError: The Branch Office Print Remote Log Entry contains a Windows Event that
	// corresponds to event ID 372.
	BranchOfficeJobEventTypeLogJobError BranchOfficeJobEventType = 3
	// kLogJobPipelineError: The Branch Office Print Remote Log Entry contains a Windows
	// Event that corresponds to event ID 824.
	BranchOfficeJobEventTypeLogJobPipelineError BranchOfficeJobEventType = 4
	// kLogOfflineFileFull: The Branch Office Print Remote Log Entry contains a Windows
	// Event that corresponds to event ID 868.
	BranchOfficeJobEventTypeLogOfflineFileFull BranchOfficeJobEventType = 5
)

func (o BranchOfficeJobEventType) String() string {
	switch o {
	case BranchOfficeJobEventTypeInvalidJobState:
		return "BranchOfficeJobEventTypeInvalidJobState"
	case BranchOfficeJobEventTypeLogJobPrinted:
		return "BranchOfficeJobEventTypeLogJobPrinted"
	case BranchOfficeJobEventTypeLogJobRendered:
		return "BranchOfficeJobEventTypeLogJobRendered"
	case BranchOfficeJobEventTypeLogJobError:
		return "BranchOfficeJobEventTypeLogJobError"
	case BranchOfficeJobEventTypeLogJobPipelineError:
		return "BranchOfficeJobEventTypeLogJobPipelineError"
	case BranchOfficeJobEventTypeLogOfflineFileFull:
		return "BranchOfficeJobEventTypeLogOfflineFileFull"
	}
	return "Invalid"
}

// BranchOfficeJobDataPrinted structure represents RPC_BranchOfficeJobDataPrinted RPC structure.
//
// The RPC_BranchOfficeJobDataPrinted structure holds a single Branch Office Print Remote
// Log Entry (section 3.1.1).<88> This entry contains the information needed to create
// event ID 307 in the Microsoft-Windows-PrintService/Operational event channel.
type BranchOfficeJobDataPrinted struct {
	// Status: A 32-bit unsigned integer that specifies an implementation-specific error
	// code for the last error that occurred during the processing of this print job.
	Status uint32 `idl:"name:Status" json:"status"`
	// pDocumentName: A string that specifies the name of the print document for this print
	// job.
	DocumentName string `idl:"name:pDocumentName;string" json:"document_name"`
	// pUserName: A pointer to a string that specifies the name of the user that owns the
	// print job. For rules governing user names, see section 2.2.4.17.
	UserName string `idl:"name:pUserName;string" json:"user_name"`
	// pMachineName: A pointer to a string that specifies the name of the client computer
	// that owns the print job. For rules governing computer names, see section 2.2.4.16.
	MachineName string `idl:"name:pMachineName;string" json:"machine_name"`
	// pPrinterName: A pointer to a string that specifies the name of the printer used for
	// the print job. For rules governing printer names, see section 2.2.4.14.
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	// pPortName: A pointer to a string that specifies a supported printer port. For rules
	// governing port names, see section 2.2.4.10.
	PortName string `idl:"name:pPortName;string" json:"port_name"`
	// Size: A 64-bit signed integer that specifies the size of the print job, in bytes.
	Size int64 `idl:"name:Size" json:"size"`
	// TotalPages: A 32-bit unsigned integer that specifies the number of pages the document
	// contains.
	TotalPages uint32 `idl:"name:TotalPages" json:"total_pages"`
}

func (o *BranchOfficeJobDataPrinted) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataPrinted) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteData(o.Status); err != nil {
		return err
	}
	if o.DocumentName != "" {
		_ptr_pDocumentName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DocumentName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DocumentName, _ptr_pDocumentName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PortName != "" {
		_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalPages); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(8); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataPrinted) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadData(&o.Status); err != nil {
		return err
	}
	_ptr_pDocumentName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DocumentName); err != nil {
			return err
		}
		return nil
	})
	_s_pDocumentName := func(ptr interface{}) { o.DocumentName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DocumentName, _s_pDocumentName, _ptr_pDocumentName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
		return nil
	})
	_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalPages); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(8); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobDataRendered structure represents RPC_BranchOfficeJobDataRendered RPC structure.
//
// The RPC_BranchOfficeJobDataRendered structure holds a single Branch Office Print
// Remote Log Entry (section 3.1.1).<89> This entry contains the information needed
// to create event ID 805 in the Microsoft-Windows-PrintService/Operational event channel.
type BranchOfficeJobDataRendered struct {
	// Size: A 64-bit signed integer that specifies the size of the print job, in bytes.
	Size int64 `idl:"name:Size" json:"size"`
	// ICMMethod: A 32-bit unsigned integer that specifies how Image Color Management (ICM)
	// is handled for the print job. See the definition of the dmICMMethod field in section
	// 2.2.2.1.
	ICMMethod uint32 `idl:"name:ICMMethod" json:"icm_method"`
	// Color: A 16-bit signed integer that specifies the color mode to use for the print
	// job. See the definition of the dmColor field in section 2.2.2.1.
	Color int16 `idl:"name:Color" json:"color"`
	// PrintQuality: A 16-bit signed integer that specifies the printer resolution for the
	// print job. See the definition of the dmPrintQuality field in section 2.2.2.1.
	PrintQuality int16 `idl:"name:PrintQuality" json:"print_quality"`
	// YResolution: A 16-bit signed integer that specifies the vertical-resolution in dots
	// per inch for the print job. See the definition of the dmYResolution field in section
	// 2.2.2.1.
	YResolution int16 `idl:"name:YResolution" json:"y_resolution"`
	// Copies: A 16-bit signed integer that specifies the number of copies to be printed
	// for the print job. See the definition of the dmCopies field in section 2.2.2.1.
	Copies int16 `idl:"name:Copies" json:"copies"`
	// TTOption: A 16-bit signed integer that specifies how TrueType fonts are printed for
	// the print job. See the definition of the dmTTOption field in section 2.2.2.1.
	TTOption int16 `idl:"name:TTOption" json:"tt_option"`
}

func (o *BranchOfficeJobDataRendered) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataRendered) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteData(o.Size); err != nil {
		return err
	}
	if err := w.WriteData(o.ICMMethod); err != nil {
		return err
	}
	if err := w.WriteData(o.Color); err != nil {
		return err
	}
	if err := w.WriteData(o.PrintQuality); err != nil {
		return err
	}
	if err := w.WriteData(o.YResolution); err != nil {
		return err
	}
	if err := w.WriteData(o.Copies); err != nil {
		return err
	}
	if err := w.WriteData(o.TTOption); err != nil {
		return err
	}
	if err := w.WriteTrailingGap(8); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataRendered) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadData(&o.Size); err != nil {
		return err
	}
	if err := w.ReadData(&o.ICMMethod); err != nil {
		return err
	}
	if err := w.ReadData(&o.Color); err != nil {
		return err
	}
	if err := w.ReadData(&o.PrintQuality); err != nil {
		return err
	}
	if err := w.ReadData(&o.YResolution); err != nil {
		return err
	}
	if err := w.ReadData(&o.Copies); err != nil {
		return err
	}
	if err := w.ReadData(&o.TTOption); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(8); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobDataError structure represents RPC_BranchOfficeJobDataError RPC structure.
//
// The RPC_BranchOfficeJobDataError structure holds a single Branch Office Print Remote
// Log Entry (section 3.1.1).<86> This entry contains the information needed to create
// event ID 372 in the Microsoft-Windows-PrintService/Admin event channel.
type BranchOfficeJobDataError struct {
	// LastError: A 32-bit unsigned integer that specifies an implementation-specific error
	// code for the last error that occurred during processing of this print job.
	LastError uint32 `idl:"name:LastError" json:"last_error"`
	// pDocumentName: A pointer to a string that specifies the name of the print document
	// for this print job.
	DocumentName string `idl:"name:pDocumentName;string" json:"document_name"`
	// pUserName: A pointer to a string that specifies the name of the user that owns the
	// print job. For rules governing user names, see section 2.2.4.17.
	UserName string `idl:"name:pUserName;string" json:"user_name"`
	// pPrinterName: A pointer to a string that specifies the name of the printer used for
	// the print job. For rules governing printer names, see section 2.2.4.14.
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	// pDataType: A pointer to a string that specifies the type of data that the printing
	// application sent to the printer in the print job. The identified data type MUST be
	// supported by the print processor that is associated with the printer that is processing
	// the job. For rules governing data type names, see section 2.2.4.2.
	DataType string `idl:"name:pDataType;string" json:"data_type"`
	// TotalSize: A 64-bit signed integer that specifies the size of the print job, in bytes.
	// This value MUST be greater than zero.
	TotalSize int64 `idl:"name:TotalSize" json:"total_size"`
	// PrintedSize: A 64-bit signed integer that specifies the amount of data for the print
	// job that actually got processed and sent to the printer, in bytes. This value MUST
	// be zero or greater.
	PrintedSize int64 `idl:"name:PrintedSize" json:"printed_size"`
	// TotalPages: A 32-bit unsigned integer that specifies the number of pages the document
	// contains.
	TotalPages uint32 `idl:"name:TotalPages" json:"total_pages"`
	// PrintedPages: A 32-bit unsigned integer that specifies the number of pages of the
	// document that actually got processed and sent to the printer.
	PrintedPages uint32 `idl:"name:PrintedPages" json:"printed_pages"`
	// pMachineName: A pointer to a string that specifies the name of the client computer
	// that owns the print job. For rules governing computer names, see section 2.2.4.16.
	MachineName string `idl:"name:pMachineName;string" json:"machine_name"`
	// pJobError: A pointer to a string that specifies the text representation of the value
	// of the LastError error code.
	JobError string `idl:"name:pJobError;string" json:"job_error"`
	// pErrorDescription: A pointer to an optional string that specifies message text for
	// a system-defined error corresponding to the value of the LastError error code.
	ErrorDescription string `idl:"name:pErrorDescription;string" json:"error_description"`
}

func (o *BranchOfficeJobDataError) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataError) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteData(o.LastError); err != nil {
		return err
	}
	if o.DocumentName != "" {
		_ptr_pDocumentName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DocumentName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DocumentName, _ptr_pDocumentName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.UserName != "" {
		_ptr_pUserName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.UserName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.UserName, _ptr_pUserName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.DataType != "" {
		_ptr_pDataType := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DataType, _ptr_pDataType); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteData(o.TotalSize); err != nil {
		return err
	}
	if err := w.WriteData(o.PrintedSize); err != nil {
		return err
	}
	if err := w.WriteData(o.TotalPages); err != nil {
		return err
	}
	if err := w.WriteData(o.PrintedPages); err != nil {
		return err
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.JobError != "" {
		_ptr_pJobError := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.JobError); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.JobError, _ptr_pJobError); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ErrorDescription != "" {
		_ptr_pErrorDescription := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ErrorDescription); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ErrorDescription, _ptr_pErrorDescription); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if err := w.WriteTrailingGap(8); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataError) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadData(&o.LastError); err != nil {
		return err
	}
	_ptr_pDocumentName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DocumentName); err != nil {
			return err
		}
		return nil
	})
	_s_pDocumentName := func(ptr interface{}) { o.DocumentName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DocumentName, _s_pDocumentName, _ptr_pDocumentName); err != nil {
		return err
	}
	_ptr_pUserName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.UserName); err != nil {
			return err
		}
		return nil
	})
	_s_pUserName := func(ptr interface{}) { o.UserName = *ptr.(*string) }
	if err := w.ReadPointer(&o.UserName, _s_pUserName, _ptr_pUserName); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pDataType := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
			return err
		}
		return nil
	})
	_s_pDataType := func(ptr interface{}) { o.DataType = *ptr.(*string) }
	if err := w.ReadPointer(&o.DataType, _s_pDataType, _ptr_pDataType); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalSize); err != nil {
		return err
	}
	if err := w.ReadData(&o.PrintedSize); err != nil {
		return err
	}
	if err := w.ReadData(&o.TotalPages); err != nil {
		return err
	}
	if err := w.ReadData(&o.PrintedPages); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	_ptr_pJobError := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.JobError); err != nil {
			return err
		}
		return nil
	})
	_s_pJobError := func(ptr interface{}) { o.JobError = *ptr.(*string) }
	if err := w.ReadPointer(&o.JobError, _s_pJobError, _ptr_pJobError); err != nil {
		return err
	}
	_ptr_pErrorDescription := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ErrorDescription); err != nil {
			return err
		}
		return nil
	})
	_s_pErrorDescription := func(ptr interface{}) { o.ErrorDescription = *ptr.(*string) }
	if err := w.ReadPointer(&o.ErrorDescription, _s_pErrorDescription, _ptr_pErrorDescription); err != nil {
		return err
	}
	if err := w.ReadTrailingGap(8); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobDataPipelineFailed structure represents RPC_BranchOfficeJobDataPipelineFailed RPC structure.
//
// The RPC_BranchOfficeJobDataPipelineFailed structure holds a single Branch Office
// Print Remote Log Entry (section 3.1.1).<87> This entry contains the information needed
// to create event ID 824 in the Microsoft-Windows-PrintService/Operational event channel.
type BranchOfficeJobDataPipelineFailed struct {
	// pDocumentName: A pointer to a string that specifies the name of the print document
	// for this print job.
	DocumentName string `idl:"name:pDocumentName;string" json:"document_name"`
	// pPrinterName: A pointer to a string that specifies the name of the printer used for
	// the print job. For rules governing printer names, see section 2.2.4.14.
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	// pExtraErrorInfo: A pointer to an optional string that specifies additional text associated
	// with the failure in the Print Pipeline.
	ExtraErrorInfo string `idl:"name:pExtraErrorInfo;string" json:"extra_error_info"`
}

func (o *BranchOfficeJobDataPipelineFailed) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataPipelineFailed) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.DocumentName != "" {
		_ptr_pDocumentName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.DocumentName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.DocumentName, _ptr_pDocumentName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.PrinterName != "" {
		_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	if o.ExtraErrorInfo != "" {
		_ptr_pExtraErrorInfo := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.ExtraErrorInfo); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.ExtraErrorInfo, _ptr_pExtraErrorInfo); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobDataPipelineFailed) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pDocumentName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.DocumentName); err != nil {
			return err
		}
		return nil
	})
	_s_pDocumentName := func(ptr interface{}) { o.DocumentName = *ptr.(*string) }
	if err := w.ReadPointer(&o.DocumentName, _s_pDocumentName, _ptr_pDocumentName); err != nil {
		return err
	}
	_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
		return nil
	})
	_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
	if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
		return err
	}
	_ptr_pExtraErrorInfo := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.ExtraErrorInfo); err != nil {
			return err
		}
		return nil
	})
	_s_pExtraErrorInfo := func(ptr interface{}) { o.ExtraErrorInfo = *ptr.(*string) }
	if err := w.ReadPointer(&o.ExtraErrorInfo, _s_pExtraErrorInfo, _ptr_pExtraErrorInfo); err != nil {
		return err
	}
	return nil
}

// BranchOfficeLogOfflineFileFull structure represents RPC_BranchOfficeLogOfflineFileFull RPC structure.
//
// The RPC_BranchOfficeLogOfflineFileFull structure holds a single Branch Office Print
// Remote Log Entry (section 3.1.1)<90> that indicates the Branch Office Print Remote
// Log Offline Archive (section 3.2.1) has exceeded the maximum allowed size.<91> This
// entry contains the information needed to create event ID 868 in the Microsoft-Windows-PrintService/Admin
// event channel.
type BranchOfficeLogOfflineFileFull struct {
	// pMachineName: A pointer to a string that specifies the name of the client computer
	// that encountered the Branch Office Print Remote Log Offline Archive full condition.
	// For rules governing computer names, see section 2.2.4.16.
	MachineName string `idl:"name:pMachineName;string" json:"machine_name"`
}

func (o *BranchOfficeLogOfflineFileFull) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeLogOfflineFileFull) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(6); err != nil {
		return err
	}
	if o.MachineName != "" {
		_ptr_pMachineName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			if err := ndr.WriteUTF16NString(ctx, w, o.MachineName); err != nil {
				return err
			}
			return nil
		})
		if err := w.WritePointer(&o.MachineName, _ptr_pMachineName); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeLogOfflineFileFull) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(6); err != nil {
		return err
	}
	_ptr_pMachineName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		if err := ndr.ReadUTF16NString(ctx, w, &o.MachineName); err != nil {
			return err
		}
		return nil
	})
	_s_pMachineName := func(ptr interface{}) { o.MachineName = *ptr.(*string) }
	if err := w.ReadPointer(&o.MachineName, _s_pMachineName, _ptr_pMachineName); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobData structure represents RPC_BranchOfficeJobData RPC structure.
//
// The RPC_BranchOfficeJobData structure holds a branch office print remote logging
// structure that contains the data required to log a single Branch Office Print Remote
// Log Entry (section 3.1.1) corresponding to a specific type of Windows Event.<85>
type BranchOfficeJobData struct {
	// eEventType: The type of Windows Event to which the Branch Office Print Remote Log
	// Entry corresponds, which MUST be an EBranchOfficeJobEventType (section 2.2.1.15.1)
	// value.
	EventType BranchOfficeJobEventType `idl:"name:eEventType" json:"event_type"`
	// JobId: The identifier of a print job.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// JobInfo: The branch office print remote logging structure that contains the data
	// required to log a Branch Office Print Remote Log Entry corresponding to the eEventType
	// member value.
	JobInfo *BranchOfficeJobData_JobInfo `idl:"name:JobInfo;switch_is:eEventType" json:"job_info"`
}

func (o *BranchOfficeJobData) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobData) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	if err := w.WriteEnum(uint16(o.EventType)); err != nil {
		return err
	}
	if err := w.WriteData(o.JobID); err != nil {
		return err
	}
	_swJobInfo := uint16(o.EventType)
	if o.JobInfo != nil {
		if err := o.JobInfo.MarshalUnionNDR(ctx, w, _swJobInfo); err != nil {
			return err
		}
	} else {
		if err := (&BranchOfficeJobData_JobInfo{}).MarshalUnionNDR(ctx, w, _swJobInfo); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobData) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	if err := w.ReadEnum((*uint16)(&o.EventType)); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobID); err != nil {
		return err
	}
	if o.JobInfo == nil {
		o.JobInfo = &BranchOfficeJobData_JobInfo{}
	}
	_swJobInfo := uint16(o.EventType)
	if err := o.JobInfo.UnmarshalUnionNDR(ctx, w, _swJobInfo); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobData_JobInfo structure represents RPC_BranchOfficeJobData union anonymous member.
//
// The RPC_BranchOfficeJobData structure holds a branch office print remote logging
// structure that contains the data required to log a single Branch Office Print Remote
// Log Entry (section 3.1.1) corresponding to a specific type of Windows Event.<85>
type BranchOfficeJobData_JobInfo struct {
	// Types that are assignable to Value
	//
	// *BranchOfficeJobData_JobInfo_LogJobPrinted
	// *BranchOfficeJobData_JobInfo_LogJobRendered
	// *BranchOfficeJobData_JobInfo_LogJobError
	// *BranchOfficeJobData_JobInfo_LogPipelineFailed
	// *BranchOfficeJobData_JobInfo_LogOfflineFileFull
	Value is_BranchOfficeJobData_JobInfo `json:"value"`
}

func (o *BranchOfficeJobData_JobInfo) GetValue() any {
	if o == nil {
		return nil
	}
	switch value := (interface{})(o.Value).(type) {
	case *BranchOfficeJobData_JobInfo_LogJobPrinted:
		if value != nil {
			return value.LogJobPrinted
		}
	case *BranchOfficeJobData_JobInfo_LogJobRendered:
		if value != nil {
			return value.LogJobRendered
		}
	case *BranchOfficeJobData_JobInfo_LogJobError:
		if value != nil {
			return value.LogJobError
		}
	case *BranchOfficeJobData_JobInfo_LogPipelineFailed:
		if value != nil {
			return value.LogPipelineFailed
		}
	case *BranchOfficeJobData_JobInfo_LogOfflineFileFull:
		if value != nil {
			return value.LogOfflineFileFull
		}
	}
	return nil
}

type is_BranchOfficeJobData_JobInfo interface {
	ndr.Marshaler
	ndr.Unmarshaler
	is_BranchOfficeJobData_JobInfo()
}

func (o *BranchOfficeJobData_JobInfo) NDRSwitchValue(sw uint16) uint16 {
	if o == nil {
		return uint16(0)
	}
	switch (interface{})(o.Value).(type) {
	case *BranchOfficeJobData_JobInfo_LogJobPrinted:
		return uint16(1)
	case *BranchOfficeJobData_JobInfo_LogJobRendered:
		return uint16(2)
	case *BranchOfficeJobData_JobInfo_LogJobError:
		return uint16(3)
	case *BranchOfficeJobData_JobInfo_LogPipelineFailed:
		return uint16(4)
	case *BranchOfficeJobData_JobInfo_LogOfflineFileFull:
		return uint16(5)
	}
	return uint16(0)
}

func (o *BranchOfficeJobData_JobInfo) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint16) error {
	if err := w.WriteUnionAlign(8); err != nil {
		return err
	}
	if err := w.WriteSwitch(ndr.Enum(uint16(sw))); err != nil {
		return err
	}
	// ms_union
	if err := w.WriteAlign(8); err != nil {
		return err
	}
	switch sw {
	case uint16(1):
		_o, _ := o.Value.(*BranchOfficeJobData_JobInfo_LogJobPrinted)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BranchOfficeJobData_JobInfo_LogJobPrinted{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(2):
		_o, _ := o.Value.(*BranchOfficeJobData_JobInfo_LogJobRendered)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BranchOfficeJobData_JobInfo_LogJobRendered{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(3):
		_o, _ := o.Value.(*BranchOfficeJobData_JobInfo_LogJobError)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BranchOfficeJobData_JobInfo_LogJobError{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(4):
		_o, _ := o.Value.(*BranchOfficeJobData_JobInfo_LogPipelineFailed)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BranchOfficeJobData_JobInfo_LogPipelineFailed{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	case uint16(5):
		_o, _ := o.Value.(*BranchOfficeJobData_JobInfo_LogOfflineFileFull)
		if _o != nil {
			if err := _o.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BranchOfficeJobData_JobInfo_LogOfflineFileFull{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

func (o *BranchOfficeJobData_JobInfo) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint16) error {
	if err := w.ReadUnionAlign(8); err != nil {
		return err
	}
	if err := w.ReadSwitch(ndr.Enum((*uint16)(&sw))); err != nil {
		return err
	}
	// ms_union
	if err := w.ReadAlign(8); err != nil {
		return err
	}
	switch sw {
	case uint16(1):
		o.Value = &BranchOfficeJobData_JobInfo_LogJobPrinted{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(2):
		o.Value = &BranchOfficeJobData_JobInfo_LogJobRendered{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(3):
		o.Value = &BranchOfficeJobData_JobInfo_LogJobError{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(4):
		o.Value = &BranchOfficeJobData_JobInfo_LogPipelineFailed{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	case uint16(5):
		o.Value = &BranchOfficeJobData_JobInfo_LogOfflineFileFull{}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unsupported switch case value %v", sw)
	}
	return nil
}

// BranchOfficeJobData_JobInfo_LogJobPrinted structure represents BranchOfficeJobData_JobInfo RPC union arm.
//
// It has following labels: 1
type BranchOfficeJobData_JobInfo_LogJobPrinted struct {
	// LogJobPrinted: An RPC_BranchOfficeJobDataPrinted (section 2.2.1.15.5) structure for
	// a Branch Office Print Remote Log Entry corresponding to event ID 307. This structure
	// is present only if eEventType is set to kLogJobPrinted.
	LogJobPrinted *BranchOfficeJobDataPrinted `idl:"name:LogJobPrinted" json:"log_job_printed"`
}

func (*BranchOfficeJobData_JobInfo_LogJobPrinted) is_BranchOfficeJobData_JobInfo() {}

func (o *BranchOfficeJobData_JobInfo_LogJobPrinted) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.LogJobPrinted != nil {
		if err := o.LogJobPrinted.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BranchOfficeJobDataPrinted{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobData_JobInfo_LogJobPrinted) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.LogJobPrinted == nil {
		o.LogJobPrinted = &BranchOfficeJobDataPrinted{}
	}
	if err := o.LogJobPrinted.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobData_JobInfo_LogJobRendered structure represents BranchOfficeJobData_JobInfo RPC union arm.
//
// It has following labels: 2
type BranchOfficeJobData_JobInfo_LogJobRendered struct {
	// LogJobRendered: An RPC_BranchOfficeJobDataRendered (section 2.2.1.15.6) structure
	// for a Branch Office Print Remote Log Entry corresponding to event ID 805. This structure
	// is present only if eEventType is set to kLogJobRendered.
	LogJobRendered *BranchOfficeJobDataRendered `idl:"name:LogJobRendered" json:"log_job_rendered"`
}

func (*BranchOfficeJobData_JobInfo_LogJobRendered) is_BranchOfficeJobData_JobInfo() {}

func (o *BranchOfficeJobData_JobInfo_LogJobRendered) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.LogJobRendered != nil {
		if err := o.LogJobRendered.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BranchOfficeJobDataRendered{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobData_JobInfo_LogJobRendered) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.LogJobRendered == nil {
		o.LogJobRendered = &BranchOfficeJobDataRendered{}
	}
	if err := o.LogJobRendered.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobData_JobInfo_LogJobError structure represents BranchOfficeJobData_JobInfo RPC union arm.
//
// It has following labels: 3
type BranchOfficeJobData_JobInfo_LogJobError struct {
	// LogJobError: An RPC_BranchOfficeJobDataError (section 2.2.1.15.3) structure for a
	// Branch Office Print Remote Log Entry corresponding to event ID 372. This structure
	// is present only if eEventType is set to kLogJobError.
	LogJobError *BranchOfficeJobDataError `idl:"name:LogJobError" json:"log_job_error"`
}

func (*BranchOfficeJobData_JobInfo_LogJobError) is_BranchOfficeJobData_JobInfo() {}

func (o *BranchOfficeJobData_JobInfo_LogJobError) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.LogJobError != nil {
		if err := o.LogJobError.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BranchOfficeJobDataError{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobData_JobInfo_LogJobError) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.LogJobError == nil {
		o.LogJobError = &BranchOfficeJobDataError{}
	}
	if err := o.LogJobError.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobData_JobInfo_LogPipelineFailed structure represents BranchOfficeJobData_JobInfo RPC union arm.
//
// It has following labels: 4
type BranchOfficeJobData_JobInfo_LogPipelineFailed struct {
	// LogPipelineFailed: An RPC_BranchOfficeJobDataPipelineFailed (section 2.2.1.15.4)
	// structure for a Branch Office Print Remote Log Entry corresponding to event ID 824.
	// This structure is present only if eEventType is set to kLogJobPipelineError.
	LogPipelineFailed *BranchOfficeJobDataPipelineFailed `idl:"name:LogPipelineFailed" json:"log_pipeline_failed"`
}

func (*BranchOfficeJobData_JobInfo_LogPipelineFailed) is_BranchOfficeJobData_JobInfo() {}

func (o *BranchOfficeJobData_JobInfo_LogPipelineFailed) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.LogPipelineFailed != nil {
		if err := o.LogPipelineFailed.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BranchOfficeJobDataPipelineFailed{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobData_JobInfo_LogPipelineFailed) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.LogPipelineFailed == nil {
		o.LogPipelineFailed = &BranchOfficeJobDataPipelineFailed{}
	}
	if err := o.LogPipelineFailed.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobData_JobInfo_LogOfflineFileFull structure represents BranchOfficeJobData_JobInfo RPC union arm.
//
// It has following labels: 5
type BranchOfficeJobData_JobInfo_LogOfflineFileFull struct {
	// LogOfflineFileFull: An RPC_BranchOfficeLogOfflineFileFull (section 2.2.1.15.7) structure
	// for a Branch Office Print Remote Log Entry corresponding to event ID 868. This structure
	// is present only if eEventType is set to kLogOfflineFileFull.
	LogOfflineFileFull *BranchOfficeLogOfflineFileFull `idl:"name:LogOfflineFileFull" json:"log_offline_file_full"`
}

func (*BranchOfficeJobData_JobInfo_LogOfflineFileFull) is_BranchOfficeJobData_JobInfo() {}

func (o *BranchOfficeJobData_JobInfo_LogOfflineFileFull) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if o.LogOfflineFileFull != nil {
		if err := o.LogOfflineFileFull.MarshalNDR(ctx, w); err != nil {
			return err
		}
	} else {
		if err := (&BranchOfficeLogOfflineFileFull{}).MarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobData_JobInfo_LogOfflineFileFull) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if o.LogOfflineFileFull == nil {
		o.LogOfflineFileFull = &BranchOfficeLogOfflineFileFull{}
	}
	if err := o.LogOfflineFileFull.UnmarshalNDR(ctx, w); err != nil {
		return err
	}
	return nil
}

// BranchOfficeJobDataContainer structure represents RPC_BranchOfficeJobDataContainer RPC structure.
//
// The RPC_BranchOfficeJobDataContainer structure is a container for an array of RPC_BranchOfficeJobData
// structures (section 2.2.1.15.2).<12>
type BranchOfficeJobDataContainer struct {
	// cJobDataEntries: The number of RPC_BranchOfficeJobData structures in the JobData
	// member.
	JobDataEntriesCount uint32 `idl:"name:cJobDataEntries" json:"job_data_entries_count"`
	// JobData: An array of RPC_BranchOfficeJobData structures. Each structure in the array
	// contains a single Branch Office Print Remote Log Entry (section 3.1.1).
	JobData []*BranchOfficeJobData `idl:"name:JobData;size_is:(cJobDataEntries);pointer:unique" json:"job_data"`
}

func (o *BranchOfficeJobDataContainer) xxx_PreparePayload(ctx context.Context) error {
	if err := ndr.BeforePreparePayload(ctx, o); err != nil {
		return err
	}
	if o.JobData != nil && o.JobDataEntriesCount == 0 {
		o.JobDataEntriesCount = uint32(len(o.JobData))
	}
	if err := ndr.AfterPreparePayload(ctx, o); err != nil {
		return err
	}
	return nil
}
func (o *BranchOfficeJobDataContainer) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PreparePayload(ctx); err != nil {
		return err
	}
	if err := w.WriteAlign(9); err != nil {
		return err
	}
	if err := w.WriteData(o.JobDataEntriesCount); err != nil {
		return err
	}
	if o.JobData != nil || o.JobDataEntriesCount > 0 {
		_ptr_JobData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
			dimSize1 := uint64(o.JobDataEntriesCount)
			if err := w.WriteSize(dimSize1); err != nil {
				return err
			}
			sizeInfo := []uint64{
				dimSize1,
			}
			for i1 := range o.JobData {
				i1 := i1
				if uint64(i1) >= sizeInfo[0] {
					break
				}
				if o.JobData[i1] != nil {
					if err := o.JobData[i1].MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&BranchOfficeJobData{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
			}
			for i1 := len(o.JobData); uint64(i1) < sizeInfo[0]; i1++ {
				if err := (&BranchOfficeJobData{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		if err := w.WritePointer(&o.JobData, _ptr_JobData); err != nil {
			return err
		}
	} else {
		if err := w.WritePointer(nil); err != nil {
			return err
		}
	}
	return nil
}
func (o *BranchOfficeJobDataContainer) UnmarshalNDR(ctx context.Context, w ndr.Reader) error {
	if err := w.ReadAlign(9); err != nil {
		return err
	}
	if err := w.ReadData(&o.JobDataEntriesCount); err != nil {
		return err
	}
	_ptr_JobData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		// XXX: for opaque unmarshaling
		if o.JobDataEntriesCount > 0 && sizeInfo[0] == 0 {
			sizeInfo[0] = uint64(o.JobDataEntriesCount)
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.JobData", sizeInfo[0])
		}
		o.JobData = make([]*BranchOfficeJobData, sizeInfo[0])
		for i1 := range o.JobData {
			i1 := i1
			if o.JobData[i1] == nil {
				o.JobData[i1] = &BranchOfficeJobData{}
			}
			if err := o.JobData[i1].UnmarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		return nil
	})
	_s_JobData := func(ptr interface{}) { o.JobData = *ptr.(*[]*BranchOfficeJobData) }
	if err := w.ReadPointer(&o.JobData, _s_JobData, _ptr_JobData); err != nil {
		return err
	}
	return nil
}

type xxx_DefaultWinspoolClient struct {
	cc dcerpc.Conn
}

func (o *xxx_DefaultWinspoolClient) EnumPrinters(ctx context.Context, in *EnumPrintersRequest, opts ...dcerpc.CallOption) (*EnumPrintersResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrintersResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) OpenPrinter(ctx context.Context, in *OpenPrinterRequest, opts ...dcerpc.CallOption) (*OpenPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &OpenPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetJob(ctx context.Context, in *SetJobRequest, opts ...dcerpc.CallOption) (*SetJobResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetJobResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...dcerpc.CallOption) (*GetJobResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetJobResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumJobs(ctx context.Context, in *EnumJobsRequest, opts ...dcerpc.CallOption) (*EnumJobsResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumJobsResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPrinter(ctx context.Context, in *AddPrinterRequest, opts ...dcerpc.CallOption) (*AddPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinter(ctx context.Context, in *DeletePrinterRequest, opts ...dcerpc.CallOption) (*DeletePrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetPrinter(ctx context.Context, in *SetPrinterRequest, opts ...dcerpc.CallOption) (*SetPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinter(ctx context.Context, in *GetPrinterRequest, opts ...dcerpc.CallOption) (*GetPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPrinterDriver(ctx context.Context, in *AddPrinterDriverRequest, opts ...dcerpc.CallOption) (*AddPrinterDriverResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPrinterDriverResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPrinterDrivers(ctx context.Context, in *EnumPrinterDriversRequest, opts ...dcerpc.CallOption) (*EnumPrinterDriversResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrinterDriversResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterDriver(ctx context.Context, in *GetPrinterDriverRequest, opts ...dcerpc.CallOption) (*GetPrinterDriverResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterDriverResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterDriverDirectory(ctx context.Context, in *GetPrinterDriverDirectoryRequest, opts ...dcerpc.CallOption) (*GetPrinterDriverDirectoryResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterDriverDirectoryResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinterDriver(ctx context.Context, in *DeletePrinterDriverRequest, opts ...dcerpc.CallOption) (*DeletePrinterDriverResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterDriverResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPrintProcessor(ctx context.Context, in *AddPrintProcessorRequest, opts ...dcerpc.CallOption) (*AddPrintProcessorResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPrintProcessorResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPrintProcessors(ctx context.Context, in *EnumPrintProcessorsRequest, opts ...dcerpc.CallOption) (*EnumPrintProcessorsResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrintProcessorsResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrintProcessorDirectory(ctx context.Context, in *GetPrintProcessorDirectoryRequest, opts ...dcerpc.CallOption) (*GetPrintProcessorDirectoryResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrintProcessorDirectoryResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) StartDocPrinter(ctx context.Context, in *StartDocPrinterRequest, opts ...dcerpc.CallOption) (*StartDocPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &StartDocPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) StartPagePrinter(ctx context.Context, in *StartPagePrinterRequest, opts ...dcerpc.CallOption) (*StartPagePrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &StartPagePrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) WritePrinter(ctx context.Context, in *WritePrinterRequest, opts ...dcerpc.CallOption) (*WritePrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &WritePrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EndPagePrinter(ctx context.Context, in *EndPagePrinterRequest, opts ...dcerpc.CallOption) (*EndPagePrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EndPagePrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AbortPrinter(ctx context.Context, in *AbortPrinterRequest, opts ...dcerpc.CallOption) (*AbortPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AbortPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) ReadPrinter(ctx context.Context, in *ReadPrinterRequest, opts ...dcerpc.CallOption) (*ReadPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &ReadPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EndDocPrinter(ctx context.Context, in *EndDocPrinterRequest, opts ...dcerpc.CallOption) (*EndDocPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EndDocPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddJob(ctx context.Context, in *AddJobRequest, opts ...dcerpc.CallOption) (*AddJobResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddJobResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) ScheduleJob(ctx context.Context, in *ScheduleJobRequest, opts ...dcerpc.CallOption) (*ScheduleJobResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &ScheduleJobResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterData(ctx context.Context, in *GetPrinterDataRequest, opts ...dcerpc.CallOption) (*GetPrinterDataResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterDataResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetPrinterData(ctx context.Context, in *SetPrinterDataRequest, opts ...dcerpc.CallOption) (*SetPrinterDataResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetPrinterDataResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) WaitForPrinterChange(ctx context.Context, in *WaitForPrinterChangeRequest, opts ...dcerpc.CallOption) (*WaitForPrinterChangeResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &WaitForPrinterChangeResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) ClosePrinter(ctx context.Context, in *ClosePrinterRequest, opts ...dcerpc.CallOption) (*ClosePrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &ClosePrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddForm(ctx context.Context, in *AddFormRequest, opts ...dcerpc.CallOption) (*AddFormResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddFormResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeleteForm(ctx context.Context, in *DeleteFormRequest, opts ...dcerpc.CallOption) (*DeleteFormResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeleteFormResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetForm(ctx context.Context, in *GetFormRequest, opts ...dcerpc.CallOption) (*GetFormResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetFormResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetForm(ctx context.Context, in *SetFormRequest, opts ...dcerpc.CallOption) (*SetFormResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetFormResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumForms(ctx context.Context, in *EnumFormsRequest, opts ...dcerpc.CallOption) (*EnumFormsResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumFormsResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPorts(ctx context.Context, in *EnumPortsRequest, opts ...dcerpc.CallOption) (*EnumPortsResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPortsResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumMonitors(ctx context.Context, in *EnumMonitorsRequest, opts ...dcerpc.CallOption) (*EnumMonitorsResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumMonitorsResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePort(ctx context.Context, in *DeletePortRequest, opts ...dcerpc.CallOption) (*DeletePortResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePortResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) CreatePrinterIC(ctx context.Context, in *CreatePrinterICRequest, opts ...dcerpc.CallOption) (*CreatePrinterICResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &CreatePrinterICResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) PlayGDIScriptOnPrinterIC(ctx context.Context, in *PlayGDIScriptOnPrinterICRequest, opts ...dcerpc.CallOption) (*PlayGDIScriptOnPrinterICResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &PlayGDIScriptOnPrinterICResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinterIC(ctx context.Context, in *DeletePrinterICRequest, opts ...dcerpc.CallOption) (*DeletePrinterICResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterICResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddMonitor(ctx context.Context, in *AddMonitorRequest, opts ...dcerpc.CallOption) (*AddMonitorResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddMonitorResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeleteMonitor(ctx context.Context, in *DeleteMonitorRequest, opts ...dcerpc.CallOption) (*DeleteMonitorResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeleteMonitorResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrintProcessor(ctx context.Context, in *DeletePrintProcessorRequest, opts ...dcerpc.CallOption) (*DeletePrintProcessorResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrintProcessorResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPrintProcessorDataTypes(ctx context.Context, in *EnumPrintProcessorDataTypesRequest, opts ...dcerpc.CallOption) (*EnumPrintProcessorDataTypesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrintProcessorDataTypesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) ResetPrinter(ctx context.Context, in *ResetPrinterRequest, opts ...dcerpc.CallOption) (*ResetPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &ResetPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterDriver2(ctx context.Context, in *GetPrinterDriver2Request, opts ...dcerpc.CallOption) (*GetPrinterDriver2Response, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterDriver2Response{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) FindClosePrinterChangeNotification(ctx context.Context, in *FindClosePrinterChangeNotificationRequest, opts ...dcerpc.CallOption) (*FindClosePrinterChangeNotificationResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &FindClosePrinterChangeNotificationResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) ReplyOpenPrinter(ctx context.Context, in *ReplyOpenPrinterRequest, opts ...dcerpc.CallOption) (*ReplyOpenPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &ReplyOpenPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) RouterReplyPrinter(ctx context.Context, in *RouterReplyPrinterRequest, opts ...dcerpc.CallOption) (*RouterReplyPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &RouterReplyPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) ReplyClosePrinter(ctx context.Context, in *ReplyClosePrinterRequest, opts ...dcerpc.CallOption) (*ReplyClosePrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &ReplyClosePrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPortEx(ctx context.Context, in *AddPortExRequest, opts ...dcerpc.CallOption) (*AddPortExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPortExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) RemoteFindFirstPrinterChangeNotification(ctx context.Context, in *RemoteFindFirstPrinterChangeNotificationRequest, opts ...dcerpc.CallOption) (*RemoteFindFirstPrinterChangeNotificationResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &RemoteFindFirstPrinterChangeNotificationResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) RemoteFindFirstPrinterChangeNotificationEx(ctx context.Context, in *RemoteFindFirstPrinterChangeNotificationExRequest, opts ...dcerpc.CallOption) (*RemoteFindFirstPrinterChangeNotificationExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &RemoteFindFirstPrinterChangeNotificationExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) RouterReplyPrinterEx(ctx context.Context, in *RouterReplyPrinterExRequest, opts ...dcerpc.CallOption) (*RouterReplyPrinterExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &RouterReplyPrinterExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) RouterRefreshPrinterChangeNotification(ctx context.Context, in *RouterRefreshPrinterChangeNotificationRequest, opts ...dcerpc.CallOption) (*RouterRefreshPrinterChangeNotificationResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &RouterRefreshPrinterChangeNotificationResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) OpenPrinterEx(ctx context.Context, in *OpenPrinterExRequest, opts ...dcerpc.CallOption) (*OpenPrinterExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &OpenPrinterExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPrinterEx(ctx context.Context, in *AddPrinterExRequest, opts ...dcerpc.CallOption) (*AddPrinterExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPrinterExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetPort(ctx context.Context, in *SetPortRequest, opts ...dcerpc.CallOption) (*SetPortResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetPortResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPrinterData(ctx context.Context, in *EnumPrinterDataRequest, opts ...dcerpc.CallOption) (*EnumPrinterDataResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrinterDataResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinterData(ctx context.Context, in *DeletePrinterDataRequest, opts ...dcerpc.CallOption) (*DeletePrinterDataResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterDataResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetPrinterDataEx(ctx context.Context, in *SetPrinterDataExRequest, opts ...dcerpc.CallOption) (*SetPrinterDataExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetPrinterDataExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterDataEx(ctx context.Context, in *GetPrinterDataExRequest, opts ...dcerpc.CallOption) (*GetPrinterDataExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterDataExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPrinterDataEx(ctx context.Context, in *EnumPrinterDataExRequest, opts ...dcerpc.CallOption) (*EnumPrinterDataExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrinterDataExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPrinterKey(ctx context.Context, in *EnumPrinterKeyRequest, opts ...dcerpc.CallOption) (*EnumPrinterKeyResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPrinterKeyResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinterDataEx(ctx context.Context, in *DeletePrinterDataExRequest, opts ...dcerpc.CallOption) (*DeletePrinterDataExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterDataExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinterKey(ctx context.Context, in *DeletePrinterKeyRequest, opts ...dcerpc.CallOption) (*DeletePrinterKeyResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterKeyResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePrinterDriverEx(ctx context.Context, in *DeletePrinterDriverExRequest, opts ...dcerpc.CallOption) (*DeletePrinterDriverExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePrinterDriverExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPerMachineConnection(ctx context.Context, in *AddPerMachineConnectionRequest, opts ...dcerpc.CallOption) (*AddPerMachineConnectionResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPerMachineConnectionResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeletePerMachineConnection(ctx context.Context, in *DeletePerMachineConnectionRequest, opts ...dcerpc.CallOption) (*DeletePerMachineConnectionResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeletePerMachineConnectionResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumPerMachineConnections(ctx context.Context, in *EnumPerMachineConnectionsRequest, opts ...dcerpc.CallOption) (*EnumPerMachineConnectionsResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumPerMachineConnectionsResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) XcvData(ctx context.Context, in *XcvDataRequest, opts ...dcerpc.CallOption) (*XcvDataResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &XcvDataResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AddPrinterDriverEx(ctx context.Context, in *AddPrinterDriverExRequest, opts ...dcerpc.CallOption) (*AddPrinterDriverExResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &AddPrinterDriverExResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) FlushPrinter(ctx context.Context, in *FlushPrinterRequest, opts ...dcerpc.CallOption) (*FlushPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &FlushPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SendRecvBIDIData(ctx context.Context, in *SendRecvBIDIDataRequest, opts ...dcerpc.CallOption) (*SendRecvBIDIDataResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SendRecvBIDIDataResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetCorePrinterDrivers(ctx context.Context, in *GetCorePrinterDriversRequest, opts ...dcerpc.CallOption) (*GetCorePrinterDriversResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetCorePrinterDriversResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterDriverPackagePath(ctx context.Context, in *GetPrinterDriverPackagePathRequest, opts ...dcerpc.CallOption) (*GetPrinterDriverPackagePathResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterDriverPackagePathResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetJobNamedPropertyValue(ctx context.Context, in *GetJobNamedPropertyValueRequest, opts ...dcerpc.CallOption) (*GetJobNamedPropertyValueResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetJobNamedPropertyValueResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetJobNamedProperty(ctx context.Context, in *SetJobNamedPropertyRequest, opts ...dcerpc.CallOption) (*SetJobNamedPropertyResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetJobNamedPropertyResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) DeleteJobNamedProperty(ctx context.Context, in *DeleteJobNamedPropertyRequest, opts ...dcerpc.CallOption) (*DeleteJobNamedPropertyResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &DeleteJobNamedPropertyResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) EnumJobNamedProperties(ctx context.Context, in *EnumJobNamedPropertiesRequest, opts ...dcerpc.CallOption) (*EnumJobNamedPropertiesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &EnumJobNamedPropertiesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) LogJobInfoForBranchOffice(ctx context.Context, in *LogJobInfoForBranchOfficeRequest, opts ...dcerpc.CallOption) (*LogJobInfoForBranchOfficeResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &LogJobInfoForBranchOfficeResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) RegeneratePrintDeviceCapabilities(ctx context.Context, in *RegeneratePrintDeviceCapabilitiesRequest, opts ...dcerpc.CallOption) (*RegeneratePrintDeviceCapabilitiesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &RegeneratePrintDeviceCapabilitiesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != uint32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) CreateJobOnPrinter(ctx context.Context, in *CreateJobOnPrinterRequest, opts ...dcerpc.CallOption) (*CreateJobOnPrinterResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &CreateJobOnPrinterResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetJobAttributes(ctx context.Context, in *GetJobAttributesRequest, opts ...dcerpc.CallOption) (*GetJobAttributesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetJobAttributesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetJobAttributes(ctx context.Context, in *SetJobAttributesRequest, opts ...dcerpc.CallOption) (*SetJobAttributesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetJobAttributesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) GetPrinterAttributes(ctx context.Context, in *GetPrinterAttributesRequest, opts ...dcerpc.CallOption) (*GetPrinterAttributesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &GetPrinterAttributesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) SetPrinterAttributes(ctx context.Context, in *SetPrinterAttributesRequest, opts ...dcerpc.CallOption) (*SetPrinterAttributesResponse, error) {
	op := in.xxx_ToOp(ctx, nil)
	if err := o.cc.Invoke(ctx, op, opts...); err != nil {
		return nil, err
	}
	out := &SetPrinterAttributesResponse{}
	out.xxx_FromOp(ctx, op)
	if op.Return != int32(0) {
		return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
	}
	return out, nil
}

func (o *xxx_DefaultWinspoolClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
	return o.cc.AlterContext(ctx, opts...)
}

func (o *xxx_DefaultWinspoolClient) Conn() dcerpc.Conn {
	return o.cc
}

func NewWinspoolClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (WinspoolClient, error) {
	cc, err := cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(WinspoolSyntaxV1_0))...)
	if err != nil {
		return nil, err
	}
	return &xxx_DefaultWinspoolClient{cc: cc}, nil
}

// xxx_EnumPrintersOperation structure represents the RpcEnumPrinters operation
type xxx_EnumPrintersOperation struct {
	Flags         uint32 `idl:"name:Flags" json:"flags"`
	Name          string `idl:"name:Name;string;pointer:unique" json:"name"`
	Level         uint32 `idl:"name:Level" json:"level"`
	PrinterEnum   []byte `idl:"name:pPrinterEnum;size_is:(cbBuf);pointer:unique" json:"printer_enum"`
	BufferLength  uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrintersOperation) OpNum() int { return 0 }

func (o *xxx_EnumPrintersOperation) OpName() string { return "/winspool/v1/RpcEnumPrinters" }

func (o *xxx_EnumPrintersOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.PrinterEnum != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.PrinterEnum))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintersOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// Flags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Flags); err != nil {
			return err
		}
	}
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_Name := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_Name); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrinterEnum != nil || o.BufferLength > 0 {
			_ptr_pPrinterEnum := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrinterEnum {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrinterEnum[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrinterEnum); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterEnum, _ptr_pPrinterEnum); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintersOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// Flags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Flags); err != nil {
			return err
		}
	}
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_Name := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_Name := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_Name, _ptr_Name); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrinterEnum := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrinterEnum", sizeInfo[0])
			}
			o.PrinterEnum = make([]byte, sizeInfo[0])
			for i1 := range o.PrinterEnum {
				i1 := i1
				if err := w.ReadData(&o.PrinterEnum[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrinterEnum := func(ptr interface{}) { o.PrinterEnum = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrinterEnum, _s_pPrinterEnum, _ptr_pPrinterEnum); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintersOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintersOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrinterEnum != nil || o.BufferLength > 0 {
			_ptr_pPrinterEnum := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrinterEnum {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrinterEnum[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrinterEnum); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterEnum, _ptr_pPrinterEnum); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintersOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrinterEnum := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrinterEnum", sizeInfo[0])
			}
			o.PrinterEnum = make([]byte, sizeInfo[0])
			for i1 := range o.PrinterEnum {
				i1 := i1
				if err := w.ReadData(&o.PrinterEnum[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrinterEnum := func(ptr interface{}) { o.PrinterEnum = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrinterEnum, _s_pPrinterEnum, _ptr_pPrinterEnum); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrintersRequest structure represents the RpcEnumPrinters operation request
type EnumPrintersRequest struct {
	// Flags: The types of print objects that this method enumerates. The value of this
	// parameter is the result of a bitwise OR of one or more of the Printer Enumeration
	// Flags (section 2.2.3.7), with the following additional specifications:
	//
	// * *PRINTER_ENUM_NAME:* If the Name parameter is NULL or points to an empty string,
	// and the Level parameter value is 0x00000001, available print providers SHOULD be
	// enumerated. If this flag is not set, the server SHOULD ignore the Name parameter.
	//
	// * *PRINTER_ENUM_REMOTE:* The Level parameter value MUST be 0x00000001.
	//
	// * *PRINTER_ENUM_NETWORK:* The Level parameter value MUST be 0x00000001.
	Flags uint32 `idl:"name:Flags" json:"flags"`
	// Name: NULL or a server name parameter as specified in Printer Server Name Parameters
	// (section 3.1.4.1.4). If the Flags parameter contains the PRINTER_ENUM_NAME flag,
	// the Name parameter value controls where the server SHOULD enumerate. The server SHOULD
	// enumerate locally if the Name parameter is either NULL or an empty string; otherwise,
	// remotely on the server whose name is specified by the Name string.
	Name string `idl:"name:Name;string;pointer:unique" json:"name"`
	// Level: The level of printer information structure, as follows.
	//
	//	+------------+------------------------------------------+
	//	|            |                                          |
	//	|   VALUE    |               DESCRIPTION                |
	//	|            |                                          |
	//	+------------+------------------------------------------+
	//	+------------+------------------------------------------+
	//	| 0x00000000 | _PRINTER_INFO_STRESS (section 2.2.2.9.1) |
	//	+------------+------------------------------------------+
	//	| 0x00000001 | _PRINTER_INFO_1 (section 2.2.2.9.2)      |
	//	+------------+------------------------------------------+
	//	| 0x00000002 | _PRINTER_INFO_2 (section 2.2.2.9.3)      |
	//	+------------+------------------------------------------+
	//	| 0x00000004 | _PRINTER_INFO_4 (section 2.2.2.9.5)      |
	//	+------------+------------------------------------------+
	//	| 0x00000005 | _PRINTER_INFO_5 (section 2.2.2.9.6)      |
	//	+------------+------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pPrinterEnum: A pointer to a BUFFER defined in INFO Structures Query Parameters (section
	// 3.1.4.1.9).
	PrinterEnum []byte `idl:"name:pPrinterEnum;size_is:(cbBuf);pointer:unique" json:"printer_enum"`
	// cbBuf: An input parameter that adheres to the specification in INFO Structures Query
	// Parameters.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumPrintersRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrintersOperation) *xxx_EnumPrintersOperation {
	if op == nil {
		op = &xxx_EnumPrintersOperation{}
	}
	if o == nil {
		return op
	}
	op.Flags = o.Flags
	op.Name = o.Name
	op.Level = o.Level
	op.PrinterEnum = o.PrinterEnum
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumPrintersRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrintersOperation) {
	if o == nil {
		return
	}
	o.Flags = op.Flags
	o.Name = op.Name
	o.Level = op.Level
	o.PrinterEnum = op.PrinterEnum
	o.BufferLength = op.BufferLength
}
func (o *EnumPrintersRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrintersRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrintersOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrintersResponse structure represents the RpcEnumPrinters operation response
type EnumPrintersResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pPrinterEnum: A pointer to a BUFFER defined in INFO Structures Query Parameters (section
	// 3.1.4.1.9).
	PrinterEnum []byte `idl:"name:pPrinterEnum;size_is:(cbBuf);pointer:unique" json:"printer_enum"`
	// pcbNeeded: An output parameter that adheres to the specification in INFO Structures
	// Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: An output parameter that adheres to the specification in INFO Structures
	// Query Parameters.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumPrinters return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrintersResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrintersOperation) *xxx_EnumPrintersOperation {
	if op == nil {
		op = &xxx_EnumPrintersOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.PrinterEnum = o.PrinterEnum
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumPrintersResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrintersOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.PrinterEnum = op.PrinterEnum
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumPrintersResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrintersResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrintersOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_OpenPrinterOperation structure represents the RpcOpenPrinter operation
type xxx_OpenPrinterOperation struct {
	PrinterName      string            `idl:"name:pPrinterName;string;pointer:unique" json:"printer_name"`
	Handle           *Printer          `idl:"name:pHandle" json:"handle"`
	DataType         string            `idl:"name:pDatatype;string;pointer:unique" json:"data_type"`
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	AccessRequired   uint32            `idl:"name:AccessRequired" json:"access_required"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_OpenPrinterOperation) OpNum() int { return 1 }

func (o *xxx_OpenPrinterOperation) OpName() string { return "/winspool/v1/RpcOpenPrinter" }

func (o *xxx_OpenPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pPrinterName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.PrinterName != "" {
			_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDatatype {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.DataType != "" {
			_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// AccessRequired {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.AccessRequired); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pPrinterName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
		if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDatatype {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
				return err
			}
			return nil
		})
		_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
		if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// AccessRequired {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.AccessRequired); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle != nil {
			if err := o.Handle.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle == nil {
			o.Handle = &Printer{}
		}
		if err := o.Handle.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// OpenPrinterRequest structure represents the RpcOpenPrinter operation request
type OpenPrinterRequest struct {
	// pPrinterName: A STRING_HANDLE (section 2.2.1.1.7) for a printer connection, printer
	// object, server object, job object, port object, or port monitor object. For opening
	// a server object, this parameter MUST adhere to the specification in Print Server
	// Name Parameters (section 3.1.4.1.4); for opening all other objects, it MUST adhere
	// to the specification in Printer Name Parameters (section 3.1.4.1.5).
	PrinterName string `idl:"name:pPrinterName;string;pointer:unique" json:"printer_name"`
	// pDatatype: A pointer to a string that specifies the data type to be associated with
	// the printer handle. This parameter MUST adhere to the specification in Datatype Name
	// Parameters (section 3.1.4.1.1).
	DataType string `idl:"name:pDatatype;string;pointer:unique" json:"data_type"`
	// pDevModeContainer: A pointer to a DEVMODE_CONTAINER structure. This parameter MUST
	// adhere to the specification in DEVMODE_CONTAINER Parameters (section 3.1.4.1.8.1).
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	// AccessRequired: The access level that the client requires for interacting with the
	// object to which a handle is being opened. The value of this parameter is one of those
	// specified in Access Values (section 2.2.3.1) or 0. For rules governing access values,
	// see section 2.2.4.1.
	AccessRequired uint32 `idl:"name:AccessRequired" json:"access_required"`
}

func (o *OpenPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_OpenPrinterOperation) *xxx_OpenPrinterOperation {
	if op == nil {
		op = &xxx_OpenPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.PrinterName = o.PrinterName
	op.DataType = o.DataType
	op.DevModeContainer = o.DevModeContainer
	op.AccessRequired = o.AccessRequired
	return op
}

func (o *OpenPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_OpenPrinterOperation) {
	if o == nil {
		return
	}
	o.PrinterName = op.PrinterName
	o.DataType = op.DataType
	o.DevModeContainer = op.DevModeContainer
	o.AccessRequired = op.AccessRequired
}
func (o *OpenPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *OpenPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_OpenPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// OpenPrinterResponse structure represents the RpcOpenPrinter operation response
type OpenPrinterResponse struct {
	// pHandle: A pointer to a PRINTER_HANDLE (section 2.2.1.1.4) that MUST receive the
	// RPC context handle [C706] to the object identified by the pPrinterName parameter.
	Handle *Printer `idl:"name:pHandle" json:"handle"`
	// Return: The RpcOpenPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *OpenPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_OpenPrinterOperation) *xxx_OpenPrinterOperation {
	if op == nil {
		op = &xxx_OpenPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Handle = o.Handle
	op.Return = o.Return
	return op
}

func (o *OpenPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_OpenPrinterOperation) {
	if o == nil {
		return
	}
	o.Handle = op.Handle
	o.Return = op.Return
}
func (o *OpenPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *OpenPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_OpenPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetJobOperation structure represents the RpcSetJob operation
type xxx_SetJobOperation struct {
	Printer      *Printer      `idl:"name:hPrinter" json:"printer"`
	JobID        uint32        `idl:"name:JobId" json:"job_id"`
	JobContainer *JobContainer `idl:"name:pJobContainer;pointer:unique" json:"job_container"`
	Command      uint32        `idl:"name:Command" json:"command"`
	Return       uint32        `idl:"name:Return" json:"return"`
}

func (o *xxx_SetJobOperation) OpNum() int { return 2 }

func (o *xxx_SetJobOperation) OpName() string { return "/winspool/v1/RpcSetJob" }

func (o *xxx_SetJobOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// pJobContainer {in} (1:{pointer=unique}*(1))(2:{alias=JOB_CONTAINER}(struct))
	{
		if o.JobContainer != nil {
			_ptr_pJobContainer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if o.JobContainer != nil {
					if err := o.JobContainer.MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&JobContainer{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.JobContainer, _ptr_pJobContainer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Command {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Command); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// pJobContainer {in} (1:{pointer=unique}*(1))(2:{alias=JOB_CONTAINER}(struct))
	{
		_ptr_pJobContainer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if o.JobContainer == nil {
				o.JobContainer = &JobContainer{}
			}
			if err := o.JobContainer.UnmarshalNDR(ctx, w); err != nil {
				return err
			}
			return nil
		})
		_s_pJobContainer := func(ptr interface{}) { o.JobContainer = *ptr.(**JobContainer) }
		if err := w.ReadPointer(&o.JobContainer, _s_pJobContainer, _ptr_pJobContainer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Command {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Command); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetJobRequest structure represents the RpcSetJob operation request
type SetJobRequest struct {
	// hPrinter: A PRINTER_HANDLE (section 2.2.1.1.4) to a printer object, job object, or
	// server object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of the print job. This value MUST NOT be zero.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// pJobContainer: An optional pointer to a JOB_CONTAINER (section 2.2.1.2.5) that specifies
	// the parameters to set on the job object.
	JobContainer *JobContainer `idl:"name:pJobContainer;pointer:unique" json:"job_container"`
	// Command: A Job Control Value (section 2.2.4.6) that specifies an action. This value
	// MUST be one of the following job control actions:
	//
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	|                                          |                                                                                  |
	//	|                NAME/VALUE                |                                   DESCRIPTION                                    |
	//	|                                          |                                                                                  |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| 0x00000000                               | Perform no additional action.                                                    |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_PAUSE 0x00000001             | Pause the print job.                                                             |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_RESUME 0x00000002            | Resume a paused print job.                                                       |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_CANCEL 0x00000003            | Delete a print job.<321>                                                         |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_RESTART 0x00000004           | Restart a print job.                                                             |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_DELETE 0x00000005            | Delete a print job.<322>                                                         |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_SENT_TO_PRINTER 0x00000006   | Used by port monitors to signal that a print job has been sent to the printer.   |
	//	|                                          | This value SHOULD NOT be used remotely.                                          |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_LAST_PAGE_EJECTED 0x00000007 | Used by language monitors to signal that the last page of a print job has been   |
	//	|                                          | ejected from the printer. This value SHOULD NOT be used remotely.                |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_RETAIN 0x00000008            | Keep the print job in the print queue after it prints.                           |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	//	| JOB_CONTROL_RELEASE 0x00000009           | Release the print job, undoing the effect of a JOB_CONTROL_RETAIN action.        |
	//	+------------------------------------------+----------------------------------------------------------------------------------+
	Command uint32 `idl:"name:Command" json:"command"`
}

func (o *SetJobRequest) xxx_ToOp(ctx context.Context, op *xxx_SetJobOperation) *xxx_SetJobOperation {
	if op == nil {
		op = &xxx_SetJobOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.JobContainer = o.JobContainer
	op.Command = o.Command
	return op
}

func (o *SetJobRequest) xxx_FromOp(ctx context.Context, op *xxx_SetJobOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.JobContainer = op.JobContainer
	o.Command = op.Command
}
func (o *SetJobRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetJobRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetJobOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetJobResponse structure represents the RpcSetJob operation response
type SetJobResponse struct {
	// Return: The RpcSetJob return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetJobResponse) xxx_ToOp(ctx context.Context, op *xxx_SetJobOperation) *xxx_SetJobOperation {
	if op == nil {
		op = &xxx_SetJobOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetJobResponse) xxx_FromOp(ctx context.Context, op *xxx_SetJobOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetJobResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetJobResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetJobOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetJobOperation structure represents the RpcGetJob operation
type xxx_GetJobOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	JobID        uint32   `idl:"name:JobId" json:"job_id"`
	Level        uint32   `idl:"name:Level" json:"level"`
	Job          []byte   `idl:"name:pJob;size_is:(cbBuf);pointer:unique" json:"job"`
	BufferLength uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetJobOperation) OpNum() int { return 3 }

func (o *xxx_GetJobOperation) OpName() string { return "/winspool/v1/RpcGetJob" }

func (o *xxx_GetJobOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Job != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Job))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Job != nil || o.BufferLength > 0 {
			_ptr_pJob := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Job {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Job[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Job); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Job, _ptr_pJob); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pJob := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Job", sizeInfo[0])
			}
			o.Job = make([]byte, sizeInfo[0])
			for i1 := range o.Job {
				i1 := i1
				if err := w.ReadData(&o.Job[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pJob := func(ptr interface{}) { o.Job = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Job, _s_pJob, _ptr_pJob); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Job != nil || o.BufferLength > 0 {
			_ptr_pJob := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Job {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Job[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Job); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Job, _ptr_pJob); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pJob := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Job", sizeInfo[0])
			}
			o.Job = make([]byte, sizeInfo[0])
			for i1 := range o.Job {
				i1 := i1
				if err := w.ReadData(&o.Job[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pJob := func(ptr interface{}) { o.Job = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Job, _s_pJob, _ptr_pJob); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetJobRequest structure represents the RpcGetJob operation request
type GetJobRequest struct {
	// hPrinter: A handle to a printer object, job object, or server object that was opened
	// by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter
	// (section 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of the print job. This value MUST NOT be zero.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// Level: The job information level. This value MUST be 0x00000001, 0x00000002, 0x00000003,
	// or 0x00000004.
	Level uint32 `idl:"name:Level" json:"level"`
	// pJob: A pointer to BUFFER as specified in INFO Structures Query Parameters (section
	// 3.1.4.1.9).
	Job []byte `idl:"name:pJob;size_is:(cbBuf);pointer:unique" json:"job"`
	// cbBuf: A parameter specified in section 3.1.4.1.9.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *GetJobRequest) xxx_ToOp(ctx context.Context, op *xxx_GetJobOperation) *xxx_GetJobOperation {
	if op == nil {
		op = &xxx_GetJobOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.Level = o.Level
	op.Job = o.Job
	op.BufferLength = o.BufferLength
	return op
}

func (o *GetJobRequest) xxx_FromOp(ctx context.Context, op *xxx_GetJobOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.Level = op.Level
	o.Job = op.Job
	o.BufferLength = op.BufferLength
}
func (o *GetJobRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetJobRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetJobOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetJobResponse structure represents the RpcGetJob operation response
type GetJobResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pJob: A pointer to BUFFER as specified in INFO Structures Query Parameters (section
	// 3.1.4.1.9).
	Job []byte `idl:"name:pJob;size_is:(cbBuf);pointer:unique" json:"job"`
	// pcbNeeded: A parameter specified in section 3.1.4.1.9.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetJob return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetJobResponse) xxx_ToOp(ctx context.Context, op *xxx_GetJobOperation) *xxx_GetJobOperation {
	if op == nil {
		op = &xxx_GetJobOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Job = o.Job
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetJobResponse) xxx_FromOp(ctx context.Context, op *xxx_GetJobOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Job = op.Job
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetJobResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetJobResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetJobOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumJobsOperation structure represents the RpcEnumJobs operation
type xxx_EnumJobsOperation struct {
	Printer       *Printer `idl:"name:hPrinter" json:"printer"`
	FirstJob      uint32   `idl:"name:FirstJob" json:"first_job"`
	NoJobs        uint32   `idl:"name:NoJobs" json:"no_jobs"`
	Level         uint32   `idl:"name:Level" json:"level"`
	Job           []byte   `idl:"name:pJob;size_is:(cbBuf);pointer:unique" json:"job"`
	BufferLength  uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32   `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumJobsOperation) OpNum() int { return 4 }

func (o *xxx_EnumJobsOperation) OpName() string { return "/winspool/v1/RpcEnumJobs" }

func (o *xxx_EnumJobsOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Job != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Job))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// FirstJob {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.FirstJob); err != nil {
			return err
		}
	}
	// NoJobs {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NoJobs); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Job != nil || o.BufferLength > 0 {
			_ptr_pJob := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Job {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Job[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Job); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Job, _ptr_pJob); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// FirstJob {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.FirstJob); err != nil {
			return err
		}
	}
	// NoJobs {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NoJobs); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pJob := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Job", sizeInfo[0])
			}
			o.Job = make([]byte, sizeInfo[0])
			for i1 := range o.Job {
				i1 := i1
				if err := w.ReadData(&o.Job[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pJob := func(ptr interface{}) { o.Job = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Job, _s_pJob, _ptr_pJob); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobsOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Job != nil || o.BufferLength > 0 {
			_ptr_pJob := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Job {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Job[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Job); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Job, _ptr_pJob); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pJob := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Job", sizeInfo[0])
			}
			o.Job = make([]byte, sizeInfo[0])
			for i1 := range o.Job {
				i1 := i1
				if err := w.ReadData(&o.Job[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pJob := func(ptr interface{}) { o.Job = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Job, _s_pJob, _ptr_pJob); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumJobsRequest structure represents the RpcEnumJobs operation request
type EnumJobsRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// FirstJob: The zero-based position within the print queue of the first print job to
	// enumerate.
	FirstJob uint32 `idl:"name:FirstJob" json:"first_job"`
	// NoJobs: The total number of print jobs to enumerate.
	NoJobs uint32 `idl:"name:NoJobs" json:"no_jobs"`
	// Level: The job information level.
	Level uint32 `idl:"name:Level" json:"level"`
	// pJob: A pointer to the BUFFER structure specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Job []byte `idl:"name:pJob;size_is:(cbBuf);pointer:unique" json:"job"`
	// cbBuf: Specified in INFO Structures Query Parameters (section 3.1.4.1.9).
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumJobsRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumJobsOperation) *xxx_EnumJobsOperation {
	if op == nil {
		op = &xxx_EnumJobsOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.FirstJob = o.FirstJob
	op.NoJobs = o.NoJobs
	op.Level = o.Level
	op.Job = o.Job
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumJobsRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumJobsOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.FirstJob = op.FirstJob
	o.NoJobs = op.NoJobs
	o.Level = op.Level
	o.Job = op.Job
	o.BufferLength = op.BufferLength
}
func (o *EnumJobsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumJobsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumJobsOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumJobsResponse structure represents the RpcEnumJobs operation response
type EnumJobsResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pJob: A pointer to the BUFFER structure specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Job []byte `idl:"name:pJob;size_is:(cbBuf);pointer:unique" json:"job"`
	// pcbNeeded: Specified in INFO Structures Query Parameters (section 3.1.4.1.9).
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: Specified in INFO Structures Query Parameters (section 3.1.4.1.9).
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumJobs return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumJobsResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumJobsOperation) *xxx_EnumJobsOperation {
	if op == nil {
		op = &xxx_EnumJobsOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Job = o.Job
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumJobsResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumJobsOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Job = op.Job
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumJobsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumJobsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumJobsOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPrinterOperation structure represents the RpcAddPrinter operation
type xxx_AddPrinterOperation struct {
	Name              string             `idl:"name:pName;string;pointer:unique" json:"name"`
	PrinterContainer  *PrinterContainer  `idl:"name:pPrinterContainer" json:"printer_container"`
	DevModeContainer  *DevModeContainer  `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	SecurityContainer *SecurityContainer `idl:"name:pSecurityContainer" json:"security_container"`
	Handle            *Printer           `idl:"name:pHandle" json:"handle"`
	Return            uint32             `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPrinterOperation) OpNum() int { return 5 }

func (o *xxx_AddPrinterOperation) OpName() string { return "/winspool/v1/RpcAddPrinter" }

func (o *xxx_AddPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrinterContainer {in} (1:{pointer=ref}*(1))(2:{alias=PRINTER_CONTAINER}(struct))
	{
		if o.PrinterContainer != nil {
			if err := o.PrinterContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pSecurityContainer {in} (1:{pointer=ref}*(1))(2:{alias=SECURITY_CONTAINER}(struct))
	{
		if o.SecurityContainer != nil {
			if err := o.SecurityContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&SecurityContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrinterContainer {in} (1:{pointer=ref}*(1))(2:{alias=PRINTER_CONTAINER}(struct))
	{
		if o.PrinterContainer == nil {
			o.PrinterContainer = &PrinterContainer{}
		}
		if err := o.PrinterContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pSecurityContainer {in} (1:{pointer=ref}*(1))(2:{alias=SECURITY_CONTAINER}(struct))
	{
		if o.SecurityContainer == nil {
			o.SecurityContainer = &SecurityContainer{}
		}
		if err := o.SecurityContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle != nil {
			if err := o.Handle.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle == nil {
			o.Handle = &Printer{}
		}
		if err := o.Handle.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPrinterRequest structure represents the RpcAddPrinter operation request
type AddPrinterRequest struct {
	// pName: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pPrinterContainer: A parameter specified in PRINTER_CONTAINER Parameters (section
	// 3.1.4.1.8.6). The Level member of the PRINTER_CONTAINER MUST be 0x00000001 or 0x00000002.
	PrinterContainer *PrinterContainer `idl:"name:pPrinterContainer" json:"printer_container"`
	// pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters (section
	// 3.1.4.1.8.1).
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	// pSecurityContainer: A parameter specified in SECURITY_CONTAINER Parameters (section
	// 3.1.4.1.8.7).
	SecurityContainer *SecurityContainer `idl:"name:pSecurityContainer" json:"security_container"`
}

func (o *AddPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterOperation) *xxx_AddPrinterOperation {
	if op == nil {
		op = &xxx_AddPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.PrinterContainer = o.PrinterContainer
	op.DevModeContainer = o.DevModeContainer
	op.SecurityContainer = o.SecurityContainer
	return op
}

func (o *AddPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.PrinterContainer = op.PrinterContainer
	o.DevModeContainer = op.DevModeContainer
	o.SecurityContainer = op.SecurityContainer
}
func (o *AddPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPrinterResponse structure represents the RpcAddPrinter operation response
type AddPrinterResponse struct {
	// pHandle: A pointer to a variable that receives the printer RPC context handle to
	// the printer object added. RPC context handles are specified in [C706].
	Handle *Printer `idl:"name:pHandle" json:"handle"`
	// Return: The RpcAddPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterOperation) *xxx_AddPrinterOperation {
	if op == nil {
		op = &xxx_AddPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Handle = o.Handle
	op.Return = o.Return
	return op
}

func (o *AddPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterOperation) {
	if o == nil {
		return
	}
	o.Handle = op.Handle
	o.Return = op.Return
}
func (o *AddPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterOperation structure represents the RpcDeletePrinter operation
type xxx_DeletePrinterOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterOperation) OpNum() int { return 6 }

func (o *xxx_DeletePrinterOperation) OpName() string { return "/winspool/v1/RpcDeletePrinter" }

func (o *xxx_DeletePrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_DeletePrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterRequest structure represents the RpcDeletePrinter operation request
type DeletePrinterRequest struct {
	// hPrinter: A handle to a printer object that MUST have been opened by using the RpcAddPrinter,
	// RpcAddPrinterEx, RpcOpenPrinter, or RpcOpenPrinterEx methods.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *DeletePrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterOperation) *xxx_DeletePrinterOperation {
	if op == nil {
		op = &xxx_DeletePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *DeletePrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *DeletePrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterResponse structure represents the RpcDeletePrinter operation response
type DeletePrinterResponse struct {
	// Return: The RpcDeletePrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterOperation) *xxx_DeletePrinterOperation {
	if op == nil {
		op = &xxx_DeletePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetPrinterOperation structure represents the RpcSetPrinter operation
type xxx_SetPrinterOperation struct {
	Printer           *Printer           `idl:"name:hPrinter" json:"printer"`
	PrinterContainer  *PrinterContainer  `idl:"name:pPrinterContainer" json:"printer_container"`
	DevModeContainer  *DevModeContainer  `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	SecurityContainer *SecurityContainer `idl:"name:pSecurityContainer" json:"security_container"`
	Command           uint32             `idl:"name:Command" json:"command"`
	Return            uint32             `idl:"name:Return" json:"return"`
}

func (o *xxx_SetPrinterOperation) OpNum() int { return 7 }

func (o *xxx_SetPrinterOperation) OpName() string { return "/winspool/v1/RpcSetPrinter" }

func (o *xxx_SetPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pPrinterContainer {in} (1:{pointer=ref}*(1))(2:{alias=PRINTER_CONTAINER}(struct))
	{
		if o.PrinterContainer != nil {
			if err := o.PrinterContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pSecurityContainer {in} (1:{pointer=ref}*(1))(2:{alias=SECURITY_CONTAINER}(struct))
	{
		if o.SecurityContainer != nil {
			if err := o.SecurityContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&SecurityContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Command {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Command); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pPrinterContainer {in} (1:{pointer=ref}*(1))(2:{alias=PRINTER_CONTAINER}(struct))
	{
		if o.PrinterContainer == nil {
			o.PrinterContainer = &PrinterContainer{}
		}
		if err := o.PrinterContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pSecurityContainer {in} (1:{pointer=ref}*(1))(2:{alias=SECURITY_CONTAINER}(struct))
	{
		if o.SecurityContainer == nil {
			o.SecurityContainer = &SecurityContainer{}
		}
		if err := o.SecurityContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Command {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Command); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetPrinterRequest structure represents the RpcSetPrinter operation request
type SetPrinterRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pPrinterContainer: A parameter specified in PRINTER_CONTAINER Parameters (section
	// 3.1.4.1.8.6). If the Command is 0, the Level member of the PRINTER_CONTAINER MUST
	// be 0x00000000 or a number from 0x00000002 to 0x00000007. If the Command parameter
	// is 1, 2, or 3, the Level member of the PRINTER_CONTAINER MUST be 0x00000000.
	PrinterContainer *PrinterContainer `idl:"name:pPrinterContainer" json:"printer_container"`
	// pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters (section
	// 3.1.4.1.8.1).
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	// pSecurityContainer: A parameter specified in SECURITY_CONTAINER Parameters (section
	// 3.1.4.1.8.7).
	SecurityContainer *SecurityContainer `idl:"name:pSecurityContainer" json:"security_container"`
	// Command: A value that specifies an action to perform. If this value is non-zero,
	// it is one of the printer control values in the following table, and the Level member
	// of the PRINTER_CONTAINER (section 2.2.1.2.9) structure that is pointed to by the
	// pPrinterContainer parameter MUST be 0x00000000.
	//
	//	+-----------------------------------+-------------------------------------------------------+
	//	|                                   |                                                       |
	//	|            NAME/VALUE             |                      DESCRIPTION                      |
	//	|                                   |                                                       |
	//	+-----------------------------------+-------------------------------------------------------+
	//	+-----------------------------------+-------------------------------------------------------+
	//	| PRINTER_CONTROL_PAUSE 0x00000001  | Pauses the printer object.                            |
	//	+-----------------------------------+-------------------------------------------------------+
	//	| PRINTER_CONTROL_RESUME 0x00000002 | Resumes a paused printer object.                      |
	//	+-----------------------------------+-------------------------------------------------------+
	//	| PRINTER_CONTROL_PURGE 0x00000003  | Deletes all print jobs queued for the printer object. |
	//	+-----------------------------------+-------------------------------------------------------+
	Command uint32 `idl:"name:Command" json:"command"`
}

func (o *SetPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterOperation) *xxx_SetPrinterOperation {
	if op == nil {
		op = &xxx_SetPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.PrinterContainer = o.PrinterContainer
	op.DevModeContainer = o.DevModeContainer
	op.SecurityContainer = o.SecurityContainer
	op.Command = o.Command
	return op
}

func (o *SetPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.PrinterContainer = op.PrinterContainer
	o.DevModeContainer = op.DevModeContainer
	o.SecurityContainer = op.SecurityContainer
	o.Command = op.Command
}
func (o *SetPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetPrinterResponse structure represents the RpcSetPrinter operation response
type SetPrinterResponse struct {
	// Return: The RpcSetPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterOperation) *xxx_SetPrinterOperation {
	if op == nil {
		op = &xxx_SetPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterOperation structure represents the RpcGetPrinter operation
type xxx_GetPrinterOperation struct {
	Printer       *Printer `idl:"name:hPrinter" json:"printer"`
	Level         uint32   `idl:"name:Level" json:"level"`
	PrinterBuffer []byte   `idl:"name:pPrinter;size_is:(cbBuf);pointer:unique" json:"printer_buffer"`
	BufferLength  uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return        uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterOperation) OpNum() int { return 8 }

func (o *xxx_GetPrinterOperation) OpName() string { return "/winspool/v1/RpcGetPrinter" }

func (o *xxx_GetPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.PrinterBuffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.PrinterBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pPrinter {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrinterBuffer != nil || o.BufferLength > 0 {
			_ptr_pPrinter := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrinterBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrinterBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrinterBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterBuffer, _ptr_pPrinter); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pPrinter {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrinter := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrinterBuffer", sizeInfo[0])
			}
			o.PrinterBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.PrinterBuffer {
				i1 := i1
				if err := w.ReadData(&o.PrinterBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrinter := func(ptr interface{}) { o.PrinterBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrinterBuffer, _s_pPrinter, _ptr_pPrinter); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pPrinter {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrinterBuffer != nil || o.BufferLength > 0 {
			_ptr_pPrinter := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrinterBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrinterBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrinterBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterBuffer, _ptr_pPrinter); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pPrinter {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrinter := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrinterBuffer", sizeInfo[0])
			}
			o.PrinterBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.PrinterBuffer {
				i1 := i1
				if err := w.ReadData(&o.PrinterBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrinter := func(ptr interface{}) { o.PrinterBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrinterBuffer, _s_pPrinter, _ptr_pPrinter); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterRequest structure represents the RpcGetPrinter operation request
type GetPrinterRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14). This value MAY be a handle to a print server
	// object.<277>
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// Level: The level of printer information structure, as follows.
	//
	//	+------------+-------------------------------------------------------------------------------+
	//	|            |                                                                               |
	//	|   VALUE    |                                  DESCRIPTION                                  |
	//	|            |                                                                               |
	//	+------------+-------------------------------------------------------------------------------+
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000000 | Corresponds to _PRINTER_INFO_STRESS (section 2.2.2.9.1).                      |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000001 | Corresponds to _PRINTER_INFO_1 (section 2.2.2.9.2).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000002 | Corresponds to _PRINTER_INFO_2 (section 2.2.2.9.3).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000003 | Corresponds to _PRINTER_INFO_3 (section 2.2.2.9.4).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000004 | Corresponds to _PRINTER_INFO_4 (section 2.2.2.9.5).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000005 | Corresponds to _PRINTER_INFO_5 (section 2.2.2.9.6).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000006 | Corresponds to _PRINTER_INFO_6 (section 2.2.2.9.7).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000007 | Corresponds to _PRINTER_INFO_7 (section 2.2.2.9.8).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000008 | Corresponds to _PRINTER_INFO_8 (section 2.2.2.9.9).                           |
	//	+------------+-------------------------------------------------------------------------------+
	//	| 0x00000009 | Not valid remotely; the server MUST respond by returning ERROR_NOT_SUPPORTED. |
	//	+------------+-------------------------------------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pPrinter: A pointer to a BUFFER (INFO Structures Query Parameters (section 3.1.4.1.9)).
	PrinterBuffer []byte `idl:"name:pPrinter;size_is:(cbBuf);pointer:unique" json:"printer_buffer"`
	// cbBuf: A parameter specified in INFO Structures Query Parameters.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *GetPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterOperation) *xxx_GetPrinterOperation {
	if op == nil {
		op = &xxx_GetPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Level = o.Level
	op.PrinterBuffer = o.PrinterBuffer
	op.BufferLength = o.BufferLength
	return op
}

func (o *GetPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Level = op.Level
	o.PrinterBuffer = op.PrinterBuffer
	o.BufferLength = op.BufferLength
}
func (o *GetPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterResponse structure represents the RpcGetPrinter operation response
type GetPrinterResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pPrinter: A pointer to a BUFFER (INFO Structures Query Parameters (section 3.1.4.1.9)).
	PrinterBuffer []byte `idl:"name:pPrinter;size_is:(cbBuf);pointer:unique" json:"printer_buffer"`
	// pcbNeeded: A parameter specified in INFO Structures Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterOperation) *xxx_GetPrinterOperation {
	if op == nil {
		op = &xxx_GetPrinterOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.PrinterBuffer = o.PrinterBuffer
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.PrinterBuffer = op.PrinterBuffer
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPrinterDriverOperation structure represents the RpcAddPrinterDriver operation
type xxx_AddPrinterDriverOperation struct {
	Name            string           `idl:"name:pName;string;pointer:unique" json:"name"`
	DriverContainer *DriverContainer `idl:"name:pDriverContainer" json:"driver_container"`
	Return          uint32           `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPrinterDriverOperation) OpNum() int { return 9 }

func (o *xxx_AddPrinterDriverOperation) OpName() string { return "/winspool/v1/RpcAddPrinterDriver" }

func (o *xxx_AddPrinterDriverOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDriverContainer {in} (1:{pointer=ref}*(1))(2:{alias=DRIVER_CONTAINER}(struct))
	{
		if o.DriverContainer != nil {
			if err := o.DriverContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDriverContainer {in} (1:{pointer=ref}*(1))(2:{alias=DRIVER_CONTAINER}(struct))
	{
		if o.DriverContainer == nil {
			o.DriverContainer = &DriverContainer{}
		}
		if err := o.DriverContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPrinterDriverRequest structure represents the RpcAddPrinterDriver operation request
type AddPrinterDriverRequest struct {
	// pName: Specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pDriverContainer: Specified in DRIVER_CONTAINER Parameters (section 3.1.4.1.8.3).
	// The Level member of the DRIVER_CONTAINER MUST be 0x00000002, 0x00000003, or 0x00000004.
	DriverContainer *DriverContainer `idl:"name:pDriverContainer" json:"driver_container"`
}

func (o *AddPrinterDriverRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterDriverOperation) *xxx_AddPrinterDriverOperation {
	if op == nil {
		op = &xxx_AddPrinterDriverOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.DriverContainer = o.DriverContainer
	return op
}

func (o *AddPrinterDriverRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterDriverOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.DriverContainer = op.DriverContainer
}
func (o *AddPrinterDriverRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPrinterDriverRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterDriverOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPrinterDriverResponse structure represents the RpcAddPrinterDriver operation response
type AddPrinterDriverResponse struct {
	// Return: The RpcAddPrinterDriver return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPrinterDriverResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterDriverOperation) *xxx_AddPrinterDriverOperation {
	if op == nil {
		op = &xxx_AddPrinterDriverOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddPrinterDriverResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterDriverOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddPrinterDriverResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPrinterDriverResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterDriverOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPrinterDriversOperation structure represents the RpcEnumPrinterDrivers operation
type xxx_EnumPrinterDriversOperation struct {
	Name          string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment   string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	Level         uint32 `idl:"name:Level" json:"level"`
	Drivers       []byte `idl:"name:pDrivers;size_is:(cbBuf);pointer:unique" json:"drivers"`
	BufferLength  uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrinterDriversOperation) OpNum() int { return 10 }

func (o *xxx_EnumPrinterDriversOperation) OpName() string {
	return "/winspool/v1/RpcEnumPrinterDrivers"
}

func (o *xxx_EnumPrinterDriversOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Drivers != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Drivers))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDriversOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pDrivers {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Drivers != nil || o.BufferLength > 0 {
			_ptr_pDrivers := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Drivers {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Drivers[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Drivers); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Drivers, _ptr_pDrivers); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDriversOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pDrivers {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDrivers := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Drivers", sizeInfo[0])
			}
			o.Drivers = make([]byte, sizeInfo[0])
			for i1 := range o.Drivers {
				i1 := i1
				if err := w.ReadData(&o.Drivers[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDrivers := func(ptr interface{}) { o.Drivers = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Drivers, _s_pDrivers, _ptr_pDrivers); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDriversOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDriversOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pDrivers {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Drivers != nil || o.BufferLength > 0 {
			_ptr_pDrivers := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Drivers {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Drivers[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Drivers); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Drivers, _ptr_pDrivers); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDriversOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pDrivers {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDrivers := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Drivers", sizeInfo[0])
			}
			o.Drivers = make([]byte, sizeInfo[0])
			for i1 := range o.Drivers {
				i1 := i1
				if err := w.ReadData(&o.Drivers[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDrivers := func(ptr interface{}) { o.Drivers = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Drivers, _s_pDrivers, _ptr_pDrivers); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrinterDriversRequest structure represents the RpcEnumPrinterDrivers operation request
type EnumPrinterDriversRequest struct {
	// pName: Specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: Specified in Environment Name Parameters (section 3.1.4.1.3).<327>
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// Level: The driver information level.
	//
	//	+------------+----------------------------------------------------+
	//	|            |                                                    |
	//	|   VALUE    |                    DESCRIPTION                     |
	//	|            |                                                    |
	//	+------------+----------------------------------------------------+
	//	+------------+----------------------------------------------------+
	//	| 0x00000001 | Corresponds to _DRIVER_INFO_1 (section 2.2.2.4.1). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000002 | Corresponds to _DRIVER_INFO_2 (section 2.2.2.4.2). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000003 | Corresponds to _DRIVER_INFO_3 (section 2.2.2.4.3). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000004 | Corresponds to _DRIVER_INFO_4 (section 2.2.2.4.4). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000005 | Corresponds to _DRIVER_INFO_5 (section 2.2.2.4.5). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000006 | Corresponds to _DRIVER_INFO_6 (section 2.2.2.4.6). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000008 | Corresponds to _DRIVER_INFO_8 (section 2.2.2.4.8). |
	//	+------------+----------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pDrivers: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Drivers []byte `idl:"name:pDrivers;size_is:(cbBuf);pointer:unique" json:"drivers"`
	// cbBuf: Specified in INFO Structures Query Parameters (section 3.1.4.1.9).
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumPrinterDriversRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterDriversOperation) *xxx_EnumPrinterDriversOperation {
	if op == nil {
		op = &xxx_EnumPrinterDriversOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.Level = o.Level
	op.Drivers = o.Drivers
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumPrinterDriversRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterDriversOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.Level = op.Level
	o.Drivers = op.Drivers
	o.BufferLength = op.BufferLength
}
func (o *EnumPrinterDriversRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrinterDriversRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterDriversOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrinterDriversResponse structure represents the RpcEnumPrinterDrivers operation response
type EnumPrinterDriversResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pDrivers: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Drivers []byte `idl:"name:pDrivers;size_is:(cbBuf);pointer:unique" json:"drivers"`
	// pcbNeeded: Specified in INFO Structures Query Parameters (section 3.1.4.1.9).
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: Specified in INFO Structures Query Parameters (section 3.1.4.1.9).
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumPrinterDrivers return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrinterDriversResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterDriversOperation) *xxx_EnumPrinterDriversOperation {
	if op == nil {
		op = &xxx_EnumPrinterDriversOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Drivers = o.Drivers
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumPrinterDriversResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterDriversOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Drivers = op.Drivers
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumPrinterDriversResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrinterDriversResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterDriversOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterDriverOperation structure represents the RpcGetPrinterDriver operation
type xxx_GetPrinterDriverOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	Environment  string   `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	Level        uint32   `idl:"name:Level" json:"level"`
	Driver       []byte   `idl:"name:pDriver;size_is:(cbBuf);pointer:unique" json:"driver"`
	BufferLength uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterDriverOperation) OpNum() int { return 11 }

func (o *xxx_GetPrinterDriverOperation) OpName() string { return "/winspool/v1/RpcGetPrinterDriver" }

func (o *xxx_GetPrinterDriverOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Driver != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Driver))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Driver != nil || o.BufferLength > 0 {
			_ptr_pDriver := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Driver {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Driver[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Driver); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Driver, _ptr_pDriver); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDriver := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Driver", sizeInfo[0])
			}
			o.Driver = make([]byte, sizeInfo[0])
			for i1 := range o.Driver {
				i1 := i1
				if err := w.ReadData(&o.Driver[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDriver := func(ptr interface{}) { o.Driver = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Driver, _s_pDriver, _ptr_pDriver); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Driver != nil || o.BufferLength > 0 {
			_ptr_pDriver := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Driver {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Driver[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Driver); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Driver, _ptr_pDriver); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDriver := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Driver", sizeInfo[0])
			}
			o.Driver = make([]byte, sizeInfo[0])
			for i1 := range o.Driver {
				i1 := i1
				if err := w.ReadData(&o.Driver[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDriver := func(ptr interface{}) { o.Driver = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Driver, _s_pDriver, _ptr_pDriver); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterDriverRequest structure represents the RpcGetPrinterDriver operation request
type GetPrinterDriverRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pEnvironment: A parameter specified in Environment Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// Level: The driver information level.
	//
	//	+------------+----------------------------------------------------+
	//	|            |                                                    |
	//	|   VALUE    |                    DESCRIPTION                     |
	//	|            |                                                    |
	//	+------------+----------------------------------------------------+
	//	+------------+----------------------------------------------------+
	//	| 0x00000001 | Corresponds to _DRIVER_INFO_1 (section 2.2.2.4.1). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000002 | Corresponds to _DRIVER_INFO_2 (section 2.2.2.4.2). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000003 | Corresponds to _DRIVER_INFO_3 (section 2.2.2.4.3). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000004 | Corresponds to _DRIVER_INFO_4 (section 2.2.2.4.4). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000006 | Corresponds to _DRIVER_INFO_6 (section 2.2.2.4.6). |
	//	+------------+----------------------------------------------------+
	//	| 0x00000008 | Corresponds to _DRIVER_INFO_8 (section 2.2.2.4.8). |
	//	+------------+----------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pDriver: An optional pointer to BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Driver []byte `idl:"name:pDriver;size_is:(cbBuf);pointer:unique" json:"driver"`
	// cbBuf: Specified in INFO Structures Query Parameters.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *GetPrinterDriverRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriverOperation) *xxx_GetPrinterDriverOperation {
	if op == nil {
		op = &xxx_GetPrinterDriverOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Environment = o.Environment
	op.Level = o.Level
	op.Driver = o.Driver
	op.BufferLength = o.BufferLength
	return op
}

func (o *GetPrinterDriverRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriverOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Environment = op.Environment
	o.Level = op.Level
	o.Driver = op.Driver
	o.BufferLength = op.BufferLength
}
func (o *GetPrinterDriverRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterDriverRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriverOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterDriverResponse structure represents the RpcGetPrinterDriver operation response
type GetPrinterDriverResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pDriver: An optional pointer to BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Driver []byte `idl:"name:pDriver;size_is:(cbBuf);pointer:unique" json:"driver"`
	// pcbNeeded: Specified in INFO Structures Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetPrinterDriver return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterDriverResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriverOperation) *xxx_GetPrinterDriverOperation {
	if op == nil {
		op = &xxx_GetPrinterDriverOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Driver = o.Driver
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetPrinterDriverResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriverOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Driver = op.Driver
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetPrinterDriverResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterDriverResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriverOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterDriverDirectoryOperation structure represents the RpcGetPrinterDriverDirectory operation
type xxx_GetPrinterDriverDirectoryOperation struct {
	Name            string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment     string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	Level           uint32 `idl:"name:Level" json:"level"`
	DriverDirectory []byte `idl:"name:pDriverDirectory;size_is:(cbBuf);pointer:unique" json:"driver_directory"`
	BufferLength    uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength    uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	Return          uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterDriverDirectoryOperation) OpNum() int { return 12 }

func (o *xxx_GetPrinterDriverDirectoryOperation) OpName() string {
	return "/winspool/v1/RpcGetPrinterDriverDirectory"
}

func (o *xxx_GetPrinterDriverDirectoryOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.DriverDirectory != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.DriverDirectory))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverDirectoryOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pDriverDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.DriverDirectory != nil || o.BufferLength > 0 {
			_ptr_pDriverDirectory := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.DriverDirectory {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.DriverDirectory[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.DriverDirectory); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.DriverDirectory, _ptr_pDriverDirectory); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverDirectoryOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pDriverDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDriverDirectory := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.DriverDirectory", sizeInfo[0])
			}
			o.DriverDirectory = make([]byte, sizeInfo[0])
			for i1 := range o.DriverDirectory {
				i1 := i1
				if err := w.ReadData(&o.DriverDirectory[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDriverDirectory := func(ptr interface{}) { o.DriverDirectory = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.DriverDirectory, _s_pDriverDirectory, _ptr_pDriverDirectory); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverDirectoryOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverDirectoryOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pDriverDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.DriverDirectory != nil || o.BufferLength > 0 {
			_ptr_pDriverDirectory := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.DriverDirectory {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.DriverDirectory[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.DriverDirectory); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.DriverDirectory, _ptr_pDriverDirectory); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverDirectoryOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pDriverDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDriverDirectory := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.DriverDirectory", sizeInfo[0])
			}
			o.DriverDirectory = make([]byte, sizeInfo[0])
			for i1 := range o.DriverDirectory {
				i1 := i1
				if err := w.ReadData(&o.DriverDirectory[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDriverDirectory := func(ptr interface{}) { o.DriverDirectory = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.DriverDirectory, _s_pDriverDirectory, _ptr_pDriverDirectory); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterDriverDirectoryRequest structure represents the RpcGetPrinterDriverDirectory operation request
type GetPrinterDriverDirectoryRequest struct {
	// pName: Specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: Specified in Environment Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// Level: The value 0x00000001.
	Level uint32 `idl:"name:Level" json:"level"`
	// pDriverDirectory: An optional pointer to BUFFER, as specified in String Query Parameters
	// (section 3.1.4.1.7). If cbBuf is zero, this parameter SHOULD be NULL.
	DriverDirectory []byte `idl:"name:pDriverDirectory;size_is:(cbBuf);pointer:unique" json:"driver_directory"`
	// cbBuf: See String Query Parameters (section 3.1.4.1.7).
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *GetPrinterDriverDirectoryRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriverDirectoryOperation) *xxx_GetPrinterDriverDirectoryOperation {
	if op == nil {
		op = &xxx_GetPrinterDriverDirectoryOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.Level = o.Level
	op.DriverDirectory = o.DriverDirectory
	op.BufferLength = o.BufferLength
	return op
}

func (o *GetPrinterDriverDirectoryRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriverDirectoryOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.Level = op.Level
	o.DriverDirectory = op.DriverDirectory
	o.BufferLength = op.BufferLength
}
func (o *GetPrinterDriverDirectoryRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterDriverDirectoryRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriverDirectoryOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterDriverDirectoryResponse structure represents the RpcGetPrinterDriverDirectory operation response
type GetPrinterDriverDirectoryResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pDriverDirectory: An optional pointer to BUFFER, as specified in String Query Parameters
	// (section 3.1.4.1.7). If cbBuf is zero, this parameter SHOULD be NULL.
	DriverDirectory []byte `idl:"name:pDriverDirectory;size_is:(cbBuf);pointer:unique" json:"driver_directory"`
	// pcbNeeded: See String Query Parameters (section 3.1.4.1.7).
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetPrinterDriverDirectory return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterDriverDirectoryResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriverDirectoryOperation) *xxx_GetPrinterDriverDirectoryOperation {
	if op == nil {
		op = &xxx_GetPrinterDriverDirectoryOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.DriverDirectory = o.DriverDirectory
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetPrinterDriverDirectoryResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriverDirectoryOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.DriverDirectory = op.DriverDirectory
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetPrinterDriverDirectoryResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterDriverDirectoryResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriverDirectoryOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterDriverOperation structure represents the RpcDeletePrinterDriver operation
type xxx_DeletePrinterDriverOperation struct {
	Name        string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment string `idl:"name:pEnvironment;string" json:"environment"`
	DriverName  string `idl:"name:pDriverName;string" json:"driver_name"`
	Return      uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterDriverOperation) OpNum() int { return 13 }

func (o *xxx_DeletePrinterDriverOperation) OpName() string {
	return "/winspool/v1/RpcDeletePrinterDriver"
}

func (o *xxx_DeletePrinterDriverOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
			return err
		}
	}
	// pDriverName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.DriverName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
	}
	// pDriverName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterDriverRequest structure represents the RpcDeletePrinterDriver operation request
type DeletePrinterDriverRequest struct {
	// pName: Specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: Specified in Environment Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string" json:"environment"`
	// pDriverName: A pointer to a string that specifies the name of the printer driver
	// to delete. For rules governing printer driver names, see section 2.2.4.3.
	DriverName string `idl:"name:pDriverName;string" json:"driver_name"`
}

func (o *DeletePrinterDriverRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDriverOperation) *xxx_DeletePrinterDriverOperation {
	if op == nil {
		op = &xxx_DeletePrinterDriverOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.DriverName = o.DriverName
	return op
}

func (o *DeletePrinterDriverRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDriverOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.DriverName = op.DriverName
}
func (o *DeletePrinterDriverRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterDriverRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDriverOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterDriverResponse structure represents the RpcDeletePrinterDriver operation response
type DeletePrinterDriverResponse struct {
	// Return: The RpcDeletePrinterDriver return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterDriverResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDriverOperation) *xxx_DeletePrinterDriverOperation {
	if op == nil {
		op = &xxx_DeletePrinterDriverOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrinterDriverResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDriverOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrinterDriverResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterDriverResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDriverOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPrintProcessorOperation structure represents the RpcAddPrintProcessor operation
type xxx_AddPrintProcessorOperation struct {
	Name               string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment        string `idl:"name:pEnvironment;string" json:"environment"`
	PathName           string `idl:"name:pPathName;string" json:"path_name"`
	PrintProcessorName string `idl:"name:pPrintProcessorName;string" json:"print_processor_name"`
	Return             uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPrintProcessorOperation) OpNum() int { return 14 }

func (o *xxx_AddPrintProcessorOperation) OpName() string { return "/winspool/v1/RpcAddPrintProcessor" }

func (o *xxx_AddPrintProcessorOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrintProcessorOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
			return err
		}
	}
	// pPathName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PathName); err != nil {
			return err
		}
	}
	// pPrintProcessorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrintProcessorOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
	}
	// pPathName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PathName); err != nil {
			return err
		}
	}
	// pPrintProcessorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrintProcessorOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrintProcessorOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrintProcessorOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPrintProcessorRequest structure represents the RpcAddPrintProcessor operation request
type AddPrintProcessorRequest struct {
	// pName: This parameter MUST adhere to the parameter specification in Print Server
	// Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: This parameter MUST adhere to the parameter specification in Environment
	// Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string" json:"environment"`
	// pPathName: A pointer to a string that specifies the file name of the print processor.
	// For rules governing path names, see section 2.2.4.9.
	PathName string `idl:"name:pPathName;string" json:"path_name"`
	// pPrintProcessorName: A pointer to a string that specifies the name of the print processor.
	// For rules governing print processor names, see section 2.2.4.11.
	PrintProcessorName string `idl:"name:pPrintProcessorName;string" json:"print_processor_name"`
}

func (o *AddPrintProcessorRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPrintProcessorOperation) *xxx_AddPrintProcessorOperation {
	if op == nil {
		op = &xxx_AddPrintProcessorOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.PathName = o.PathName
	op.PrintProcessorName = o.PrintProcessorName
	return op
}

func (o *AddPrintProcessorRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPrintProcessorOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.PathName = op.PathName
	o.PrintProcessorName = op.PrintProcessorName
}
func (o *AddPrintProcessorRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPrintProcessorRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrintProcessorOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPrintProcessorResponse structure represents the RpcAddPrintProcessor operation response
type AddPrintProcessorResponse struct {
	// Return: The RpcAddPrintProcessor return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPrintProcessorResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPrintProcessorOperation) *xxx_AddPrintProcessorOperation {
	if op == nil {
		op = &xxx_AddPrintProcessorOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddPrintProcessorResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPrintProcessorOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddPrintProcessorResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPrintProcessorResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrintProcessorOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPrintProcessorsOperation structure represents the RpcEnumPrintProcessors operation
type xxx_EnumPrintProcessorsOperation struct {
	Name               string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment        string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	Level              uint32 `idl:"name:Level" json:"level"`
	PrintProcessorInfo []byte `idl:"name:pPrintProcessorInfo;size_is:(cbBuf);pointer:unique" json:"print_processor_info"`
	BufferLength       uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength       uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount      uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return             uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrintProcessorsOperation) OpNum() int { return 15 }

func (o *xxx_EnumPrintProcessorsOperation) OpName() string {
	return "/winspool/v1/RpcEnumPrintProcessors"
}

func (o *xxx_EnumPrintProcessorsOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.PrintProcessorInfo != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.PrintProcessorInfo))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pPrintProcessorInfo {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrintProcessorInfo != nil || o.BufferLength > 0 {
			_ptr_pPrintProcessorInfo := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrintProcessorInfo {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrintProcessorInfo[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrintProcessorInfo); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrintProcessorInfo, _ptr_pPrintProcessorInfo); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pPrintProcessorInfo {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrintProcessorInfo := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrintProcessorInfo", sizeInfo[0])
			}
			o.PrintProcessorInfo = make([]byte, sizeInfo[0])
			for i1 := range o.PrintProcessorInfo {
				i1 := i1
				if err := w.ReadData(&o.PrintProcessorInfo[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrintProcessorInfo := func(ptr interface{}) { o.PrintProcessorInfo = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrintProcessorInfo, _s_pPrintProcessorInfo, _ptr_pPrintProcessorInfo); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorsOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pPrintProcessorInfo {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrintProcessorInfo != nil || o.BufferLength > 0 {
			_ptr_pPrintProcessorInfo := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrintProcessorInfo {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrintProcessorInfo[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrintProcessorInfo); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrintProcessorInfo, _ptr_pPrintProcessorInfo); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pPrintProcessorInfo {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrintProcessorInfo := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrintProcessorInfo", sizeInfo[0])
			}
			o.PrintProcessorInfo = make([]byte, sizeInfo[0])
			for i1 := range o.PrintProcessorInfo {
				i1 := i1
				if err := w.ReadData(&o.PrintProcessorInfo[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrintProcessorInfo := func(ptr interface{}) { o.PrintProcessorInfo = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrintProcessorInfo, _s_pPrintProcessorInfo, _ptr_pPrintProcessorInfo); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrintProcessorsRequest structure represents the RpcEnumPrintProcessors operation request
type EnumPrintProcessorsRequest struct {
	// pName: A parameter specified in Print Server Name Parameters, section 3.1.4.1.4.
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: A parameter specified in Environment Name Parameters, section 3.1.4.1.3.
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// Level: The information level. This value MUST be 0x00000001.
	Level uint32 `idl:"name:Level" json:"level"`
	// pPrintProcessorInfo: A pointer to BUFFER as specified in INFO Structures Query Parameters,
	// section 3.1.4.1.9
	PrintProcessorInfo []byte `idl:"name:pPrintProcessorInfo;size_is:(cbBuf);pointer:unique" json:"print_processor_info"`
	// cbBuf: A parameter specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumPrintProcessorsRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrintProcessorsOperation) *xxx_EnumPrintProcessorsOperation {
	if op == nil {
		op = &xxx_EnumPrintProcessorsOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.Level = o.Level
	op.PrintProcessorInfo = o.PrintProcessorInfo
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumPrintProcessorsRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrintProcessorsOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.Level = op.Level
	o.PrintProcessorInfo = op.PrintProcessorInfo
	o.BufferLength = op.BufferLength
}
func (o *EnumPrintProcessorsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrintProcessorsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrintProcessorsOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrintProcessorsResponse structure represents the RpcEnumPrintProcessors operation response
type EnumPrintProcessorsResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pPrintProcessorInfo: A pointer to BUFFER as specified in INFO Structures Query Parameters,
	// section 3.1.4.1.9
	PrintProcessorInfo []byte `idl:"name:pPrintProcessorInfo;size_is:(cbBuf);pointer:unique" json:"print_processor_info"`
	// pcbNeeded: A parameter specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: A parameter specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumPrintProcessors return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrintProcessorsResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrintProcessorsOperation) *xxx_EnumPrintProcessorsOperation {
	if op == nil {
		op = &xxx_EnumPrintProcessorsOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.PrintProcessorInfo = o.PrintProcessorInfo
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumPrintProcessorsResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrintProcessorsOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.PrintProcessorInfo = op.PrintProcessorInfo
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumPrintProcessorsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrintProcessorsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrintProcessorsOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrintProcessorDirectoryOperation structure represents the RpcGetPrintProcessorDirectory operation
type xxx_GetPrintProcessorDirectoryOperation struct {
	Name                    string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment             string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	Level                   uint32 `idl:"name:Level" json:"level"`
	PrintProcessorDirectory []byte `idl:"name:pPrintProcessorDirectory;size_is:(cbBuf);pointer:unique" json:"print_processor_directory"`
	BufferLength            uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength            uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	Return                  uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrintProcessorDirectoryOperation) OpNum() int { return 16 }

func (o *xxx_GetPrintProcessorDirectoryOperation) OpName() string {
	return "/winspool/v1/RpcGetPrintProcessorDirectory"
}

func (o *xxx_GetPrintProcessorDirectoryOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.PrintProcessorDirectory != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.PrintProcessorDirectory))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrintProcessorDirectoryOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pPrintProcessorDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrintProcessorDirectory != nil || o.BufferLength > 0 {
			_ptr_pPrintProcessorDirectory := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrintProcessorDirectory {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrintProcessorDirectory[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrintProcessorDirectory); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrintProcessorDirectory, _ptr_pPrintProcessorDirectory); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrintProcessorDirectoryOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pPrintProcessorDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrintProcessorDirectory := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrintProcessorDirectory", sizeInfo[0])
			}
			o.PrintProcessorDirectory = make([]byte, sizeInfo[0])
			for i1 := range o.PrintProcessorDirectory {
				i1 := i1
				if err := w.ReadData(&o.PrintProcessorDirectory[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrintProcessorDirectory := func(ptr interface{}) { o.PrintProcessorDirectory = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrintProcessorDirectory, _s_pPrintProcessorDirectory, _ptr_pPrintProcessorDirectory); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrintProcessorDirectoryOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrintProcessorDirectoryOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pPrintProcessorDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrintProcessorDirectory != nil || o.BufferLength > 0 {
			_ptr_pPrintProcessorDirectory := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrintProcessorDirectory {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrintProcessorDirectory[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrintProcessorDirectory); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrintProcessorDirectory, _ptr_pPrintProcessorDirectory); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrintProcessorDirectoryOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pPrintProcessorDirectory {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrintProcessorDirectory := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrintProcessorDirectory", sizeInfo[0])
			}
			o.PrintProcessorDirectory = make([]byte, sizeInfo[0])
			for i1 := range o.PrintProcessorDirectory {
				i1 := i1
				if err := w.ReadData(&o.PrintProcessorDirectory[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrintProcessorDirectory := func(ptr interface{}) { o.PrintProcessorDirectory = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrintProcessorDirectory, _s_pPrintProcessorDirectory, _ptr_pPrintProcessorDirectory); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrintProcessorDirectoryRequest structure represents the RpcGetPrintProcessorDirectory operation request
type GetPrintProcessorDirectoryRequest struct {
	// pName: This parameter MUST adhere to the parameter specification in Print Server
	// Name Parameters, section 3.1.4.1.4.
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: This parameter MUST adhere to the parameter specification in Environment
	// Name Parameters, section 3.1.4.1.3.
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// Level: The value of this parameter MUST be 0x00000001.
	Level uint32 `idl:"name:Level" json:"level"`
	// pPrintProcessorDirectory: This parameter MAY be NULL if cbBuf equals zero; otherwise,
	// it is a pointer to BUFFER as specified in String Query Parameters, section 3.1.4.1.7.
	PrintProcessorDirectory []byte `idl:"name:pPrintProcessorDirectory;size_is:(cbBuf);pointer:unique" json:"print_processor_directory"`
	// cbBuf: This parameter MUST adhere to the parameter specification in String Query
	// Parameters, section 3.1.4.1.7.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *GetPrintProcessorDirectoryRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrintProcessorDirectoryOperation) *xxx_GetPrintProcessorDirectoryOperation {
	if op == nil {
		op = &xxx_GetPrintProcessorDirectoryOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.Level = o.Level
	op.PrintProcessorDirectory = o.PrintProcessorDirectory
	op.BufferLength = o.BufferLength
	return op
}

func (o *GetPrintProcessorDirectoryRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrintProcessorDirectoryOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.Level = op.Level
	o.PrintProcessorDirectory = op.PrintProcessorDirectory
	o.BufferLength = op.BufferLength
}
func (o *GetPrintProcessorDirectoryRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrintProcessorDirectoryRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrintProcessorDirectoryOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrintProcessorDirectoryResponse structure represents the RpcGetPrintProcessorDirectory operation response
type GetPrintProcessorDirectoryResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pPrintProcessorDirectory: This parameter MAY be NULL if cbBuf equals zero; otherwise,
	// it is a pointer to BUFFER as specified in String Query Parameters, section 3.1.4.1.7.
	PrintProcessorDirectory []byte `idl:"name:pPrintProcessorDirectory;size_is:(cbBuf);pointer:unique" json:"print_processor_directory"`
	// pcbNeeded: This parameter MUST adhere to the parameter specification in String Query
	// Parameters, section 3.1.4.1.7.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetPrintProcessorDirectory return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrintProcessorDirectoryResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrintProcessorDirectoryOperation) *xxx_GetPrintProcessorDirectoryOperation {
	if op == nil {
		op = &xxx_GetPrintProcessorDirectoryOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.PrintProcessorDirectory = o.PrintProcessorDirectory
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetPrintProcessorDirectoryResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrintProcessorDirectoryOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.PrintProcessorDirectory = op.PrintProcessorDirectory
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetPrintProcessorDirectoryResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrintProcessorDirectoryResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrintProcessorDirectoryOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_StartDocPrinterOperation structure represents the RpcStartDocPrinter operation
type xxx_StartDocPrinterOperation struct {
	Printer          *Printer          `idl:"name:hPrinter" json:"printer"`
	DocInfoContainer *DocInfoContainer `idl:"name:pDocInfoContainer" json:"doc_info_container"`
	JobID            uint32            `idl:"name:pJobId" json:"job_id"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_StartDocPrinterOperation) OpNum() int { return 17 }

func (o *xxx_StartDocPrinterOperation) OpName() string { return "/winspool/v1/RpcStartDocPrinter" }

func (o *xxx_StartDocPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartDocPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pDocInfoContainer {in} (1:{pointer=ref}*(1))(2:{alias=DOC_INFO_CONTAINER}(struct))
	{
		if o.DocInfoContainer != nil {
			if err := o.DocInfoContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DocInfoContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartDocPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pDocInfoContainer {in} (1:{pointer=ref}*(1))(2:{alias=DOC_INFO_CONTAINER}(struct))
	{
		if o.DocInfoContainer == nil {
			o.DocInfoContainer = &DocInfoContainer{}
		}
		if err := o.DocInfoContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartDocPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartDocPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pJobId {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartDocPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pJobId {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// StartDocPrinterRequest structure represents the RpcStartDocPrinter operation request
type StartDocPrinterRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14). The printer handle MUST NOT
	// be in use for printing another document at the time of this call.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pDocInfoContainer: A parameter specified in DOC_INFO_CONTAINER Parameters (section
	// 3.1.4.1.8.2).
	DocInfoContainer *DocInfoContainer `idl:"name:pDocInfoContainer" json:"doc_info_container"`
}

func (o *StartDocPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_StartDocPrinterOperation) *xxx_StartDocPrinterOperation {
	if op == nil {
		op = &xxx_StartDocPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.DocInfoContainer = o.DocInfoContainer
	return op
}

func (o *StartDocPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_StartDocPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.DocInfoContainer = op.DocInfoContainer
}
func (o *StartDocPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *StartDocPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_StartDocPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// StartDocPrinterResponse structure represents the RpcStartDocPrinter operation response
type StartDocPrinterResponse struct {
	// pJobId: A pointer to a variable that receives a nonzero print job identifier. The
	// job MUST be created with an identifier that is unique for this printer.
	JobID uint32 `idl:"name:pJobId" json:"job_id"`
	// Return: The RpcStartDocPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *StartDocPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_StartDocPrinterOperation) *xxx_StartDocPrinterOperation {
	if op == nil {
		op = &xxx_StartDocPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.JobID = o.JobID
	op.Return = o.Return
	return op
}

func (o *StartDocPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_StartDocPrinterOperation) {
	if o == nil {
		return
	}
	o.JobID = op.JobID
	o.Return = op.Return
}
func (o *StartDocPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *StartDocPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_StartDocPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_StartPagePrinterOperation structure represents the RpcStartPagePrinter operation
type xxx_StartPagePrinterOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_StartPagePrinterOperation) OpNum() int { return 18 }

func (o *xxx_StartPagePrinterOperation) OpName() string { return "/winspool/v1/RpcStartPagePrinter" }

func (o *xxx_StartPagePrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartPagePrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_StartPagePrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartPagePrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartPagePrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_StartPagePrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// StartPagePrinterRequest structure represents the RpcStartPagePrinter operation request
type StartPagePrinterRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *StartPagePrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_StartPagePrinterOperation) *xxx_StartPagePrinterOperation {
	if op == nil {
		op = &xxx_StartPagePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *StartPagePrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_StartPagePrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *StartPagePrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *StartPagePrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_StartPagePrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// StartPagePrinterResponse structure represents the RpcStartPagePrinter operation response
type StartPagePrinterResponse struct {
	// Return: The RpcStartPagePrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *StartPagePrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_StartPagePrinterOperation) *xxx_StartPagePrinterOperation {
	if op == nil {
		op = &xxx_StartPagePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *StartPagePrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_StartPagePrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *StartPagePrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *StartPagePrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_StartPagePrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_WritePrinterOperation structure represents the RpcWritePrinter operation
type xxx_WritePrinterOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	Buffer       []byte   `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
	BufferLength uint32   `idl:"name:cbBuf" json:"buffer_length"`
	WrittenCount uint32   `idl:"name:pcWritten" json:"written_count"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_WritePrinterOperation) OpNum() int { return 19 }

func (o *xxx_WritePrinterOperation) OpName() string { return "/winspool/v1/RpcWritePrinter" }

func (o *xxx_WritePrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Buffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Buffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WritePrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pBuf {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		dimSize1 := uint64(o.BufferLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Buffer {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Buffer[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WritePrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pBuf {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
		}
		o.Buffer = make([]byte, sizeInfo[0])
		for i1 := range o.Buffer {
			i1 := i1
			if err := w.ReadData(&o.Buffer[i1]); err != nil {
				return err
			}
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WritePrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WritePrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pcWritten {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.WrittenCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WritePrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pcWritten {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.WrittenCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// WritePrinterRequest structure represents the RpcWritePrinter operation request
type WritePrinterRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pBuf: A pointer to a buffer that contains the data to be written. This parameter
	// can be NULL if the value of the cbBuf parameter is zero.
	Buffer []byte `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
	// cbBuf: The number of bytes of data to be written.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *WritePrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_WritePrinterOperation) *xxx_WritePrinterOperation {
	if op == nil {
		op = &xxx_WritePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Buffer = o.Buffer
	op.BufferLength = o.BufferLength
	return op
}

func (o *WritePrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_WritePrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Buffer = op.Buffer
	o.BufferLength = op.BufferLength
}
func (o *WritePrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *WritePrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_WritePrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// WritePrinterResponse structure represents the RpcWritePrinter operation response
type WritePrinterResponse struct {
	// pcWritten: A pointer to a value that receives the number of bytes of data that were
	// written.
	WrittenCount uint32 `idl:"name:pcWritten" json:"written_count"`
	// Return: The RpcWritePrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *WritePrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_WritePrinterOperation) *xxx_WritePrinterOperation {
	if op == nil {
		op = &xxx_WritePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.WrittenCount = o.WrittenCount
	op.Return = o.Return
	return op
}

func (o *WritePrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_WritePrinterOperation) {
	if o == nil {
		return
	}
	o.WrittenCount = op.WrittenCount
	o.Return = op.Return
}
func (o *WritePrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *WritePrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_WritePrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EndPagePrinterOperation structure represents the RpcEndPagePrinter operation
type xxx_EndPagePrinterOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EndPagePrinterOperation) OpNum() int { return 20 }

func (o *xxx_EndPagePrinterOperation) OpName() string { return "/winspool/v1/RpcEndPagePrinter" }

func (o *xxx_EndPagePrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndPagePrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_EndPagePrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndPagePrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndPagePrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndPagePrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EndPagePrinterRequest structure represents the RpcEndPagePrinter operation request
type EndPagePrinterRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *EndPagePrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_EndPagePrinterOperation) *xxx_EndPagePrinterOperation {
	if op == nil {
		op = &xxx_EndPagePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *EndPagePrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_EndPagePrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *EndPagePrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EndPagePrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EndPagePrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EndPagePrinterResponse structure represents the RpcEndPagePrinter operation response
type EndPagePrinterResponse struct {
	// Return: The RpcEndPagePrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EndPagePrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_EndPagePrinterOperation) *xxx_EndPagePrinterOperation {
	if op == nil {
		op = &xxx_EndPagePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *EndPagePrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_EndPagePrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *EndPagePrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EndPagePrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EndPagePrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AbortPrinterOperation structure represents the RpcAbortPrinter operation
type xxx_AbortPrinterOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_AbortPrinterOperation) OpNum() int { return 21 }

func (o *xxx_AbortPrinterOperation) OpName() string { return "/winspool/v1/RpcAbortPrinter" }

func (o *xxx_AbortPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AbortPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_AbortPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AbortPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AbortPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AbortPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AbortPrinterRequest structure represents the RpcAbortPrinter operation request
type AbortPrinterRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *AbortPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_AbortPrinterOperation) *xxx_AbortPrinterOperation {
	if op == nil {
		op = &xxx_AbortPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *AbortPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_AbortPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *AbortPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AbortPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AbortPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AbortPrinterResponse structure represents the RpcAbortPrinter operation response
type AbortPrinterResponse struct {
	// Return: The RpcAbortPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AbortPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_AbortPrinterOperation) *xxx_AbortPrinterOperation {
	if op == nil {
		op = &xxx_AbortPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AbortPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_AbortPrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AbortPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AbortPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AbortPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_ReadPrinterOperation structure represents the RpcReadPrinter operation
type xxx_ReadPrinterOperation struct {
	Printer          *Printer `idl:"name:hPrinter" json:"printer"`
	Buffer           []byte   `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
	BufferLength     uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NoBytesReadCount uint32   `idl:"name:pcNoBytesRead" json:"no_bytes_read_count"`
	Return           uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_ReadPrinterOperation) OpNum() int { return 22 }

func (o *xxx_ReadPrinterOperation) OpName() string { return "/winspool/v1/RpcReadPrinter" }

func (o *xxx_ReadPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReadPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReadPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReadPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReadPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pBuf {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		dimSize1 := uint64(o.BufferLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Buffer {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Buffer[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// pcNoBytesRead {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NoBytesReadCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReadPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pBuf {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
		}
		o.Buffer = make([]byte, sizeInfo[0])
		for i1 := range o.Buffer {
			i1 := i1
			if err := w.ReadData(&o.Buffer[i1]); err != nil {
				return err
			}
		}
	}
	// pcNoBytesRead {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NoBytesReadCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// ReadPrinterRequest structure represents the RpcReadPrinter operation request
type ReadPrinterRequest struct {
	// hPrinter: A handle to a job object or port object that was opened by RpcOpenPrinter
	// (section 3.1.4.2.2) or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// cbBuf: The size, in bytes, of data to be read into the buffer that is pointed to
	// by the pBuf parameter.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *ReadPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_ReadPrinterOperation) *xxx_ReadPrinterOperation {
	if op == nil {
		op = &xxx_ReadPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.BufferLength = o.BufferLength
	return op
}

func (o *ReadPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_ReadPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.BufferLength = op.BufferLength
}
func (o *ReadPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *ReadPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ReadPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// ReadPrinterResponse structure represents the RpcReadPrinter operation response
type ReadPrinterResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pBuf: A pointer to a buffer that receives the printer data. If the hPrinter parameter
	// is the handle to a port object, this method returns the data that is returned by
	// the port monitor.
	Buffer []byte `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
	// pcNoBytesRead: A pointer to a variable that receives the number of bytes of data
	// copied into the array to which pBuf points.
	NoBytesReadCount uint32 `idl:"name:pcNoBytesRead" json:"no_bytes_read_count"`
	// Return: The RpcReadPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *ReadPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_ReadPrinterOperation) *xxx_ReadPrinterOperation {
	if op == nil {
		op = &xxx_ReadPrinterOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Buffer = o.Buffer
	op.NoBytesReadCount = o.NoBytesReadCount
	op.Return = o.Return
	return op
}

func (o *ReadPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_ReadPrinterOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Buffer = op.Buffer
	o.NoBytesReadCount = op.NoBytesReadCount
	o.Return = op.Return
}
func (o *ReadPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *ReadPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ReadPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EndDocPrinterOperation structure represents the RpcEndDocPrinter operation
type xxx_EndDocPrinterOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EndDocPrinterOperation) OpNum() int { return 23 }

func (o *xxx_EndDocPrinterOperation) OpName() string { return "/winspool/v1/RpcEndDocPrinter" }

func (o *xxx_EndDocPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndDocPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_EndDocPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndDocPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndDocPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EndDocPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EndDocPrinterRequest structure represents the RpcEndDocPrinter operation request
type EndDocPrinterRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *EndDocPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_EndDocPrinterOperation) *xxx_EndDocPrinterOperation {
	if op == nil {
		op = &xxx_EndDocPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *EndDocPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_EndDocPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *EndDocPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EndDocPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EndDocPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EndDocPrinterResponse structure represents the RpcEndDocPrinter operation response
type EndDocPrinterResponse struct {
	// Return: The RpcEndDocPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EndDocPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_EndDocPrinterOperation) *xxx_EndDocPrinterOperation {
	if op == nil {
		op = &xxx_EndDocPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *EndDocPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_EndDocPrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *EndDocPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EndDocPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EndDocPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddJobOperation structure represents the RpcAddJob operation
type xxx_AddJobOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	Level        uint32   `idl:"name:Level" json:"level"`
	AddJob       []byte   `idl:"name:pAddJob;size_is:(cbBuf);pointer:unique" json:"add_job"`
	BufferLength uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_AddJobOperation) OpNum() int { return 24 }

func (o *xxx_AddJobOperation) OpName() string { return "/winspool/v1/RpcAddJob" }

func (o *xxx_AddJobOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.AddJob != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.AddJob))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddJobOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pAddJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.AddJob != nil || o.BufferLength > 0 {
			_ptr_pAddJob := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.AddJob {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.AddJob[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.AddJob); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.AddJob, _ptr_pAddJob); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddJobOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pAddJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pAddJob := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.AddJob", sizeInfo[0])
			}
			o.AddJob = make([]byte, sizeInfo[0])
			for i1 := range o.AddJob {
				i1 := i1
				if err := w.ReadData(&o.AddJob[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pAddJob := func(ptr interface{}) { o.AddJob = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.AddJob, _s_pAddJob, _ptr_pAddJob); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddJobOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddJobOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pAddJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.AddJob != nil || o.BufferLength > 0 {
			_ptr_pAddJob := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.AddJob {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.AddJob[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.AddJob); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.AddJob, _ptr_pAddJob); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddJobOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pAddJob {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pAddJob := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.AddJob", sizeInfo[0])
			}
			o.AddJob = make([]byte, sizeInfo[0])
			for i1 := range o.AddJob {
				i1 := i1
				if err := w.ReadData(&o.AddJob[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pAddJob := func(ptr interface{}) { o.AddJob = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.AddJob, _s_pAddJob, _ptr_pAddJob); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddJobRequest structure represents the RpcAddJob operation request
type AddJobRequest struct {
	// hPrinter: A handle to a printer object that was opened using RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// Level: A value that MUST be 0x00000001, 0x00000002 or 0x00000003.
	Level uint32 `idl:"name:Level" json:"level"`
	// pAddJob: A pointer to a buffer of undefined values. This value can be NULL if cbBuf
	// is zero and Level is 0x00000001.
	AddJob []byte `idl:"name:pAddJob;size_is:(cbBuf);pointer:unique" json:"add_job"`
	// cbBuf: The size, in bytes, of the buffer pointed to by pAddJob. If Level is 0x00000002
	// or 0x00000003, this value SHOULD be greater than or equal to 10 bytes.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *AddJobRequest) xxx_ToOp(ctx context.Context, op *xxx_AddJobOperation) *xxx_AddJobOperation {
	if op == nil {
		op = &xxx_AddJobOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Level = o.Level
	op.AddJob = o.AddJob
	op.BufferLength = o.BufferLength
	return op
}

func (o *AddJobRequest) xxx_FromOp(ctx context.Context, op *xxx_AddJobOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Level = op.Level
	o.AddJob = op.AddJob
	o.BufferLength = op.BufferLength
}
func (o *AddJobRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddJobRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddJobOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddJobResponse structure represents the RpcAddJob operation response
type AddJobResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pAddJob: A pointer to a buffer of undefined values. This value can be NULL if cbBuf
	// is zero and Level is 0x00000001.
	AddJob []byte `idl:"name:pAddJob;size_is:(cbBuf);pointer:unique" json:"add_job"`
	// pcbNeeded: A pointer to a variable that SHOULD receive zero.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcAddJob return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddJobResponse) xxx_ToOp(ctx context.Context, op *xxx_AddJobOperation) *xxx_AddJobOperation {
	if op == nil {
		op = &xxx_AddJobOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.AddJob = o.AddJob
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *AddJobResponse) xxx_FromOp(ctx context.Context, op *xxx_AddJobOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.AddJob = op.AddJob
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *AddJobResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddJobResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddJobOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_ScheduleJobOperation structure represents the RpcScheduleJob operation
type xxx_ScheduleJobOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	JobID   uint32   `idl:"name:JobId" json:"job_id"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_ScheduleJobOperation) OpNum() int { return 25 }

func (o *xxx_ScheduleJobOperation) OpName() string { return "/winspool/v1/RpcScheduleJob" }

func (o *xxx_ScheduleJobOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ScheduleJobOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ScheduleJobOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ScheduleJobOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ScheduleJobOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ScheduleJobOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// ScheduleJobRequest structure represents the RpcScheduleJob operation request
type ScheduleJobRequest struct {
	// hPrinter: A handle to a printer object that was opened using RpcAddPrinter, RpcAddPrinterEx,
	// RpcOpenPrinter, or RpcOpenPrinterEx.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of the print job.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
}

func (o *ScheduleJobRequest) xxx_ToOp(ctx context.Context, op *xxx_ScheduleJobOperation) *xxx_ScheduleJobOperation {
	if op == nil {
		op = &xxx_ScheduleJobOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	return op
}

func (o *ScheduleJobRequest) xxx_FromOp(ctx context.Context, op *xxx_ScheduleJobOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
}
func (o *ScheduleJobRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *ScheduleJobRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ScheduleJobOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// ScheduleJobResponse structure represents the RpcScheduleJob operation response
type ScheduleJobResponse struct {
	// Return: The RpcScheduleJob return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *ScheduleJobResponse) xxx_ToOp(ctx context.Context, op *xxx_ScheduleJobOperation) *xxx_ScheduleJobOperation {
	if op == nil {
		op = &xxx_ScheduleJobOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *ScheduleJobResponse) xxx_FromOp(ctx context.Context, op *xxx_ScheduleJobOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *ScheduleJobResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *ScheduleJobResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ScheduleJobOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterDataOperation structure represents the RpcGetPrinterData operation
type xxx_GetPrinterDataOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	ValueName    string   `idl:"name:pValueName;string" json:"value_name"`
	Type         uint32   `idl:"name:pType" json:"type"`
	Data         []byte   `idl:"name:pData;size_is:(nSize)" json:"data"`
	Size         uint32   `idl:"name:nSize" json:"size"`
	NeededLength uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterDataOperation) OpNum() int { return 26 }

func (o *xxx_GetPrinterDataOperation) OpName() string { return "/winspool/v1/RpcGetPrinterData" }

func (o *xxx_GetPrinterDataOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.ValueName); err != nil {
			return err
		}
	}
	// nSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Size); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.ValueName); err != nil {
			return err
		}
	}
	// nSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Size); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pType {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Type); err != nil {
			return err
		}
	}
	// pData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=nSize](uchar))
	{
		dimSize1 := uint64(o.Size)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Data {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Data[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pType {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Type); err != nil {
			return err
		}
	}
	// pData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=nSize](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]byte, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if err := w.ReadData(&o.Data[i1]); err != nil {
				return err
			}
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterDataRequest structure represents the RpcGetPrinterData operation request
type GetPrinterDataRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pValueName: A pointer to a string that identifies the configuration data to get.
	// For rules governing value names, see section 2.2.4.18.
	//
	// For print servers, the value name is one of the predefined strings listed in Server
	// Handle Key Values (section 2.2.3.10).
	ValueName string `idl:"name:pValueName;string" json:"value_name"`
	// nSize: A parameter specified in Dynamically Typed Query Parameters.
	Size uint32 `idl:"name:nSize" json:"size"`
}

func (o *GetPrinterDataRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDataOperation) *xxx_GetPrinterDataOperation {
	if op == nil {
		op = &xxx_GetPrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.ValueName = o.ValueName
	op.Size = o.Size
	return op
}

func (o *GetPrinterDataRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDataOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.ValueName = op.ValueName
	o.Size = op.Size
}
func (o *GetPrinterDataRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterDataRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDataOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterDataResponse structure represents the RpcGetPrinterData operation response
type GetPrinterDataResponse struct {
	// XXX: nSize is an implicit input depedency for output parameters
	Size uint32 `idl:"name:nSize" json:"size"`

	// pType: A parameter specified in Dynamically Typed Query Parameters (section 3.1.4.1.2).
	Type uint32 `idl:"name:pType" json:"type"`
	// pData: A pointer to BUFFER as specified in Dynamically Typed Query Parameters.
	Data []byte `idl:"name:pData;size_is:(nSize)" json:"data"`
	// pcbNeeded: A parameter specified in Dynamically Typed Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetPrinterData return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterDataResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDataOperation) *xxx_GetPrinterDataOperation {
	if op == nil {
		op = &xxx_GetPrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.Size == uint32(0) {
		op.Size = o.Size
	}

	op.Type = o.Type
	op.Data = o.Data
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetPrinterDataResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDataOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.Size = op.Size

	o.Type = op.Type
	o.Data = op.Data
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetPrinterDataResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterDataResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDataOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetPrinterDataOperation structure represents the RpcSetPrinterData operation
type xxx_SetPrinterDataOperation struct {
	Printer    *Printer `idl:"name:hPrinter" json:"printer"`
	ValueName  string   `idl:"name:pValueName;string" json:"value_name"`
	Type       uint32   `idl:"name:Type" json:"type"`
	Data       []byte   `idl:"name:pData;size_is:(cbData)" json:"data"`
	DataLength uint32   `idl:"name:cbData" json:"data_length"`
	Return     uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_SetPrinterDataOperation) OpNum() int { return 27 }

func (o *xxx_SetPrinterDataOperation) OpName() string { return "/winspool/v1/RpcSetPrinterData" }

func (o *xxx_SetPrinterDataOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Data != nil && o.DataLength == 0 {
		o.DataLength = uint32(len(o.Data))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.ValueName); err != nil {
			return err
		}
	}
	// Type {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Type); err != nil {
			return err
		}
	}
	// pData {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbData](uchar))
	{
		dimSize1 := uint64(o.DataLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Data {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Data[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// cbData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.DataLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.ValueName); err != nil {
			return err
		}
	}
	// Type {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Type); err != nil {
			return err
		}
	}
	// pData {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbData](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]byte, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if err := w.ReadData(&o.Data[i1]); err != nil {
				return err
			}
		}
	}
	// cbData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.DataLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetPrinterDataRequest structure represents the RpcSetPrinterData operation request
type SetPrinterDataRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pValueName: A pointer to a string that identifies the configuration data to set.
	// For rules governing value names, see section 2.2.4.18.
	//
	// For print servers, the value name is one of the predefined strings listed in Server
	// Handle Key Values (section 2.2.3.10).
	ValueName string `idl:"name:pValueName;string" json:"value_name"`
	// Type: The type value for data pointed to by the pData parameter. This value SHOULD
	// be one of the type codes defined in section 2.2.3.9. For rules governing registry
	// type values, see section 2.2.4.15.
	Type uint32 `idl:"name:Type" json:"type"`
	// pData: A pointer to an array of bytes that contain the printer configuration data.
	// The type of the data in the buffer is specified by the Type parameter.
	Data []byte `idl:"name:pData;size_is:(cbData)" json:"data"`
	// cbData: The size, in bytes, of the pData array. This value SHOULD NOT be zero.
	DataLength uint32 `idl:"name:cbData" json:"data_length"`
}

func (o *SetPrinterDataRequest) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterDataOperation) *xxx_SetPrinterDataOperation {
	if op == nil {
		op = &xxx_SetPrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.ValueName = o.ValueName
	op.Type = o.Type
	op.Data = o.Data
	op.DataLength = o.DataLength
	return op
}

func (o *SetPrinterDataRequest) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterDataOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.ValueName = op.ValueName
	o.Type = op.Type
	o.Data = op.Data
	o.DataLength = op.DataLength
}
func (o *SetPrinterDataRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetPrinterDataRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterDataOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetPrinterDataResponse structure represents the RpcSetPrinterData operation response
type SetPrinterDataResponse struct {
	// Return: The RpcSetPrinterData return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetPrinterDataResponse) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterDataOperation) *xxx_SetPrinterDataOperation {
	if op == nil {
		op = &xxx_SetPrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetPrinterDataResponse) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterDataOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetPrinterDataResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetPrinterDataResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterDataOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_WaitForPrinterChangeOperation structure represents the RpcWaitForPrinterChange operation
type xxx_WaitForPrinterChangeOperation struct {
	Printer  *Printer `idl:"name:hPrinter" json:"printer"`
	Flags    uint32   `idl:"name:Flags" json:"flags"`
	FlagsOut uint32   `idl:"name:pFlagsOut" json:"flags_out"`
	Return   uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_WaitForPrinterChangeOperation) OpNum() int { return 28 }

func (o *xxx_WaitForPrinterChangeOperation) OpName() string {
	return "/winspool/v1/RpcWaitForPrinterChange"
}

func (o *xxx_WaitForPrinterChangeOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WaitForPrinterChangeOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Flags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Flags); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WaitForPrinterChangeOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Flags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Flags); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WaitForPrinterChangeOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WaitForPrinterChangeOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pFlagsOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.FlagsOut); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_WaitForPrinterChangeOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pFlagsOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.FlagsOut); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// WaitForPrinterChangeRequest structure represents the RpcWaitForPrinterChange operation request
type WaitForPrinterChangeRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// Flags: The change notifications to wait for. The value of this parameter is a bitwise
	// OR of one or more printer change values, defined in sections 2.2.3.6.1 and 2.2.3.6.2.
	// For rules governing printer change values, see section 2.2.4.13.
	Flags uint32 `idl:"name:Flags" json:"flags"`
}

func (o *WaitForPrinterChangeRequest) xxx_ToOp(ctx context.Context, op *xxx_WaitForPrinterChangeOperation) *xxx_WaitForPrinterChangeOperation {
	if op == nil {
		op = &xxx_WaitForPrinterChangeOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Flags = o.Flags
	return op
}

func (o *WaitForPrinterChangeRequest) xxx_FromOp(ctx context.Context, op *xxx_WaitForPrinterChangeOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Flags = op.Flags
}
func (o *WaitForPrinterChangeRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *WaitForPrinterChangeRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_WaitForPrinterChangeOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// WaitForPrinterChangeResponse structure represents the RpcWaitForPrinterChange operation response
type WaitForPrinterChangeResponse struct {
	FlagsOut uint32 `idl:"name:pFlagsOut" json:"flags_out"`
	// Return: The RpcWaitForPrinterChange return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *WaitForPrinterChangeResponse) xxx_ToOp(ctx context.Context, op *xxx_WaitForPrinterChangeOperation) *xxx_WaitForPrinterChangeOperation {
	if op == nil {
		op = &xxx_WaitForPrinterChangeOperation{}
	}
	if o == nil {
		return op
	}
	op.FlagsOut = o.FlagsOut
	op.Return = o.Return
	return op
}

func (o *WaitForPrinterChangeResponse) xxx_FromOp(ctx context.Context, op *xxx_WaitForPrinterChangeOperation) {
	if o == nil {
		return
	}
	o.FlagsOut = op.FlagsOut
	o.Return = op.Return
}
func (o *WaitForPrinterChangeResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *WaitForPrinterChangeResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_WaitForPrinterChangeOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_ClosePrinterOperation structure represents the RpcClosePrinter operation
type xxx_ClosePrinterOperation struct {
	Printer *Printer `idl:"name:phPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_ClosePrinterOperation) OpNum() int { return 29 }

func (o *xxx_ClosePrinterOperation) OpName() string { return "/winspool/v1/RpcClosePrinter" }

func (o *xxx_ClosePrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ClosePrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// phPrinter {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_ClosePrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// phPrinter {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ClosePrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ClosePrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// phPrinter {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ClosePrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// phPrinter {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// ClosePrinterRequest structure represents the RpcClosePrinter operation request
type ClosePrinterRequest struct {
	// phPrinter: A pointer to a handle to a printer object, server object, job object,
	// or port object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:phPrinter" json:"printer"`
}

func (o *ClosePrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_ClosePrinterOperation) *xxx_ClosePrinterOperation {
	if op == nil {
		op = &xxx_ClosePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *ClosePrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_ClosePrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *ClosePrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *ClosePrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ClosePrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// ClosePrinterResponse structure represents the RpcClosePrinter operation response
type ClosePrinterResponse struct {
	// phPrinter: A pointer to a handle to a printer object, server object, job object,
	// or port object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:phPrinter" json:"printer"`
	// Return: The RpcClosePrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *ClosePrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_ClosePrinterOperation) *xxx_ClosePrinterOperation {
	if op == nil {
		op = &xxx_ClosePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Return = o.Return
	return op
}

func (o *ClosePrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_ClosePrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Return = op.Return
}
func (o *ClosePrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *ClosePrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ClosePrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddFormOperation structure represents the RpcAddForm operation
type xxx_AddFormOperation struct {
	Printer           *Printer       `idl:"name:hPrinter" json:"printer"`
	FormInfoContainer *FormContainer `idl:"name:pFormInfoContainer" json:"form_info_container"`
	Return            uint32         `idl:"name:Return" json:"return"`
}

func (o *xxx_AddFormOperation) OpNum() int { return 30 }

func (o *xxx_AddFormOperation) OpName() string { return "/winspool/v1/RpcAddForm" }

func (o *xxx_AddFormOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddFormOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pFormInfoContainer {in} (1:{pointer=ref}*(1))(2:{alias=FORM_CONTAINER}(struct))
	{
		if o.FormInfoContainer != nil {
			if err := o.FormInfoContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&FormContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddFormOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pFormInfoContainer {in} (1:{pointer=ref}*(1))(2:{alias=FORM_CONTAINER}(struct))
	{
		if o.FormInfoContainer == nil {
			o.FormInfoContainer = &FormContainer{}
		}
		if err := o.FormInfoContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddFormOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddFormOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddFormOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddFormRequest structure represents the RpcAddForm operation request
type AddFormRequest struct {
	// hPrinter: A handle to a printer object or server object that MUST have been opened
	// using the RpcAddPrinter, RpcAddPrinterEx, RpcOpenPrinter, or RpcOpenPrinterEx methods.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pFormInfoContainer: This parameter MUST adhere to the parameter specification in
	// FORM_CONTAINER Parameters (section 3.1.4.1.8.4).
	FormInfoContainer *FormContainer `idl:"name:pFormInfoContainer" json:"form_info_container"`
}

func (o *AddFormRequest) xxx_ToOp(ctx context.Context, op *xxx_AddFormOperation) *xxx_AddFormOperation {
	if op == nil {
		op = &xxx_AddFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.FormInfoContainer = o.FormInfoContainer
	return op
}

func (o *AddFormRequest) xxx_FromOp(ctx context.Context, op *xxx_AddFormOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.FormInfoContainer = op.FormInfoContainer
}
func (o *AddFormRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddFormRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddFormOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddFormResponse structure represents the RpcAddForm operation response
type AddFormResponse struct {
	// Return: The RpcAddForm return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddFormResponse) xxx_ToOp(ctx context.Context, op *xxx_AddFormOperation) *xxx_AddFormOperation {
	if op == nil {
		op = &xxx_AddFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddFormResponse) xxx_FromOp(ctx context.Context, op *xxx_AddFormOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddFormResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddFormResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddFormOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeleteFormOperation structure represents the RpcDeleteForm operation
type xxx_DeleteFormOperation struct {
	Printer  *Printer `idl:"name:hPrinter" json:"printer"`
	FormName string   `idl:"name:pFormName;string" json:"form_name"`
	Return   uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_DeleteFormOperation) OpNum() int { return 31 }

func (o *xxx_DeleteFormOperation) OpName() string { return "/winspool/v1/RpcDeleteForm" }

func (o *xxx_DeleteFormOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteFormOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pFormName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.FormName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteFormOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pFormName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.FormName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteFormOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteFormOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteFormOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeleteFormRequest structure represents the RpcDeleteForm operation request
type DeleteFormRequest struct {
	// hPrinter: A handle to a printer object or server object that MUST have been opened
	// by using the RpcAddPrinter, RpcAddPrinterEx, RpcOpenPrinter, or RpcOpenPrinterEx
	// methods.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pFormName: A pointer to a string that MUST identify the form to delete. For rules
	// governing form names, see section 2.2.4.5.
	FormName string `idl:"name:pFormName;string" json:"form_name"`
}

func (o *DeleteFormRequest) xxx_ToOp(ctx context.Context, op *xxx_DeleteFormOperation) *xxx_DeleteFormOperation {
	if op == nil {
		op = &xxx_DeleteFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.FormName = o.FormName
	return op
}

func (o *DeleteFormRequest) xxx_FromOp(ctx context.Context, op *xxx_DeleteFormOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.FormName = op.FormName
}
func (o *DeleteFormRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeleteFormRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeleteFormOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeleteFormResponse structure represents the RpcDeleteForm operation response
type DeleteFormResponse struct {
	// Return: The RpcDeleteForm return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeleteFormResponse) xxx_ToOp(ctx context.Context, op *xxx_DeleteFormOperation) *xxx_DeleteFormOperation {
	if op == nil {
		op = &xxx_DeleteFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeleteFormResponse) xxx_FromOp(ctx context.Context, op *xxx_DeleteFormOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeleteFormResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeleteFormResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeleteFormOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetFormOperation structure represents the RpcGetForm operation
type xxx_GetFormOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	FormName     string   `idl:"name:pFormName;string" json:"form_name"`
	Level        uint32   `idl:"name:Level" json:"level"`
	Form         []byte   `idl:"name:pForm;size_is:(cbBuf);pointer:unique" json:"form"`
	BufferLength uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetFormOperation) OpNum() int { return 32 }

func (o *xxx_GetFormOperation) OpName() string { return "/winspool/v1/RpcGetForm" }

func (o *xxx_GetFormOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Form != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Form))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetFormOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pFormName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.FormName); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Form != nil || o.BufferLength > 0 {
			_ptr_pForm := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Form {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Form[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Form); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Form, _ptr_pForm); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetFormOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pFormName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.FormName); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pForm := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Form", sizeInfo[0])
			}
			o.Form = make([]byte, sizeInfo[0])
			for i1 := range o.Form {
				i1 := i1
				if err := w.ReadData(&o.Form[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pForm := func(ptr interface{}) { o.Form = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Form, _s_pForm, _ptr_pForm); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetFormOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetFormOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Form != nil || o.BufferLength > 0 {
			_ptr_pForm := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Form {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Form[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Form); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Form, _ptr_pForm); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetFormOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pForm := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Form", sizeInfo[0])
			}
			o.Form = make([]byte, sizeInfo[0])
			for i1 := range o.Form {
				i1 := i1
				if err := w.ReadData(&o.Form[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pForm := func(ptr interface{}) { o.Form = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Form, _s_pForm, _ptr_pForm); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetFormRequest structure represents the RpcGetForm operation request
type GetFormRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pFormName: A pointer to a string that specifies the form name for which data is required.
	// For rules governing form names, see section 2.2.4.5.
	FormName string `idl:"name:pFormName;string" json:"form_name"`
	// Level: The form information level.
	//
	//	+------------+--------------------------------------------------+
	//	|            |                                                  |
	//	|   VALUE    |                   DESCRIPTION                    |
	//	|            |                                                  |
	//	+------------+--------------------------------------------------+
	//	+------------+--------------------------------------------------+
	//	| 0x00000001 | Corresponds to _FORM_INFO_1 (section 2.2.2.5.1). |
	//	+------------+--------------------------------------------------+
	//	| 0x00000002 | Corresponds to _FORM_INFO_2 (section 2.2.2.5.2). |
	//	+------------+--------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pForm: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Form []byte `idl:"name:pForm;size_is:(cbBuf);pointer:unique" json:"form"`
	// cbBuf: Specified in INFO Structures Query Parameters.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *GetFormRequest) xxx_ToOp(ctx context.Context, op *xxx_GetFormOperation) *xxx_GetFormOperation {
	if op == nil {
		op = &xxx_GetFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.FormName = o.FormName
	op.Level = o.Level
	op.Form = o.Form
	op.BufferLength = o.BufferLength
	return op
}

func (o *GetFormRequest) xxx_FromOp(ctx context.Context, op *xxx_GetFormOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.FormName = op.FormName
	o.Level = op.Level
	o.Form = op.Form
	o.BufferLength = op.BufferLength
}
func (o *GetFormRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetFormRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetFormOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetFormResponse structure represents the RpcGetForm operation response
type GetFormResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pForm: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Form []byte `idl:"name:pForm;size_is:(cbBuf);pointer:unique" json:"form"`
	// pcbNeeded: Specified in INFO Structures Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetForm return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetFormResponse) xxx_ToOp(ctx context.Context, op *xxx_GetFormOperation) *xxx_GetFormOperation {
	if op == nil {
		op = &xxx_GetFormOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Form = o.Form
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetFormResponse) xxx_FromOp(ctx context.Context, op *xxx_GetFormOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Form = op.Form
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetFormResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetFormResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetFormOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetFormOperation structure represents the RpcSetForm operation
type xxx_SetFormOperation struct {
	Printer           *Printer       `idl:"name:hPrinter" json:"printer"`
	FormName          string         `idl:"name:pFormName;string" json:"form_name"`
	FormInfoContainer *FormContainer `idl:"name:pFormInfoContainer" json:"form_info_container"`
	Return            uint32         `idl:"name:Return" json:"return"`
}

func (o *xxx_SetFormOperation) OpNum() int { return 33 }

func (o *xxx_SetFormOperation) OpName() string { return "/winspool/v1/RpcSetForm" }

func (o *xxx_SetFormOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetFormOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pFormName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.FormName); err != nil {
			return err
		}
	}
	// pFormInfoContainer {in} (1:{pointer=ref}*(1))(2:{alias=FORM_CONTAINER}(struct))
	{
		if o.FormInfoContainer != nil {
			if err := o.FormInfoContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&FormContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetFormOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pFormName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.FormName); err != nil {
			return err
		}
	}
	// pFormInfoContainer {in} (1:{pointer=ref}*(1))(2:{alias=FORM_CONTAINER}(struct))
	{
		if o.FormInfoContainer == nil {
			o.FormInfoContainer = &FormContainer{}
		}
		if err := o.FormInfoContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetFormOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetFormOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetFormOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetFormRequest structure represents the RpcSetForm operation request
type SetFormRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pFormName: A pointer to a string that specifies the form name on which the form information
	// is set. For rules governing form names, see section 2.2.4.5.
	FormName string `idl:"name:pFormName;string" json:"form_name"`
	// pFormInfoContainer: A parameter specified in FORM_CONTAINER Parameters, section 3.1.4.1.8.4.
	FormInfoContainer *FormContainer `idl:"name:pFormInfoContainer" json:"form_info_container"`
}

func (o *SetFormRequest) xxx_ToOp(ctx context.Context, op *xxx_SetFormOperation) *xxx_SetFormOperation {
	if op == nil {
		op = &xxx_SetFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.FormName = o.FormName
	op.FormInfoContainer = o.FormInfoContainer
	return op
}

func (o *SetFormRequest) xxx_FromOp(ctx context.Context, op *xxx_SetFormOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.FormName = op.FormName
	o.FormInfoContainer = op.FormInfoContainer
}
func (o *SetFormRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetFormRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetFormOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetFormResponse structure represents the RpcSetForm operation response
type SetFormResponse struct {
	// Return: The RpcSetForm return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetFormResponse) xxx_ToOp(ctx context.Context, op *xxx_SetFormOperation) *xxx_SetFormOperation {
	if op == nil {
		op = &xxx_SetFormOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetFormResponse) xxx_FromOp(ctx context.Context, op *xxx_SetFormOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetFormResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetFormResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetFormOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumFormsOperation structure represents the RpcEnumForms operation
type xxx_EnumFormsOperation struct {
	Printer       *Printer `idl:"name:hPrinter" json:"printer"`
	Level         uint32   `idl:"name:Level" json:"level"`
	Form          []byte   `idl:"name:pForm;size_is:(cbBuf);pointer:unique" json:"form"`
	BufferLength  uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32   `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumFormsOperation) OpNum() int { return 34 }

func (o *xxx_EnumFormsOperation) OpName() string { return "/winspool/v1/RpcEnumForms" }

func (o *xxx_EnumFormsOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Form != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Form))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumFormsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Form != nil || o.BufferLength > 0 {
			_ptr_pForm := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Form {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Form[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Form); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Form, _ptr_pForm); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumFormsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pForm := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Form", sizeInfo[0])
			}
			o.Form = make([]byte, sizeInfo[0])
			for i1 := range o.Form {
				i1 := i1
				if err := w.ReadData(&o.Form[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pForm := func(ptr interface{}) { o.Form = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Form, _s_pForm, _ptr_pForm); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumFormsOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumFormsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Form != nil || o.BufferLength > 0 {
			_ptr_pForm := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Form {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Form[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Form); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Form, _ptr_pForm); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumFormsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pForm {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pForm := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Form", sizeInfo[0])
			}
			o.Form = make([]byte, sizeInfo[0])
			for i1 := range o.Form {
				i1 := i1
				if err := w.ReadData(&o.Form[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pForm := func(ptr interface{}) { o.Form = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Form, _s_pForm, _ptr_pForm); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumFormsRequest structure represents the RpcEnumForms operation request
type EnumFormsRequest struct {
	// hPrinter: A handle to a printer object or server object that MUST have been opened
	// by using the RpcAddPrinter, RpcAddPrinterEx, RpcOpenPrinter, or RpcOpenPrinterEx
	// methods.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// Level: This value refers to the level of form information structure, as follows.
	//
	//	+------------+--------------------------------------------------+
	//	|            |                                                  |
	//	|   VALUE    |                   DESCRIPTION                    |
	//	|            |                                                  |
	//	+------------+--------------------------------------------------+
	//	+------------+--------------------------------------------------+
	//	| 0x00000001 | Corresponds to _FORM_INFO_1 (section 2.2.2.5.1). |
	//	+------------+--------------------------------------------------+
	//	| 0x00000002 | Corresponds to _FORM_INFO_2 (section 2.2.2.5.2). |
	//	+------------+--------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pForm: This parameter MAY be NULL if cbBuf equals zero; otherwise, it is a pointer
	// to the BUFFER, as specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	Form []byte `idl:"name:pForm;size_is:(cbBuf);pointer:unique" json:"form"`
	// cbBuf: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumFormsRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumFormsOperation) *xxx_EnumFormsOperation {
	if op == nil {
		op = &xxx_EnumFormsOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Level = o.Level
	op.Form = o.Form
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumFormsRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumFormsOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Level = op.Level
	o.Form = op.Form
	o.BufferLength = op.BufferLength
}
func (o *EnumFormsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumFormsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumFormsOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumFormsResponse structure represents the RpcEnumForms operation response
type EnumFormsResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pForm: This parameter MAY be NULL if cbBuf equals zero; otherwise, it is a pointer
	// to the BUFFER, as specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	Form []byte `idl:"name:pForm;size_is:(cbBuf);pointer:unique" json:"form"`
	// pcbNeeded: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumForms return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumFormsResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumFormsOperation) *xxx_EnumFormsOperation {
	if op == nil {
		op = &xxx_EnumFormsOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Form = o.Form
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumFormsResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumFormsOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Form = op.Form
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumFormsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumFormsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumFormsOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPortsOperation structure represents the RpcEnumPorts operation
type xxx_EnumPortsOperation struct {
	Name          string `idl:"name:pName;string;pointer:unique" json:"name"`
	Level         uint32 `idl:"name:Level" json:"level"`
	Port          []byte `idl:"name:pPort;size_is:(cbBuf);pointer:unique" json:"port"`
	BufferLength  uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPortsOperation) OpNum() int { return 35 }

func (o *xxx_EnumPortsOperation) OpName() string { return "/winspool/v1/RpcEnumPorts" }

func (o *xxx_EnumPortsOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Port != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Port))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPortsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pPort {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Port != nil || o.BufferLength > 0 {
			_ptr_pPort := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Port {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Port[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Port); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Port, _ptr_pPort); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPortsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pPort {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPort := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Port", sizeInfo[0])
			}
			o.Port = make([]byte, sizeInfo[0])
			for i1 := range o.Port {
				i1 := i1
				if err := w.ReadData(&o.Port[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPort := func(ptr interface{}) { o.Port = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Port, _s_pPort, _ptr_pPort); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPortsOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPortsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pPort {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Port != nil || o.BufferLength > 0 {
			_ptr_pPort := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Port {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Port[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Port); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Port, _ptr_pPort); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPortsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pPort {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPort := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Port", sizeInfo[0])
			}
			o.Port = make([]byte, sizeInfo[0])
			for i1 := range o.Port {
				i1 := i1
				if err := w.ReadData(&o.Port[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPort := func(ptr interface{}) { o.Port = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Port, _s_pPort, _ptr_pPort); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPortsRequest structure represents the RpcEnumPorts operation request
type EnumPortsRequest struct {
	// pName: A parameter specified in Print Server Name Parameters, section 3.1.4.1.4.
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// Level: The port information level.
	//
	//	+------------+--------------------------------------------------+
	//	|            |                                                  |
	//	|   VALUE    |                   DESCRIPTION                    |
	//	|            |                                                  |
	//	+------------+--------------------------------------------------+
	//	+------------+--------------------------------------------------+
	//	| 0x00000001 | Corresponds to _PORT_INFO_1 (section 2.2.2.8.1). |
	//	+------------+--------------------------------------------------+
	//	| 0x00000002 | Corresponds to _PORT_INFO_2 (section 2.2.2.8.2). |
	//	+------------+--------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pPort: A pointer to the BUFFER, as specified in INFO Structures Query Parameters,
	// section 3.1.4.1.9.
	Port []byte `idl:"name:pPort;size_is:(cbBuf);pointer:unique" json:"port"`
	// cbBuf: A parameter specified in INFO Structures Query Parameters.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumPortsRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPortsOperation) *xxx_EnumPortsOperation {
	if op == nil {
		op = &xxx_EnumPortsOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Level = o.Level
	op.Port = o.Port
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumPortsRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPortsOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Level = op.Level
	o.Port = op.Port
	o.BufferLength = op.BufferLength
}
func (o *EnumPortsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPortsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPortsOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPortsResponse structure represents the RpcEnumPorts operation response
type EnumPortsResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pPort: A pointer to the BUFFER, as specified in INFO Structures Query Parameters,
	// section 3.1.4.1.9.
	Port []byte `idl:"name:pPort;size_is:(cbBuf);pointer:unique" json:"port"`
	// pcbNeeded: A parameter specified in INFO Structures Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: A parameter specified in INFO Structures Query Parameters.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumPorts return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPortsResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPortsOperation) *xxx_EnumPortsOperation {
	if op == nil {
		op = &xxx_EnumPortsOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Port = o.Port
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumPortsResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPortsOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Port = op.Port
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumPortsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPortsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPortsOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumMonitorsOperation structure represents the RpcEnumMonitors operation
type xxx_EnumMonitorsOperation struct {
	Name          string `idl:"name:pName;string;pointer:unique" json:"name"`
	Level         uint32 `idl:"name:Level" json:"level"`
	Monitor       []byte `idl:"name:pMonitor;size_is:(cbBuf);pointer:unique" json:"monitor"`
	BufferLength  uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumMonitorsOperation) OpNum() int { return 36 }

func (o *xxx_EnumMonitorsOperation) OpName() string { return "/winspool/v1/RpcEnumMonitors" }

func (o *xxx_EnumMonitorsOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Monitor != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Monitor))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumMonitorsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pMonitor {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Monitor != nil || o.BufferLength > 0 {
			_ptr_pMonitor := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Monitor {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Monitor[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Monitor); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Monitor, _ptr_pMonitor); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumMonitorsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pMonitor {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pMonitor := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Monitor", sizeInfo[0])
			}
			o.Monitor = make([]byte, sizeInfo[0])
			for i1 := range o.Monitor {
				i1 := i1
				if err := w.ReadData(&o.Monitor[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pMonitor := func(ptr interface{}) { o.Monitor = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Monitor, _s_pMonitor, _ptr_pMonitor); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumMonitorsOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumMonitorsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pMonitor {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Monitor != nil || o.BufferLength > 0 {
			_ptr_pMonitor := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Monitor {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Monitor[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Monitor); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Monitor, _ptr_pMonitor); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumMonitorsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pMonitor {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pMonitor := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Monitor", sizeInfo[0])
			}
			o.Monitor = make([]byte, sizeInfo[0])
			for i1 := range o.Monitor {
				i1 := i1
				if err := w.ReadData(&o.Monitor[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pMonitor := func(ptr interface{}) { o.Monitor = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Monitor, _s_pMonitor, _ptr_pMonitor); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumMonitorsRequest structure represents the RpcEnumMonitors operation request
type EnumMonitorsRequest struct {
	// pName: This parameter MUST adhere to the parameter specification in Print Server
	// Name Parameters, section 3.1.4.1.4.
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// Level: This value refers to the level of port monitor information structure, as follows.
	//
	//	+------------+-----------------------------------------------------+
	//	|            |                                                     |
	//	|   VALUE    |                     DESCRIPTION                     |
	//	|            |                                                     |
	//	+------------+-----------------------------------------------------+
	//	+------------+-----------------------------------------------------+
	//	| 0x00000001 | Corresponds to _MONITOR_INFO_1 (section 2.2.2.7.1). |
	//	+------------+-----------------------------------------------------+
	//	| 0x00000002 | Corresponds to _MONITOR_INFO_2 (section 2.2.2.7.2). |
	//	+------------+-----------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pMonitor: This parameter SHOULD be ignored if cbBuf equals zero; otherwise, it is
	// a pointer to the BUFFER, as specified in INFO Structures Query Parameters, section
	// 3.1.4.1.9.
	Monitor []byte `idl:"name:pMonitor;size_is:(cbBuf);pointer:unique" json:"monitor"`
	// cbBuf: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumMonitorsRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumMonitorsOperation) *xxx_EnumMonitorsOperation {
	if op == nil {
		op = &xxx_EnumMonitorsOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Level = o.Level
	op.Monitor = o.Monitor
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumMonitorsRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumMonitorsOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Level = op.Level
	o.Monitor = op.Monitor
	o.BufferLength = op.BufferLength
}
func (o *EnumMonitorsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumMonitorsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumMonitorsOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumMonitorsResponse structure represents the RpcEnumMonitors operation response
type EnumMonitorsResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pMonitor: This parameter SHOULD be ignored if cbBuf equals zero; otherwise, it is
	// a pointer to the BUFFER, as specified in INFO Structures Query Parameters, section
	// 3.1.4.1.9.
	Monitor []byte `idl:"name:pMonitor;size_is:(cbBuf);pointer:unique" json:"monitor"`
	// pcbNeeded: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumMonitors return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumMonitorsResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumMonitorsOperation) *xxx_EnumMonitorsOperation {
	if op == nil {
		op = &xxx_EnumMonitorsOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Monitor = o.Monitor
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumMonitorsResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumMonitorsOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Monitor = op.Monitor
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumMonitorsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumMonitorsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumMonitorsOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePortOperation structure represents the RpcDeletePort operation
type xxx_DeletePortOperation struct {
	Name     string `idl:"name:pName;string;pointer:unique" json:"name"`
	Wnd      uint64 `idl:"name:hWnd" json:"wnd"`
	PortName string `idl:"name:pPortName;string" json:"port_name"`
	Return   uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePortOperation) OpNum() int { return 39 }

func (o *xxx_DeletePortOperation) OpName() string { return "/winspool/v1/RpcDeletePort" }

func (o *xxx_DeletePortOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePortOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// hWnd {in} (1:{alias=ULONG_PTR}(uint32_64))
	{
		if err := w.WriteData(ndr.Uint3264(o.Wnd)); err != nil {
			return err
		}
	}
	// pPortName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePortOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// hWnd {in} (1:{alias=ULONG_PTR}(uint32_64))
	{
		if err := w.ReadData((*ndr.Uint3264)(&o.Wnd)); err != nil {
			return err
		}
	}
	// pPortName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePortOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePortOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePortOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePortRequest structure represents the RpcDeletePort operation request
type DeletePortRequest struct {
	// pName: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// hWnd: The value of this parameter SHOULD be set to zero when sent and MUST be ignored
	// on receipt.
	Wnd uint64 `idl:"name:hWnd" json:"wnd"`
	// pPortName: A pointer to a string that specifies the name of the port that is deleted.
	// For rules governing port names, see section 2.2.4.10.
	PortName string `idl:"name:pPortName;string" json:"port_name"`
}

func (o *DeletePortRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePortOperation) *xxx_DeletePortOperation {
	if op == nil {
		op = &xxx_DeletePortOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Wnd = o.Wnd
	op.PortName = o.PortName
	return op
}

func (o *DeletePortRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePortOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Wnd = op.Wnd
	o.PortName = op.PortName
}
func (o *DeletePortRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePortRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePortOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePortResponse structure represents the RpcDeletePort operation response
type DeletePortResponse struct {
	// Return: The RpcDeletePort return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePortResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePortOperation) *xxx_DeletePortOperation {
	if op == nil {
		op = &xxx_DeletePortOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePortResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePortOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePortResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePortResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePortOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_CreatePrinterICOperation structure represents the RpcCreatePrinterIC operation
type xxx_CreatePrinterICOperation struct {
	Printer          *Printer          `idl:"name:hPrinter" json:"printer"`
	Handle           *GDI              `idl:"name:pHandle" json:"handle"`
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_CreatePrinterICOperation) OpNum() int { return 40 }

func (o *xxx_CreatePrinterICOperation) OpName() string { return "/winspool/v1/RpcCreatePrinterIC" }

func (o *xxx_CreatePrinterICOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreatePrinterICOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreatePrinterICOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreatePrinterICOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreatePrinterICOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle != nil {
			if err := o.Handle.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&GDI{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreatePrinterICOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle == nil {
			o.Handle = &GDI{}
		}
		if err := o.Handle.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// CreatePrinterICRequest structure represents the RpcCreatePrinterIC operation request
type CreatePrinterICRequest struct {
	// hPrinter: A handle to a printer object (section 2.2.1.1.4) that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters (section
	// 3.1.4.1.8.1).
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
}

func (o *CreatePrinterICRequest) xxx_ToOp(ctx context.Context, op *xxx_CreatePrinterICOperation) *xxx_CreatePrinterICOperation {
	if op == nil {
		op = &xxx_CreatePrinterICOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.DevModeContainer = o.DevModeContainer
	return op
}

func (o *CreatePrinterICRequest) xxx_FromOp(ctx context.Context, op *xxx_CreatePrinterICOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.DevModeContainer = op.DevModeContainer
}
func (o *CreatePrinterICRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *CreatePrinterICRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_CreatePrinterICOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// CreatePrinterICResponse structure represents the RpcCreatePrinterIC operation response
type CreatePrinterICResponse struct {
	// pHandle: A pointer to a printer information context handle (section 2.2.1.1.2).
	Handle *GDI `idl:"name:pHandle" json:"handle"`
	// Return: The RpcCreatePrinterIC return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *CreatePrinterICResponse) xxx_ToOp(ctx context.Context, op *xxx_CreatePrinterICOperation) *xxx_CreatePrinterICOperation {
	if op == nil {
		op = &xxx_CreatePrinterICOperation{}
	}
	if o == nil {
		return op
	}
	op.Handle = o.Handle
	op.Return = o.Return
	return op
}

func (o *CreatePrinterICResponse) xxx_FromOp(ctx context.Context, op *xxx_CreatePrinterICOperation) {
	if o == nil {
		return
	}
	o.Handle = op.Handle
	o.Return = op.Return
}
func (o *CreatePrinterICResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *CreatePrinterICResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_CreatePrinterICOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_PlayGDIScriptOnPrinterICOperation structure represents the RpcPlayGdiScriptOnPrinterIC operation
type xxx_PlayGDIScriptOnPrinterICOperation struct {
	PrinterIC *GDI   `idl:"name:hPrinterIC" json:"printer_ic"`
	In        []byte `idl:"name:pIn;size_is:(cIn)" json:"in"`
	InCount   uint32 `idl:"name:cIn" json:"in_count"`
	Out       []byte `idl:"name:pOut;size_is:(cOut)" json:"out"`
	OutCount  uint32 `idl:"name:cOut" json:"out_count"`
	Ul        uint32 `idl:"name:ul" json:"ul"`
	Return    uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) OpNum() int { return 41 }

func (o *xxx_PlayGDIScriptOnPrinterICOperation) OpName() string {
	return "/winspool/v1/RpcPlayGdiScriptOnPrinterIC"
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.In != nil && o.InCount == 0 {
		o.InCount = uint32(len(o.In))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinterIC {in} (1:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterIC != nil {
			if err := o.PrinterIC.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&GDI{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pIn {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cIn](uchar))
	{
		dimSize1 := uint64(o.InCount)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.In {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.In[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.In); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// cIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.InCount); err != nil {
			return err
		}
	}
	// cOut {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.OutCount); err != nil {
			return err
		}
	}
	// ul {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Ul); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinterIC {in} (1:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterIC == nil {
			o.PrinterIC = &GDI{}
		}
		if err := o.PrinterIC.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pIn {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cIn](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.In", sizeInfo[0])
		}
		o.In = make([]byte, sizeInfo[0])
		for i1 := range o.In {
			i1 := i1
			if err := w.ReadData(&o.In[i1]); err != nil {
				return err
			}
		}
	}
	// cIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.InCount); err != nil {
			return err
		}
	}
	// cOut {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.OutCount); err != nil {
			return err
		}
	}
	// ul {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Ul); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pOut {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cOut](uchar))
	{
		dimSize1 := uint64(o.OutCount)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Out {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Out[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Out); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_PlayGDIScriptOnPrinterICOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pOut {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cOut](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Out", sizeInfo[0])
		}
		o.Out = make([]byte, sizeInfo[0])
		for i1 := range o.Out {
			i1 := i1
			if err := w.ReadData(&o.Out[i1]); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// PlayGDIScriptOnPrinterICRequest structure represents the RpcPlayGdiScriptOnPrinterIC operation request
type PlayGDIScriptOnPrinterICRequest struct {
	// hPrinterIC: A printer information context handle (section 2.2.1.1.2) that was returned
	// by RpcCreatePrinterIC (section 3.1.4.2.10).
	PrinterIC *GDI `idl:"name:hPrinterIC" json:"printer_ic"`
	// pIn: A pointer that SHOULD be set to NULL when sent and MUST be ignored on receipt.
	In []byte `idl:"name:pIn;size_is:(cIn)" json:"in"`
	// cIn: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.
	InCount uint32 `idl:"name:cIn" json:"in_count"`
	// cOut: The size, in bytes, of the buffer pointed to by pOut.
	OutCount uint32 `idl:"name:cOut" json:"out_count"`
	// ul: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.
	Ul uint32 `idl:"name:ul" json:"ul"`
}

func (o *PlayGDIScriptOnPrinterICRequest) xxx_ToOp(ctx context.Context, op *xxx_PlayGDIScriptOnPrinterICOperation) *xxx_PlayGDIScriptOnPrinterICOperation {
	if op == nil {
		op = &xxx_PlayGDIScriptOnPrinterICOperation{}
	}
	if o == nil {
		return op
	}
	op.PrinterIC = o.PrinterIC
	op.In = o.In
	op.InCount = o.InCount
	op.OutCount = o.OutCount
	op.Ul = o.Ul
	return op
}

func (o *PlayGDIScriptOnPrinterICRequest) xxx_FromOp(ctx context.Context, op *xxx_PlayGDIScriptOnPrinterICOperation) {
	if o == nil {
		return
	}
	o.PrinterIC = op.PrinterIC
	o.In = op.In
	o.InCount = op.InCount
	o.OutCount = op.OutCount
	o.Ul = op.Ul
}
func (o *PlayGDIScriptOnPrinterICRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *PlayGDIScriptOnPrinterICRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_PlayGDIScriptOnPrinterICOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// PlayGDIScriptOnPrinterICResponse structure represents the RpcPlayGdiScriptOnPrinterIC operation response
type PlayGDIScriptOnPrinterICResponse struct {
	// XXX: cOut is an implicit input depedency for output parameters
	OutCount uint32 `idl:"name:cOut" json:"out_count"`

	// pOut: A pointer to a buffer, the size and contents of which are determined by the
	// value of the cOut parameter.
	Out []byte `idl:"name:pOut;size_is:(cOut)" json:"out"`
	// Return: The RpcPlayGdiScriptOnPrinterIC return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *PlayGDIScriptOnPrinterICResponse) xxx_ToOp(ctx context.Context, op *xxx_PlayGDIScriptOnPrinterICOperation) *xxx_PlayGDIScriptOnPrinterICOperation {
	if op == nil {
		op = &xxx_PlayGDIScriptOnPrinterICOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.OutCount == uint32(0) {
		op.OutCount = o.OutCount
	}

	op.Out = o.Out
	op.Return = o.Return
	return op
}

func (o *PlayGDIScriptOnPrinterICResponse) xxx_FromOp(ctx context.Context, op *xxx_PlayGDIScriptOnPrinterICOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.OutCount = op.OutCount

	o.Out = op.Out
	o.Return = op.Return
}
func (o *PlayGDIScriptOnPrinterICResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *PlayGDIScriptOnPrinterICResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_PlayGDIScriptOnPrinterICOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterICOperation structure represents the RpcDeletePrinterIC operation
type xxx_DeletePrinterICOperation struct {
	PrinterIC *GDI   `idl:"name:phPrinterIC" json:"printer_ic"`
	Return    uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterICOperation) OpNum() int { return 42 }

func (o *xxx_DeletePrinterICOperation) OpName() string { return "/winspool/v1/RpcDeletePrinterIC" }

func (o *xxx_DeletePrinterICOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterICOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// phPrinterIC {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterIC != nil {
			if err := o.PrinterIC.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&GDI{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_DeletePrinterICOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// phPrinterIC {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterIC == nil {
			o.PrinterIC = &GDI{}
		}
		if err := o.PrinterIC.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterICOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterICOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// phPrinterIC {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterIC != nil {
			if err := o.PrinterIC.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&GDI{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterICOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// phPrinterIC {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=GDI_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterIC == nil {
			o.PrinterIC = &GDI{}
		}
		if err := o.PrinterIC.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterICRequest structure represents the RpcDeletePrinterIC operation request
type DeletePrinterICRequest struct {
	// phPrinterIC: A pointer to a printer information context handle (section 2.2.1.1.2)
	// that was returned by RpcCreatePrinterIC (section 3.1.4.2.10).
	PrinterIC *GDI `idl:"name:phPrinterIC" json:"printer_ic"`
}

func (o *DeletePrinterICRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterICOperation) *xxx_DeletePrinterICOperation {
	if op == nil {
		op = &xxx_DeletePrinterICOperation{}
	}
	if o == nil {
		return op
	}
	op.PrinterIC = o.PrinterIC
	return op
}

func (o *DeletePrinterICRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterICOperation) {
	if o == nil {
		return
	}
	o.PrinterIC = op.PrinterIC
}
func (o *DeletePrinterICRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterICRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterICOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterICResponse structure represents the RpcDeletePrinterIC operation response
type DeletePrinterICResponse struct {
	// phPrinterIC: A pointer to a printer information context handle (section 2.2.1.1.2)
	// that was returned by RpcCreatePrinterIC (section 3.1.4.2.10).
	PrinterIC *GDI `idl:"name:phPrinterIC" json:"printer_ic"`
	// Return: The RpcDeletePrinterIC return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterICResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterICOperation) *xxx_DeletePrinterICOperation {
	if op == nil {
		op = &xxx_DeletePrinterICOperation{}
	}
	if o == nil {
		return op
	}
	op.PrinterIC = o.PrinterIC
	op.Return = o.Return
	return op
}

func (o *DeletePrinterICResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterICOperation) {
	if o == nil {
		return
	}
	o.PrinterIC = op.PrinterIC
	o.Return = op.Return
}
func (o *DeletePrinterICResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterICResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterICOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddMonitorOperation structure represents the RpcAddMonitor operation
type xxx_AddMonitorOperation struct {
	Name             string            `idl:"name:Name;string;pointer:unique" json:"name"`
	MonitorContainer *MonitorContainer `idl:"name:pMonitorContainer" json:"monitor_container"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_AddMonitorOperation) OpNum() int { return 46 }

func (o *xxx_AddMonitorOperation) OpName() string { return "/winspool/v1/RpcAddMonitor" }

func (o *xxx_AddMonitorOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddMonitorOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_Name := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_Name); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pMonitorContainer {in} (1:{pointer=ref}*(1))(2:{alias=MONITOR_CONTAINER}(struct))
	{
		if o.MonitorContainer != nil {
			if err := o.MonitorContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&MonitorContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddMonitorOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_Name := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_Name := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_Name, _ptr_Name); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pMonitorContainer {in} (1:{pointer=ref}*(1))(2:{alias=MONITOR_CONTAINER}(struct))
	{
		if o.MonitorContainer == nil {
			o.MonitorContainer = &MonitorContainer{}
		}
		if err := o.MonitorContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddMonitorOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddMonitorOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddMonitorOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddMonitorRequest structure represents the RpcAddMonitor operation request
type AddMonitorRequest struct {
	// Name: A parameter that adheres to the specification in Print Server Name Parameters
	// (section 3.1.4.1.4).
	Name string `idl:"name:Name;string;pointer:unique" json:"name"`
	// pMonitorContainer: A parameter that adheres to the specification in MONITOR_CONTAINER
	// Parameters (section 3.1.4.1.8.9). The Level member of the MONITOR_CONTAINER MUST
	// be 0x00000002.
	MonitorContainer *MonitorContainer `idl:"name:pMonitorContainer" json:"monitor_container"`
}

func (o *AddMonitorRequest) xxx_ToOp(ctx context.Context, op *xxx_AddMonitorOperation) *xxx_AddMonitorOperation {
	if op == nil {
		op = &xxx_AddMonitorOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.MonitorContainer = o.MonitorContainer
	return op
}

func (o *AddMonitorRequest) xxx_FromOp(ctx context.Context, op *xxx_AddMonitorOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.MonitorContainer = op.MonitorContainer
}
func (o *AddMonitorRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddMonitorRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddMonitorOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddMonitorResponse structure represents the RpcAddMonitor operation response
type AddMonitorResponse struct {
	// Return: The RpcAddMonitor return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddMonitorResponse) xxx_ToOp(ctx context.Context, op *xxx_AddMonitorOperation) *xxx_AddMonitorOperation {
	if op == nil {
		op = &xxx_AddMonitorOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddMonitorResponse) xxx_FromOp(ctx context.Context, op *xxx_AddMonitorOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddMonitorResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddMonitorResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddMonitorOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeleteMonitorOperation structure represents the RpcDeleteMonitor operation
type xxx_DeleteMonitorOperation struct {
	Name        string `idl:"name:Name;string;pointer:unique" json:"name"`
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	MonitorName string `idl:"name:pMonitorName;string" json:"monitor_name"`
	Return      uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeleteMonitorOperation) OpNum() int { return 47 }

func (o *xxx_DeleteMonitorOperation) OpName() string { return "/winspool/v1/RpcDeleteMonitor" }

func (o *xxx_DeleteMonitorOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteMonitorOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_Name := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_Name); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pMonitorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteMonitorOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_Name := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_Name := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_Name, _ptr_Name); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pMonitorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteMonitorOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteMonitorOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteMonitorOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeleteMonitorRequest structure represents the RpcDeleteMonitor operation request
type DeleteMonitorRequest struct {
	// Name: This parameter MUST adhere to the parameter specification in Print Server Name
	// Parameters, section 3.1.4.1.4.
	Name string `idl:"name:Name;string;pointer:unique" json:"name"`
	// pEnvironment: This parameter MUST adhere to the parameter specification in Environment
	// Name Parameters, section 3.1.4.1.3.
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// pMonitorName: A pointer to a string that specifies the name of the monitor to remove.
	// For rules governing monitor names, see section 2.2.4.8.
	MonitorName string `idl:"name:pMonitorName;string" json:"monitor_name"`
}

func (o *DeleteMonitorRequest) xxx_ToOp(ctx context.Context, op *xxx_DeleteMonitorOperation) *xxx_DeleteMonitorOperation {
	if op == nil {
		op = &xxx_DeleteMonitorOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.MonitorName = o.MonitorName
	return op
}

func (o *DeleteMonitorRequest) xxx_FromOp(ctx context.Context, op *xxx_DeleteMonitorOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.MonitorName = op.MonitorName
}
func (o *DeleteMonitorRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeleteMonitorRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeleteMonitorOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeleteMonitorResponse structure represents the RpcDeleteMonitor operation response
type DeleteMonitorResponse struct {
	// Return: The RpcDeleteMonitor return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeleteMonitorResponse) xxx_ToOp(ctx context.Context, op *xxx_DeleteMonitorOperation) *xxx_DeleteMonitorOperation {
	if op == nil {
		op = &xxx_DeleteMonitorOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeleteMonitorResponse) xxx_FromOp(ctx context.Context, op *xxx_DeleteMonitorOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeleteMonitorResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeleteMonitorResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeleteMonitorOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrintProcessorOperation structure represents the RpcDeletePrintProcessor operation
type xxx_DeletePrintProcessorOperation struct {
	Name               string `idl:"name:Name;string;pointer:unique" json:"name"`
	Environment        string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	PrintProcessorName string `idl:"name:pPrintProcessorName;string" json:"print_processor_name"`
	Return             uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrintProcessorOperation) OpNum() int { return 48 }

func (o *xxx_DeletePrintProcessorOperation) OpName() string {
	return "/winspool/v1/RpcDeletePrintProcessor"
}

func (o *xxx_DeletePrintProcessorOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrintProcessorOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_Name := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_Name); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrintProcessorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrintProcessorOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// Name {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_Name := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_Name := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_Name, _ptr_Name); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrintProcessorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrintProcessorOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrintProcessorOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrintProcessorOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrintProcessorRequest structure represents the RpcDeletePrintProcessor operation request
type DeletePrintProcessorRequest struct {
	// Name: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:Name;string;pointer:unique" json:"name"`
	// pEnvironment: A parameter specified in Environment Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// pPrintProcessorName: A pointer to a string that specifies the name of the print processor
	// that is removed. For rules governing print processor names, see Print Processor Names
	// (section 2.2.4.11).
	PrintProcessorName string `idl:"name:pPrintProcessorName;string" json:"print_processor_name"`
}

func (o *DeletePrintProcessorRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrintProcessorOperation) *xxx_DeletePrintProcessorOperation {
	if op == nil {
		op = &xxx_DeletePrintProcessorOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.PrintProcessorName = o.PrintProcessorName
	return op
}

func (o *DeletePrintProcessorRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrintProcessorOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.PrintProcessorName = op.PrintProcessorName
}
func (o *DeletePrintProcessorRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrintProcessorRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrintProcessorOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrintProcessorResponse structure represents the RpcDeletePrintProcessor operation response
type DeletePrintProcessorResponse struct {
	// Return: The RpcDeletePrintProcessor return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrintProcessorResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrintProcessorOperation) *xxx_DeletePrintProcessorOperation {
	if op == nil {
		op = &xxx_DeletePrintProcessorOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrintProcessorResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrintProcessorOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrintProcessorResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrintProcessorResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrintProcessorOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPrintProcessorDataTypesOperation structure represents the RpcEnumPrintProcessorDatatypes operation
type xxx_EnumPrintProcessorDataTypesOperation struct {
	Name               string `idl:"name:pName;string;pointer:unique" json:"name"`
	PrintProcessorName string `idl:"name:pPrintProcessorName;string;pointer:unique" json:"print_processor_name"`
	Level              uint32 `idl:"name:Level" json:"level"`
	DataTypes          []byte `idl:"name:pDatatypes;size_is:(cbBuf);pointer:unique" json:"data_types"`
	BufferLength       uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength       uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount      uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return             uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) OpNum() int { return 51 }

func (o *xxx_EnumPrintProcessorDataTypesOperation) OpName() string {
	return "/winspool/v1/RpcEnumPrintProcessorDatatypes"
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.DataTypes != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.DataTypes))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrintProcessorName {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.PrintProcessorName != "" {
			_ptr_pPrintProcessorName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.PrintProcessorName); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.PrintProcessorName, _ptr_pPrintProcessorName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pDatatypes {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.DataTypes != nil || o.BufferLength > 0 {
			_ptr_pDatatypes := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.DataTypes {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.DataTypes[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.DataTypes); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.DataTypes, _ptr_pDatatypes); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrintProcessorName {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pPrintProcessorName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.PrintProcessorName); err != nil {
				return err
			}
			return nil
		})
		_s_pPrintProcessorName := func(ptr interface{}) { o.PrintProcessorName = *ptr.(*string) }
		if err := w.ReadPointer(&o.PrintProcessorName, _s_pPrintProcessorName, _ptr_pPrintProcessorName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pDatatypes {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDatatypes := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.DataTypes", sizeInfo[0])
			}
			o.DataTypes = make([]byte, sizeInfo[0])
			for i1 := range o.DataTypes {
				i1 := i1
				if err := w.ReadData(&o.DataTypes[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDatatypes := func(ptr interface{}) { o.DataTypes = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.DataTypes, _s_pDatatypes, _ptr_pDatatypes); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pDatatypes {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.DataTypes != nil || o.BufferLength > 0 {
			_ptr_pDatatypes := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.DataTypes {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.DataTypes[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.DataTypes); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.DataTypes, _ptr_pDatatypes); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrintProcessorDataTypesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pDatatypes {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDatatypes := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.DataTypes", sizeInfo[0])
			}
			o.DataTypes = make([]byte, sizeInfo[0])
			for i1 := range o.DataTypes {
				i1 := i1
				if err := w.ReadData(&o.DataTypes[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDatatypes := func(ptr interface{}) { o.DataTypes = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.DataTypes, _s_pDatatypes, _ptr_pDatatypes); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrintProcessorDataTypesRequest structure represents the RpcEnumPrintProcessorDatatypes operation request
type EnumPrintProcessorDataTypesRequest struct {
	// pName: This parameter MUST adhere to the parameter specification in Print Server
	// Name Parameters, section 3.1.4.1.4.
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pPrintProcessorName: A pointer to a string that specifies the name of the print processor
	// whose data types MUST be enumerated. For rules governing print processor names, see
	// section 2.2.4.11.
	PrintProcessorName string `idl:"name:pPrintProcessorName;string;pointer:unique" json:"print_processor_name"`
	// Level: The value of this parameter MUST be 0x00000001.
	Level uint32 `idl:"name:Level" json:"level"`
	// pDatatypes: This parameter MAY be NULL if cbBuf equals zero; otherwise, it is a pointer
	// to BUFFER as specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	DataTypes []byte `idl:"name:pDatatypes;size_is:(cbBuf);pointer:unique" json:"data_types"`
	// cbBuf: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumPrintProcessorDataTypesRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrintProcessorDataTypesOperation) *xxx_EnumPrintProcessorDataTypesOperation {
	if op == nil {
		op = &xxx_EnumPrintProcessorDataTypesOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.PrintProcessorName = o.PrintProcessorName
	op.Level = o.Level
	op.DataTypes = o.DataTypes
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumPrintProcessorDataTypesRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrintProcessorDataTypesOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.PrintProcessorName = op.PrintProcessorName
	o.Level = op.Level
	o.DataTypes = op.DataTypes
	o.BufferLength = op.BufferLength
}
func (o *EnumPrintProcessorDataTypesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrintProcessorDataTypesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrintProcessorDataTypesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrintProcessorDataTypesResponse structure represents the RpcEnumPrintProcessorDatatypes operation response
type EnumPrintProcessorDataTypesResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pDatatypes: This parameter MAY be NULL if cbBuf equals zero; otherwise, it is a pointer
	// to BUFFER as specified in INFO Structures Query Parameters, section 3.1.4.1.9.
	DataTypes []byte `idl:"name:pDatatypes;size_is:(cbBuf);pointer:unique" json:"data_types"`
	// pcbNeeded: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: This parameter MUST adhere to the parameter specification in INFO Structures
	// Query Parameters, section 3.1.4.1.9.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumPrintProcessorDatatypes return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrintProcessorDataTypesResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrintProcessorDataTypesOperation) *xxx_EnumPrintProcessorDataTypesOperation {
	if op == nil {
		op = &xxx_EnumPrintProcessorDataTypesOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.DataTypes = o.DataTypes
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumPrintProcessorDataTypesResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrintProcessorDataTypesOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.DataTypes = op.DataTypes
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumPrintProcessorDataTypesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrintProcessorDataTypesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrintProcessorDataTypesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_ResetPrinterOperation structure represents the RpcResetPrinter operation
type xxx_ResetPrinterOperation struct {
	Printer          *Printer          `idl:"name:hPrinter" json:"printer"`
	DataType         string            `idl:"name:pDatatype;string;pointer:unique" json:"data_type"`
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_ResetPrinterOperation) OpNum() int { return 52 }

func (o *xxx_ResetPrinterOperation) OpName() string { return "/winspool/v1/RpcResetPrinter" }

func (o *xxx_ResetPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ResetPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pDatatype {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.DataType != "" {
			_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ResetPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pDatatype {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
				return err
			}
			return nil
		})
		_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
		if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ResetPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ResetPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ResetPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// ResetPrinterRequest structure represents the RpcResetPrinter operation request
type ResetPrinterRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pDatatype: A parameter specified in Datatype Name Parameters (section 3.1.4.1.1).
	DataType string `idl:"name:pDatatype;string;pointer:unique" json:"data_type"`
	// pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters.
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
}

func (o *ResetPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_ResetPrinterOperation) *xxx_ResetPrinterOperation {
	if op == nil {
		op = &xxx_ResetPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.DataType = o.DataType
	op.DevModeContainer = o.DevModeContainer
	return op
}

func (o *ResetPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_ResetPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.DataType = op.DataType
	o.DevModeContainer = op.DevModeContainer
}
func (o *ResetPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *ResetPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ResetPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// ResetPrinterResponse structure represents the RpcResetPrinter operation response
type ResetPrinterResponse struct {
	// Return: The RpcResetPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *ResetPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_ResetPrinterOperation) *xxx_ResetPrinterOperation {
	if op == nil {
		op = &xxx_ResetPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *ResetPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_ResetPrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *ResetPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *ResetPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ResetPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterDriver2Operation structure represents the RpcGetPrinterDriver2 operation
type xxx_GetPrinterDriver2Operation struct {
	Printer            *Printer `idl:"name:hPrinter" json:"printer"`
	Environment        string   `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	Level              uint32   `idl:"name:Level" json:"level"`
	Driver             []byte   `idl:"name:pDriver;size_is:(cbBuf);pointer:unique" json:"driver"`
	BufferLength       uint32   `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength       uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	ClientMajorVersion uint32   `idl:"name:dwClientMajorVersion" json:"client_major_version"`
	ClientMinorVersion uint32   `idl:"name:dwClientMinorVersion" json:"client_minor_version"`
	ServerMaxVersion   uint32   `idl:"name:pdwServerMaxVersion" json:"server_max_version"`
	ServerMinVersion   uint32   `idl:"name:pdwServerMinVersion" json:"server_min_version"`
	Return             uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterDriver2Operation) OpNum() int { return 53 }

func (o *xxx_GetPrinterDriver2Operation) OpName() string { return "/winspool/v1/RpcGetPrinterDriver2" }

func (o *xxx_GetPrinterDriver2Operation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Driver != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Driver))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriver2Operation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Environment != "" {
			_ptr_pEnvironment := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Environment, _ptr_pEnvironment); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Level); err != nil {
			return err
		}
	}
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Driver != nil || o.BufferLength > 0 {
			_ptr_pDriver := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Driver {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Driver[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Driver); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Driver, _ptr_pDriver); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	// dwClientMajorVersion {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ClientMajorVersion); err != nil {
			return err
		}
	}
	// dwClientMinorVersion {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ClientMinorVersion); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriver2Operation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pEnvironment := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
				return err
			}
			return nil
		})
		_s_pEnvironment := func(ptr interface{}) { o.Environment = *ptr.(*string) }
		if err := w.ReadPointer(&o.Environment, _s_pEnvironment, _ptr_pEnvironment); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Level {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Level); err != nil {
			return err
		}
	}
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDriver := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Driver", sizeInfo[0])
			}
			o.Driver = make([]byte, sizeInfo[0])
			for i1 := range o.Driver {
				i1 := i1
				if err := w.ReadData(&o.Driver[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDriver := func(ptr interface{}) { o.Driver = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Driver, _s_pDriver, _ptr_pDriver); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	// dwClientMajorVersion {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ClientMajorVersion); err != nil {
			return err
		}
	}
	// dwClientMinorVersion {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ClientMinorVersion); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriver2Operation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriver2Operation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.Driver != nil || o.BufferLength > 0 {
			_ptr_pDriver := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Driver {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Driver[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Driver); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Driver, _ptr_pDriver); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pdwServerMaxVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ServerMaxVersion); err != nil {
			return err
		}
	}
	// pdwServerMinVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ServerMinVersion); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriver2Operation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pDriver {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pDriver := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Driver", sizeInfo[0])
			}
			o.Driver = make([]byte, sizeInfo[0])
			for i1 := range o.Driver {
				i1 := i1
				if err := w.ReadData(&o.Driver[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pDriver := func(ptr interface{}) { o.Driver = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Driver, _s_pDriver, _ptr_pDriver); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pdwServerMaxVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ServerMaxVersion); err != nil {
			return err
		}
	}
	// pdwServerMinVersion {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ServerMinVersion); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterDriver2Request structure represents the RpcGetPrinterDriver2 operation request
type GetPrinterDriver2Request struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pEnvironment: A parameter specified in Environment Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string;pointer:unique" json:"environment"`
	// Level: The driver information level.
	//
	//	+------------+------------------------------------------------------+
	//	|            |                                                      |
	//	|   VALUE    |                     DESCRIPTION                      |
	//	|            |                                                      |
	//	+------------+------------------------------------------------------+
	//	+------------+------------------------------------------------------+
	//	| 0x00000001 | Corresponds to _DRIVER_INFO_1 (section 2.2.2.4.1).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000002 | Corresponds to _DRIVER_INFO_2 (section 2.2.2.4.2).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000003 | Corresponds to _DRIVER_INFO_3 (section 2.2.2.4.3).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000004 | Corresponds to _DRIVER_INFO_4 (section 2.2.2.4.4).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000005 | Corresponds to _DRIVER_INFO_5 (section 2.2.2.4.5).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000006 | Corresponds to _DRIVER_INFO_6 (section 2.2.2.4.6).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000008 | Corresponds to _DRIVER_INFO_8 (section 2.2.2.4.8).   |
	//	+------------+------------------------------------------------------+
	//	| 0x00000065 | Corresponds to _DRIVER_INFO_101 (section 2.2.2.4.9). |
	//	+------------+------------------------------------------------------+
	Level uint32 `idl:"name:Level" json:"level"`
	// pDriver: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Driver []byte `idl:"name:pDriver;size_is:(cbBuf);pointer:unique" json:"driver"`
	// cbBuf: A parameter specified in INFO Structures Query Parameters.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// dwClientMajorVersion: The implementation-specific major printer driver version of
	// the client operating system.<335>
	ClientMajorVersion uint32 `idl:"name:dwClientMajorVersion" json:"client_major_version"`
	// dwClientMinorVersion: The implementation-specific minor printer driver version of
	// the client operating system.<336>
	ClientMinorVersion uint32 `idl:"name:dwClientMinorVersion" json:"client_minor_version"`
}

func (o *GetPrinterDriver2Request) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriver2Operation) *xxx_GetPrinterDriver2Operation {
	if op == nil {
		op = &xxx_GetPrinterDriver2Operation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Environment = o.Environment
	op.Level = o.Level
	op.Driver = o.Driver
	op.BufferLength = o.BufferLength
	op.ClientMajorVersion = o.ClientMajorVersion
	op.ClientMinorVersion = o.ClientMinorVersion
	return op
}

func (o *GetPrinterDriver2Request) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriver2Operation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Environment = op.Environment
	o.Level = op.Level
	o.Driver = op.Driver
	o.BufferLength = op.BufferLength
	o.ClientMajorVersion = op.ClientMajorVersion
	o.ClientMinorVersion = op.ClientMinorVersion
}
func (o *GetPrinterDriver2Request) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterDriver2Request) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriver2Operation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterDriver2Response structure represents the RpcGetPrinterDriver2 operation response
type GetPrinterDriver2Response struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pDriver: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	Driver []byte `idl:"name:pDriver;size_is:(cbBuf);pointer:unique" json:"driver"`
	// pcbNeeded: A parameter specified in INFO Structures Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pdwServerMaxVersion: A pointer to a DWORD that receives the implementation-specific
	// major version that the operating system supports for that printer driver.
	ServerMaxVersion uint32 `idl:"name:pdwServerMaxVersion" json:"server_max_version"`
	// pdwServerMinVersion: A pointer to a DWORD that receives the implementation-specific
	// minimum version that the operating system supports for that printer driver.<337>
	ServerMinVersion uint32 `idl:"name:pdwServerMinVersion" json:"server_min_version"`
	// Return: The RpcGetPrinterDriver2 return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterDriver2Response) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriver2Operation) *xxx_GetPrinterDriver2Operation {
	if op == nil {
		op = &xxx_GetPrinterDriver2Operation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Driver = o.Driver
	op.NeededLength = o.NeededLength
	op.ServerMaxVersion = o.ServerMaxVersion
	op.ServerMinVersion = o.ServerMinVersion
	op.Return = o.Return
	return op
}

func (o *GetPrinterDriver2Response) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriver2Operation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Driver = op.Driver
	o.NeededLength = op.NeededLength
	o.ServerMaxVersion = op.ServerMaxVersion
	o.ServerMinVersion = op.ServerMinVersion
	o.Return = op.Return
}
func (o *GetPrinterDriver2Response) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterDriver2Response) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriver2Operation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_FindClosePrinterChangeNotificationOperation structure represents the RpcFindClosePrinterChangeNotification operation
type xxx_FindClosePrinterChangeNotificationOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) OpNum() int { return 56 }

func (o *xxx_FindClosePrinterChangeNotificationOperation) OpName() string {
	return "/winspool/v1/RpcFindClosePrinterChangeNotification"
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FindClosePrinterChangeNotificationOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// FindClosePrinterChangeNotificationRequest structure represents the RpcFindClosePrinterChangeNotification operation request
type FindClosePrinterChangeNotificationRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *FindClosePrinterChangeNotificationRequest) xxx_ToOp(ctx context.Context, op *xxx_FindClosePrinterChangeNotificationOperation) *xxx_FindClosePrinterChangeNotificationOperation {
	if op == nil {
		op = &xxx_FindClosePrinterChangeNotificationOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *FindClosePrinterChangeNotificationRequest) xxx_FromOp(ctx context.Context, op *xxx_FindClosePrinterChangeNotificationOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *FindClosePrinterChangeNotificationRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *FindClosePrinterChangeNotificationRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_FindClosePrinterChangeNotificationOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// FindClosePrinterChangeNotificationResponse structure represents the RpcFindClosePrinterChangeNotification operation response
type FindClosePrinterChangeNotificationResponse struct {
	// Return: The RpcFindClosePrinterChangeNotification return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *FindClosePrinterChangeNotificationResponse) xxx_ToOp(ctx context.Context, op *xxx_FindClosePrinterChangeNotificationOperation) *xxx_FindClosePrinterChangeNotificationOperation {
	if op == nil {
		op = &xxx_FindClosePrinterChangeNotificationOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *FindClosePrinterChangeNotificationResponse) xxx_FromOp(ctx context.Context, op *xxx_FindClosePrinterChangeNotificationOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *FindClosePrinterChangeNotificationResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *FindClosePrinterChangeNotificationResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_FindClosePrinterChangeNotificationOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_ReplyOpenPrinterOperation structure represents the RpcReplyOpenPrinter operation
type xxx_ReplyOpenPrinterOperation struct {
	Machine       string   `idl:"name:pMachine;string" json:"machine"`
	PrinterNotify *Printer `idl:"name:phPrinterNotify" json:"printer_notify"`
	PrinterRemote uint32   `idl:"name:dwPrinterRemote" json:"printer_remote"`
	Type          uint32   `idl:"name:dwType" json:"type"`
	BufferLength  uint32   `idl:"name:cbBuffer" json:"buffer_length"`
	Buffer        []byte   `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
	Return        uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_ReplyOpenPrinterOperation) OpNum() int { return 58 }

func (o *xxx_ReplyOpenPrinterOperation) OpName() string { return "/winspool/v1/RpcReplyOpenPrinter" }

func (o *xxx_ReplyOpenPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Buffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Buffer))
	}
	if o.BufferLength > uint32(512) {
		return fmt.Errorf("BufferLength is out of range")
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyOpenPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pMachine {in} (1:{handle, string, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Machine); err != nil {
			return err
		}
	}
	// dwPrinterRemote {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.PrinterRemote); err != nil {
			return err
		}
	}
	// dwType {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Type); err != nil {
			return err
		}
	}
	// cbBuffer {in} (1:{range=(0,512), alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	// pBuffer {in, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		if o.Buffer != nil || o.BufferLength > 0 {
			_ptr_pBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Buffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Buffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Buffer, _ptr_pBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyOpenPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pMachine {in} (1:{handle, string, alias=STRING_HANDLE,pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Machine); err != nil {
			return err
		}
	}
	// dwPrinterRemote {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.PrinterRemote); err != nil {
			return err
		}
	}
	// dwType {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Type); err != nil {
			return err
		}
	}
	// cbBuffer {in} (1:{range=(0,512), alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	// pBuffer {in, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		_ptr_pBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
			}
			o.Buffer = make([]byte, sizeInfo[0])
			for i1 := range o.Buffer {
				i1 := i1
				if err := w.ReadData(&o.Buffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pBuffer := func(ptr interface{}) { o.Buffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Buffer, _s_pBuffer, _ptr_pBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyOpenPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyOpenPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// phPrinterNotify {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterNotify != nil {
			if err := o.PrinterNotify.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyOpenPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// phPrinterNotify {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.PrinterNotify == nil {
			o.PrinterNotify = &Printer{}
		}
		if err := o.PrinterNotify.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// ReplyOpenPrinterRequest structure represents the RpcReplyOpenPrinter operation request
type ReplyOpenPrinterRequest struct {
	// pMachine: A string that specifies the print client computer name. It is synonymous
	// with pName, as specified in Print Server Name Parameters (section 3.1.4.1.4).
	Machine string `idl:"name:pMachine;string" json:"machine"`
	// dwPrinterRemote: A value that is supplied to the server by the dwPrinterLocal parameter
	// of a corresponding call to RpcRemoteFindFirstPrinterChangeNotification (section 3.1.4.10.3)
	// or RpcRemoteFindFirstPrinterChangeNotificationEx (section 3.1.4.10.4). This value
	// MUST NOT be zero.
	PrinterRemote uint32 `idl:"name:dwPrinterRemote" json:"printer_remote"`
	// dwType: A value that MUST be 0x00000001.
	Type uint32 `idl:"name:dwType" json:"type"`
	// cbBuffer: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.
	BufferLength uint32 `idl:"name:cbBuffer" json:"buffer_length"`
	// pBuffer: A pointer that SHOULD be set to NULL when sent and MUST be ignored on receipt.
	Buffer []byte `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
}

func (o *ReplyOpenPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_ReplyOpenPrinterOperation) *xxx_ReplyOpenPrinterOperation {
	if op == nil {
		op = &xxx_ReplyOpenPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Machine = o.Machine
	op.PrinterRemote = o.PrinterRemote
	op.Type = o.Type
	op.BufferLength = o.BufferLength
	op.Buffer = o.Buffer
	return op
}

func (o *ReplyOpenPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_ReplyOpenPrinterOperation) {
	if o == nil {
		return
	}
	o.Machine = op.Machine
	o.PrinterRemote = op.PrinterRemote
	o.Type = op.Type
	o.BufferLength = op.BufferLength
	o.Buffer = op.Buffer
}
func (o *ReplyOpenPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *ReplyOpenPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ReplyOpenPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// ReplyOpenPrinterResponse structure represents the RpcReplyOpenPrinter operation response
type ReplyOpenPrinterResponse struct {
	// phPrinterNotify: A pointer to a remote printer RPC context handle that is used by
	// a print server to send notifications to a print client. RPC context handles are specified
	// in [C706].
	PrinterNotify *Printer `idl:"name:phPrinterNotify" json:"printer_notify"`
	// Return: The RpcReplyOpenPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *ReplyOpenPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_ReplyOpenPrinterOperation) *xxx_ReplyOpenPrinterOperation {
	if op == nil {
		op = &xxx_ReplyOpenPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.PrinterNotify = o.PrinterNotify
	op.Return = o.Return
	return op
}

func (o *ReplyOpenPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_ReplyOpenPrinterOperation) {
	if o == nil {
		return
	}
	o.PrinterNotify = op.PrinterNotify
	o.Return = op.Return
}
func (o *ReplyOpenPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *ReplyOpenPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ReplyOpenPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_RouterReplyPrinterOperation structure represents the RpcRouterReplyPrinter operation
type xxx_RouterReplyPrinterOperation struct {
	Notify       *Printer `idl:"name:hNotify" json:"notify"`
	Flags        uint32   `idl:"name:fdwFlags" json:"flags"`
	BufferLength uint32   `idl:"name:cbBuffer" json:"buffer_length"`
	Buffer       []byte   `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_RouterReplyPrinterOperation) OpNum() int { return 59 }

func (o *xxx_RouterReplyPrinterOperation) OpName() string {
	return "/winspool/v1/RpcRouterReplyPrinter"
}

func (o *xxx_RouterReplyPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Buffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Buffer))
	}
	if o.BufferLength > uint32(512) {
		return fmt.Errorf("BufferLength is out of range")
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hNotify {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify != nil {
			if err := o.Notify.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Flags); err != nil {
			return err
		}
	}
	// cbBuffer {in} (1:{range=(0,512), alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	// pBuffer {in, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		if o.Buffer != nil || o.BufferLength > 0 {
			_ptr_pBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Buffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Buffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Buffer, _ptr_pBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hNotify {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify == nil {
			o.Notify = &Printer{}
		}
		if err := o.Notify.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Flags); err != nil {
			return err
		}
	}
	// cbBuffer {in} (1:{range=(0,512), alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	// pBuffer {in, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		_ptr_pBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
			}
			o.Buffer = make([]byte, sizeInfo[0])
			for i1 := range o.Buffer {
				i1 := i1
				if err := w.ReadData(&o.Buffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pBuffer := func(ptr interface{}) { o.Buffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Buffer, _s_pBuffer, _ptr_pBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// RouterReplyPrinterRequest structure represents the RpcRouterReplyPrinter operation request
type RouterReplyPrinterRequest struct {
	// hNotify: A notification handle that was opened by the server using RpcReplyOpenPrinter
	// (section 3.2.4.1.1).
	Notify *Printer `idl:"name:hNotify" json:"notify"`
	// fdwFlags: A value that contains Printer Change Flags (section 2.2.3.6), which indicate
	// changes in printer configuration values.
	Flags uint32 `idl:"name:fdwFlags" json:"flags"`
	// cbBuffer: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.
	BufferLength uint32 `idl:"name:cbBuffer" json:"buffer_length"`
	// pBuffer: A pointer that SHOULD be set to NULL when sent and MUST be ignored on receipt.
	Buffer []byte `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
}

func (o *RouterReplyPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_RouterReplyPrinterOperation) *xxx_RouterReplyPrinterOperation {
	if op == nil {
		op = &xxx_RouterReplyPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Notify = o.Notify
	op.Flags = o.Flags
	op.BufferLength = o.BufferLength
	op.Buffer = o.Buffer
	return op
}

func (o *RouterReplyPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_RouterReplyPrinterOperation) {
	if o == nil {
		return
	}
	o.Notify = op.Notify
	o.Flags = op.Flags
	o.BufferLength = op.BufferLength
	o.Buffer = op.Buffer
}
func (o *RouterReplyPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *RouterReplyPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RouterReplyPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// RouterReplyPrinterResponse structure represents the RpcRouterReplyPrinter operation response
type RouterReplyPrinterResponse struct {
	// Return: The RpcRouterReplyPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *RouterReplyPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_RouterReplyPrinterOperation) *xxx_RouterReplyPrinterOperation {
	if op == nil {
		op = &xxx_RouterReplyPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *RouterReplyPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_RouterReplyPrinterOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *RouterReplyPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *RouterReplyPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RouterReplyPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_ReplyClosePrinterOperation structure represents the RpcReplyClosePrinter operation
type xxx_ReplyClosePrinterOperation struct {
	Notify *Printer `idl:"name:phNotify" json:"notify"`
	Return uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_ReplyClosePrinterOperation) OpNum() int { return 60 }

func (o *xxx_ReplyClosePrinterOperation) OpName() string { return "/winspool/v1/RpcReplyClosePrinter" }

func (o *xxx_ReplyClosePrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyClosePrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// phNotify {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify != nil {
			if err := o.Notify.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_ReplyClosePrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// phNotify {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify == nil {
			o.Notify = &Printer{}
		}
		if err := o.Notify.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyClosePrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyClosePrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// phNotify {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify != nil {
			if err := o.Notify.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_ReplyClosePrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// phNotify {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify == nil {
			o.Notify = &Printer{}
		}
		if err := o.Notify.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// ReplyClosePrinterRequest structure represents the RpcReplyClosePrinter operation request
type ReplyClosePrinterRequest struct {
	// phNotify: A pointer to the notification context handle to close that was opened by
	// RpcReplyOpenPrinter (section 3.2.4.1.1).
	Notify *Printer `idl:"name:phNotify" json:"notify"`
}

func (o *ReplyClosePrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_ReplyClosePrinterOperation) *xxx_ReplyClosePrinterOperation {
	if op == nil {
		op = &xxx_ReplyClosePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Notify = o.Notify
	return op
}

func (o *ReplyClosePrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_ReplyClosePrinterOperation) {
	if o == nil {
		return
	}
	o.Notify = op.Notify
}
func (o *ReplyClosePrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *ReplyClosePrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ReplyClosePrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// ReplyClosePrinterResponse structure represents the RpcReplyClosePrinter operation response
type ReplyClosePrinterResponse struct {
	// phNotify: A pointer to the notification context handle to close that was opened by
	// RpcReplyOpenPrinter (section 3.2.4.1.1).
	Notify *Printer `idl:"name:phNotify" json:"notify"`
	// Return: The RpcReplyClosePrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *ReplyClosePrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_ReplyClosePrinterOperation) *xxx_ReplyClosePrinterOperation {
	if op == nil {
		op = &xxx_ReplyClosePrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Notify = o.Notify
	op.Return = o.Return
	return op
}

func (o *ReplyClosePrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_ReplyClosePrinterOperation) {
	if o == nil {
		return
	}
	o.Notify = op.Notify
	o.Return = op.Return
}
func (o *ReplyClosePrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *ReplyClosePrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_ReplyClosePrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPortExOperation structure represents the RpcAddPortEx operation
type xxx_AddPortExOperation struct {
	Name             string            `idl:"name:pName;string;pointer:unique" json:"name"`
	PortContainer    *PortContainer    `idl:"name:pPortContainer" json:"port_container"`
	PortVarContainer *PortVarContainer `idl:"name:pPortVarContainer" json:"port_var_container"`
	MonitorName      string            `idl:"name:pMonitorName;string" json:"monitor_name"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPortExOperation) OpNum() int { return 61 }

func (o *xxx_AddPortExOperation) OpName() string { return "/winspool/v1/RpcAddPortEx" }

func (o *xxx_AddPortExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPortExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPortContainer {in} (1:{pointer=ref}*(1))(2:{alias=PORT_CONTAINER}(struct))
	{
		if o.PortContainer != nil {
			if err := o.PortContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPortVarContainer {in} (1:{pointer=ref}*(1))(2:{alias=PORT_VAR_CONTAINER}(struct))
	{
		if o.PortVarContainer != nil {
			if err := o.PortVarContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortVarContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pMonitorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.MonitorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPortExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPortContainer {in} (1:{pointer=ref}*(1))(2:{alias=PORT_CONTAINER}(struct))
	{
		if o.PortContainer == nil {
			o.PortContainer = &PortContainer{}
		}
		if err := o.PortContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPortVarContainer {in} (1:{pointer=ref}*(1))(2:{alias=PORT_VAR_CONTAINER}(struct))
	{
		if o.PortVarContainer == nil {
			o.PortVarContainer = &PortVarContainer{}
		}
		if err := o.PortVarContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pMonitorName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.MonitorName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPortExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPortExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPortExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPortExRequest structure represents the RpcAddPortEx operation request
type AddPortExRequest struct {
	// pName: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pPortContainer: A parameter specified in PORT_CONTAINER Parameters (section 3.1.4.1.8.5).
	// The value of the Level member in the PORT_CONTAINER that is referenced by this parameter
	// MUST be 0x00000001 or 0xFFFFFFFF.
	PortContainer *PortContainer `idl:"name:pPortContainer" json:"port_container"`
	// pPortVarContainer: A pointer to a PORT_VAR_CONTAINER (section 2.2.1.2.8) information
	// structure that contains information about the port.
	PortVarContainer *PortVarContainer `idl:"name:pPortVarContainer" json:"port_var_container"`
	// pMonitorName: A pointer to a string that specifies the monitor associated with the
	// port. For rules governing monitor names, see section 2.2.4.8.
	MonitorName string `idl:"name:pMonitorName;string" json:"monitor_name"`
}

func (o *AddPortExRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPortExOperation) *xxx_AddPortExOperation {
	if op == nil {
		op = &xxx_AddPortExOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.PortContainer = o.PortContainer
	op.PortVarContainer = o.PortVarContainer
	op.MonitorName = o.MonitorName
	return op
}

func (o *AddPortExRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPortExOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.PortContainer = op.PortContainer
	o.PortVarContainer = op.PortVarContainer
	o.MonitorName = op.MonitorName
}
func (o *AddPortExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPortExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPortExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPortExResponse structure represents the RpcAddPortEx operation response
type AddPortExResponse struct {
	// Return: The RpcAddPortEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPortExResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPortExOperation) *xxx_AddPortExOperation {
	if op == nil {
		op = &xxx_AddPortExOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddPortExResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPortExOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddPortExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPortExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPortExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_RemoteFindFirstPrinterChangeNotificationOperation structure represents the RpcRemoteFindFirstPrinterChangeNotification operation
type xxx_RemoteFindFirstPrinterChangeNotificationOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	Flags        uint32   `idl:"name:fdwFlags" json:"flags"`
	Options      uint32   `idl:"name:fdwOptions" json:"options"`
	LocalMachine string   `idl:"name:pszLocalMachine;string;pointer:unique" json:"local_machine"`
	PrinterLocal uint32   `idl:"name:dwPrinterLocal" json:"printer_local"`
	BufferLength uint32   `idl:"name:cbBuffer" json:"buffer_length"`
	Buffer       []byte   `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) OpNum() int { return 62 }

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) OpName() string {
	return "/winspool/v1/RpcRemoteFindFirstPrinterChangeNotification"
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Buffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Buffer))
	}
	if o.BufferLength > uint32(512) {
		return fmt.Errorf("BufferLength is out of range")
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Flags); err != nil {
			return err
		}
	}
	// fdwOptions {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Options); err != nil {
			return err
		}
	}
	// pszLocalMachine {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.LocalMachine != "" {
			_ptr_pszLocalMachine := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.LocalMachine); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.LocalMachine, _ptr_pszLocalMachine); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// dwPrinterLocal {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.PrinterLocal); err != nil {
			return err
		}
	}
	// cbBuffer {in} (1:{range=(0,512), alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	// pBuffer {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		if o.Buffer != nil || o.BufferLength > 0 {
			_ptr_pBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Buffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Buffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Buffer, _ptr_pBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Flags); err != nil {
			return err
		}
	}
	// fdwOptions {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Options); err != nil {
			return err
		}
	}
	// pszLocalMachine {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pszLocalMachine := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.LocalMachine); err != nil {
				return err
			}
			return nil
		})
		_s_pszLocalMachine := func(ptr interface{}) { o.LocalMachine = *ptr.(*string) }
		if err := w.ReadPointer(&o.LocalMachine, _s_pszLocalMachine, _ptr_pszLocalMachine); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// dwPrinterLocal {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.PrinterLocal); err != nil {
			return err
		}
	}
	// cbBuffer {in} (1:{range=(0,512), alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	// pBuffer {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		_ptr_pBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
			}
			o.Buffer = make([]byte, sizeInfo[0])
			for i1 := range o.Buffer {
				i1 := i1
				if err := w.ReadData(&o.Buffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pBuffer := func(ptr interface{}) { o.Buffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Buffer, _s_pBuffer, _ptr_pBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pBuffer {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		if o.Buffer != nil || o.BufferLength > 0 {
			_ptr_pBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Buffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.Buffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Buffer, _ptr_pBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pBuffer {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuffer](uchar))
	{
		_ptr_pBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
			}
			o.Buffer = make([]byte, sizeInfo[0])
			for i1 := range o.Buffer {
				i1 := i1
				if err := w.ReadData(&o.Buffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pBuffer := func(ptr interface{}) { o.Buffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.Buffer, _s_pBuffer, _ptr_pBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// RemoteFindFirstPrinterChangeNotificationRequest structure represents the RpcRemoteFindFirstPrinterChangeNotification operation request
type RemoteFindFirstPrinterChangeNotificationRequest struct {
	// hPrinter: A handle to a printer or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// fdwFlags: Flags that specify the conditions that are required for a change notification
	// object to enter a signaled state. A change notification MUST occur when one or more
	// of the specified conditions are met.
	Flags uint32 `idl:"name:fdwFlags" json:"flags"`
	// fdwOptions: The category of printers for which change notifications are returned.
	// This parameter MUST be one of the supported values specified in Printer Notification
	// Values (section 2.2.3.8).
	Options uint32 `idl:"name:fdwOptions" json:"options"`
	// pszLocalMachine: A pointer to a string that represents the name of the client computer.
	// The rules governing server names are specified in section 2.2.4.16.
	LocalMachine string `idl:"name:pszLocalMachine;string;pointer:unique" json:"local_machine"`
	// dwPrinterLocal: An implementation-specific unique value that MUST be sufficient for
	// the client to determine whether a call to RpcReplyOpenPrinter (section 3.2.4.1.1)
	// by the server is associated with the hPrinter parameter in this call.<381>
	PrinterLocal uint32 `idl:"name:dwPrinterLocal" json:"printer_local"`
	// cbBuffer: A value that SHOULD be set to zero when sent and MUST be ignored on receipt.
	BufferLength uint32 `idl:"name:cbBuffer" json:"buffer_length"`
	// pBuffer: A pointer that MUST be set to NULL when sent and MUST be ignored on receipt.
	Buffer []byte `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
}

func (o *RemoteFindFirstPrinterChangeNotificationRequest) xxx_ToOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationOperation) *xxx_RemoteFindFirstPrinterChangeNotificationOperation {
	if op == nil {
		op = &xxx_RemoteFindFirstPrinterChangeNotificationOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Flags = o.Flags
	op.Options = o.Options
	op.LocalMachine = o.LocalMachine
	op.PrinterLocal = o.PrinterLocal
	op.BufferLength = o.BufferLength
	op.Buffer = o.Buffer
	return op
}

func (o *RemoteFindFirstPrinterChangeNotificationRequest) xxx_FromOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Flags = op.Flags
	o.Options = op.Options
	o.LocalMachine = op.LocalMachine
	o.PrinterLocal = op.PrinterLocal
	o.BufferLength = op.BufferLength
	o.Buffer = op.Buffer
}
func (o *RemoteFindFirstPrinterChangeNotificationRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *RemoteFindFirstPrinterChangeNotificationRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RemoteFindFirstPrinterChangeNotificationOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// RemoteFindFirstPrinterChangeNotificationResponse structure represents the RpcRemoteFindFirstPrinterChangeNotification operation response
type RemoteFindFirstPrinterChangeNotificationResponse struct {
	// XXX: cbBuffer is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuffer" json:"buffer_length"`

	// pBuffer: A pointer that MUST be set to NULL when sent and MUST be ignored on receipt.
	Buffer []byte `idl:"name:pBuffer;size_is:(cbBuffer);pointer:unique" json:"buffer"`
	// Return: The RpcRemoteFindFirstPrinterChangeNotification return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *RemoteFindFirstPrinterChangeNotificationResponse) xxx_ToOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationOperation) *xxx_RemoteFindFirstPrinterChangeNotificationOperation {
	if op == nil {
		op = &xxx_RemoteFindFirstPrinterChangeNotificationOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.Buffer = o.Buffer
	op.Return = o.Return
	return op
}

func (o *RemoteFindFirstPrinterChangeNotificationResponse) xxx_FromOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.Buffer = op.Buffer
	o.Return = op.Return
}
func (o *RemoteFindFirstPrinterChangeNotificationResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *RemoteFindFirstPrinterChangeNotificationResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RemoteFindFirstPrinterChangeNotificationOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_RemoteFindFirstPrinterChangeNotificationExOperation structure represents the RpcRemoteFindFirstPrinterChangeNotificationEx operation
type xxx_RemoteFindFirstPrinterChangeNotificationExOperation struct {
	Printer       *Printer         `idl:"name:hPrinter" json:"printer"`
	Flags         uint32           `idl:"name:fdwFlags" json:"flags"`
	Options       uint32           `idl:"name:fdwOptions" json:"options"`
	LocalMachine  string           `idl:"name:pszLocalMachine;string;pointer:unique" json:"local_machine"`
	PrinterLocal  uint32           `idl:"name:dwPrinterLocal" json:"printer_local"`
	NotifyOptions *V2NotifyOptions `idl:"name:pNotifyOptions;pointer:unique" json:"notify_options"`
	Return        uint32           `idl:"name:Return" json:"return"`
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) OpNum() int { return 65 }

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) OpName() string {
	return "/winspool/v1/RpcRemoteFindFirstPrinterChangeNotificationEx"
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Flags); err != nil {
			return err
		}
	}
	// fdwOptions {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Options); err != nil {
			return err
		}
	}
	// pszLocalMachine {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.LocalMachine != "" {
			_ptr_pszLocalMachine := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.LocalMachine); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.LocalMachine, _ptr_pszLocalMachine); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// dwPrinterLocal {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.PrinterLocal); err != nil {
			return err
		}
	}
	// pNotifyOptions {in} (1:{pointer=unique}*(1))(2:{alias=RPC_V2_NOTIFY_OPTIONS}(struct))
	{
		if o.NotifyOptions != nil {
			_ptr_pNotifyOptions := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if o.NotifyOptions != nil {
					if err := o.NotifyOptions.MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&V2NotifyOptions{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.NotifyOptions, _ptr_pNotifyOptions); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Flags); err != nil {
			return err
		}
	}
	// fdwOptions {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Options); err != nil {
			return err
		}
	}
	// pszLocalMachine {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pszLocalMachine := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.LocalMachine); err != nil {
				return err
			}
			return nil
		})
		_s_pszLocalMachine := func(ptr interface{}) { o.LocalMachine = *ptr.(*string) }
		if err := w.ReadPointer(&o.LocalMachine, _s_pszLocalMachine, _ptr_pszLocalMachine); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// dwPrinterLocal {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.PrinterLocal); err != nil {
			return err
		}
	}
	// pNotifyOptions {in} (1:{pointer=unique}*(1))(2:{alias=RPC_V2_NOTIFY_OPTIONS}(struct))
	{
		_ptr_pNotifyOptions := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if o.NotifyOptions == nil {
				o.NotifyOptions = &V2NotifyOptions{}
			}
			if err := o.NotifyOptions.UnmarshalNDR(ctx, w); err != nil {
				return err
			}
			return nil
		})
		_s_pNotifyOptions := func(ptr interface{}) { o.NotifyOptions = *ptr.(**V2NotifyOptions) }
		if err := w.ReadPointer(&o.NotifyOptions, _s_pNotifyOptions, _ptr_pNotifyOptions); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// RemoteFindFirstPrinterChangeNotificationExRequest structure represents the RpcRemoteFindFirstPrinterChangeNotificationEx operation request
type RemoteFindFirstPrinterChangeNotificationExRequest struct {
	// hPrinter: A handle to a printer or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// fdwFlags: Flags that specify the conditions that are required for a change notification
	// object to enter a signaled state. A change notification MUST occur when one or more
	// of the specified conditions are met.
	Flags uint32 `idl:"name:fdwFlags" json:"flags"`
	// fdwOptions: The category of printers for which change notifications are returned.
	// This parameter MUST be one of the supported values specified in Printer Notification
	// Values (section 2.2.3.8).
	Options uint32 `idl:"name:fdwOptions" json:"options"`
	// pszLocalMachine: A pointer to a string that represents the name of the client computer.
	// The rules governing server names are specified in section 2.2.4.16.
	LocalMachine string `idl:"name:pszLocalMachine;string;pointer:unique" json:"local_machine"`
	// dwPrinterLocal: An implementation-specific unique value that MUST be sufficient for
	// the client to determine whether a call to RpcReplyOpenPrinter (section 3.2.4.1.1)
	// by the server is associated with the hPrinter parameter in this call.<382>
	PrinterLocal  uint32           `idl:"name:dwPrinterLocal" json:"printer_local"`
	NotifyOptions *V2NotifyOptions `idl:"name:pNotifyOptions;pointer:unique" json:"notify_options"`
}

func (o *RemoteFindFirstPrinterChangeNotificationExRequest) xxx_ToOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) *xxx_RemoteFindFirstPrinterChangeNotificationExOperation {
	if op == nil {
		op = &xxx_RemoteFindFirstPrinterChangeNotificationExOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Flags = o.Flags
	op.Options = o.Options
	op.LocalMachine = o.LocalMachine
	op.PrinterLocal = o.PrinterLocal
	op.NotifyOptions = o.NotifyOptions
	return op
}

func (o *RemoteFindFirstPrinterChangeNotificationExRequest) xxx_FromOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Flags = op.Flags
	o.Options = op.Options
	o.LocalMachine = op.LocalMachine
	o.PrinterLocal = op.PrinterLocal
	o.NotifyOptions = op.NotifyOptions
}
func (o *RemoteFindFirstPrinterChangeNotificationExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *RemoteFindFirstPrinterChangeNotificationExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RemoteFindFirstPrinterChangeNotificationExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// RemoteFindFirstPrinterChangeNotificationExResponse structure represents the RpcRemoteFindFirstPrinterChangeNotificationEx operation response
type RemoteFindFirstPrinterChangeNotificationExResponse struct {
	// Return: The RpcRemoteFindFirstPrinterChangeNotificationEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *RemoteFindFirstPrinterChangeNotificationExResponse) xxx_ToOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) *xxx_RemoteFindFirstPrinterChangeNotificationExOperation {
	if op == nil {
		op = &xxx_RemoteFindFirstPrinterChangeNotificationExOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *RemoteFindFirstPrinterChangeNotificationExResponse) xxx_FromOp(ctx context.Context, op *xxx_RemoteFindFirstPrinterChangeNotificationExOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *RemoteFindFirstPrinterChangeNotificationExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *RemoteFindFirstPrinterChangeNotificationExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RemoteFindFirstPrinterChangeNotificationExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_RouterReplyPrinterExOperation structure represents the RpcRouterReplyPrinterEx operation
type xxx_RouterReplyPrinterExOperation struct {
	Notify    *Printer        `idl:"name:hNotify" json:"notify"`
	Color     uint32          `idl:"name:dwColor" json:"color"`
	Flags     uint32          `idl:"name:fdwFlags" json:"flags"`
	Result    uint32          `idl:"name:pdwResult" json:"result"`
	ReplyType uint32          `idl:"name:dwReplyType" json:"reply_type"`
	Reply     *V2ReplyPrinter `idl:"name:Reply;switch_is:dwReplyType" json:"reply"`
	Return    uint32          `idl:"name:Return" json:"return"`
}

func (o *xxx_RouterReplyPrinterExOperation) OpNum() int { return 66 }

func (o *xxx_RouterReplyPrinterExOperation) OpName() string {
	return "/winspool/v1/RpcRouterReplyPrinterEx"
}

func (o *xxx_RouterReplyPrinterExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hNotify {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify != nil {
			if err := o.Notify.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// dwColor {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Color); err != nil {
			return err
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Flags); err != nil {
			return err
		}
	}
	// dwReplyType {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReplyType); err != nil {
			return err
		}
	}
	// Reply {in} (1:{switch_type={alias=DWORD}(uint32), alias=RPC_V2_UREPLY_PRINTER}(union))
	{
		_swReply := uint32(o.ReplyType)
		if o.Reply != nil {
			if err := o.Reply.MarshalUnionNDR(ctx, w, _swReply); err != nil {
				return err
			}
		} else {
			if err := (&V2ReplyPrinter{}).MarshalUnionNDR(ctx, w, _swReply); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hNotify {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Notify == nil {
			o.Notify = &Printer{}
		}
		if err := o.Notify.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// dwColor {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Color); err != nil {
			return err
		}
	}
	// fdwFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Flags); err != nil {
			return err
		}
	}
	// dwReplyType {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReplyType); err != nil {
			return err
		}
	}
	// Reply {in} (1:{switch_type={alias=DWORD}(uint32), alias=RPC_V2_UREPLY_PRINTER}(union))
	{
		if o.Reply == nil {
			o.Reply = &V2ReplyPrinter{}
		}
		_swReply := uint32(o.ReplyType)
		if err := o.Reply.UnmarshalUnionNDR(ctx, w, _swReply); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pdwResult {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Result); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterReplyPrinterExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pdwResult {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Result); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// RouterReplyPrinterExRequest structure represents the RpcRouterReplyPrinterEx operation request
type RouterReplyPrinterExRequest struct {
	// hNotify: A notification RPC context handle that was opened by RpcReplyOpenPrinter
	// (section 3.2.4.1.1).
	Notify *Printer `idl:"name:hNotify" json:"notify"`
	// dwColor: The value that was most recently specified by the client in the dwColor
	// parameter of a call to RpcRouterRefreshPrinterChangeNotification (section 3.1.4.10.5).
	Color uint32 `idl:"name:dwColor" json:"color"`
	// fdwFlags: A value that contains Printer Change Flags (section 2.2.3.6), which indicate
	// changes in printer configuration values.
	Flags uint32 `idl:"name:fdwFlags" json:"flags"`
	// dwReplyType: A value that MUST be zero.
	ReplyType uint32 `idl:"name:dwReplyType" json:"reply_type"`
	// Reply: A pointer to an RPC_V2_UREPLY_PRINTER union, which contains a pointer to an
	// RPC_V2_NOTIFY_INFO structure, which contains available notification data that matched
	// the set of notifications that the client previously requested.
	Reply *V2ReplyPrinter `idl:"name:Reply;switch_is:dwReplyType" json:"reply"`
}

func (o *RouterReplyPrinterExRequest) xxx_ToOp(ctx context.Context, op *xxx_RouterReplyPrinterExOperation) *xxx_RouterReplyPrinterExOperation {
	if op == nil {
		op = &xxx_RouterReplyPrinterExOperation{}
	}
	if o == nil {
		return op
	}
	op.Notify = o.Notify
	op.Color = o.Color
	op.Flags = o.Flags
	op.ReplyType = o.ReplyType
	op.Reply = o.Reply
	return op
}

func (o *RouterReplyPrinterExRequest) xxx_FromOp(ctx context.Context, op *xxx_RouterReplyPrinterExOperation) {
	if o == nil {
		return
	}
	o.Notify = op.Notify
	o.Color = op.Color
	o.Flags = op.Flags
	o.ReplyType = op.ReplyType
	o.Reply = op.Reply
}
func (o *RouterReplyPrinterExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *RouterReplyPrinterExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RouterReplyPrinterExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// RouterReplyPrinterExResponse structure represents the RpcRouterReplyPrinterEx operation response
type RouterReplyPrinterExResponse struct {
	// pdwResult: A pointer to a value that contains Change Notification Flags (section
	// 2.2.3.2), which indicate how the client processed the notification.
	Result uint32 `idl:"name:pdwResult" json:"result"`
	// Return: The RpcRouterReplyPrinterEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *RouterReplyPrinterExResponse) xxx_ToOp(ctx context.Context, op *xxx_RouterReplyPrinterExOperation) *xxx_RouterReplyPrinterExOperation {
	if op == nil {
		op = &xxx_RouterReplyPrinterExOperation{}
	}
	if o == nil {
		return op
	}
	op.Result = o.Result
	op.Return = o.Return
	return op
}

func (o *RouterReplyPrinterExResponse) xxx_FromOp(ctx context.Context, op *xxx_RouterReplyPrinterExOperation) {
	if o == nil {
		return
	}
	o.Result = op.Result
	o.Return = op.Return
}
func (o *RouterReplyPrinterExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *RouterReplyPrinterExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RouterReplyPrinterExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_RouterRefreshPrinterChangeNotificationOperation structure represents the RpcRouterRefreshPrinterChangeNotification operation
type xxx_RouterRefreshPrinterChangeNotificationOperation struct {
	Printer *Printer         `idl:"name:hPrinter" json:"printer"`
	Color   uint32           `idl:"name:dwColor" json:"color"`
	Out     *V2NotifyOptions `idl:"name:out;pointer:unique" json:"out"`
	Return  uint32           `idl:"name:Return" json:"return"`
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) OpNum() int { return 67 }

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) OpName() string {
	return "/winspool/v1/RpcRouterRefreshPrinterChangeNotification"
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// dwColor {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Color); err != nil {
			return err
		}
	}
	// out {in} (1:{pointer=unique}*(1))(2:{alias=RPC_V2_NOTIFY_OPTIONS}(struct))
	{
		if o.Out != nil {
			_ptr_out := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if o.Out != nil {
					if err := o.Out.MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&V2NotifyOptions{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Out, _ptr_out); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// dwColor {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Color); err != nil {
			return err
		}
	}
	// out {in} (1:{pointer=unique}*(1))(2:{alias=RPC_V2_NOTIFY_OPTIONS}(struct))
	{
		_ptr_out := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if o.Out == nil {
				o.Out = &V2NotifyOptions{}
			}
			if err := o.Out.UnmarshalNDR(ctx, w); err != nil {
				return err
			}
			return nil
		})
		_s_out := func(ptr interface{}) { o.Out = *ptr.(**V2NotifyOptions) }
		if err := w.ReadPointer(&o.Out, _s_out, _ptr_out); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RouterRefreshPrinterChangeNotificationOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// RouterRefreshPrinterChangeNotificationRequest structure represents the RpcRouterRefreshPrinterChangeNotification operation request
type RouterRefreshPrinterChangeNotificationRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// dwColor: An implementation-specific value that MAY be used by print clients to get
	// an indication of the order of notifications.<384>
	Color uint32           `idl:"name:dwColor" json:"color"`
	Out   *V2NotifyOptions `idl:"name:out;pointer:unique" json:"out"`
}

func (o *RouterRefreshPrinterChangeNotificationRequest) xxx_ToOp(ctx context.Context, op *xxx_RouterRefreshPrinterChangeNotificationOperation) *xxx_RouterRefreshPrinterChangeNotificationOperation {
	if op == nil {
		op = &xxx_RouterRefreshPrinterChangeNotificationOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Color = o.Color
	op.Out = o.Out
	return op
}

func (o *RouterRefreshPrinterChangeNotificationRequest) xxx_FromOp(ctx context.Context, op *xxx_RouterRefreshPrinterChangeNotificationOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Color = op.Color
	o.Out = op.Out
}
func (o *RouterRefreshPrinterChangeNotificationRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *RouterRefreshPrinterChangeNotificationRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RouterRefreshPrinterChangeNotificationOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// RouterRefreshPrinterChangeNotificationResponse structure represents the RpcRouterRefreshPrinterChangeNotification operation response
type RouterRefreshPrinterChangeNotificationResponse struct {
	// Return: The RpcRouterRefreshPrinterChangeNotification return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *RouterRefreshPrinterChangeNotificationResponse) xxx_ToOp(ctx context.Context, op *xxx_RouterRefreshPrinterChangeNotificationOperation) *xxx_RouterRefreshPrinterChangeNotificationOperation {
	if op == nil {
		op = &xxx_RouterRefreshPrinterChangeNotificationOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *RouterRefreshPrinterChangeNotificationResponse) xxx_FromOp(ctx context.Context, op *xxx_RouterRefreshPrinterChangeNotificationOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *RouterRefreshPrinterChangeNotificationResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *RouterRefreshPrinterChangeNotificationResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RouterRefreshPrinterChangeNotificationOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_OpenPrinterExOperation structure represents the RpcOpenPrinterEx operation
type xxx_OpenPrinterExOperation struct {
	PrinterName      string            `idl:"name:pPrinterName;string;pointer:unique" json:"printer_name"`
	Handle           *Printer          `idl:"name:pHandle" json:"handle"`
	DataType         string            `idl:"name:pDatatype;string;pointer:unique" json:"data_type"`
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	AccessRequired   uint32            `idl:"name:AccessRequired" json:"access_required"`
	ClientInfo       *ClientContainer  `idl:"name:pClientInfo" json:"client_info"`
	Return           uint32            `idl:"name:Return" json:"return"`
}

func (o *xxx_OpenPrinterExOperation) OpNum() int { return 69 }

func (o *xxx_OpenPrinterExOperation) OpName() string { return "/winspool/v1/RpcOpenPrinterEx" }

func (o *xxx_OpenPrinterExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pPrinterName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.PrinterName != "" {
			_ptr_pPrinterName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterName, _ptr_pPrinterName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDatatype {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.DataType != "" {
			_ptr_pDatatype := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.DataType); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.DataType, _ptr_pDatatype); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// AccessRequired {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.AccessRequired); err != nil {
			return err
		}
	}
	// pClientInfo {in} (1:{pointer=ref}*(1))(2:{alias=SPLCLIENT_CONTAINER}(struct))
	{
		if o.ClientInfo != nil {
			if err := o.ClientInfo.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&ClientContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pPrinterName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pPrinterName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
				return err
			}
			return nil
		})
		_s_pPrinterName := func(ptr interface{}) { o.PrinterName = *ptr.(*string) }
		if err := w.ReadPointer(&o.PrinterName, _s_pPrinterName, _ptr_pPrinterName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDatatype {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pDatatype := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.DataType); err != nil {
				return err
			}
			return nil
		})
		_s_pDatatype := func(ptr interface{}) { o.DataType = *ptr.(*string) }
		if err := w.ReadPointer(&o.DataType, _s_pDatatype, _ptr_pDatatype); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// AccessRequired {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.AccessRequired); err != nil {
			return err
		}
	}
	// pClientInfo {in} (1:{pointer=ref}*(1))(2:{alias=SPLCLIENT_CONTAINER}(struct))
	{
		if o.ClientInfo == nil {
			o.ClientInfo = &ClientContainer{}
		}
		if err := o.ClientInfo.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle != nil {
			if err := o.Handle.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_OpenPrinterExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle == nil {
			o.Handle = &Printer{}
		}
		if err := o.Handle.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// OpenPrinterExRequest structure represents the RpcOpenPrinterEx operation request
type OpenPrinterExRequest struct {
	// pPrinterName: A STRING_HANDLE (section 2.2.1.1.7) for a printer connection, printer
	// object, server object, job object, port object, or port monitor object. For opening
	// a server object, this parameter MUST adhere to the specification in Print Server
	// Name Parameters (section 3.1.4.1.4); for opening all other objects, it MUST adhere
	// to the specification in Printer Name Parameters (section 3.1.4.1.5).
	PrinterName string `idl:"name:pPrinterName;string;pointer:unique" json:"printer_name"`
	// pDatatype: A pointer to a string that specifies the data type to be associated with
	// the printer handle. This parameter MUST adhere to the specification in Datatype Name
	// Parameters (section 3.1.4.1.1).
	DataType string `idl:"name:pDatatype;string;pointer:unique" json:"data_type"`
	// pDevModeContainer: A pointer to a DEVMODE_CONTAINER structure. This parameter MUST
	// adhere to the specification in DEVMODE_CONTAINER Parameters (section 3.1.4.1.8.1).
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	// AccessRequired: The access level that the client requires for interacting with the
	// object to which a handle is being opened. The value of this parameter is one of those
	// specified in Access Values (section 2.2.3.1). For rules governing access values,
	// see section 2.2.4.1.
	AccessRequired uint32 `idl:"name:AccessRequired" json:"access_required"`
	// pClientInfo: A pointer to a SPLCLIENT_CONTAINER (section 2.2.1.2.14) structure. This
	// parameter MUST adhere to the specification in SPLCLIENT_CONTAINER Parameters (section
	// 3.1.4.1.8.8).
	ClientInfo *ClientContainer `idl:"name:pClientInfo" json:"client_info"`
}

func (o *OpenPrinterExRequest) xxx_ToOp(ctx context.Context, op *xxx_OpenPrinterExOperation) *xxx_OpenPrinterExOperation {
	if op == nil {
		op = &xxx_OpenPrinterExOperation{}
	}
	if o == nil {
		return op
	}
	op.PrinterName = o.PrinterName
	op.DataType = o.DataType
	op.DevModeContainer = o.DevModeContainer
	op.AccessRequired = o.AccessRequired
	op.ClientInfo = o.ClientInfo
	return op
}

func (o *OpenPrinterExRequest) xxx_FromOp(ctx context.Context, op *xxx_OpenPrinterExOperation) {
	if o == nil {
		return
	}
	o.PrinterName = op.PrinterName
	o.DataType = op.DataType
	o.DevModeContainer = op.DevModeContainer
	o.AccessRequired = op.AccessRequired
	o.ClientInfo = op.ClientInfo
}
func (o *OpenPrinterExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *OpenPrinterExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_OpenPrinterExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// OpenPrinterExResponse structure represents the RpcOpenPrinterEx operation response
type OpenPrinterExResponse struct {
	// pHandle: A pointer to a PRINTER_HANDLE (section 2.2.1.1.4) that MUST receive the
	// RPC context handle [C706] to the object identified by the pPrinterName parameter.
	Handle *Printer `idl:"name:pHandle" json:"handle"`
	// Return: The RpcOpenPrinterEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *OpenPrinterExResponse) xxx_ToOp(ctx context.Context, op *xxx_OpenPrinterExOperation) *xxx_OpenPrinterExOperation {
	if op == nil {
		op = &xxx_OpenPrinterExOperation{}
	}
	if o == nil {
		return op
	}
	op.Handle = o.Handle
	op.Return = o.Return
	return op
}

func (o *OpenPrinterExResponse) xxx_FromOp(ctx context.Context, op *xxx_OpenPrinterExOperation) {
	if o == nil {
		return
	}
	o.Handle = op.Handle
	o.Return = op.Return
}
func (o *OpenPrinterExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *OpenPrinterExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_OpenPrinterExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPrinterExOperation structure represents the RpcAddPrinterEx operation
type xxx_AddPrinterExOperation struct {
	Name              string             `idl:"name:pName;string;pointer:unique" json:"name"`
	PrinterContainer  *PrinterContainer  `idl:"name:pPrinterContainer" json:"printer_container"`
	DevModeContainer  *DevModeContainer  `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	SecurityContainer *SecurityContainer `idl:"name:pSecurityContainer" json:"security_container"`
	ClientInfo        *ClientContainer   `idl:"name:pClientInfo" json:"client_info"`
	Handle            *Printer           `idl:"name:pHandle" json:"handle"`
	Return            uint32             `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPrinterExOperation) OpNum() int { return 70 }

func (o *xxx_AddPrinterExOperation) OpName() string { return "/winspool/v1/RpcAddPrinterEx" }

func (o *xxx_AddPrinterExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrinterContainer {in} (1:{pointer=ref}*(1))(2:{alias=PRINTER_CONTAINER}(struct))
	{
		if o.PrinterContainer != nil {
			if err := o.PrinterContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrinterContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer != nil {
			if err := o.DevModeContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DevModeContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pSecurityContainer {in} (1:{pointer=ref}*(1))(2:{alias=SECURITY_CONTAINER}(struct))
	{
		if o.SecurityContainer != nil {
			if err := o.SecurityContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&SecurityContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pClientInfo {in} (1:{pointer=ref}*(1))(2:{alias=SPLCLIENT_CONTAINER}(struct))
	{
		if o.ClientInfo != nil {
			if err := o.ClientInfo.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&ClientContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrinterContainer {in} (1:{pointer=ref}*(1))(2:{alias=PRINTER_CONTAINER}(struct))
	{
		if o.PrinterContainer == nil {
			o.PrinterContainer = &PrinterContainer{}
		}
		if err := o.PrinterContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDevModeContainer {in} (1:{pointer=ref}*(1))(2:{alias=DEVMODE_CONTAINER}(struct))
	{
		if o.DevModeContainer == nil {
			o.DevModeContainer = &DevModeContainer{}
		}
		if err := o.DevModeContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pSecurityContainer {in} (1:{pointer=ref}*(1))(2:{alias=SECURITY_CONTAINER}(struct))
	{
		if o.SecurityContainer == nil {
			o.SecurityContainer = &SecurityContainer{}
		}
		if err := o.SecurityContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pClientInfo {in} (1:{pointer=ref}*(1))(2:{alias=SPLCLIENT_CONTAINER}(struct))
	{
		if o.ClientInfo == nil {
			o.ClientInfo = &ClientContainer{}
		}
		if err := o.ClientInfo.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle != nil {
			if err := o.Handle.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pHandle {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Handle == nil {
			o.Handle = &Printer{}
		}
		if err := o.Handle.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPrinterExRequest structure represents the RpcAddPrinterEx operation request
type AddPrinterExRequest struct {
	// pName: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pPrinterContainer: A parameter specified in PRINTER_CONTAINER Parameters (section
	// 3.1.4.1.8.6). The Level member of the PRINTER_CONTAINER MUST be 0x00000001 or 0x00000002.
	PrinterContainer *PrinterContainer `idl:"name:pPrinterContainer" json:"printer_container"`
	// pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters (section
	// 3.1.4.1.8.1).
	DevModeContainer *DevModeContainer `idl:"name:pDevModeContainer" json:"dev_mode_container"`
	// pSecurityContainer: A parameter specified in SECURITY_CONTAINER Parameters (section
	// 3.1.4.1.8.7).
	SecurityContainer *SecurityContainer `idl:"name:pSecurityContainer" json:"security_container"`
	// pClientInfo: A parameter specified in SPLCLIENT_CONTAINER Parameters (section 3.1.4.1.8.8).
	ClientInfo *ClientContainer `idl:"name:pClientInfo" json:"client_info"`
}

func (o *AddPrinterExRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterExOperation) *xxx_AddPrinterExOperation {
	if op == nil {
		op = &xxx_AddPrinterExOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.PrinterContainer = o.PrinterContainer
	op.DevModeContainer = o.DevModeContainer
	op.SecurityContainer = o.SecurityContainer
	op.ClientInfo = o.ClientInfo
	return op
}

func (o *AddPrinterExRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterExOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.PrinterContainer = op.PrinterContainer
	o.DevModeContainer = op.DevModeContainer
	o.SecurityContainer = op.SecurityContainer
	o.ClientInfo = op.ClientInfo
}
func (o *AddPrinterExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPrinterExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPrinterExResponse structure represents the RpcAddPrinterEx operation response
type AddPrinterExResponse struct {
	// pHandle: A pointer to a variable that MUST receive the printer remote procedure call
	// (RPC) context handle to the printer object added. RPC context handles are specified
	// in [C706].
	Handle *Printer `idl:"name:pHandle" json:"handle"`
	// Return: The RpcAddPrinterEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPrinterExResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterExOperation) *xxx_AddPrinterExOperation {
	if op == nil {
		op = &xxx_AddPrinterExOperation{}
	}
	if o == nil {
		return op
	}
	op.Handle = o.Handle
	op.Return = o.Return
	return op
}

func (o *AddPrinterExResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterExOperation) {
	if o == nil {
		return
	}
	o.Handle = op.Handle
	o.Return = op.Return
}
func (o *AddPrinterExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPrinterExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetPortOperation structure represents the RpcSetPort operation
type xxx_SetPortOperation struct {
	Name          string         `idl:"name:pName;string;pointer:unique" json:"name"`
	PortName      string         `idl:"name:pPortName;string;pointer:unique" json:"port_name"`
	PortContainer *PortContainer `idl:"name:pPortContainer" json:"port_container"`
	Return        uint32         `idl:"name:Return" json:"return"`
}

func (o *xxx_SetPortOperation) OpNum() int { return 71 }

func (o *xxx_SetPortOperation) OpName() string { return "/winspool/v1/RpcSetPort" }

func (o *xxx_SetPortOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPortOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPortName {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.PortName != "" {
			_ptr_pPortName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.PortName); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.PortName, _ptr_pPortName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPortContainer {in} (1:{pointer=ref}*(1))(2:{alias=PORT_CONTAINER}(struct))
	{
		if o.PortContainer != nil {
			if err := o.PortContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PortContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPortOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPortName {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pPortName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.PortName); err != nil {
				return err
			}
			return nil
		})
		_s_pPortName := func(ptr interface{}) { o.PortName = *ptr.(*string) }
		if err := w.ReadPointer(&o.PortName, _s_pPortName, _ptr_pPortName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPortContainer {in} (1:{pointer=ref}*(1))(2:{alias=PORT_CONTAINER}(struct))
	{
		if o.PortContainer == nil {
			o.PortContainer = &PortContainer{}
		}
		if err := o.PortContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPortOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPortOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPortOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetPortRequest structure represents the RpcSetPort operation request
type SetPortRequest struct {
	// pName: A parameter that adheres to the specification in Print Server Name Parameters
	// (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pPortName: A pointer to a string that specifies the name of the printer port. For
	// rules governing port names, see section 2.2.4.10.
	PortName string `idl:"name:pPortName;string;pointer:unique" json:"port_name"`
	// pPortContainer: A parameter that adheres to the specification in PORT_CONTAINER Parameters
	// (section 3.1.4.1.8.5). The level as specified in the Level member of the PORT_CONTAINER
	// structure MUST be 0x00000003.
	PortContainer *PortContainer `idl:"name:pPortContainer" json:"port_container"`
}

func (o *SetPortRequest) xxx_ToOp(ctx context.Context, op *xxx_SetPortOperation) *xxx_SetPortOperation {
	if op == nil {
		op = &xxx_SetPortOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.PortName = o.PortName
	op.PortContainer = o.PortContainer
	return op
}

func (o *SetPortRequest) xxx_FromOp(ctx context.Context, op *xxx_SetPortOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.PortName = op.PortName
	o.PortContainer = op.PortContainer
}
func (o *SetPortRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetPortRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPortOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetPortResponse structure represents the RpcSetPort operation response
type SetPortResponse struct {
	// Return: The RpcSetPort return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetPortResponse) xxx_ToOp(ctx context.Context, op *xxx_SetPortOperation) *xxx_SetPortOperation {
	if op == nil {
		op = &xxx_SetPortOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetPortResponse) xxx_FromOp(ctx context.Context, op *xxx_SetPortOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetPortResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetPortResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPortOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPrinterDataOperation structure represents the RpcEnumPrinterData operation
type xxx_EnumPrinterDataOperation struct {
	Printer            *Printer `idl:"name:hPrinter" json:"printer"`
	Index              uint32   `idl:"name:dwIndex" json:"index"`
	ValueName          string   `idl:"name:pValueName;size_is:((cbValueNameIn/2))" json:"value_name"`
	ValueNameInLength  uint32   `idl:"name:cbValueNameIn" json:"value_name_in_length"`
	ValueNameOutLength uint32   `idl:"name:pcbValueNameOut" json:"value_name_out_length"`
	Type               uint32   `idl:"name:pType" json:"type"`
	Data               []byte   `idl:"name:pData;size_is:(cbDataIn)" json:"data"`
	DataInLength       uint32   `idl:"name:cbDataIn" json:"data_in_length"`
	DataOutLength      uint32   `idl:"name:pcbDataOut" json:"data_out_length"`
	Return             uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrinterDataOperation) OpNum() int { return 72 }

func (o *xxx_EnumPrinterDataOperation) OpName() string { return "/winspool/v1/RpcEnumPrinterData" }

func (o *xxx_EnumPrinterDataOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// dwIndex {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Index); err != nil {
			return err
		}
	}
	// cbValueNameIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ValueNameInLength); err != nil {
			return err
		}
	}
	// cbDataIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.DataInLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// dwIndex {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Index); err != nil {
			return err
		}
	}
	// cbValueNameIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ValueNameInLength); err != nil {
			return err
		}
	}
	// cbDataIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.DataInLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pValueName {out} (1:{pointer=ref}*(1)[dim:0,size_is=(cbValueNameIn/2),string](wchar))
	{
		dimSize1 := uint64((o.ValueNameInLength / 2))
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		_ValueName_buf := utf16.Encode([]rune(o.ValueName))
		if uint64(len(_ValueName_buf)) > sizeInfo[0] {
			_ValueName_buf = _ValueName_buf[:sizeInfo[0]]
		}
		for i1 := range _ValueName_buf {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(_ValueName_buf[i1]); err != nil {
				return err
			}
		}
		for i1 := len(_ValueName_buf); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint16(0)); err != nil {
				return err
			}
		}
	}
	// pcbValueNameOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ValueNameOutLength); err != nil {
			return err
		}
	}
	// pType {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Type); err != nil {
			return err
		}
	}
	// pData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbDataIn](uchar))
	{
		dimSize1 := uint64(o.DataInLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Data {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Data[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// pcbDataOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.DataOutLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pValueName {out} (1:{pointer=ref}*(1)[dim:0,size_is=(cbValueNameIn/2),string](wchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		var _ValueName_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _ValueName_buf", sizeInfo[0])
		}
		_ValueName_buf = make([]uint16, sizeInfo[0])
		for i1 := range _ValueName_buf {
			i1 := i1
			if err := w.ReadData(&_ValueName_buf[i1]); err != nil {
				return err
			}
		}
		o.ValueName = strings.TrimRight(string(utf16.Decode(_ValueName_buf)), ndr.ZeroString)
	}
	// pcbValueNameOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ValueNameOutLength); err != nil {
			return err
		}
	}
	// pType {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Type); err != nil {
			return err
		}
	}
	// pData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbDataIn](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]byte, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if err := w.ReadData(&o.Data[i1]); err != nil {
				return err
			}
		}
	}
	// pcbDataOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.DataOutLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrinterDataRequest structure represents the RpcEnumPrinterData operation request
type EnumPrinterDataRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// dwIndex: The index of the configuration data value to retrieve. The value MUST be
	// greater than or equal to zero and less than the total number of configuration data
	// values for the printer. The client SHOULD use RpcEnumPrinterKeys to determine the
	// total number of configuration data values for the printer.
	Index             uint32 `idl:"name:dwIndex" json:"index"`
	ValueNameInLength uint32 `idl:"name:cbValueNameIn" json:"value_name_in_length"`
	DataInLength      uint32 `idl:"name:cbDataIn" json:"data_in_length"`
}

func (o *EnumPrinterDataRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterDataOperation) *xxx_EnumPrinterDataOperation {
	if op == nil {
		op = &xxx_EnumPrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Index = o.Index
	op.ValueNameInLength = o.ValueNameInLength
	op.DataInLength = o.DataInLength
	return op
}

func (o *EnumPrinterDataRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterDataOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Index = op.Index
	o.ValueNameInLength = op.ValueNameInLength
	o.DataInLength = op.DataInLength
}
func (o *EnumPrinterDataRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrinterDataRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterDataOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrinterDataResponse structure represents the RpcEnumPrinterData operation response
type EnumPrinterDataResponse struct {
	// XXX: cbValueNameIn is an implicit input depedency for output parameters
	ValueNameInLength uint32 `idl:"name:cbValueNameIn" json:"value_name_in_length"`
	// XXX: cbDataIn is an implicit input depedency for output parameters
	DataInLength uint32 `idl:"name:cbDataIn" json:"data_in_length"`

	// pValueName: A pointer to a buffer that receives a string specifying the name of the
	// configuration data value. For rules governing value names, see section 2.2.4.18.
	ValueName          string `idl:"name:pValueName;size_is:((cbValueNameIn/2))" json:"value_name"`
	ValueNameOutLength uint32 `idl:"name:pcbValueNameOut" json:"value_name_out_length"`
	// pType: A parameter specified in Dynamically Typed Query Parameters (section 3.1.4.1.2).
	Type uint32 `idl:"name:pType" json:"type"`
	// pData: A pointer to BUFFER as specified in Dynamically Typed Query Parameters. This
	// parameter can be NULL if cbData equals zero.
	Data          []byte `idl:"name:pData;size_is:(cbDataIn)" json:"data"`
	DataOutLength uint32 `idl:"name:pcbDataOut" json:"data_out_length"`
	// Return: The RpcEnumPrinterData return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrinterDataResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterDataOperation) *xxx_EnumPrinterDataOperation {
	if op == nil {
		op = &xxx_EnumPrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.ValueNameInLength == uint32(0) {
		op.ValueNameInLength = o.ValueNameInLength
	}
	if op.DataInLength == uint32(0) {
		op.DataInLength = o.DataInLength
	}

	op.ValueName = o.ValueName
	op.ValueNameOutLength = o.ValueNameOutLength
	op.Type = o.Type
	op.Data = o.Data
	op.DataOutLength = o.DataOutLength
	op.Return = o.Return
	return op
}

func (o *EnumPrinterDataResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterDataOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.ValueNameInLength = op.ValueNameInLength
	o.DataInLength = op.DataInLength

	o.ValueName = op.ValueName
	o.ValueNameOutLength = op.ValueNameOutLength
	o.Type = op.Type
	o.Data = op.Data
	o.DataOutLength = op.DataOutLength
	o.Return = op.Return
}
func (o *EnumPrinterDataResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrinterDataResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterDataOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterDataOperation structure represents the RpcDeletePrinterData operation
type xxx_DeletePrinterDataOperation struct {
	Printer   *Printer `idl:"name:hPrinter" json:"printer"`
	ValueName string   `idl:"name:pValueName;string" json:"value_name"`
	Return    uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterDataOperation) OpNum() int { return 73 }

func (o *xxx_DeletePrinterDataOperation) OpName() string { return "/winspool/v1/RpcDeletePrinterData" }

func (o *xxx_DeletePrinterDataOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.ValueName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.ValueName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterDataRequest structure represents the RpcDeletePrinterData operation request
type DeletePrinterDataRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pValueName: A pointer to a string that identifies the configuration data to delete.
	// For rules governing value names, see section 2.2.4.18.
	ValueName string `idl:"name:pValueName;string" json:"value_name"`
}

func (o *DeletePrinterDataRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDataOperation) *xxx_DeletePrinterDataOperation {
	if op == nil {
		op = &xxx_DeletePrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.ValueName = o.ValueName
	return op
}

func (o *DeletePrinterDataRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDataOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.ValueName = op.ValueName
}
func (o *DeletePrinterDataRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterDataRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDataOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterDataResponse structure represents the RpcDeletePrinterData operation response
type DeletePrinterDataResponse struct {
	// Return: The RpcDeletePrinterData return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterDataResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDataOperation) *xxx_DeletePrinterDataOperation {
	if op == nil {
		op = &xxx_DeletePrinterDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrinterDataResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDataOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrinterDataResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterDataResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDataOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetPrinterDataExOperation structure represents the RpcSetPrinterDataEx operation
type xxx_SetPrinterDataExOperation struct {
	Printer    *Printer `idl:"name:hPrinter" json:"printer"`
	KeyName    string   `idl:"name:pKeyName;string" json:"key_name"`
	ValueName  string   `idl:"name:pValueName;string" json:"value_name"`
	Type       uint32   `idl:"name:Type" json:"type"`
	Data       []byte   `idl:"name:pData;size_is:(cbData)" json:"data"`
	DataLength uint32   `idl:"name:cbData" json:"data_length"`
	Return     uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_SetPrinterDataExOperation) OpNum() int { return 77 }

func (o *xxx_SetPrinterDataExOperation) OpName() string { return "/winspool/v1/RpcSetPrinterDataEx" }

func (o *xxx_SetPrinterDataExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Data != nil && o.DataLength == 0 {
		o.DataLength = uint32(len(o.Data))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.KeyName); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.ValueName); err != nil {
			return err
		}
	}
	// Type {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Type); err != nil {
			return err
		}
	}
	// pData {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbData](uchar))
	{
		dimSize1 := uint64(o.DataLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Data {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Data[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// cbData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.DataLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.KeyName); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.ValueName); err != nil {
			return err
		}
	}
	// Type {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Type); err != nil {
			return err
		}
	}
	// pData {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbData](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]byte, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if err := w.ReadData(&o.Data[i1]); err != nil {
				return err
			}
		}
	}
	// cbData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.DataLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterDataExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetPrinterDataExRequest structure represents the RpcSetPrinterDataEx operation request
type SetPrinterDataExRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pKeyName: A pointer to a string that specifies the key under which the value is to
	// be set. A key name is an arbitrary string defined by the printer driver associated
	// with the printer object. For rules governing key names, see section 2.2.4.7.
	KeyName string `idl:"name:pKeyName;string" json:"key_name"`
	// pValueName: A pointer to a string that identifies the data to set. For rules governing
	// value names, see section 2.2.4.18.
	//
	// For print servers, a value name is one of the predefined strings listed in Server
	// Handle Key Values (section 2.2.3.10).
	ValueName string `idl:"name:pValueName;string" json:"value_name"`
	// Type: A code that indicates the type of data that is pointed to by the pData parameter.
	// The value SHOULD be one of the possible type codes defined by type values in section
	// 2.2.3.9. For rules governing registry type values, see section 2.2.4.15.
	Type uint32 `idl:"name:Type" json:"type"`
	// pData: A pointer to an array of bytes that contain the printer configuration data.
	// The type of the data in the buffer is specified by the Type parameter.
	Data []byte `idl:"name:pData;size_is:(cbData)" json:"data"`
	// cbData: The size, in bytes, of the pData array. This value SHOULD NOT be zero.
	DataLength uint32 `idl:"name:cbData" json:"data_length"`
}

func (o *SetPrinterDataExRequest) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterDataExOperation) *xxx_SetPrinterDataExOperation {
	if op == nil {
		op = &xxx_SetPrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.KeyName = o.KeyName
	op.ValueName = o.ValueName
	op.Type = o.Type
	op.Data = o.Data
	op.DataLength = o.DataLength
	return op
}

func (o *SetPrinterDataExRequest) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterDataExOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.KeyName = op.KeyName
	o.ValueName = op.ValueName
	o.Type = op.Type
	o.Data = op.Data
	o.DataLength = op.DataLength
}
func (o *SetPrinterDataExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetPrinterDataExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterDataExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetPrinterDataExResponse structure represents the RpcSetPrinterDataEx operation response
type SetPrinterDataExResponse struct {
	// Return: The RpcSetPrinterDataEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetPrinterDataExResponse) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterDataExOperation) *xxx_SetPrinterDataExOperation {
	if op == nil {
		op = &xxx_SetPrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetPrinterDataExResponse) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterDataExOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetPrinterDataExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetPrinterDataExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterDataExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterDataExOperation structure represents the RpcGetPrinterDataEx operation
type xxx_GetPrinterDataExOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	KeyName      string   `idl:"name:pKeyName;string" json:"key_name"`
	ValueName    string   `idl:"name:pValueName;string" json:"value_name"`
	Type         uint32   `idl:"name:pType" json:"type"`
	Data         []byte   `idl:"name:pData;size_is:(nSize)" json:"data"`
	Size         uint32   `idl:"name:nSize" json:"size"`
	NeededLength uint32   `idl:"name:pcbNeeded" json:"needed_length"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterDataExOperation) OpNum() int { return 78 }

func (o *xxx_GetPrinterDataExOperation) OpName() string { return "/winspool/v1/RpcGetPrinterDataEx" }

func (o *xxx_GetPrinterDataExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.KeyName); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.ValueName); err != nil {
			return err
		}
	}
	// nSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Size); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.KeyName); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.ValueName); err != nil {
			return err
		}
	}
	// nSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Size); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pType {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Type); err != nil {
			return err
		}
	}
	// pData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=nSize](uchar))
	{
		dimSize1 := uint64(o.Size)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Data {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Data[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Data); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDataExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pType {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Type); err != nil {
			return err
		}
	}
	// pData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=nSize](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Data", sizeInfo[0])
		}
		o.Data = make([]byte, sizeInfo[0])
		for i1 := range o.Data {
			i1 := i1
			if err := w.ReadData(&o.Data[i1]); err != nil {
				return err
			}
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterDataExRequest structure represents the RpcGetPrinterDataEx operation request
type GetPrinterDataExRequest struct {
	// hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pKeyName: A pointer to a string that specifies the key under which the value is to
	// be queried. A key name is an arbitrary string defined by the printer driver associated
	// with the printer object. For rules governing key names, see section 2.2.4.7.
	KeyName string `idl:"name:pKeyName;string" json:"key_name"`
	// pValueName: A pointer to a string that identifies the data to get. For rules governing
	// value names, see section 2.2.4.18.
	//
	// For print servers, the value name is one of the predefined strings listed in Server
	// Handle Key Values (section 2.2.3.10).
	ValueName string `idl:"name:pValueName;string" json:"value_name"`
	// nSize: A parameter specified in Dynamically Typed Query Parameters.
	Size uint32 `idl:"name:nSize" json:"size"`
}

func (o *GetPrinterDataExRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDataExOperation) *xxx_GetPrinterDataExOperation {
	if op == nil {
		op = &xxx_GetPrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.KeyName = o.KeyName
	op.ValueName = o.ValueName
	op.Size = o.Size
	return op
}

func (o *GetPrinterDataExRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDataExOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.KeyName = op.KeyName
	o.ValueName = op.ValueName
	o.Size = op.Size
}
func (o *GetPrinterDataExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterDataExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDataExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterDataExResponse structure represents the RpcGetPrinterDataEx operation response
type GetPrinterDataExResponse struct {
	// XXX: nSize is an implicit input depedency for output parameters
	Size uint32 `idl:"name:nSize" json:"size"`

	// pType: A parameter specified in Dynamically Typed Query Parameters (section 3.1.4.1.2).
	Type uint32 `idl:"name:pType" json:"type"`
	// pData: A pointer to BUFFER, as specified in Dynamically Typed Query Parameters. This
	// parameter can be NULL if nSize equals zero
	Data []byte `idl:"name:pData;size_is:(nSize)" json:"data"`
	// pcbNeeded: A parameter specified in Dynamically Typed Query Parameters.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// Return: The RpcGetPrinterDataEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterDataExResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDataExOperation) *xxx_GetPrinterDataExOperation {
	if op == nil {
		op = &xxx_GetPrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.Size == uint32(0) {
		op.Size = o.Size
	}

	op.Type = o.Type
	op.Data = o.Data
	op.NeededLength = o.NeededLength
	op.Return = o.Return
	return op
}

func (o *GetPrinterDataExResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDataExOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.Size = op.Size

	o.Type = op.Type
	o.Data = op.Data
	o.NeededLength = op.NeededLength
	o.Return = op.Return
}
func (o *GetPrinterDataExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterDataExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDataExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPrinterDataExOperation structure represents the RpcEnumPrinterDataEx operation
type xxx_EnumPrinterDataExOperation struct {
	Printer             *Printer `idl:"name:hPrinter" json:"printer"`
	KeyName             string   `idl:"name:pKeyName;string" json:"key_name"`
	EnumValues          []byte   `idl:"name:pEnumValues;size_is:(cbEnumValuesIn)" json:"enum_values"`
	EnumValuesInLength  uint32   `idl:"name:cbEnumValuesIn" json:"enum_values_in_length"`
	EnumValuesOutLength uint32   `idl:"name:pcbEnumValuesOut" json:"enum_values_out_length"`
	EnumValuesLength    uint32   `idl:"name:numEnumValues" json:"enum_values_length"`
	Return              uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrinterDataExOperation) OpNum() int { return 79 }

func (o *xxx_EnumPrinterDataExOperation) OpName() string { return "/winspool/v1/RpcEnumPrinterDataEx" }

func (o *xxx_EnumPrinterDataExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.KeyName); err != nil {
			return err
		}
	}
	// cbEnumValuesIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.EnumValuesInLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.KeyName); err != nil {
			return err
		}
	}
	// cbEnumValuesIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.EnumValuesInLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pEnumValues {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbEnumValuesIn](uchar))
	{
		dimSize1 := uint64(o.EnumValuesInLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.EnumValues {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.EnumValues[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.EnumValues); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// pcbEnumValuesOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.EnumValuesOutLength); err != nil {
			return err
		}
	}
	// numEnumValues {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.EnumValuesLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterDataExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pEnumValues {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbEnumValuesIn](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.EnumValues", sizeInfo[0])
		}
		o.EnumValues = make([]byte, sizeInfo[0])
		for i1 := range o.EnumValues {
			i1 := i1
			if err := w.ReadData(&o.EnumValues[i1]); err != nil {
				return err
			}
		}
	}
	// pcbEnumValuesOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.EnumValuesOutLength); err != nil {
			return err
		}
	}
	// numEnumValues {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.EnumValuesLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrinterDataExRequest structure represents the RpcEnumPrinterDataEx operation request
type EnumPrinterDataExRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pKeyName: A pointer to a string that specifies the key containing the values to enumerate.
	// A key name is an arbitrary string defined by the printer driver associated with the
	// printer object. For rules governing key names, see section 2.2.4.7.
	KeyName            string `idl:"name:pKeyName;string" json:"key_name"`
	EnumValuesInLength uint32 `idl:"name:cbEnumValuesIn" json:"enum_values_in_length"`
}

func (o *EnumPrinterDataExRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterDataExOperation) *xxx_EnumPrinterDataExOperation {
	if op == nil {
		op = &xxx_EnumPrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.KeyName = o.KeyName
	op.EnumValuesInLength = o.EnumValuesInLength
	return op
}

func (o *EnumPrinterDataExRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterDataExOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.KeyName = op.KeyName
	o.EnumValuesInLength = op.EnumValuesInLength
}
func (o *EnumPrinterDataExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrinterDataExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterDataExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrinterDataExResponse structure represents the RpcEnumPrinterDataEx operation response
type EnumPrinterDataExResponse struct {
	// XXX: cbEnumValuesIn is an implicit input depedency for output parameters
	EnumValuesInLength uint32 `idl:"name:cbEnumValuesIn" json:"enum_values_in_length"`

	// pEnumValues: A pointer to BUFFER as specified in PRINTER_ENUM_VALUES Structures Query
	// Parameters (section 3.1.4.1.10).
	EnumValues          []byte `idl:"name:pEnumValues;size_is:(cbEnumValuesIn)" json:"enum_values"`
	EnumValuesOutLength uint32 `idl:"name:pcbEnumValuesOut" json:"enum_values_out_length"`
	EnumValuesLength    uint32 `idl:"name:numEnumValues" json:"enum_values_length"`
	// Return: The RpcEnumPrinterDataEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrinterDataExResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterDataExOperation) *xxx_EnumPrinterDataExOperation {
	if op == nil {
		op = &xxx_EnumPrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.EnumValuesInLength == uint32(0) {
		op.EnumValuesInLength = o.EnumValuesInLength
	}

	op.EnumValues = o.EnumValues
	op.EnumValuesOutLength = o.EnumValuesOutLength
	op.EnumValuesLength = o.EnumValuesLength
	op.Return = o.Return
	return op
}

func (o *EnumPrinterDataExResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterDataExOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.EnumValuesInLength = op.EnumValuesInLength

	o.EnumValues = op.EnumValues
	o.EnumValuesOutLength = op.EnumValuesOutLength
	o.EnumValuesLength = op.EnumValuesLength
	o.Return = op.Return
}
func (o *EnumPrinterDataExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrinterDataExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterDataExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPrinterKeyOperation structure represents the RpcEnumPrinterKey operation
type xxx_EnumPrinterKeyOperation struct {
	Printer         *Printer `idl:"name:hPrinter" json:"printer"`
	KeyName         string   `idl:"name:pKeyName;string" json:"key_name"`
	Subkey          string   `idl:"name:pSubkey;size_is:((cbSubkeyIn/2))" json:"subkey"`
	SubkeyInLength  uint32   `idl:"name:cbSubkeyIn" json:"subkey_in_length"`
	SubkeyOutLength uint32   `idl:"name:pcbSubkeyOut" json:"subkey_out_length"`
	Return          uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPrinterKeyOperation) OpNum() int { return 80 }

func (o *xxx_EnumPrinterKeyOperation) OpName() string { return "/winspool/v1/RpcEnumPrinterKey" }

func (o *xxx_EnumPrinterKeyOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterKeyOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.KeyName); err != nil {
			return err
		}
	}
	// cbSubkeyIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.SubkeyInLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterKeyOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.KeyName); err != nil {
			return err
		}
	}
	// cbSubkeyIn {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.SubkeyInLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterKeyOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterKeyOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pSubkey {out} (1:{pointer=ref}*(1)[dim:0,size_is=(cbSubkeyIn/2),string](wchar))
	{
		dimSize1 := uint64((o.SubkeyInLength / 2))
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		_Subkey_buf := utf16.Encode([]rune(o.Subkey))
		if uint64(len(_Subkey_buf)) > sizeInfo[0] {
			_Subkey_buf = _Subkey_buf[:sizeInfo[0]]
		}
		for i1 := range _Subkey_buf {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(_Subkey_buf[i1]); err != nil {
				return err
			}
		}
		for i1 := len(_Subkey_buf); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint16(0)); err != nil {
				return err
			}
		}
	}
	// pcbSubkeyOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.SubkeyOutLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPrinterKeyOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pSubkey {out} (1:{pointer=ref}*(1)[dim:0,size_is=(cbSubkeyIn/2),string](wchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		var _Subkey_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _Subkey_buf", sizeInfo[0])
		}
		_Subkey_buf = make([]uint16, sizeInfo[0])
		for i1 := range _Subkey_buf {
			i1 := i1
			if err := w.ReadData(&_Subkey_buf[i1]); err != nil {
				return err
			}
		}
		o.Subkey = strings.TrimRight(string(utf16.Decode(_Subkey_buf)), ndr.ZeroString)
	}
	// pcbSubkeyOut {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.SubkeyOutLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPrinterKeyRequest structure represents the RpcEnumPrinterKey operation request
type EnumPrinterKeyRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pKeyName: A pointer to a string that specifies the key containing the subkeys to
	// enumerate. A key name is an arbitrary string defined by the printer driver associated
	// with the printer object. For rules governing key names, see section 2.2.4.7.
	KeyName        string `idl:"name:pKeyName;string" json:"key_name"`
	SubkeyInLength uint32 `idl:"name:cbSubkeyIn" json:"subkey_in_length"`
}

func (o *EnumPrinterKeyRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterKeyOperation) *xxx_EnumPrinterKeyOperation {
	if op == nil {
		op = &xxx_EnumPrinterKeyOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.KeyName = o.KeyName
	op.SubkeyInLength = o.SubkeyInLength
	return op
}

func (o *EnumPrinterKeyRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterKeyOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.KeyName = op.KeyName
	o.SubkeyInLength = op.SubkeyInLength
}
func (o *EnumPrinterKeyRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPrinterKeyRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterKeyOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPrinterKeyResponse structure represents the RpcEnumPrinterKey operation response
type EnumPrinterKeyResponse struct {
	// XXX: cbSubkeyIn is an implicit input depedency for output parameters
	SubkeyInLength uint32 `idl:"name:cbSubkeyIn" json:"subkey_in_length"`

	// pSubkey: A pointer to BUFFER as specified in String Query Parameters (section 3.1.4.1.7).
	Subkey          string `idl:"name:pSubkey;size_is:((cbSubkeyIn/2))" json:"subkey"`
	SubkeyOutLength uint32 `idl:"name:pcbSubkeyOut" json:"subkey_out_length"`
	// Return: The RpcEnumPrinterKey return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPrinterKeyResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPrinterKeyOperation) *xxx_EnumPrinterKeyOperation {
	if op == nil {
		op = &xxx_EnumPrinterKeyOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.SubkeyInLength == uint32(0) {
		op.SubkeyInLength = o.SubkeyInLength
	}

	op.Subkey = o.Subkey
	op.SubkeyOutLength = o.SubkeyOutLength
	op.Return = o.Return
	return op
}

func (o *EnumPrinterKeyResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPrinterKeyOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.SubkeyInLength = op.SubkeyInLength

	o.Subkey = op.Subkey
	o.SubkeyOutLength = op.SubkeyOutLength
	o.Return = op.Return
}
func (o *EnumPrinterKeyResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPrinterKeyResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPrinterKeyOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterDataExOperation structure represents the RpcDeletePrinterDataEx operation
type xxx_DeletePrinterDataExOperation struct {
	Printer   *Printer `idl:"name:hPrinter" json:"printer"`
	KeyName   string   `idl:"name:pKeyName;string" json:"key_name"`
	ValueName string   `idl:"name:pValueName;string" json:"value_name"`
	Return    uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterDataExOperation) OpNum() int { return 81 }

func (o *xxx_DeletePrinterDataExOperation) OpName() string {
	return "/winspool/v1/RpcDeletePrinterDataEx"
}

func (o *xxx_DeletePrinterDataExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.KeyName); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.ValueName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.KeyName); err != nil {
			return err
		}
	}
	// pValueName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.ValueName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDataExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterDataExRequest structure represents the RpcDeletePrinterDataEx operation request
type DeletePrinterDataExRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pKeyName: A pointer to a string that specifies the key containing the value to delete.
	// A key name is an arbitrary string defined by the printer driver associated with the
	// printer object. For rules governing key names, see section 2.2.4.7.
	KeyName string `idl:"name:pKeyName;string" json:"key_name"`
	// pValueName: A pointer to a string that identifies the configuration data to delete.
	// For rules governing value names, see section 2.2.4.18.
	ValueName string `idl:"name:pValueName;string" json:"value_name"`
}

func (o *DeletePrinterDataExRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDataExOperation) *xxx_DeletePrinterDataExOperation {
	if op == nil {
		op = &xxx_DeletePrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.KeyName = o.KeyName
	op.ValueName = o.ValueName
	return op
}

func (o *DeletePrinterDataExRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDataExOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.KeyName = op.KeyName
	o.ValueName = op.ValueName
}
func (o *DeletePrinterDataExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterDataExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDataExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterDataExResponse structure represents the RpcDeletePrinterDataEx operation response
type DeletePrinterDataExResponse struct {
	// Return: The RpcDeletePrinterDataEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterDataExResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDataExOperation) *xxx_DeletePrinterDataExOperation {
	if op == nil {
		op = &xxx_DeletePrinterDataExOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrinterDataExResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDataExOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrinterDataExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterDataExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDataExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterKeyOperation structure represents the RpcDeletePrinterKey operation
type xxx_DeletePrinterKeyOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	KeyName string   `idl:"name:pKeyName;string" json:"key_name"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterKeyOperation) OpNum() int { return 82 }

func (o *xxx_DeletePrinterKeyOperation) OpName() string { return "/winspool/v1/RpcDeletePrinterKey" }

func (o *xxx_DeletePrinterKeyOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterKeyOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.KeyName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterKeyOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pKeyName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.KeyName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterKeyOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterKeyOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterKeyOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterKeyRequest structure represents the RpcDeletePrinterKey operation request
type DeletePrinterKeyRequest struct {
	// hPrinter: A handle to a printer object that was opened by RpcAddPrinter (section
	// 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2),
	// or RpcOpenPrinterEx (section 3.1.4.2.14) methods.
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pKeyName: A pointer to a string that specifies the key to delete. A key name is an
	// arbitrary string defined by the printer driver associated with the printer object.
	// For rules governing key names, see section 2.2.4.7.
	KeyName string `idl:"name:pKeyName;string" json:"key_name"`
}

func (o *DeletePrinterKeyRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterKeyOperation) *xxx_DeletePrinterKeyOperation {
	if op == nil {
		op = &xxx_DeletePrinterKeyOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.KeyName = o.KeyName
	return op
}

func (o *DeletePrinterKeyRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterKeyOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.KeyName = op.KeyName
}
func (o *DeletePrinterKeyRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterKeyRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterKeyOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterKeyResponse structure represents the RpcDeletePrinterKey operation response
type DeletePrinterKeyResponse struct {
	// Return: The RpcDeletePrinterKey return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterKeyResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterKeyOperation) *xxx_DeletePrinterKeyOperation {
	if op == nil {
		op = &xxx_DeletePrinterKeyOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrinterKeyResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterKeyOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrinterKeyResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterKeyResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterKeyOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePrinterDriverExOperation structure represents the RpcDeletePrinterDriverEx operation
type xxx_DeletePrinterDriverExOperation struct {
	Name        string `idl:"name:pName;string;pointer:unique" json:"name"`
	Environment string `idl:"name:pEnvironment;string" json:"environment"`
	DriverName  string `idl:"name:pDriverName;string" json:"driver_name"`
	DeleteFlag  uint32 `idl:"name:dwDeleteFlag" json:"delete_flag"`
	VersionNum  uint32 `idl:"name:dwVersionNum" json:"version_num"`
	Return      uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePrinterDriverExOperation) OpNum() int { return 84 }

func (o *xxx_DeletePrinterDriverExOperation) OpName() string {
	return "/winspool/v1/RpcDeletePrinterDriverEx"
}

func (o *xxx_DeletePrinterDriverExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
			return err
		}
	}
	// pDriverName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.DriverName); err != nil {
			return err
		}
	}
	// dwDeleteFlag {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.DeleteFlag); err != nil {
			return err
		}
	}
	// dwVersionNum {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.VersionNum); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
	}
	// pDriverName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.DriverName); err != nil {
			return err
		}
	}
	// dwDeleteFlag {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.DeleteFlag); err != nil {
			return err
		}
	}
	// dwVersionNum {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.VersionNum); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePrinterDriverExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePrinterDriverExRequest structure represents the RpcDeletePrinterDriverEx operation request
type DeletePrinterDriverExRequest struct {
	// pName: A STRING_HANDLE structure (section 2.2.1.1.7) that conforms to the parameter
	// specification in Print Server Name Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pEnvironment: A string that conforms to the parameter specification in Environment
	// Name Parameters (section 3.1.4.1.3).
	Environment string `idl:"name:pEnvironment;string" json:"environment"`
	// pDriverName: A pointer to a string that specifies the name of the printer driver
	// to delete. For rules governing printer driver names, see section 2.2.4.3.
	DriverName string `idl:"name:pDriverName;string" json:"driver_name"`
	// dwDeleteFlag: A bit field that specifies options for deleting files and versions
	// of the printer driver. If the value of this parameter is zero, the driver MUST be
	// removed from the list of supported drivers, and the driver files MUST remain on the
	// print server.
	//
	// These flags can be combined to specify multiple options.
	//
	//	+----------------------------------------+----------------------------------------------------------------------------------+
	//	|                                        |                                                                                  |
	//	|               NAME/VALUE               |                                   DESCRIPTION                                    |
	//	|                                        |                                                                                  |
	//	+----------------------------------------+----------------------------------------------------------------------------------+
	//	+----------------------------------------+----------------------------------------------------------------------------------+
	//	| DPD_DELETE_UNUSED_FILES 0x00000001     | Remove unused printer driver files. In this case, an error MUST NOT be returned  |
	//	|                                        | if some of the files are being used by another installed driver.                 |
	//	+----------------------------------------+----------------------------------------------------------------------------------+
	//	| DPD_DELETE_SPECIFIC_VERSION 0x00000002 | Delete the version specified by the value of the dwVersionNum parameter. Because |
	//	|                                        | more than one version of a printer driver can be installed on a print server,    |
	//	|                                        | setting this flag does not guarantee that the driver is removed from the list of |
	//	|                                        | supported drivers on the server.                                                 |
	//	+----------------------------------------+----------------------------------------------------------------------------------+
	//	| DPD_DELETE_ALL_FILES 0x00000004        | Delete the printer driver only if all its associated files can be removed. In    |
	//	|                                        | this case, an error MUST be returned if some of the files are being used by      |
	//	|                                        | another installed driver.                                                        |
	//	+----------------------------------------+----------------------------------------------------------------------------------+
	DeleteFlag uint32 `idl:"name:dwDeleteFlag" json:"delete_flag"`
	// dwVersionNum: The version of the printer driver to delete.
	//
	// The value of this parameter is implementation-specific and identifies the driver
	// version and the operating system for which the driver was written. The driver version
	// for each printer driver object in a List of Printers (section 3.1.1). It has the
	// same format and meaning as the cVersion members in RPC_DRIVER_INFO structures (section
	// 2.2.1.5).<340>
	VersionNum uint32 `idl:"name:dwVersionNum" json:"version_num"`
}

func (o *DeletePrinterDriverExRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDriverExOperation) *xxx_DeletePrinterDriverExOperation {
	if op == nil {
		op = &xxx_DeletePrinterDriverExOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.Environment = o.Environment
	op.DriverName = o.DriverName
	op.DeleteFlag = o.DeleteFlag
	op.VersionNum = o.VersionNum
	return op
}

func (o *DeletePrinterDriverExRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDriverExOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.Environment = op.Environment
	o.DriverName = op.DriverName
	o.DeleteFlag = op.DeleteFlag
	o.VersionNum = op.VersionNum
}
func (o *DeletePrinterDriverExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePrinterDriverExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDriverExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePrinterDriverExResponse structure represents the RpcDeletePrinterDriverEx operation response
type DeletePrinterDriverExResponse struct {
	// Return: The RpcDeletePrinterDriverEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePrinterDriverExResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePrinterDriverExOperation) *xxx_DeletePrinterDriverExOperation {
	if op == nil {
		op = &xxx_DeletePrinterDriverExOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePrinterDriverExResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePrinterDriverExOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePrinterDriverExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePrinterDriverExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePrinterDriverExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPerMachineConnectionOperation structure represents the RpcAddPerMachineConnection operation
type xxx_AddPerMachineConnectionOperation struct {
	Server      string `idl:"name:pServer;string;pointer:unique" json:"server"`
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	PrintServer string `idl:"name:pPrintServer;string" json:"print_server"`
	Provider    string `idl:"name:pProvider;string" json:"provider"`
	Return      uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPerMachineConnectionOperation) OpNum() int { return 85 }

func (o *xxx_AddPerMachineConnectionOperation) OpName() string {
	return "/winspool/v1/RpcAddPerMachineConnection"
}

func (o *xxx_AddPerMachineConnectionOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPerMachineConnectionOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Server != "" {
			_ptr_pServer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Server); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Server, _ptr_pServer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrinterName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
			return err
		}
	}
	// pPrintServer {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PrintServer); err != nil {
			return err
		}
	}
	// pProvider {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Provider); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPerMachineConnectionOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pServer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Server); err != nil {
				return err
			}
			return nil
		})
		_s_pServer := func(ptr interface{}) { o.Server = *ptr.(*string) }
		if err := w.ReadPointer(&o.Server, _s_pServer, _ptr_pServer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrinterName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
	}
	// pPrintServer {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrintServer); err != nil {
			return err
		}
	}
	// pProvider {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Provider); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPerMachineConnectionOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPerMachineConnectionOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPerMachineConnectionOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPerMachineConnectionRequest structure represents the RpcAddPerMachineConnection operation request
type AddPerMachineConnectionRequest struct {
	// pServer: A value that adheres to the specification in Print Server Name Parameters
	// (section 3.1.4.1.4).
	Server string `idl:"name:pServer;string;pointer:unique" json:"server"`
	// pPrinterName: A value that adheres to the specification in Printer Name Parameters
	// (section 3.1.4.1.5). A printer connection of the form:
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	// pPrintServer: A pointer to a string that specifies the name of the print server that
	// is hosting the printer to which the connection is established. For rules governing
	// server names, see section 2.2.4.16.
	PrintServer string `idl:"name:pPrintServer;string" json:"print_server"`
	// pProvider: A pointer to a string that specifies the name of a print provider. If
	// the string is the empty string "", an implementation-specific default print provider
	// name is used.<312> For rules governing print provider names, see section 2.2.4.12.
	Provider string `idl:"name:pProvider;string" json:"provider"`
}

func (o *AddPerMachineConnectionRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPerMachineConnectionOperation) *xxx_AddPerMachineConnectionOperation {
	if op == nil {
		op = &xxx_AddPerMachineConnectionOperation{}
	}
	if o == nil {
		return op
	}
	op.Server = o.Server
	op.PrinterName = o.PrinterName
	op.PrintServer = o.PrintServer
	op.Provider = o.Provider
	return op
}

func (o *AddPerMachineConnectionRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPerMachineConnectionOperation) {
	if o == nil {
		return
	}
	o.Server = op.Server
	o.PrinterName = op.PrinterName
	o.PrintServer = op.PrintServer
	o.Provider = op.Provider
}
func (o *AddPerMachineConnectionRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPerMachineConnectionRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPerMachineConnectionOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPerMachineConnectionResponse structure represents the RpcAddPerMachineConnection operation response
type AddPerMachineConnectionResponse struct {
	// Return: The RpcAddPerMachineConnection return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPerMachineConnectionResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPerMachineConnectionOperation) *xxx_AddPerMachineConnectionOperation {
	if op == nil {
		op = &xxx_AddPerMachineConnectionOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddPerMachineConnectionResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPerMachineConnectionOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddPerMachineConnectionResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPerMachineConnectionResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPerMachineConnectionOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeletePerMachineConnectionOperation structure represents the RpcDeletePerMachineConnection operation
type xxx_DeletePerMachineConnectionOperation struct {
	Server      string `idl:"name:pServer;string;pointer:unique" json:"server"`
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
	Return      uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_DeletePerMachineConnectionOperation) OpNum() int { return 86 }

func (o *xxx_DeletePerMachineConnectionOperation) OpName() string {
	return "/winspool/v1/RpcDeletePerMachineConnection"
}

func (o *xxx_DeletePerMachineConnectionOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePerMachineConnectionOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Server != "" {
			_ptr_pServer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Server); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Server, _ptr_pServer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrinterName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PrinterName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePerMachineConnectionOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pServer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Server); err != nil {
				return err
			}
			return nil
		})
		_s_pServer := func(ptr interface{}) { o.Server = *ptr.(*string) }
		if err := w.ReadPointer(&o.Server, _s_pServer, _ptr_pServer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrinterName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PrinterName); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePerMachineConnectionOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePerMachineConnectionOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeletePerMachineConnectionOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeletePerMachineConnectionRequest structure represents the RpcDeletePerMachineConnection operation request
type DeletePerMachineConnectionRequest struct {
	// pServer: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Server string `idl:"name:pServer;string;pointer:unique" json:"server"`
	// pPrinterName: A parameter specified in Printer Name Parameters (section 3.1.4.1.5)
	// which specifies a printer connection.
	PrinterName string `idl:"name:pPrinterName;string" json:"printer_name"`
}

func (o *DeletePerMachineConnectionRequest) xxx_ToOp(ctx context.Context, op *xxx_DeletePerMachineConnectionOperation) *xxx_DeletePerMachineConnectionOperation {
	if op == nil {
		op = &xxx_DeletePerMachineConnectionOperation{}
	}
	if o == nil {
		return op
	}
	op.Server = o.Server
	op.PrinterName = o.PrinterName
	return op
}

func (o *DeletePerMachineConnectionRequest) xxx_FromOp(ctx context.Context, op *xxx_DeletePerMachineConnectionOperation) {
	if o == nil {
		return
	}
	o.Server = op.Server
	o.PrinterName = op.PrinterName
}
func (o *DeletePerMachineConnectionRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeletePerMachineConnectionRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePerMachineConnectionOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeletePerMachineConnectionResponse structure represents the RpcDeletePerMachineConnection operation response
type DeletePerMachineConnectionResponse struct {
	// Return: The RpcDeletePerMachineConnection return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeletePerMachineConnectionResponse) xxx_ToOp(ctx context.Context, op *xxx_DeletePerMachineConnectionOperation) *xxx_DeletePerMachineConnectionOperation {
	if op == nil {
		op = &xxx_DeletePerMachineConnectionOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeletePerMachineConnectionResponse) xxx_FromOp(ctx context.Context, op *xxx_DeletePerMachineConnectionOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeletePerMachineConnectionResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeletePerMachineConnectionResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeletePerMachineConnectionOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumPerMachineConnectionsOperation structure represents the RpcEnumPerMachineConnections operation
type xxx_EnumPerMachineConnectionsOperation struct {
	Server        string `idl:"name:pServer;string;pointer:unique" json:"server"`
	PrinterEnum   []byte `idl:"name:pPrinterEnum;size_is:(cbBuf);pointer:unique" json:"printer_enum"`
	BufferLength  uint32 `idl:"name:cbBuf" json:"buffer_length"`
	NeededLength  uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	Return        uint32 `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumPerMachineConnectionsOperation) OpNum() int { return 87 }

func (o *xxx_EnumPerMachineConnectionsOperation) OpName() string {
	return "/winspool/v1/RpcEnumPerMachineConnections"
}

func (o *xxx_EnumPerMachineConnectionsOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.PrinterEnum != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.PrinterEnum))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPerMachineConnectionsOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Server != "" {
			_ptr_pServer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Server); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Server, _ptr_pServer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrinterEnum != nil || o.BufferLength > 0 {
			_ptr_pPrinterEnum := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrinterEnum {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrinterEnum[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrinterEnum); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterEnum, _ptr_pPrinterEnum); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPerMachineConnectionsOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pServer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Server); err != nil {
				return err
			}
			return nil
		})
		_s_pServer := func(ptr interface{}) { o.Server = *ptr.(*string) }
		if err := w.ReadPointer(&o.Server, _s_pServer, _ptr_pServer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrinterEnum := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrinterEnum", sizeInfo[0])
			}
			o.PrinterEnum = make([]byte, sizeInfo[0])
			for i1 := range o.PrinterEnum {
				i1 := i1
				if err := w.ReadData(&o.PrinterEnum[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrinterEnum := func(ptr interface{}) { o.PrinterEnum = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrinterEnum, _s_pPrinterEnum, _ptr_pPrinterEnum); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPerMachineConnectionsOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPerMachineConnectionsOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		if o.PrinterEnum != nil || o.BufferLength > 0 {
			_ptr_pPrinterEnum := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.BufferLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.PrinterEnum {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.PrinterEnum[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.PrinterEnum); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.PrinterEnum, _ptr_pPrinterEnum); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumPerMachineConnectionsOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pPrinterEnum {in, out, disable_consistency_check} (1:{pointer=unique}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		_ptr_pPrinterEnum := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.PrinterEnum", sizeInfo[0])
			}
			o.PrinterEnum = make([]byte, sizeInfo[0])
			for i1 := range o.PrinterEnum {
				i1 := i1
				if err := w.ReadData(&o.PrinterEnum[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_pPrinterEnum := func(ptr interface{}) { o.PrinterEnum = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.PrinterEnum, _s_pPrinterEnum, _ptr_pPrinterEnum); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcbNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.NeededLength); err != nil {
			return err
		}
	}
	// pcReturned {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ReturnedCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumPerMachineConnectionsRequest structure represents the RpcEnumPerMachineConnections operation request
type EnumPerMachineConnectionsRequest struct {
	// pServer: A parameter specified in Print Server Name Parameters (section 3.1.4.1.4).
	Server string `idl:"name:pServer;string;pointer:unique" json:"server"`
	// pPrinterEnum: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	PrinterEnum []byte `idl:"name:pPrinterEnum;size_is:(cbBuf);pointer:unique" json:"printer_enum"`
	// cbBuf: A parameter specified in section 3.1.4.1.9.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
}

func (o *EnumPerMachineConnectionsRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumPerMachineConnectionsOperation) *xxx_EnumPerMachineConnectionsOperation {
	if op == nil {
		op = &xxx_EnumPerMachineConnectionsOperation{}
	}
	if o == nil {
		return op
	}
	op.Server = o.Server
	op.PrinterEnum = o.PrinterEnum
	op.BufferLength = o.BufferLength
	return op
}

func (o *EnumPerMachineConnectionsRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumPerMachineConnectionsOperation) {
	if o == nil {
		return
	}
	o.Server = op.Server
	o.PrinterEnum = op.PrinterEnum
	o.BufferLength = op.BufferLength
}
func (o *EnumPerMachineConnectionsRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumPerMachineConnectionsRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPerMachineConnectionsOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumPerMachineConnectionsResponse structure represents the RpcEnumPerMachineConnections operation response
type EnumPerMachineConnectionsResponse struct {
	// XXX: cbBuf is an implicit input depedency for output parameters
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`

	// pPrinterEnum: A pointer to the BUFFER, as specified in INFO Structures Query Parameters
	// (section 3.1.4.1.9).
	PrinterEnum []byte `idl:"name:pPrinterEnum;size_is:(cbBuf);pointer:unique" json:"printer_enum"`
	// pcbNeeded: A parameter specified in section 3.1.4.1.9.
	NeededLength uint32 `idl:"name:pcbNeeded" json:"needed_length"`
	// pcReturned: A parameter specified in section 3.1.4.1.9.
	ReturnedCount uint32 `idl:"name:pcReturned" json:"returned_count"`
	// Return: The RpcEnumPerMachineConnections return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumPerMachineConnectionsResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumPerMachineConnectionsOperation) *xxx_EnumPerMachineConnectionsOperation {
	if op == nil {
		op = &xxx_EnumPerMachineConnectionsOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.BufferLength == uint32(0) {
		op.BufferLength = o.BufferLength
	}

	op.PrinterEnum = o.PrinterEnum
	op.NeededLength = o.NeededLength
	op.ReturnedCount = o.ReturnedCount
	op.Return = o.Return
	return op
}

func (o *EnumPerMachineConnectionsResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumPerMachineConnectionsOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.BufferLength = op.BufferLength

	o.PrinterEnum = op.PrinterEnum
	o.NeededLength = op.NeededLength
	o.ReturnedCount = op.ReturnedCount
	o.Return = op.Return
}
func (o *EnumPerMachineConnectionsResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumPerMachineConnectionsResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumPerMachineConnectionsOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_XcvDataOperation structure represents the RpcXcvData operation
type xxx_XcvDataOperation struct {
	Xcv                *Printer `idl:"name:hXcv" json:"xcv"`
	DataName           string   `idl:"name:pszDataName;string" json:"data_name"`
	InputData          []byte   `idl:"name:pInputData;size_is:(cbInputData)" json:"input_data"`
	InputDataLength    uint32   `idl:"name:cbInputData" json:"input_data_length"`
	OutputData         []byte   `idl:"name:pOutputData;size_is:(cbOutputData)" json:"output_data"`
	OutputDataLength   uint32   `idl:"name:cbOutputData" json:"output_data_length"`
	OutputNeededLength uint32   `idl:"name:pcbOutputNeeded" json:"output_needed_length"`
	Status             uint32   `idl:"name:pdwStatus" json:"status"`
	Return             uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_XcvDataOperation) OpNum() int { return 88 }

func (o *xxx_XcvDataOperation) OpName() string { return "/winspool/v1/RpcXcvData" }

func (o *xxx_XcvDataOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.InputData != nil && o.InputDataLength == 0 {
		o.InputDataLength = uint32(len(o.InputData))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_XcvDataOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hXcv {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Xcv != nil {
			if err := o.Xcv.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pszDataName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.DataName); err != nil {
			return err
		}
	}
	// pInputData {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbInputData](uchar))
	{
		dimSize1 := uint64(o.InputDataLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.InputData {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.InputData[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.InputData); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// cbInputData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.InputDataLength); err != nil {
			return err
		}
	}
	// cbOutputData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.OutputDataLength); err != nil {
			return err
		}
	}
	// pdwStatus {in, out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Status); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_XcvDataOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hXcv {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Xcv == nil {
			o.Xcv = &Printer{}
		}
		if err := o.Xcv.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pszDataName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.DataName); err != nil {
			return err
		}
	}
	// pInputData {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbInputData](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.InputData", sizeInfo[0])
		}
		o.InputData = make([]byte, sizeInfo[0])
		for i1 := range o.InputData {
			i1 := i1
			if err := w.ReadData(&o.InputData[i1]); err != nil {
				return err
			}
		}
	}
	// cbInputData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.InputDataLength); err != nil {
			return err
		}
	}
	// cbOutputData {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.OutputDataLength); err != nil {
			return err
		}
	}
	// pdwStatus {in, out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Status); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_XcvDataOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_XcvDataOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pOutputData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbOutputData](uchar))
	{
		dimSize1 := uint64(o.OutputDataLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.OutputData {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.OutputData[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.OutputData); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// pcbOutputNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.OutputNeededLength); err != nil {
			return err
		}
	}
	// pdwStatus {in, out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Status); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_XcvDataOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pOutputData {out} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbOutputData](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.OutputData", sizeInfo[0])
		}
		o.OutputData = make([]byte, sizeInfo[0])
		for i1 := range o.OutputData {
			i1 := i1
			if err := w.ReadData(&o.OutputData[i1]); err != nil {
				return err
			}
		}
	}
	// pcbOutputNeeded {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.OutputNeededLength); err != nil {
			return err
		}
	}
	// pdwStatus {in, out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Status); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// XcvDataRequest structure represents the RpcXcvData operation request
type XcvDataRequest struct {
	// hXcv: A handle to a port or port monitor object that was opened by RpcOpenPrinter
	// (section 3.1.4.2.2) or RpcOpenPrinterEx (section 3.1.4.2.14).
	Xcv *Printer `idl:"name:hXcv" json:"xcv"`
	// pszDataName: A pointer to a string representing the name of the requested data or
	// action. The following table shows the actions that SHOULD be supported. Other port
	// monitor–specific action strings MAY be supported.<364>
	//
	//	+--------------+----------------------------------------------------------------------------------+
	//	|              |                                                                                  |
	//	|    VALUE     |                                   DESCRIPTION                                    |
	//	|              |                                                                                  |
	//	+--------------+----------------------------------------------------------------------------------+
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "AddPort"    | Add an instance of a specific port type controlled by the port monitor.          |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "DeletePort" | Delete an instance of a specific port type controlled by the port monitor.       |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "MonitorUI"  | The action returns the name of the associated port monitor client-side           |
	//	|              | executable configuration module in the buffer that is referenced by the          |
	//	|              | pOutputData parameter.                                                           |
	//	+--------------+----------------------------------------------------------------------------------+
	DataName string `idl:"name:pszDataName;string" json:"data_name"`
	// pInputData: A pointer to a buffer that contains input data. This parameter can be
	// NULL if cbInputData equals zero.
	InputData []byte `idl:"name:pInputData;size_is:(cbInputData)" json:"input_data"`
	// cbInputData: The size, in bytes, of the buffer pointed to by the pInputData parameter.
	InputDataLength uint32 `idl:"name:cbInputData" json:"input_data_length"`
	// cbOutputData: The size, in bytes, of the buffer pointed to by the pOutputData parameter.
	OutputDataLength uint32 `idl:"name:cbOutputData" json:"output_data_length"`
	// pdwStatus: A pointer to a variable that receives the status value that is returned
	// by the port monitor's XcvData method. The value MUST be zero to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	Status uint32 `idl:"name:pdwStatus" json:"status"`
}

func (o *XcvDataRequest) xxx_ToOp(ctx context.Context, op *xxx_XcvDataOperation) *xxx_XcvDataOperation {
	if op == nil {
		op = &xxx_XcvDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Xcv = o.Xcv
	op.DataName = o.DataName
	op.InputData = o.InputData
	op.InputDataLength = o.InputDataLength
	op.OutputDataLength = o.OutputDataLength
	op.Status = o.Status
	return op
}

func (o *XcvDataRequest) xxx_FromOp(ctx context.Context, op *xxx_XcvDataOperation) {
	if o == nil {
		return
	}
	o.Xcv = op.Xcv
	o.DataName = op.DataName
	o.InputData = op.InputData
	o.InputDataLength = op.InputDataLength
	o.OutputDataLength = op.OutputDataLength
	o.Status = op.Status
}
func (o *XcvDataRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *XcvDataRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_XcvDataOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// XcvDataResponse structure represents the RpcXcvData operation response
type XcvDataResponse struct {
	// XXX: cbOutputData is an implicit input depedency for output parameters
	OutputDataLength uint32 `idl:"name:cbOutputData" json:"output_data_length"`

	// pOutputData: A pointer to a buffer to receive output data. This parameter can be
	// NULL if cbOutputData equals zero.
	OutputData []byte `idl:"name:pOutputData;size_is:(cbOutputData)" json:"output_data"`
	// pcbOutputNeeded: A pointer to a location that receives the size, in bytes, required
	// for the buffer pointed to by the pOutputData parameter.
	OutputNeededLength uint32 `idl:"name:pcbOutputNeeded" json:"output_needed_length"`
	// pdwStatus: A pointer to a variable that receives the status value that is returned
	// by the port monitor's XcvData method. The value MUST be zero to indicate successful
	// completion or a nonzero Windows error code to indicate failure [MS-ERREF].
	Status uint32 `idl:"name:pdwStatus" json:"status"`
	// Return: The RpcXcvData return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *XcvDataResponse) xxx_ToOp(ctx context.Context, op *xxx_XcvDataOperation) *xxx_XcvDataOperation {
	if op == nil {
		op = &xxx_XcvDataOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.OutputDataLength == uint32(0) {
		op.OutputDataLength = o.OutputDataLength
	}

	op.OutputData = o.OutputData
	op.OutputNeededLength = o.OutputNeededLength
	op.Status = o.Status
	op.Return = o.Return
	return op
}

func (o *XcvDataResponse) xxx_FromOp(ctx context.Context, op *xxx_XcvDataOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.OutputDataLength = op.OutputDataLength

	o.OutputData = op.OutputData
	o.OutputNeededLength = op.OutputNeededLength
	o.Status = op.Status
	o.Return = op.Return
}
func (o *XcvDataResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *XcvDataResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_XcvDataOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_AddPrinterDriverExOperation structure represents the RpcAddPrinterDriverEx operation
type xxx_AddPrinterDriverExOperation struct {
	Name            string           `idl:"name:pName;string;pointer:unique" json:"name"`
	DriverContainer *DriverContainer `idl:"name:pDriverContainer" json:"driver_container"`
	FileCopyFlags   uint32           `idl:"name:dwFileCopyFlags" json:"file_copy_flags"`
	Return          uint32           `idl:"name:Return" json:"return"`
}

func (o *xxx_AddPrinterDriverExOperation) OpNum() int { return 89 }

func (o *xxx_AddPrinterDriverExOperation) OpName() string {
	return "/winspool/v1/RpcAddPrinterDriverEx"
}

func (o *xxx_AddPrinterDriverExOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverExOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Name != "" {
			_ptr_pName := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Name, _ptr_pName); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pDriverContainer {in} (1:{pointer=ref}*(1))(2:{alias=DRIVER_CONTAINER}(struct))
	{
		if o.DriverContainer != nil {
			if err := o.DriverContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&DriverContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// dwFileCopyFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.FileCopyFlags); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverExOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pName {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pName := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
				return err
			}
			return nil
		})
		_s_pName := func(ptr interface{}) { o.Name = *ptr.(*string) }
		if err := w.ReadPointer(&o.Name, _s_pName, _ptr_pName); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pDriverContainer {in} (1:{pointer=ref}*(1))(2:{alias=DRIVER_CONTAINER}(struct))
	{
		if o.DriverContainer == nil {
			o.DriverContainer = &DriverContainer{}
		}
		if err := o.DriverContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// dwFileCopyFlags {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.FileCopyFlags); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverExOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverExOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_AddPrinterDriverExOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// AddPrinterDriverExRequest structure represents the RpcAddPrinterDriverEx operation request
type AddPrinterDriverExRequest struct {
	// pName: A string that conforms to the parameter specification in Print Server Name
	// Parameters (section 3.1.4.1.4).
	Name string `idl:"name:pName;string;pointer:unique" json:"name"`
	// pDriverContainer: A pointer to a DRIVER_CONTAINER structure (section 2.2.1.2.3) that
	// MUST conform to the specification in DRIVER_CONTAINER parameters (section 3.1.4.1.8.3).
	//
	// The Level member of the DRIVER_CONTAINER refers to the level of driver information
	// structure, as follows:
	//
	//	+------------+----------------------------------------+
	//	|            |                                        |
	//	|   VALUE    |              DESCRIPTION               |
	//	|            |                                        |
	//	+------------+----------------------------------------+
	//	+------------+----------------------------------------+
	//	| 0x00000002 | DRIVER_INFO_2 (section 2.2.1.5.2).     |
	//	+------------+----------------------------------------+
	//	| 0x00000003 | RPC_DRIVER_INFO_3 (section 2.2.1.5.3). |
	//	+------------+----------------------------------------+
	//	| 0x00000004 | RPC_DRIVER_INFO_4 (section 2.2.1.5.4). |
	//	+------------+----------------------------------------+
	//	| 0x00000006 | RPC_DRIVER_INFO_6 (section 2.2.1.5.5). |
	//	+------------+----------------------------------------+
	//	| 0x00000008 | RPC_DRIVER_INFO_8 (section 2.2.1.5.6). |
	//	+------------+----------------------------------------+
	DriverContainer *DriverContainer `idl:"name:pDriverContainer" json:"driver_container"`
	// dwFileCopyFlags: A bit field that specifies options for copying replacement printer
	// driver files. The value of this parameter is a combination of flags from the following
	// tables.
	//
	// Exactly one of the following flags MUST be specified:
	//
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//	|                                 |                                                                                  |
	//	|           NAME/VALUE            |                                   DESCRIPTION                                    |
	//	|                                 |                                                                                  |
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//	| APD_STRICT_UPGRADE 0x00000001   | Add the replacement printer driver only if none of the files of the replacement  |
	//	|                                 | driver are older than any corresponding files of the currently installed driver. |
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//	| APD_STRICT_DOWNGRADE 0x00000002 | Add the replacement printer driver only if none of the files of the currently    |
	//	|                                 | installed driver are older than any corresponding files of the replacement       |
	//	|                                 | driver.                                                                          |
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//	| APD_COPY_ALL_FILES 0x00000004   | Add the printer driver and copy all the files in the driver directory. File time |
	//	|                                 | stamps MUST be ignored.                                                          |
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//	| APD_COPY_NEW_FILES 0x00000008   | Add the printer driver and copy the files in the driver directory that are newer |
	//	|                                 | than any of the corresponding files that are currently in use.                   |
	//	+---------------------------------+----------------------------------------------------------------------------------+
	//
	// Zero or more of the following flags can be specified.
	//
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	|                                            |                                                                                  |
	//	|                 NAME/VALUE                 |                                   DESCRIPTION                                    |
	//	|                                            |                                                                                  |
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	| APD_COPY_FROM_DIRECTORY 0x00000010         | Add the printer driver by using the fully qualified file names that are          |
	//	|                                            | specified in the _DRIVER_INFO_6 structure. If this flag is specified, one of the |
	//	|                                            | other copy flags in this bit field MUST be specified.                            |
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	| APD_DONT_COPY_FILES_TO_CLUSTER 0x00001000  | When adding a printer driver to a print server cluster, do not copy the driver   |
	//	|                                            | files to the shared cluster disk.                                                |
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	| APD_COPY_TO_ALL_SPOOLERS 0x00002000        | Add the printer driver to cluster spooler servers.                               |
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	| APD_INSTALL_WARNED_DRIVER 0x00008000       | Add the printer driver, even if it is in the server's List of Warned Printer     |
	//	|                                            | Drivers (section 3.1.1).<343>                                                    |
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	//	| APD_RETURN_BLOCKING_STATUS_CODE 0x00010000 | Specifies the implementation-specific error code to return if the printer driver |
	//	|                                            | is blocked from installation by server policy.<344>                              |
	//	+--------------------------------------------+----------------------------------------------------------------------------------+
	FileCopyFlags uint32 `idl:"name:dwFileCopyFlags" json:"file_copy_flags"`
}

func (o *AddPrinterDriverExRequest) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterDriverExOperation) *xxx_AddPrinterDriverExOperation {
	if op == nil {
		op = &xxx_AddPrinterDriverExOperation{}
	}
	if o == nil {
		return op
	}
	op.Name = o.Name
	op.DriverContainer = o.DriverContainer
	op.FileCopyFlags = o.FileCopyFlags
	return op
}

func (o *AddPrinterDriverExRequest) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterDriverExOperation) {
	if o == nil {
		return
	}
	o.Name = op.Name
	o.DriverContainer = op.DriverContainer
	o.FileCopyFlags = op.FileCopyFlags
}
func (o *AddPrinterDriverExRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *AddPrinterDriverExRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterDriverExOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// AddPrinterDriverExResponse structure represents the RpcAddPrinterDriverEx operation response
type AddPrinterDriverExResponse struct {
	// Return: The RpcAddPrinterDriverEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *AddPrinterDriverExResponse) xxx_ToOp(ctx context.Context, op *xxx_AddPrinterDriverExOperation) *xxx_AddPrinterDriverExOperation {
	if op == nil {
		op = &xxx_AddPrinterDriverExOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *AddPrinterDriverExResponse) xxx_FromOp(ctx context.Context, op *xxx_AddPrinterDriverExOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *AddPrinterDriverExResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *AddPrinterDriverExResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_AddPrinterDriverExOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_FlushPrinterOperation structure represents the RpcFlushPrinter operation
type xxx_FlushPrinterOperation struct {
	Printer      *Printer `idl:"name:hPrinter" json:"printer"`
	Buffer       []byte   `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
	BufferLength uint32   `idl:"name:cbBuf" json:"buffer_length"`
	WrittenCount uint32   `idl:"name:pcWritten" json:"written_count"`
	SleepCount   uint32   `idl:"name:cSleep" json:"sleep_count"`
	Return       uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_FlushPrinterOperation) OpNum() int { return 96 }

func (o *xxx_FlushPrinterOperation) OpName() string { return "/winspool/v1/RpcFlushPrinter" }

func (o *xxx_FlushPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.Buffer != nil && o.BufferLength == 0 {
		o.BufferLength = uint32(len(o.Buffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FlushPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pBuf {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		dimSize1 := uint64(o.BufferLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.Buffer {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.Buffer[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.Buffer); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.BufferLength); err != nil {
			return err
		}
	}
	// cSleep {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.SleepCount); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FlushPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pBuf {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=cbBuf](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.Buffer", sizeInfo[0])
		}
		o.Buffer = make([]byte, sizeInfo[0])
		for i1 := range o.Buffer {
			i1 := i1
			if err := w.ReadData(&o.Buffer[i1]); err != nil {
				return err
			}
		}
	}
	// cbBuf {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.BufferLength); err != nil {
			return err
		}
	}
	// cSleep {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.SleepCount); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FlushPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FlushPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pcWritten {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.WrittenCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_FlushPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pcWritten {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.WrittenCount); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// FlushPrinterRequest structure represents the RpcFlushPrinter operation request
type FlushPrinterRequest struct {
	// hPrinter: A handle to a port object that was opened by RpcOpenPrinter (section 3.1.4.2.2)
	// or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pBuf: A pointer to the array of bytes containing the data to be written to the printer.
	// This parameter can be NULL if the value of the cbBuf parameter is zero.
	Buffer []byte `idl:"name:pBuf;size_is:(cbBuf)" json:"buffer"`
	// cbBuf: The size, in bytes, of the array pointed to by the pBuf parameter.
	BufferLength uint32 `idl:"name:cbBuf" json:"buffer_length"`
	// cSleep: The time, in milliseconds, to delay the I/O line to the printer port. A value
	// of zero indicates no delay.
	SleepCount uint32 `idl:"name:cSleep" json:"sleep_count"`
}

func (o *FlushPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_FlushPrinterOperation) *xxx_FlushPrinterOperation {
	if op == nil {
		op = &xxx_FlushPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Buffer = o.Buffer
	op.BufferLength = o.BufferLength
	op.SleepCount = o.SleepCount
	return op
}

func (o *FlushPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_FlushPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Buffer = op.Buffer
	o.BufferLength = op.BufferLength
	o.SleepCount = op.SleepCount
}
func (o *FlushPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *FlushPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_FlushPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// FlushPrinterResponse structure represents the RpcFlushPrinter operation response
type FlushPrinterResponse struct {
	// pcWritten: A pointer to a variable that receives the number of bytes of data that
	// were written to the printer.
	WrittenCount uint32 `idl:"name:pcWritten" json:"written_count"`
	// Return: The RpcFlushPrinter return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *FlushPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_FlushPrinterOperation) *xxx_FlushPrinterOperation {
	if op == nil {
		op = &xxx_FlushPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.WrittenCount = o.WrittenCount
	op.Return = o.Return
	return op
}

func (o *FlushPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_FlushPrinterOperation) {
	if o == nil {
		return
	}
	o.WrittenCount = op.WrittenCount
	o.Return = op.Return
}
func (o *FlushPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *FlushPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_FlushPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SendRecvBIDIDataOperation structure represents the RpcSendRecvBidiData operation
type xxx_SendRecvBIDIDataOperation struct {
	Printer      *Printer               `idl:"name:hPrinter" json:"printer"`
	Action       string                 `idl:"name:pAction;string;pointer:unique" json:"action"`
	RequestData  *BIDIRequestContainer  `idl:"name:pReqData" json:"request_data"`
	ResponseData *BIDIResponseContainer `idl:"name:ppRespData" json:"response_data"`
	Return       uint32                 `idl:"name:Return" json:"return"`
}

func (o *xxx_SendRecvBIDIDataOperation) OpNum() int { return 97 }

func (o *xxx_SendRecvBIDIDataOperation) OpName() string { return "/winspool/v1/RpcSendRecvBidiData" }

func (o *xxx_SendRecvBIDIDataOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SendRecvBIDIDataOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pAction {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Action != "" {
			_ptr_pAction := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Action); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Action, _ptr_pAction); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pReqData {in} (1:{pointer=ref}*(1))(2:{alias=RPC_BIDI_REQUEST_CONTAINER}(struct))
	{
		if o.RequestData != nil {
			if err := o.RequestData.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BIDIRequestContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SendRecvBIDIDataOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pAction {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pAction := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Action); err != nil {
				return err
			}
			return nil
		})
		_s_pAction := func(ptr interface{}) { o.Action = *ptr.(*string) }
		if err := w.ReadPointer(&o.Action, _s_pAction, _ptr_pAction); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pReqData {in} (1:{pointer=ref}*(1))(2:{alias=RPC_BIDI_REQUEST_CONTAINER}(struct))
	{
		if o.RequestData == nil {
			o.RequestData = &BIDIRequestContainer{}
		}
		if err := o.RequestData.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SendRecvBIDIDataOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SendRecvBIDIDataOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// ppRespData {out} (1:{pointer=ref}*(2)*(1))(2:{alias=RPC_BIDI_RESPONSE_CONTAINER}(struct))
	{
		if o.ResponseData != nil {
			_ptr_ppRespData := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if o.ResponseData != nil {
					if err := o.ResponseData.MarshalNDR(ctx, w); err != nil {
						return err
					}
				} else {
					if err := (&BIDIResponseContainer{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.ResponseData, _ptr_ppRespData); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SendRecvBIDIDataOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// ppRespData {out} (1:{pointer=ref}*(2)*(1))(2:{alias=RPC_BIDI_RESPONSE_CONTAINER}(struct))
	{
		_ptr_ppRespData := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if o.ResponseData == nil {
				o.ResponseData = &BIDIResponseContainer{}
			}
			if err := o.ResponseData.UnmarshalNDR(ctx, w); err != nil {
				return err
			}
			return nil
		})
		_s_ppRespData := func(ptr interface{}) { o.ResponseData = *ptr.(**BIDIResponseContainer) }
		if err := w.ReadPointer(&o.ResponseData, _s_ppRespData, _ptr_ppRespData); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SendRecvBIDIDataRequest structure represents the RpcSendRecvBidiData operation request
type SendRecvBIDIDataRequest struct {
	// hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter
	// (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section
	// 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// pAction: A pointer to a string that specifies an action to take. The following actions
	// SHOULD be supported.<318>, <319> Port monitors MAY support additional, implementation-specific
	// action strings.
	//
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	|                                                 |                                                                                  |
	//	|                   NAME/VALUE                    |                                   DESCRIPTION                                    |
	//	|                                                 |                                                                                  |
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	| BIDI_ACTION_ENUM_SCHEMA "EnumSchema"            | The method MUST enumerate the supported schemas. The pReqData parameter MUST be  |
	//	|                                                 | ignored. The method MUST store one or more values that correspond to supported   |
	//	|                                                 | schema entries in the buffer that is pointed to by the ppRespData parameter.     |
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	| BIDI_ACTION_GET "Get"                           | The method MUST return the specific value item requested. The pReqData parameter |
	//	|                                                 | specifies a single value entry in the schema. The method MUST store the value of |
	//	|                                                 | that entry in the buffer that is pointed to by the ppRespData parameter.         |
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	| BIDI_ACTION_SET "Set"                           | The method MUST store the supplied data in a single value item in the schema.    |
	//	|                                                 | The pReqData parameter specifies a single value entry for the schema and the new |
	//	|                                                 | value to be stored there. This action MUST NOT change the contents of the buffer |
	//	|                                                 | that is pointed to by the ppRespData parameter.                                  |
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	| BIDI_ACTION_GET_ALL "GetAll"                    | The method MUST return one or more value items that are reachable from the       |
	//	|                                                 | requested schema item. The pReqData parameter specifies an entry in the schema,  |
	//	|                                                 | which is either a value item or an inner schema entry. The action MUST store     |
	//	|                                                 | one or more value entries, and their associated values, in the buffer that is    |
	//	|                                                 | pointed to by the ppRespData parameter.                                          |
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	//	| BIDI_ACTION_GET_WITH_ARGUMENT "GetWithArgument" | The method MUST return one or more value items that are reachable from the       |
	//	|                                                 | requested schema item. The pReqData parameter specifies an entry in the schema,  |
	//	|                                                 | which is either a value item or an inner schema entry, and a data value to       |
	//	|                                                 | be used when processing the request. The action MUST store one or more value     |
	//	|                                                 | entries, and their associated values, in the buffer that is pointed to by the    |
	//	|                                                 | ppRespData parameter.                                                            |
	//	+-------------------------------------------------+----------------------------------------------------------------------------------+
	Action string `idl:"name:pAction;string;pointer:unique" json:"action"`
	// pReqData: A pointer to an RPC_BIDI_REQUEST_CONTAINER (section 2.2.1.2.10) structure
	// that contains the requested binary data.
	RequestData *BIDIRequestContainer `idl:"name:pReqData" json:"request_data"`
}

func (o *SendRecvBIDIDataRequest) xxx_ToOp(ctx context.Context, op *xxx_SendRecvBIDIDataOperation) *xxx_SendRecvBIDIDataOperation {
	if op == nil {
		op = &xxx_SendRecvBIDIDataOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.Action = o.Action
	op.RequestData = o.RequestData
	return op
}

func (o *SendRecvBIDIDataRequest) xxx_FromOp(ctx context.Context, op *xxx_SendRecvBIDIDataOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.Action = op.Action
	o.RequestData = op.RequestData
}
func (o *SendRecvBIDIDataRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SendRecvBIDIDataRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SendRecvBIDIDataOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SendRecvBIDIDataResponse structure represents the RpcSendRecvBidiData operation response
type SendRecvBIDIDataResponse struct {
	// ppRespData: A pointer to a variable that receives a pointer to a RPC_BIDI_RESPONSE_CONTAINER
	// (section 2.2.1.2.11) structure that contains the response binary data.
	ResponseData *BIDIResponseContainer `idl:"name:ppRespData" json:"response_data"`
	// Return: The RpcSendRecvBidiData return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SendRecvBIDIDataResponse) xxx_ToOp(ctx context.Context, op *xxx_SendRecvBIDIDataOperation) *xxx_SendRecvBIDIDataOperation {
	if op == nil {
		op = &xxx_SendRecvBIDIDataOperation{}
	}
	if o == nil {
		return op
	}
	op.ResponseData = o.ResponseData
	op.Return = o.Return
	return op
}

func (o *SendRecvBIDIDataResponse) xxx_FromOp(ctx context.Context, op *xxx_SendRecvBIDIDataOperation) {
	if o == nil {
		return
	}
	o.ResponseData = op.ResponseData
	o.Return = op.Return
}
func (o *SendRecvBIDIDataResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SendRecvBIDIDataResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SendRecvBIDIDataOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetCorePrinterDriversOperation structure represents the RpcGetCorePrinterDrivers operation
type xxx_GetCorePrinterDriversOperation struct {
	Server                  string               `idl:"name:pszServer;string;pointer:unique" json:"server"`
	Environment             string               `idl:"name:pszEnvironment;string" json:"environment"`
	CoreDriversLength       uint32               `idl:"name:cchCoreDrivers" json:"core_drivers_length"`
	CoreDriverDependencies  string               `idl:"name:pszzCoreDriverDependencies;size_is:(cchCoreDrivers)" json:"core_driver_dependencies"`
	CorePrinterDriversCount uint32               `idl:"name:cCorePrinterDrivers" json:"core_printer_drivers_count"`
	CorePrinterDrivers      []*CorePrinterDriver `idl:"name:pCorePrinterDrivers;size_is:(cCorePrinterDrivers)" json:"core_printer_drivers"`
	Return                  int32                `idl:"name:Return" json:"return"`
}

func (o *xxx_GetCorePrinterDriversOperation) OpNum() int { return 102 }

func (o *xxx_GetCorePrinterDriversOperation) OpName() string {
	return "/winspool/v1/RpcGetCorePrinterDrivers"
}

func (o *xxx_GetCorePrinterDriversOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.CoreDriverDependencies != "" && o.CoreDriversLength == 0 {
		o.CoreDriversLength = uint32(ndr.UTF16Len(o.CoreDriverDependencies))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetCorePrinterDriversOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pszServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Server != "" {
			_ptr_pszServer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Server); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Server, _ptr_pszServer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pszEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
			return err
		}
	}
	// cchCoreDrivers {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.CoreDriversLength); err != nil {
			return err
		}
	}
	// pszzCoreDriverDependencies {in} (1:{pointer=ref}*(1)[dim:0,size_is=cchCoreDrivers,string](wchar))
	{
		dimSize1 := uint64(o.CoreDriversLength)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		_CoreDriverDependencies_buf := utf16.Encode([]rune(o.CoreDriverDependencies))
		if uint64(len(_CoreDriverDependencies_buf)) > sizeInfo[0] {
			_CoreDriverDependencies_buf = _CoreDriverDependencies_buf[:sizeInfo[0]]
		}
		for i1 := range _CoreDriverDependencies_buf {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(_CoreDriverDependencies_buf[i1]); err != nil {
				return err
			}
		}
		for i1 := len(_CoreDriverDependencies_buf); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint16(0)); err != nil {
				return err
			}
		}
	}
	// cCorePrinterDrivers {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.CorePrinterDriversCount); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetCorePrinterDriversOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pszServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pszServer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Server); err != nil {
				return err
			}
			return nil
		})
		_s_pszServer := func(ptr interface{}) { o.Server = *ptr.(*string) }
		if err := w.ReadPointer(&o.Server, _s_pszServer, _ptr_pszServer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pszEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
	}
	// cchCoreDrivers {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.CoreDriversLength); err != nil {
			return err
		}
	}
	// pszzCoreDriverDependencies {in} (1:{pointer=ref}*(1)[dim:0,size_is=cchCoreDrivers,string](wchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		var _CoreDriverDependencies_buf []uint16
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array _CoreDriverDependencies_buf", sizeInfo[0])
		}
		_CoreDriverDependencies_buf = make([]uint16, sizeInfo[0])
		for i1 := range _CoreDriverDependencies_buf {
			i1 := i1
			if err := w.ReadData(&_CoreDriverDependencies_buf[i1]); err != nil {
				return err
			}
		}
		o.CoreDriverDependencies = strings.TrimRight(string(utf16.Decode(_CoreDriverDependencies_buf)), ndr.ZeroString)
	}
	// cCorePrinterDrivers {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.CorePrinterDriversCount); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetCorePrinterDriversOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetCorePrinterDriversOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pCorePrinterDrivers {out} (1:{pointer=ref}*(1))(2:{alias=CORE_PRINTER_DRIVER}[dim:0,size_is=cCorePrinterDrivers](struct))
	{
		dimSize1 := uint64(o.CorePrinterDriversCount)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.CorePrinterDrivers {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if o.CorePrinterDrivers[i1] != nil {
				if err := o.CorePrinterDrivers[i1].MarshalNDR(ctx, w); err != nil {
					return err
				}
			} else {
				if err := (&CorePrinterDriver{}).MarshalNDR(ctx, w); err != nil {
					return err
				}
			}
		}
		for i1 := len(o.CorePrinterDrivers); uint64(i1) < sizeInfo[0]; i1++ {
			if err := (&CorePrinterDriver{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetCorePrinterDriversOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pCorePrinterDrivers {out} (1:{pointer=ref}*(1))(2:{alias=CORE_PRINTER_DRIVER}[dim:0,size_is=cCorePrinterDrivers](struct))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.CorePrinterDrivers", sizeInfo[0])
		}
		o.CorePrinterDrivers = make([]*CorePrinterDriver, sizeInfo[0])
		for i1 := range o.CorePrinterDrivers {
			i1 := i1
			if o.CorePrinterDrivers[i1] == nil {
				o.CorePrinterDrivers[i1] = &CorePrinterDriver{}
			}
			if err := o.CorePrinterDrivers[i1].UnmarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetCorePrinterDriversRequest structure represents the RpcGetCorePrinterDrivers operation request
type GetCorePrinterDriversRequest struct {
	// pszServer: A STRING_HANDLE (section 2.2.1.1.7) for a server object. This parameter
	// MUST adhere to the specification in Print Server Name Parameters (section 3.1.4.1.4).
	Server string `idl:"name:pszServer;string;pointer:unique" json:"server"`
	// pszEnvironment: A pointer to a string that specifies the environment name for which
	// the core printer driver information is returned. For rules governing environment
	// names and product behaviors, see section 2.2.4.4.
	Environment string `idl:"name:pszEnvironment;string" json:"environment"`
	// cchCoreDrivers: The size, in bytes, of the buffer that is referenced by the pszzCoreDriverDependencies
	// parameter.
	CoreDriversLength uint32 `idl:"name:cchCoreDrivers" json:"core_drivers_length"`
	// pszzCoreDriverDependencies: A pointer to a multisz that contains a list of IDs of
	// the core printer drivers to be retrieved.<348>
	//
	// *
	//
	// Call RpcGetPrinterDriver (section 3.1.4.4.3 ( 00d91852-785d-42e4-a774-b1d96361b0ce
	// ) ) with a Level parameter value of 0x00000008.
	//
	// *
	//
	// A pointer to a _DRIVER_INFO_8 custom-marshaled structure (section 2.2.2.4.8 ( f9b749d6-08fc-4820-8d7b-fe0ee33e42c5
	// ) ) is returned in the pDriver parameter.
	//
	// *
	//
	// In the _DRIVER_INFO_8 structure, the *szzCoreDependenciesOffset* member contains
	// an offset to a multisz that contains the list of IDs.
	CoreDriverDependencies string `idl:"name:pszzCoreDriverDependencies;size_is:(cchCoreDrivers)" json:"core_driver_dependencies"`
	// cCorePrinterDrivers: The count of CORE_PRINTER_DRIVER (section 2.2.2.13) structures
	// that are contained in the buffer that is pointed to by the pCorePrinterDrivers parameter.
	// It MUST equal the number of IDs that are specified in the multisz that is pointed
	// to by the pszzCoreDriverDependencies parameter.
	CorePrinterDriversCount uint32 `idl:"name:cCorePrinterDrivers" json:"core_printer_drivers_count"`
}

func (o *GetCorePrinterDriversRequest) xxx_ToOp(ctx context.Context, op *xxx_GetCorePrinterDriversOperation) *xxx_GetCorePrinterDriversOperation {
	if op == nil {
		op = &xxx_GetCorePrinterDriversOperation{}
	}
	if o == nil {
		return op
	}
	op.Server = o.Server
	op.Environment = o.Environment
	op.CoreDriversLength = o.CoreDriversLength
	op.CoreDriverDependencies = o.CoreDriverDependencies
	op.CorePrinterDriversCount = o.CorePrinterDriversCount
	return op
}

func (o *GetCorePrinterDriversRequest) xxx_FromOp(ctx context.Context, op *xxx_GetCorePrinterDriversOperation) {
	if o == nil {
		return
	}
	o.Server = op.Server
	o.Environment = op.Environment
	o.CoreDriversLength = op.CoreDriversLength
	o.CoreDriverDependencies = op.CoreDriverDependencies
	o.CorePrinterDriversCount = op.CorePrinterDriversCount
}
func (o *GetCorePrinterDriversRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetCorePrinterDriversRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetCorePrinterDriversOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetCorePrinterDriversResponse structure represents the RpcGetCorePrinterDrivers operation response
type GetCorePrinterDriversResponse struct {
	// XXX: cCorePrinterDrivers is an implicit input depedency for output parameters
	CorePrinterDriversCount uint32 `idl:"name:cCorePrinterDrivers" json:"core_printer_drivers_count"`

	// pCorePrinterDrivers: A pointer to a buffer that receives an array of CORE_PRINTER_DRIVER
	// structures.
	CorePrinterDrivers []*CorePrinterDriver `idl:"name:pCorePrinterDrivers;size_is:(cCorePrinterDrivers)" json:"core_printer_drivers"`
	// Return: The RpcGetCorePrinterDrivers return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *GetCorePrinterDriversResponse) xxx_ToOp(ctx context.Context, op *xxx_GetCorePrinterDriversOperation) *xxx_GetCorePrinterDriversOperation {
	if op == nil {
		op = &xxx_GetCorePrinterDriversOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.CorePrinterDriversCount == uint32(0) {
		op.CorePrinterDriversCount = o.CorePrinterDriversCount
	}

	op.CorePrinterDrivers = o.CorePrinterDrivers
	op.Return = o.Return
	return op
}

func (o *GetCorePrinterDriversResponse) xxx_FromOp(ctx context.Context, op *xxx_GetCorePrinterDriversOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.CorePrinterDriversCount = op.CorePrinterDriversCount

	o.CorePrinterDrivers = op.CorePrinterDrivers
	o.Return = op.Return
}
func (o *GetCorePrinterDriversResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetCorePrinterDriversResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetCorePrinterDriversOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterDriverPackagePathOperation structure represents the RpcGetPrinterDriverPackagePath operation
type xxx_GetPrinterDriverPackagePathOperation struct {
	Server                 string `idl:"name:pszServer;string;pointer:unique" json:"server"`
	Environment            string `idl:"name:pszEnvironment;string" json:"environment"`
	Language               string `idl:"name:pszLanguage;string;pointer:unique" json:"language"`
	PackageID              string `idl:"name:pszPackageID;string" json:"package_id"`
	DriverPackageCab       string `idl:"name:pszDriverPackageCab;size_is:(cchDriverPackageCab);pointer:unique" json:"driver_package_cab"`
	DriverPackageCabLength uint32 `idl:"name:cchDriverPackageCab" json:"driver_package_cab_length"`
	RequiredLength         uint32 `idl:"name:pcchRequiredSize" json:"required_length"`
	Return                 int32  `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterDriverPackagePathOperation) OpNum() int { return 104 }

func (o *xxx_GetPrinterDriverPackagePathOperation) OpName() string {
	return "/winspool/v1/RpcGetPrinterDriverPackagePath"
}

func (o *xxx_GetPrinterDriverPackagePathOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.DriverPackageCab != "" && o.DriverPackageCabLength == 0 {
		o.DriverPackageCabLength = uint32(ndr.UTF16Len(o.DriverPackageCab))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverPackagePathOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// pszServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		if o.Server != "" {
			_ptr_pszServer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Server); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Server, _ptr_pszServer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pszEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Environment); err != nil {
			return err
		}
	}
	// pszLanguage {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.Language != "" {
			_ptr_pszLanguage := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.Language); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.Language, _ptr_pszLanguage); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pszPackageID {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.PackageID); err != nil {
			return err
		}
	}
	// pszDriverPackageCab {in, out} (1:{pointer=unique}*(1)[dim:0,size_is=cchDriverPackageCab,string](wchar))
	{
		if o.DriverPackageCab != "" || o.DriverPackageCabLength > 0 {
			_ptr_pszDriverPackageCab := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.DriverPackageCabLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				_DriverPackageCab_buf := utf16.Encode([]rune(o.DriverPackageCab))
				if uint64(len(_DriverPackageCab_buf)) > sizeInfo[0] {
					_DriverPackageCab_buf = _DriverPackageCab_buf[:sizeInfo[0]]
				}
				for i1 := range _DriverPackageCab_buf {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(_DriverPackageCab_buf[i1]); err != nil {
						return err
					}
				}
				for i1 := len(_DriverPackageCab_buf); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint16(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.DriverPackageCab, _ptr_pszDriverPackageCab); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// cchDriverPackageCab {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.DriverPackageCabLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverPackagePathOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// pszServer {in} (1:{handle, string, pointer=unique, alias=STRING_HANDLE}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pszServer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Server); err != nil {
				return err
			}
			return nil
		})
		_s_pszServer := func(ptr interface{}) { o.Server = *ptr.(*string) }
		if err := w.ReadPointer(&o.Server, _s_pszServer, _ptr_pszServer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pszEnvironment {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Environment); err != nil {
			return err
		}
	}
	// pszLanguage {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pszLanguage := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.Language); err != nil {
				return err
			}
			return nil
		})
		_s_pszLanguage := func(ptr interface{}) { o.Language = *ptr.(*string) }
		if err := w.ReadPointer(&o.Language, _s_pszLanguage, _ptr_pszLanguage); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pszPackageID {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.PackageID); err != nil {
			return err
		}
	}
	// pszDriverPackageCab {in, out} (1:{pointer=unique}*(1)[dim:0,size_is=cchDriverPackageCab,string](wchar))
	{
		_ptr_pszDriverPackageCab := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			var _DriverPackageCab_buf []uint16
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array _DriverPackageCab_buf", sizeInfo[0])
			}
			_DriverPackageCab_buf = make([]uint16, sizeInfo[0])
			for i1 := range _DriverPackageCab_buf {
				i1 := i1
				if err := w.ReadData(&_DriverPackageCab_buf[i1]); err != nil {
					return err
				}
			}
			o.DriverPackageCab = strings.TrimRight(string(utf16.Decode(_DriverPackageCab_buf)), ndr.ZeroString)
			return nil
		})
		_s_pszDriverPackageCab := func(ptr interface{}) { o.DriverPackageCab = *ptr.(*string) }
		if err := w.ReadPointer(&o.DriverPackageCab, _s_pszDriverPackageCab, _ptr_pszDriverPackageCab); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// cchDriverPackageCab {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.DriverPackageCabLength); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverPackagePathOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverPackagePathOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pszDriverPackageCab {in, out} (1:{pointer=unique}*(1)[dim:0,size_is=cchDriverPackageCab,string](wchar))
	{
		if o.DriverPackageCab != "" || o.DriverPackageCabLength > 0 {
			_ptr_pszDriverPackageCab := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.DriverPackageCabLength)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				_DriverPackageCab_buf := utf16.Encode([]rune(o.DriverPackageCab))
				if uint64(len(_DriverPackageCab_buf)) > sizeInfo[0] {
					_DriverPackageCab_buf = _DriverPackageCab_buf[:sizeInfo[0]]
				}
				for i1 := range _DriverPackageCab_buf {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(_DriverPackageCab_buf[i1]); err != nil {
						return err
					}
				}
				for i1 := len(_DriverPackageCab_buf); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint16(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.DriverPackageCab, _ptr_pszDriverPackageCab); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// pcchRequiredSize {out} (1:{alias=LPDWORD}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.RequiredLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterDriverPackagePathOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pszDriverPackageCab {in, out} (1:{pointer=unique}*(1)[dim:0,size_is=cchDriverPackageCab,string](wchar))
	{
		_ptr_pszDriverPackageCab := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			var _DriverPackageCab_buf []uint16
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array _DriverPackageCab_buf", sizeInfo[0])
			}
			_DriverPackageCab_buf = make([]uint16, sizeInfo[0])
			for i1 := range _DriverPackageCab_buf {
				i1 := i1
				if err := w.ReadData(&_DriverPackageCab_buf[i1]); err != nil {
					return err
				}
			}
			o.DriverPackageCab = strings.TrimRight(string(utf16.Decode(_DriverPackageCab_buf)), ndr.ZeroString)
			return nil
		})
		_s_pszDriverPackageCab := func(ptr interface{}) { o.DriverPackageCab = *ptr.(*string) }
		if err := w.ReadPointer(&o.DriverPackageCab, _s_pszDriverPackageCab, _ptr_pszDriverPackageCab); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// pcchRequiredSize {out} (1:{alias=LPDWORD,pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.RequiredLength); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterDriverPackagePathRequest structure represents the RpcGetPrinterDriverPackagePath operation request
type GetPrinterDriverPackagePathRequest struct {
	// pszServer: A STRING_HANDLE (section 2.2.1.1.7) for a server object. This parameter
	// MUST adhere to the specification in Print Server Name Parameters (section 3.1.4.1.4).
	Server string `idl:"name:pszServer;string;pointer:unique" json:"server"`
	// pszEnvironment: A pointer to a string that specifies the environment name for which
	// the driver package path MUST be returned. For rules governing environment names,
	// see section 2.2.4.4.
	Environment string `idl:"name:pszEnvironment;string" json:"environment"`
	// pszLanguage: An optional pointer to a string that specifies the language for which
	// the driver package path MUST<350> be returned.
	Language string `idl:"name:pszLanguage;string;pointer:unique" json:"language"`
	// pszPackageID: A pointer to a string that specifies the package name. The package
	// name MUST be obtained by calling RpcGetCorePrinterDrivers.
	PackageID string `idl:"name:pszPackageID;string" json:"package_id"`
	// pszDriverPackageCab: This parameter is a pointer to a buffer that receives a string
	// that specifies the path name of the driver package file.<351> For rules governing
	// path names, see section 2.2.4.9. pszDriverPackageCab MUST NOT be NULL unless cchDriverPackageCab
	// is zero.
	DriverPackageCab string `idl:"name:pszDriverPackageCab;size_is:(cchDriverPackageCab);pointer:unique" json:"driver_package_cab"`
	// cchDriverPackageCab: This parameter specifies the size, in characters, of the buffer
	// that is referenced by the pszDriverPackageCab parameter. The value of this parameter
	// MAY<352> be zero.
	DriverPackageCabLength uint32 `idl:"name:cchDriverPackageCab" json:"driver_package_cab_length"`
}

func (o *GetPrinterDriverPackagePathRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriverPackagePathOperation) *xxx_GetPrinterDriverPackagePathOperation {
	if op == nil {
		op = &xxx_GetPrinterDriverPackagePathOperation{}
	}
	if o == nil {
		return op
	}
	op.Server = o.Server
	op.Environment = o.Environment
	op.Language = o.Language
	op.PackageID = o.PackageID
	op.DriverPackageCab = o.DriverPackageCab
	op.DriverPackageCabLength = o.DriverPackageCabLength
	return op
}

func (o *GetPrinterDriverPackagePathRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriverPackagePathOperation) {
	if o == nil {
		return
	}
	o.Server = op.Server
	o.Environment = op.Environment
	o.Language = op.Language
	o.PackageID = op.PackageID
	o.DriverPackageCab = op.DriverPackageCab
	o.DriverPackageCabLength = op.DriverPackageCabLength
}
func (o *GetPrinterDriverPackagePathRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterDriverPackagePathRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriverPackagePathOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterDriverPackagePathResponse structure represents the RpcGetPrinterDriverPackagePath operation response
type GetPrinterDriverPackagePathResponse struct {
	// XXX: cchDriverPackageCab is an implicit input depedency for output parameters
	DriverPackageCabLength uint32 `idl:"name:cchDriverPackageCab" json:"driver_package_cab_length"`

	// pszDriverPackageCab: This parameter is a pointer to a buffer that receives a string
	// that specifies the path name of the driver package file.<351> For rules governing
	// path names, see section 2.2.4.9. pszDriverPackageCab MUST NOT be NULL unless cchDriverPackageCab
	// is zero.
	DriverPackageCab string `idl:"name:pszDriverPackageCab;size_is:(cchDriverPackageCab);pointer:unique" json:"driver_package_cab"`
	// pcchRequiredSize: A pointer to a variable that MUST receive the required size of
	// the buffer that is pointed to by the pszDriverPackageCab parameter.
	RequiredLength uint32 `idl:"name:pcchRequiredSize" json:"required_length"`
	// Return: The RpcGetPrinterDriverPackagePath return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterDriverPackagePathResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterDriverPackagePathOperation) *xxx_GetPrinterDriverPackagePathOperation {
	if op == nil {
		op = &xxx_GetPrinterDriverPackagePathOperation{}
	}
	if o == nil {
		return op
	}
	// XXX: implicit input dependencies for output parameters
	if op.DriverPackageCabLength == uint32(0) {
		op.DriverPackageCabLength = o.DriverPackageCabLength
	}

	op.DriverPackageCab = o.DriverPackageCab
	op.RequiredLength = o.RequiredLength
	op.Return = o.Return
	return op
}

func (o *GetPrinterDriverPackagePathResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterDriverPackagePathOperation) {
	if o == nil {
		return
	}
	// XXX: implicit input dependencies for output parameters
	o.DriverPackageCabLength = op.DriverPackageCabLength

	o.DriverPackageCab = op.DriverPackageCab
	o.RequiredLength = op.RequiredLength
	o.Return = op.Return
}
func (o *GetPrinterDriverPackagePathResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterDriverPackagePathResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterDriverPackagePathOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetJobNamedPropertyValueOperation structure represents the RpcGetJobNamedPropertyValue operation
type xxx_GetJobNamedPropertyValueOperation struct {
	Printer *Printer            `idl:"name:hPrinter" json:"printer"`
	JobID   uint32              `idl:"name:JobId" json:"job_id"`
	Name    string              `idl:"name:pszName;string" json:"name"`
	Value   *PrintPropertyValue `idl:"name:pValue" json:"value"`
	Return  uint32              `idl:"name:Return" json:"return"`
}

func (o *xxx_GetJobNamedPropertyValueOperation) OpNum() int { return 110 }

func (o *xxx_GetJobNamedPropertyValueOperation) OpName() string {
	return "/winspool/v1/RpcGetJobNamedPropertyValue"
}

func (o *xxx_GetJobNamedPropertyValueOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobNamedPropertyValueOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// pszName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobNamedPropertyValueOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// pszName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobNamedPropertyValueOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobNamedPropertyValueOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pValue {out} (1:{pointer=ref}*(1))(2:{alias=RPC_PrintPropertyValue}(struct))
	{
		if o.Value != nil {
			if err := o.Value.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintPropertyValue{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobNamedPropertyValueOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pValue {out} (1:{pointer=ref}*(1))(2:{alias=RPC_PrintPropertyValue}(struct))
	{
		if o.Value == nil {
			o.Value = &PrintPropertyValue{}
		}
		if err := o.Value.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetJobNamedPropertyValueRequest structure represents the RpcGetJobNamedPropertyValue operation request
type GetJobNamedPropertyValueRequest struct {
	// hPrinter: A PRINTER_HANDLE (section 2.2.1.1.4) to a printer object, job object, or
	// server object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of a print job. This value MUST NOT be zero.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// pszName: A pointer to a string that specifies the Job Named Property to be queried.
	// This pointer MUST NOT be NULL.
	Name string `idl:"name:pszName;string" json:"name"`
}

func (o *GetJobNamedPropertyValueRequest) xxx_ToOp(ctx context.Context, op *xxx_GetJobNamedPropertyValueOperation) *xxx_GetJobNamedPropertyValueOperation {
	if op == nil {
		op = &xxx_GetJobNamedPropertyValueOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.Name = o.Name
	return op
}

func (o *GetJobNamedPropertyValueRequest) xxx_FromOp(ctx context.Context, op *xxx_GetJobNamedPropertyValueOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.Name = op.Name
}
func (o *GetJobNamedPropertyValueRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetJobNamedPropertyValueRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetJobNamedPropertyValueOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetJobNamedPropertyValueResponse structure represents the RpcGetJobNamedPropertyValue operation response
type GetJobNamedPropertyValueResponse struct {
	// pValue: A pointer to an RPC_PrintPropertyValue (section 2.2.1.14.1) structure that
	// on return from this call contains the value of the Job Named Property specified by
	// the pszName argument.
	Value *PrintPropertyValue `idl:"name:pValue" json:"value"`
	// Return: The RpcGetJobNamedPropertyValue return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *GetJobNamedPropertyValueResponse) xxx_ToOp(ctx context.Context, op *xxx_GetJobNamedPropertyValueOperation) *xxx_GetJobNamedPropertyValueOperation {
	if op == nil {
		op = &xxx_GetJobNamedPropertyValueOperation{}
	}
	if o == nil {
		return op
	}
	op.Value = o.Value
	op.Return = o.Return
	return op
}

func (o *GetJobNamedPropertyValueResponse) xxx_FromOp(ctx context.Context, op *xxx_GetJobNamedPropertyValueOperation) {
	if o == nil {
		return
	}
	o.Value = op.Value
	o.Return = op.Return
}
func (o *GetJobNamedPropertyValueResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetJobNamedPropertyValueResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetJobNamedPropertyValueOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetJobNamedPropertyOperation structure represents the RpcSetJobNamedProperty operation
type xxx_SetJobNamedPropertyOperation struct {
	Printer  *Printer            `idl:"name:hPrinter" json:"printer"`
	JobID    uint32              `idl:"name:JobId" json:"job_id"`
	Property *PrintNamedProperty `idl:"name:pProperty" json:"property"`
	Return   uint32              `idl:"name:Return" json:"return"`
}

func (o *xxx_SetJobNamedPropertyOperation) OpNum() int { return 111 }

func (o *xxx_SetJobNamedPropertyOperation) OpName() string {
	return "/winspool/v1/RpcSetJobNamedProperty"
}

func (o *xxx_SetJobNamedPropertyOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobNamedPropertyOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// pProperty {in} (1:{pointer=ref}*(1))(2:{alias=RPC_PrintNamedProperty}(struct))
	{
		if o.Property != nil {
			if err := o.Property.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&PrintNamedProperty{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobNamedPropertyOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// pProperty {in} (1:{pointer=ref}*(1))(2:{alias=RPC_PrintNamedProperty}(struct))
	{
		if o.Property == nil {
			o.Property = &PrintNamedProperty{}
		}
		if err := o.Property.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobNamedPropertyOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobNamedPropertyOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobNamedPropertyOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetJobNamedPropertyRequest structure represents the RpcSetJobNamedProperty operation request
type SetJobNamedPropertyRequest struct {
	// hPrinter: A PRINTER_HANDLE (section 2.2.1.1.4) to a printer object, job object, or
	// server object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of a print job. This value MUST NOT be zero.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// pProperty: A pointer to an RPC_PrintNamedProperty (section 2.2.1.14.2) structure
	// specifies the property to be created if it does not exist for the print job specified
	// by the JobId parameter, or update an existing property with a new value. This pointer
	// MUST NOT be NULL.
	Property *PrintNamedProperty `idl:"name:pProperty" json:"property"`
}

func (o *SetJobNamedPropertyRequest) xxx_ToOp(ctx context.Context, op *xxx_SetJobNamedPropertyOperation) *xxx_SetJobNamedPropertyOperation {
	if op == nil {
		op = &xxx_SetJobNamedPropertyOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.Property = o.Property
	return op
}

func (o *SetJobNamedPropertyRequest) xxx_FromOp(ctx context.Context, op *xxx_SetJobNamedPropertyOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.Property = op.Property
}
func (o *SetJobNamedPropertyRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetJobNamedPropertyRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetJobNamedPropertyOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetJobNamedPropertyResponse structure represents the RpcSetJobNamedProperty operation response
type SetJobNamedPropertyResponse struct {
	// Return: The RpcSetJobNamedProperty return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *SetJobNamedPropertyResponse) xxx_ToOp(ctx context.Context, op *xxx_SetJobNamedPropertyOperation) *xxx_SetJobNamedPropertyOperation {
	if op == nil {
		op = &xxx_SetJobNamedPropertyOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *SetJobNamedPropertyResponse) xxx_FromOp(ctx context.Context, op *xxx_SetJobNamedPropertyOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *SetJobNamedPropertyResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetJobNamedPropertyResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetJobNamedPropertyOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_DeleteJobNamedPropertyOperation structure represents the RpcDeleteJobNamedProperty operation
type xxx_DeleteJobNamedPropertyOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	JobID   uint32   `idl:"name:JobId" json:"job_id"`
	Name    string   `idl:"name:pszName;string" json:"name"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_DeleteJobNamedPropertyOperation) OpNum() int { return 112 }

func (o *xxx_DeleteJobNamedPropertyOperation) OpName() string {
	return "/winspool/v1/RpcDeleteJobNamedProperty"
}

func (o *xxx_DeleteJobNamedPropertyOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteJobNamedPropertyOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// pszName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.WriteUTF16NString(ctx, w, o.Name); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteJobNamedPropertyOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// pszName {in} (1:{string, pointer=ref}*(1)[dim:0,string,null](wchar))
	{
		if err := ndr.ReadUTF16NString(ctx, w, &o.Name); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteJobNamedPropertyOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteJobNamedPropertyOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_DeleteJobNamedPropertyOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// DeleteJobNamedPropertyRequest structure represents the RpcDeleteJobNamedProperty operation request
type DeleteJobNamedPropertyRequest struct {
	// hPrinter: A PRINTER_HANDLE (section 2.2.1.1.4) to a printer object, job object, or
	// server object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of a print job. This value MUST NOT be zero.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
	// pszName: A pointer to a string that specifies the Job Named Property to be deleted.
	// This pointer MUST NOT be NULL.
	Name string `idl:"name:pszName;string" json:"name"`
}

func (o *DeleteJobNamedPropertyRequest) xxx_ToOp(ctx context.Context, op *xxx_DeleteJobNamedPropertyOperation) *xxx_DeleteJobNamedPropertyOperation {
	if op == nil {
		op = &xxx_DeleteJobNamedPropertyOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.Name = o.Name
	return op
}

func (o *DeleteJobNamedPropertyRequest) xxx_FromOp(ctx context.Context, op *xxx_DeleteJobNamedPropertyOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.Name = op.Name
}
func (o *DeleteJobNamedPropertyRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *DeleteJobNamedPropertyRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeleteJobNamedPropertyOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// DeleteJobNamedPropertyResponse structure represents the RpcDeleteJobNamedProperty operation response
type DeleteJobNamedPropertyResponse struct {
	// Return: The RpcDeleteJobNamedProperty return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *DeleteJobNamedPropertyResponse) xxx_ToOp(ctx context.Context, op *xxx_DeleteJobNamedPropertyOperation) *xxx_DeleteJobNamedPropertyOperation {
	if op == nil {
		op = &xxx_DeleteJobNamedPropertyOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *DeleteJobNamedPropertyResponse) xxx_FromOp(ctx context.Context, op *xxx_DeleteJobNamedPropertyOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *DeleteJobNamedPropertyResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *DeleteJobNamedPropertyResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_DeleteJobNamedPropertyOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_EnumJobNamedPropertiesOperation structure represents the RpcEnumJobNamedProperties operation
type xxx_EnumJobNamedPropertiesOperation struct {
	Printer         *Printer              `idl:"name:hPrinter" json:"printer"`
	JobID           uint32                `idl:"name:JobId" json:"job_id"`
	PropertiesCount uint32                `idl:"name:pcProperties" json:"properties_count"`
	Properties      []*PrintNamedProperty `idl:"name:ppProperties;size_is:(, pcProperties)" json:"properties"`
	Return          uint32                `idl:"name:Return" json:"return"`
}

func (o *xxx_EnumJobNamedPropertiesOperation) OpNum() int { return 113 }

func (o *xxx_EnumJobNamedPropertiesOperation) OpName() string {
	return "/winspool/v1/RpcEnumJobNamedProperties"
}

func (o *xxx_EnumJobNamedPropertiesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobNamedPropertiesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobNamedPropertiesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// JobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobNamedPropertiesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if o.Properties != nil && o.PropertiesCount == 0 {
		o.PropertiesCount = uint32(len(o.Properties))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobNamedPropertiesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// pcProperties {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.PropertiesCount); err != nil {
			return err
		}
	}
	// ppProperties {out} (1:{pointer=ref}*(2)*(1))(2:{alias=RPC_PrintNamedProperty}[dim:0,size_is=pcProperties](struct))
	{
		if o.Properties != nil || o.PropertiesCount > 0 {
			_ptr_ppProperties := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.PropertiesCount)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.Properties {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if o.Properties[i1] != nil {
						if err := o.Properties[i1].MarshalNDR(ctx, w); err != nil {
							return err
						}
					} else {
						if err := (&PrintNamedProperty{}).MarshalNDR(ctx, w); err != nil {
							return err
						}
					}
				}
				for i1 := len(o.Properties); uint64(i1) < sizeInfo[0]; i1++ {
					if err := (&PrintNamedProperty{}).MarshalNDR(ctx, w); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.Properties, _ptr_ppProperties); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_EnumJobNamedPropertiesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// pcProperties {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.PropertiesCount); err != nil {
			return err
		}
	}
	// ppProperties {out} (1:{pointer=ref}*(2)*(1))(2:{alias=RPC_PrintNamedProperty}[dim:0,size_is=pcProperties](struct))
	{
		_ptr_ppProperties := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.Properties", sizeInfo[0])
			}
			o.Properties = make([]*PrintNamedProperty, sizeInfo[0])
			for i1 := range o.Properties {
				i1 := i1
				if o.Properties[i1] == nil {
					o.Properties[i1] = &PrintNamedProperty{}
				}
				if err := o.Properties[i1].UnmarshalNDR(ctx, w); err != nil {
					return err
				}
			}
			return nil
		})
		_s_ppProperties := func(ptr interface{}) { o.Properties = *ptr.(*[]*PrintNamedProperty) }
		if err := w.ReadPointer(&o.Properties, _s_ppProperties, _ptr_ppProperties); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// EnumJobNamedPropertiesRequest structure represents the RpcEnumJobNamedProperties operation request
type EnumJobNamedPropertiesRequest struct {
	// hPrinter: A PRINTER_HANDLE (section 2.2.1.1.4) to a printer object, job object, or
	// server object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx
	// (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section
	// 3.1.4.2.14).
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	// JobId: The identifier of a print job. This value MUST NOT be zero.
	JobID uint32 `idl:"name:JobId" json:"job_id"`
}

func (o *EnumJobNamedPropertiesRequest) xxx_ToOp(ctx context.Context, op *xxx_EnumJobNamedPropertiesOperation) *xxx_EnumJobNamedPropertiesOperation {
	if op == nil {
		op = &xxx_EnumJobNamedPropertiesOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	return op
}

func (o *EnumJobNamedPropertiesRequest) xxx_FromOp(ctx context.Context, op *xxx_EnumJobNamedPropertiesOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
}
func (o *EnumJobNamedPropertiesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *EnumJobNamedPropertiesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumJobNamedPropertiesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// EnumJobNamedPropertiesResponse structure represents the RpcEnumJobNamedProperties operation response
type EnumJobNamedPropertiesResponse struct {
	// pcProperties: On successful return from this call, this parameter is a pointer to
	// the address of an array of RPC_PrintNamedProperty (section 2.2.1.14.2) structures
	// returned. This pointer MUST NOT be NULL.
	PropertiesCount uint32 `idl:"name:pcProperties" json:"properties_count"`
	// ppProperties: On successful return from this call, this parameter is a pointer to
	// the address of an array of RPC_PrintNamedProperty structures returned. This pointer
	// MUST NOT be NULL.
	Properties []*PrintNamedProperty `idl:"name:ppProperties;size_is:(, pcProperties)" json:"properties"`
	// Return: The RpcEnumJobNamedProperties return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *EnumJobNamedPropertiesResponse) xxx_ToOp(ctx context.Context, op *xxx_EnumJobNamedPropertiesOperation) *xxx_EnumJobNamedPropertiesOperation {
	if op == nil {
		op = &xxx_EnumJobNamedPropertiesOperation{}
	}
	if o == nil {
		return op
	}
	op.PropertiesCount = o.PropertiesCount
	op.Properties = o.Properties
	op.Return = o.Return
	return op
}

func (o *EnumJobNamedPropertiesResponse) xxx_FromOp(ctx context.Context, op *xxx_EnumJobNamedPropertiesOperation) {
	if o == nil {
		return
	}
	o.PropertiesCount = op.PropertiesCount
	o.Properties = op.Properties
	o.Return = op.Return
}
func (o *EnumJobNamedPropertiesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *EnumJobNamedPropertiesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_EnumJobNamedPropertiesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_LogJobInfoForBranchOfficeOperation structure represents the RpcLogJobInfoForBranchOffice operation
type xxx_LogJobInfoForBranchOfficeOperation struct {
	Printer                      *Printer                      `idl:"name:hPrinter" json:"printer"`
	BranchOfficeJobDataContainer *BranchOfficeJobDataContainer `idl:"name:pBranchOfficeJobDataContainer;pointer:ref" json:"branch_office_job_data_container"`
	Return                       uint32                        `idl:"name:Return" json:"return"`
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) OpNum() int { return 116 }

func (o *xxx_LogJobInfoForBranchOfficeOperation) OpName() string {
	return "/winspool/v1/RpcLogJobInfoForBranchOffice"
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// pBranchOfficeJobDataContainer {in} (1:{pointer=ref}*(1))(2:{alias=RPC_BranchOfficeJobDataContainer}(struct))
	{
		if o.BranchOfficeJobDataContainer != nil {
			if err := o.BranchOfficeJobDataContainer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&BranchOfficeJobDataContainer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// pBranchOfficeJobDataContainer {in} (1:{pointer=ref}*(1))(2:{alias=RPC_BranchOfficeJobDataContainer}(struct))
	{
		if o.BranchOfficeJobDataContainer == nil {
			o.BranchOfficeJobDataContainer = &BranchOfficeJobDataContainer{}
		}
		if err := o.BranchOfficeJobDataContainer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_LogJobInfoForBranchOfficeOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// LogJobInfoForBranchOfficeRequest structure represents the RpcLogJobInfoForBranchOffice operation request
type LogJobInfoForBranchOfficeRequest struct {
	Printer                      *Printer                      `idl:"name:hPrinter" json:"printer"`
	BranchOfficeJobDataContainer *BranchOfficeJobDataContainer `idl:"name:pBranchOfficeJobDataContainer;pointer:ref" json:"branch_office_job_data_container"`
}

func (o *LogJobInfoForBranchOfficeRequest) xxx_ToOp(ctx context.Context, op *xxx_LogJobInfoForBranchOfficeOperation) *xxx_LogJobInfoForBranchOfficeOperation {
	if op == nil {
		op = &xxx_LogJobInfoForBranchOfficeOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.BranchOfficeJobDataContainer = o.BranchOfficeJobDataContainer
	return op
}

func (o *LogJobInfoForBranchOfficeRequest) xxx_FromOp(ctx context.Context, op *xxx_LogJobInfoForBranchOfficeOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.BranchOfficeJobDataContainer = op.BranchOfficeJobDataContainer
}
func (o *LogJobInfoForBranchOfficeRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *LogJobInfoForBranchOfficeRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_LogJobInfoForBranchOfficeOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// LogJobInfoForBranchOfficeResponse structure represents the RpcLogJobInfoForBranchOffice operation response
type LogJobInfoForBranchOfficeResponse struct {
	// Return: The RpcLogJobInfoForBranchOffice return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *LogJobInfoForBranchOfficeResponse) xxx_ToOp(ctx context.Context, op *xxx_LogJobInfoForBranchOfficeOperation) *xxx_LogJobInfoForBranchOfficeOperation {
	if op == nil {
		op = &xxx_LogJobInfoForBranchOfficeOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *LogJobInfoForBranchOfficeResponse) xxx_FromOp(ctx context.Context, op *xxx_LogJobInfoForBranchOfficeOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *LogJobInfoForBranchOfficeResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *LogJobInfoForBranchOfficeResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_LogJobInfoForBranchOfficeOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_RegeneratePrintDeviceCapabilitiesOperation structure represents the RpcRegeneratePrintDeviceCapabilities operation
type xxx_RegeneratePrintDeviceCapabilitiesOperation struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
	Return  uint32   `idl:"name:Return" json:"return"`
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) OpNum() int { return 117 }

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) OpName() string {
	return "/winspool/v1/RpcRegeneratePrintDeviceCapabilities"
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_RegeneratePrintDeviceCapabilitiesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// Return {out} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// RegeneratePrintDeviceCapabilitiesRequest structure represents the RpcRegeneratePrintDeviceCapabilities operation request
type RegeneratePrintDeviceCapabilitiesRequest struct {
	Printer *Printer `idl:"name:hPrinter" json:"printer"`
}

func (o *RegeneratePrintDeviceCapabilitiesRequest) xxx_ToOp(ctx context.Context, op *xxx_RegeneratePrintDeviceCapabilitiesOperation) *xxx_RegeneratePrintDeviceCapabilitiesOperation {
	if op == nil {
		op = &xxx_RegeneratePrintDeviceCapabilitiesOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	return op
}

func (o *RegeneratePrintDeviceCapabilitiesRequest) xxx_FromOp(ctx context.Context, op *xxx_RegeneratePrintDeviceCapabilitiesOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
}
func (o *RegeneratePrintDeviceCapabilitiesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *RegeneratePrintDeviceCapabilitiesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RegeneratePrintDeviceCapabilitiesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// RegeneratePrintDeviceCapabilitiesResponse structure represents the RpcRegeneratePrintDeviceCapabilities operation response
type RegeneratePrintDeviceCapabilitiesResponse struct {
	// Return: The RpcRegeneratePrintDeviceCapabilities return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

func (o *RegeneratePrintDeviceCapabilitiesResponse) xxx_ToOp(ctx context.Context, op *xxx_RegeneratePrintDeviceCapabilitiesOperation) *xxx_RegeneratePrintDeviceCapabilitiesOperation {
	if op == nil {
		op = &xxx_RegeneratePrintDeviceCapabilitiesOperation{}
	}
	if o == nil {
		return op
	}
	op.Return = o.Return
	return op
}

func (o *RegeneratePrintDeviceCapabilitiesResponse) xxx_FromOp(ctx context.Context, op *xxx_RegeneratePrintDeviceCapabilitiesOperation) {
	if o == nil {
		return
	}
	o.Return = op.Return
}
func (o *RegeneratePrintDeviceCapabilitiesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *RegeneratePrintDeviceCapabilitiesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_RegeneratePrintDeviceCapabilitiesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_CreateJobOnPrinterOperation structure represents the RpcIppCreateJobOnPrinter operation
type xxx_CreateJobOnPrinterOperation struct {
	Printer                     *Printer `idl:"name:hPrinter" json:"printer"`
	JobID                       uint32   `idl:"name:jobId" json:"job_id"`
	PDLFormat                   string   `idl:"name:pdlFormat;string;pointer:unique" json:"pdl_format"`
	JobAttributeGroupBufferSize uint32   `idl:"name:jobAttributeGroupBufferSize" json:"job_attribute_group_buffer_size"`
	JobAttributeGroupBuffer     []byte   `idl:"name:jobAttributeGroupBuffer;size_is:(jobAttributeGroupBufferSize)" json:"job_attribute_group_buffer"`
	ResponseBufferSize          uint32   `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer              []byte   `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	Return                      int32    `idl:"name:Return" json:"return"`
}

func (o *xxx_CreateJobOnPrinterOperation) OpNum() int { return 119 }

func (o *xxx_CreateJobOnPrinterOperation) OpName() string {
	return "/winspool/v1/RpcIppCreateJobOnPrinter"
}

func (o *xxx_CreateJobOnPrinterOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.JobAttributeGroupBuffer != nil && o.JobAttributeGroupBufferSize == 0 {
		o.JobAttributeGroupBufferSize = uint32(len(o.JobAttributeGroupBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreateJobOnPrinterOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// jobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// pdlFormat {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		if o.PDLFormat != "" {
			_ptr_pdlFormat := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				if err := ndr.WriteUTF16NString(ctx, w, o.PDLFormat); err != nil {
					return err
				}
				return nil
			})
			if err := w.WritePointer(&o.PDLFormat, _ptr_pdlFormat); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// jobAttributeGroupBufferSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobAttributeGroupBufferSize); err != nil {
			return err
		}
	}
	// jobAttributeGroupBuffer {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=jobAttributeGroupBufferSize](uchar))
	{
		dimSize1 := uint64(o.JobAttributeGroupBufferSize)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.JobAttributeGroupBuffer {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.JobAttributeGroupBuffer[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.JobAttributeGroupBuffer); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_CreateJobOnPrinterOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// jobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// pdlFormat {in} (1:{string, pointer=unique}*(1)[dim:0,string,null](wchar))
	{
		_ptr_pdlFormat := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			if err := ndr.ReadUTF16NString(ctx, w, &o.PDLFormat); err != nil {
				return err
			}
			return nil
		})
		_s_pdlFormat := func(ptr interface{}) { o.PDLFormat = *ptr.(*string) }
		if err := w.ReadPointer(&o.PDLFormat, _s_pdlFormat, _ptr_pdlFormat); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// jobAttributeGroupBufferSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobAttributeGroupBufferSize); err != nil {
			return err
		}
	}
	// jobAttributeGroupBuffer {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=jobAttributeGroupBufferSize](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.JobAttributeGroupBuffer", sizeInfo[0])
		}
		o.JobAttributeGroupBuffer = make([]byte, sizeInfo[0])
		for i1 := range o.JobAttributeGroupBuffer {
			i1 := i1
			if err := w.ReadData(&o.JobAttributeGroupBuffer[i1]); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_CreateJobOnPrinterOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if o.ResponseBuffer != nil && o.ResponseBufferSize == 0 {
		o.ResponseBufferSize = uint32(len(o.ResponseBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreateJobOnPrinterOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		if o.ResponseBuffer != nil || o.ResponseBufferSize > 0 {
			_ptr_ippResponseBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.ResponseBufferSize)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.ResponseBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.ResponseBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.ResponseBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.ResponseBuffer, _ptr_ippResponseBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_CreateJobOnPrinterOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		_ptr_ippResponseBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.ResponseBuffer", sizeInfo[0])
			}
			o.ResponseBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.ResponseBuffer {
				i1 := i1
				if err := w.ReadData(&o.ResponseBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_ippResponseBuffer := func(ptr interface{}) { o.ResponseBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.ResponseBuffer, _s_ippResponseBuffer, _ptr_ippResponseBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// CreateJobOnPrinterRequest structure represents the RpcIppCreateJobOnPrinter operation request
type CreateJobOnPrinterRequest struct {
	Printer                     *Printer `idl:"name:hPrinter" json:"printer"`
	JobID                       uint32   `idl:"name:jobId" json:"job_id"`
	PDLFormat                   string   `idl:"name:pdlFormat;string;pointer:unique" json:"pdl_format"`
	JobAttributeGroupBufferSize uint32   `idl:"name:jobAttributeGroupBufferSize" json:"job_attribute_group_buffer_size"`
	JobAttributeGroupBuffer     []byte   `idl:"name:jobAttributeGroupBuffer;size_is:(jobAttributeGroupBufferSize)" json:"job_attribute_group_buffer"`
}

func (o *CreateJobOnPrinterRequest) xxx_ToOp(ctx context.Context, op *xxx_CreateJobOnPrinterOperation) *xxx_CreateJobOnPrinterOperation {
	if op == nil {
		op = &xxx_CreateJobOnPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.PDLFormat = o.PDLFormat
	op.JobAttributeGroupBufferSize = o.JobAttributeGroupBufferSize
	op.JobAttributeGroupBuffer = o.JobAttributeGroupBuffer
	return op
}

func (o *CreateJobOnPrinterRequest) xxx_FromOp(ctx context.Context, op *xxx_CreateJobOnPrinterOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.PDLFormat = op.PDLFormat
	o.JobAttributeGroupBufferSize = op.JobAttributeGroupBufferSize
	o.JobAttributeGroupBuffer = op.JobAttributeGroupBuffer
}
func (o *CreateJobOnPrinterRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *CreateJobOnPrinterRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_CreateJobOnPrinterOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// CreateJobOnPrinterResponse structure represents the RpcIppCreateJobOnPrinter operation response
type CreateJobOnPrinterResponse struct {
	ResponseBufferSize uint32 `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	// Return: The RpcIppCreateJobOnPrinter return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *CreateJobOnPrinterResponse) xxx_ToOp(ctx context.Context, op *xxx_CreateJobOnPrinterOperation) *xxx_CreateJobOnPrinterOperation {
	if op == nil {
		op = &xxx_CreateJobOnPrinterOperation{}
	}
	if o == nil {
		return op
	}
	op.ResponseBufferSize = o.ResponseBufferSize
	op.ResponseBuffer = o.ResponseBuffer
	op.Return = o.Return
	return op
}

func (o *CreateJobOnPrinterResponse) xxx_FromOp(ctx context.Context, op *xxx_CreateJobOnPrinterOperation) {
	if o == nil {
		return
	}
	o.ResponseBufferSize = op.ResponseBufferSize
	o.ResponseBuffer = op.ResponseBuffer
	o.Return = op.Return
}
func (o *CreateJobOnPrinterResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *CreateJobOnPrinterResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_CreateJobOnPrinterOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetJobAttributesOperation structure represents the RpcIppGetJobAttributes operation
type xxx_GetJobAttributesOperation struct {
	Printer            *Printer `idl:"name:hPrinter" json:"printer"`
	JobID              uint32   `idl:"name:jobId" json:"job_id"`
	AttributeNameCount uint32   `idl:"name:attributeNameCount" json:"attribute_name_count"`
	AttributeNames     []string `idl:"name:attributeNames;size_is:(attributeNameCount);string" json:"attribute_names"`
	ResponseBufferSize uint32   `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte   `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	Return             int32    `idl:"name:Return" json:"return"`
}

func (o *xxx_GetJobAttributesOperation) OpNum() int { return 120 }

func (o *xxx_GetJobAttributesOperation) OpName() string { return "/winspool/v1/RpcIppGetJobAttributes" }

func (o *xxx_GetJobAttributesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.AttributeNames != nil && o.AttributeNameCount == 0 {
		o.AttributeNameCount = uint32(len(o.AttributeNames))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobAttributesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// jobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// attributeNameCount {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.AttributeNameCount); err != nil {
			return err
		}
	}
	// attributeNames {in} (1:{string, pointer=ref}*(1)[dim:0,size_is=attributeNameCount]*(1)[dim:0,string,null](wchar))
	{
		dimSize1 := uint64(o.AttributeNameCount)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.AttributeNames {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if o.AttributeNames[i1] != "" {
				_ptr_attributeNames := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
					if err := ndr.WriteUTF16NString(ctx, w, o.AttributeNames[i1]); err != nil {
						return err
					}
					return nil
				})
				if err := w.WritePointer(&o.AttributeNames[i1], _ptr_attributeNames); err != nil {
					return err
				}
			} else {
				if err := w.WritePointer(nil); err != nil {
					return err
				}
			}
		}
		for i1 := len(o.AttributeNames); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobAttributesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// jobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// attributeNameCount {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.AttributeNameCount); err != nil {
			return err
		}
	}
	// attributeNames {in} (1:{string, pointer=ref}*(1)[dim:0,size_is=attributeNameCount]*(1)[dim:0,string,null](wchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.AttributeNames", sizeInfo[0])
		}
		o.AttributeNames = make([]string, sizeInfo[0])
		for i1 := range o.AttributeNames {
			i1 := i1
			_ptr_attributeNames := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
				if err := ndr.ReadUTF16NString(ctx, w, &o.AttributeNames[i1]); err != nil {
					return err
				}
				return nil
			})
			_s_attributeNames := func(ptr interface{}) { o.AttributeNames[i1] = *ptr.(*string) }
			if err := w.ReadPointer(&o.AttributeNames[i1], _s_attributeNames, _ptr_attributeNames); err != nil {
				return err
			}
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobAttributesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if o.ResponseBuffer != nil && o.ResponseBufferSize == 0 {
		o.ResponseBufferSize = uint32(len(o.ResponseBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobAttributesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		if o.ResponseBuffer != nil || o.ResponseBufferSize > 0 {
			_ptr_ippResponseBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.ResponseBufferSize)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.ResponseBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.ResponseBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.ResponseBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.ResponseBuffer, _ptr_ippResponseBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetJobAttributesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		_ptr_ippResponseBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.ResponseBuffer", sizeInfo[0])
			}
			o.ResponseBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.ResponseBuffer {
				i1 := i1
				if err := w.ReadData(&o.ResponseBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_ippResponseBuffer := func(ptr interface{}) { o.ResponseBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.ResponseBuffer, _s_ippResponseBuffer, _ptr_ippResponseBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetJobAttributesRequest structure represents the RpcIppGetJobAttributes operation request
type GetJobAttributesRequest struct {
	Printer            *Printer `idl:"name:hPrinter" json:"printer"`
	JobID              uint32   `idl:"name:jobId" json:"job_id"`
	AttributeNameCount uint32   `idl:"name:attributeNameCount" json:"attribute_name_count"`
	AttributeNames     []string `idl:"name:attributeNames;size_is:(attributeNameCount);string" json:"attribute_names"`
}

func (o *GetJobAttributesRequest) xxx_ToOp(ctx context.Context, op *xxx_GetJobAttributesOperation) *xxx_GetJobAttributesOperation {
	if op == nil {
		op = &xxx_GetJobAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.AttributeNameCount = o.AttributeNameCount
	op.AttributeNames = o.AttributeNames
	return op
}

func (o *GetJobAttributesRequest) xxx_FromOp(ctx context.Context, op *xxx_GetJobAttributesOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.AttributeNameCount = op.AttributeNameCount
	o.AttributeNames = op.AttributeNames
}
func (o *GetJobAttributesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetJobAttributesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetJobAttributesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetJobAttributesResponse structure represents the RpcIppGetJobAttributes operation response
type GetJobAttributesResponse struct {
	ResponseBufferSize uint32 `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	// Return: The RpcIppGetJobAttributes return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *GetJobAttributesResponse) xxx_ToOp(ctx context.Context, op *xxx_GetJobAttributesOperation) *xxx_GetJobAttributesOperation {
	if op == nil {
		op = &xxx_GetJobAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.ResponseBufferSize = o.ResponseBufferSize
	op.ResponseBuffer = o.ResponseBuffer
	op.Return = o.Return
	return op
}

func (o *GetJobAttributesResponse) xxx_FromOp(ctx context.Context, op *xxx_GetJobAttributesOperation) {
	if o == nil {
		return
	}
	o.ResponseBufferSize = op.ResponseBufferSize
	o.ResponseBuffer = op.ResponseBuffer
	o.Return = op.Return
}
func (o *GetJobAttributesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetJobAttributesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetJobAttributesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetJobAttributesOperation structure represents the RpcIppSetJobAttributes operation
type xxx_SetJobAttributesOperation struct {
	Printer                     *Printer `idl:"name:hPrinter" json:"printer"`
	JobID                       uint32   `idl:"name:jobId" json:"job_id"`
	JobAttributeGroupBufferSize uint32   `idl:"name:jobAttributeGroupBufferSize" json:"job_attribute_group_buffer_size"`
	JobAttributeGroupBuffer     []byte   `idl:"name:jobAttributeGroupBuffer;size_is:(jobAttributeGroupBufferSize)" json:"job_attribute_group_buffer"`
	ResponseBufferSize          uint32   `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer              []byte   `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	Return                      int32    `idl:"name:Return" json:"return"`
}

func (o *xxx_SetJobAttributesOperation) OpNum() int { return 121 }

func (o *xxx_SetJobAttributesOperation) OpName() string { return "/winspool/v1/RpcIppSetJobAttributes" }

func (o *xxx_SetJobAttributesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.JobAttributeGroupBuffer != nil && o.JobAttributeGroupBufferSize == 0 {
		o.JobAttributeGroupBufferSize = uint32(len(o.JobAttributeGroupBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobAttributesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// jobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobID); err != nil {
			return err
		}
	}
	// jobAttributeGroupBufferSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobAttributeGroupBufferSize); err != nil {
			return err
		}
	}
	// jobAttributeGroupBuffer {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=jobAttributeGroupBufferSize](uchar))
	{
		dimSize1 := uint64(o.JobAttributeGroupBufferSize)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.JobAttributeGroupBuffer {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.JobAttributeGroupBuffer[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.JobAttributeGroupBuffer); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_SetJobAttributesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// jobId {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobID); err != nil {
			return err
		}
	}
	// jobAttributeGroupBufferSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobAttributeGroupBufferSize); err != nil {
			return err
		}
	}
	// jobAttributeGroupBuffer {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=jobAttributeGroupBufferSize](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.JobAttributeGroupBuffer", sizeInfo[0])
		}
		o.JobAttributeGroupBuffer = make([]byte, sizeInfo[0])
		for i1 := range o.JobAttributeGroupBuffer {
			i1 := i1
			if err := w.ReadData(&o.JobAttributeGroupBuffer[i1]); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_SetJobAttributesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if o.ResponseBuffer != nil && o.ResponseBufferSize == 0 {
		o.ResponseBufferSize = uint32(len(o.ResponseBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobAttributesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		if o.ResponseBuffer != nil || o.ResponseBufferSize > 0 {
			_ptr_ippResponseBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.ResponseBufferSize)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.ResponseBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.ResponseBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.ResponseBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.ResponseBuffer, _ptr_ippResponseBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetJobAttributesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		_ptr_ippResponseBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.ResponseBuffer", sizeInfo[0])
			}
			o.ResponseBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.ResponseBuffer {
				i1 := i1
				if err := w.ReadData(&o.ResponseBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_ippResponseBuffer := func(ptr interface{}) { o.ResponseBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.ResponseBuffer, _s_ippResponseBuffer, _ptr_ippResponseBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetJobAttributesRequest structure represents the RpcIppSetJobAttributes operation request
type SetJobAttributesRequest struct {
	Printer                     *Printer `idl:"name:hPrinter" json:"printer"`
	JobID                       uint32   `idl:"name:jobId" json:"job_id"`
	JobAttributeGroupBufferSize uint32   `idl:"name:jobAttributeGroupBufferSize" json:"job_attribute_group_buffer_size"`
	JobAttributeGroupBuffer     []byte   `idl:"name:jobAttributeGroupBuffer;size_is:(jobAttributeGroupBufferSize)" json:"job_attribute_group_buffer"`
}

func (o *SetJobAttributesRequest) xxx_ToOp(ctx context.Context, op *xxx_SetJobAttributesOperation) *xxx_SetJobAttributesOperation {
	if op == nil {
		op = &xxx_SetJobAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobID = o.JobID
	op.JobAttributeGroupBufferSize = o.JobAttributeGroupBufferSize
	op.JobAttributeGroupBuffer = o.JobAttributeGroupBuffer
	return op
}

func (o *SetJobAttributesRequest) xxx_FromOp(ctx context.Context, op *xxx_SetJobAttributesOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobID = op.JobID
	o.JobAttributeGroupBufferSize = op.JobAttributeGroupBufferSize
	o.JobAttributeGroupBuffer = op.JobAttributeGroupBuffer
}
func (o *SetJobAttributesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetJobAttributesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetJobAttributesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetJobAttributesResponse structure represents the RpcIppSetJobAttributes operation response
type SetJobAttributesResponse struct {
	ResponseBufferSize uint32 `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	// Return: The RpcIppSetJobAttributes return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *SetJobAttributesResponse) xxx_ToOp(ctx context.Context, op *xxx_SetJobAttributesOperation) *xxx_SetJobAttributesOperation {
	if op == nil {
		op = &xxx_SetJobAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.ResponseBufferSize = o.ResponseBufferSize
	op.ResponseBuffer = o.ResponseBuffer
	op.Return = o.Return
	return op
}

func (o *SetJobAttributesResponse) xxx_FromOp(ctx context.Context, op *xxx_SetJobAttributesOperation) {
	if o == nil {
		return
	}
	o.ResponseBufferSize = op.ResponseBufferSize
	o.ResponseBuffer = op.ResponseBuffer
	o.Return = op.Return
}
func (o *SetJobAttributesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetJobAttributesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetJobAttributesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_GetPrinterAttributesOperation structure represents the RpcIppGetPrinterAttributes operation
type xxx_GetPrinterAttributesOperation struct {
	Printer            *Printer `idl:"name:hPrinter" json:"printer"`
	AttributeNameCount uint32   `idl:"name:attributeNameCount" json:"attribute_name_count"`
	AttributeNames     []string `idl:"name:attributeNames;size_is:(attributeNameCount);string" json:"attribute_names"`
	ResponseBufferSize uint32   `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte   `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	Return             int32    `idl:"name:Return" json:"return"`
}

func (o *xxx_GetPrinterAttributesOperation) OpNum() int { return 122 }

func (o *xxx_GetPrinterAttributesOperation) OpName() string {
	return "/winspool/v1/RpcIppGetPrinterAttributes"
}

func (o *xxx_GetPrinterAttributesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.AttributeNames != nil && o.AttributeNameCount == 0 {
		o.AttributeNameCount = uint32(len(o.AttributeNames))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterAttributesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// attributeNameCount {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.AttributeNameCount); err != nil {
			return err
		}
	}
	// attributeNames {in} (1:{string, pointer=ref}*(1)[dim:0,size_is=attributeNameCount]*(1)[dim:0,string,null](wchar))
	{
		dimSize1 := uint64(o.AttributeNameCount)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.AttributeNames {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if o.AttributeNames[i1] != "" {
				_ptr_attributeNames := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
					if err := ndr.WriteUTF16NString(ctx, w, o.AttributeNames[i1]); err != nil {
						return err
					}
					return nil
				})
				if err := w.WritePointer(&o.AttributeNames[i1], _ptr_attributeNames); err != nil {
					return err
				}
			} else {
				if err := w.WritePointer(nil); err != nil {
					return err
				}
			}
		}
		for i1 := len(o.AttributeNames); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterAttributesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// attributeNameCount {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.AttributeNameCount); err != nil {
			return err
		}
	}
	// attributeNames {in} (1:{string, pointer=ref}*(1)[dim:0,size_is=attributeNameCount]*(1)[dim:0,string,null](wchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.AttributeNames", sizeInfo[0])
		}
		o.AttributeNames = make([]string, sizeInfo[0])
		for i1 := range o.AttributeNames {
			i1 := i1
			_ptr_attributeNames := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
				if err := ndr.ReadUTF16NString(ctx, w, &o.AttributeNames[i1]); err != nil {
					return err
				}
				return nil
			})
			_s_attributeNames := func(ptr interface{}) { o.AttributeNames[i1] = *ptr.(*string) }
			if err := w.ReadPointer(&o.AttributeNames[i1], _s_attributeNames, _ptr_attributeNames); err != nil {
				return err
			}
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterAttributesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if o.ResponseBuffer != nil && o.ResponseBufferSize == 0 {
		o.ResponseBufferSize = uint32(len(o.ResponseBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterAttributesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		if o.ResponseBuffer != nil || o.ResponseBufferSize > 0 {
			_ptr_ippResponseBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.ResponseBufferSize)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.ResponseBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.ResponseBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.ResponseBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.ResponseBuffer, _ptr_ippResponseBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_GetPrinterAttributesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		_ptr_ippResponseBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.ResponseBuffer", sizeInfo[0])
			}
			o.ResponseBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.ResponseBuffer {
				i1 := i1
				if err := w.ReadData(&o.ResponseBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_ippResponseBuffer := func(ptr interface{}) { o.ResponseBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.ResponseBuffer, _s_ippResponseBuffer, _ptr_ippResponseBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// GetPrinterAttributesRequest structure represents the RpcIppGetPrinterAttributes operation request
type GetPrinterAttributesRequest struct {
	Printer            *Printer `idl:"name:hPrinter" json:"printer"`
	AttributeNameCount uint32   `idl:"name:attributeNameCount" json:"attribute_name_count"`
	AttributeNames     []string `idl:"name:attributeNames;size_is:(attributeNameCount);string" json:"attribute_names"`
}

func (o *GetPrinterAttributesRequest) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterAttributesOperation) *xxx_GetPrinterAttributesOperation {
	if op == nil {
		op = &xxx_GetPrinterAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.AttributeNameCount = o.AttributeNameCount
	op.AttributeNames = o.AttributeNames
	return op
}

func (o *GetPrinterAttributesRequest) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterAttributesOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.AttributeNameCount = op.AttributeNameCount
	o.AttributeNames = op.AttributeNames
}
func (o *GetPrinterAttributesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *GetPrinterAttributesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterAttributesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// GetPrinterAttributesResponse structure represents the RpcIppGetPrinterAttributes operation response
type GetPrinterAttributesResponse struct {
	ResponseBufferSize uint32 `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	// Return: The RpcIppGetPrinterAttributes return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *GetPrinterAttributesResponse) xxx_ToOp(ctx context.Context, op *xxx_GetPrinterAttributesOperation) *xxx_GetPrinterAttributesOperation {
	if op == nil {
		op = &xxx_GetPrinterAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.ResponseBufferSize = o.ResponseBufferSize
	op.ResponseBuffer = o.ResponseBuffer
	op.Return = o.Return
	return op
}

func (o *GetPrinterAttributesResponse) xxx_FromOp(ctx context.Context, op *xxx_GetPrinterAttributesOperation) {
	if o == nil {
		return
	}
	o.ResponseBufferSize = op.ResponseBufferSize
	o.ResponseBuffer = op.ResponseBuffer
	o.Return = op.Return
}
func (o *GetPrinterAttributesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *GetPrinterAttributesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_GetPrinterAttributesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// xxx_SetPrinterAttributesOperation structure represents the RpcIppSetPrinterAttributes operation
type xxx_SetPrinterAttributesOperation struct {
	Printer                     *Printer `idl:"name:hPrinter" json:"printer"`
	JobAttributeGroupBufferSize uint32   `idl:"name:jobAttributeGroupBufferSize" json:"job_attribute_group_buffer_size"`
	JobAttributeGroupBuffer     []byte   `idl:"name:jobAttributeGroupBuffer;size_is:(jobAttributeGroupBufferSize)" json:"job_attribute_group_buffer"`
	ResponseBufferSize          uint32   `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer              []byte   `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	Return                      int32    `idl:"name:Return" json:"return"`
}

func (o *xxx_SetPrinterAttributesOperation) OpNum() int { return 123 }

func (o *xxx_SetPrinterAttributesOperation) OpName() string {
	return "/winspool/v1/RpcIppSetPrinterAttributes"
}

func (o *xxx_SetPrinterAttributesOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
	if o.JobAttributeGroupBuffer != nil && o.JobAttributeGroupBufferSize == 0 {
		o.JobAttributeGroupBufferSize = uint32(len(o.JobAttributeGroupBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
		if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterAttributesOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
		return err
	}
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer != nil {
			if err := o.Printer.MarshalNDR(ctx, w); err != nil {
				return err
			}
		} else {
			if err := (&Printer{}).MarshalNDR(ctx, w); err != nil {
				return err
			}
		}
	}
	// jobAttributeGroupBufferSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.JobAttributeGroupBufferSize); err != nil {
			return err
		}
	}
	// jobAttributeGroupBuffer {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=jobAttributeGroupBufferSize](uchar))
	{
		dimSize1 := uint64(o.JobAttributeGroupBufferSize)
		if err := w.WriteSize(dimSize1); err != nil {
			return err
		}
		sizeInfo := []uint64{
			dimSize1,
		}
		for i1 := range o.JobAttributeGroupBuffer {
			i1 := i1
			if uint64(i1) >= sizeInfo[0] {
				break
			}
			if err := w.WriteData(o.JobAttributeGroupBuffer[i1]); err != nil {
				return err
			}
		}
		for i1 := len(o.JobAttributeGroupBuffer); uint64(i1) < sizeInfo[0]; i1++ {
			if err := w.WriteData(uint8(0)); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_SetPrinterAttributesOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
	// hPrinter {in} (1:{context_handle, alias=PRINTER_HANDLE, names=ndr_context_handle}(struct))
	{
		if o.Printer == nil {
			o.Printer = &Printer{}
		}
		if err := o.Printer.UnmarshalNDR(ctx, w); err != nil {
			return err
		}
	}
	// jobAttributeGroupBufferSize {in} (1:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.JobAttributeGroupBufferSize); err != nil {
			return err
		}
	}
	// jobAttributeGroupBuffer {in} (1:{pointer=ref}*(1))(2:{alias=BYTE}[dim:0,size_is=jobAttributeGroupBufferSize](uchar))
	{
		sizeInfo := []uint64{
			0,
		}
		for sz1 := range sizeInfo {
			if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
				return err
			}
		}
		if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
			return fmt.Errorf("buffer overflow for size %d of array o.JobAttributeGroupBuffer", sizeInfo[0])
		}
		o.JobAttributeGroupBuffer = make([]byte, sizeInfo[0])
		for i1 := range o.JobAttributeGroupBuffer {
			i1 := i1
			if err := w.ReadData(&o.JobAttributeGroupBuffer[i1]); err != nil {
				return err
			}
		}
	}
	return nil
}

func (o *xxx_SetPrinterAttributesOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
	if o.ResponseBuffer != nil && o.ResponseBufferSize == 0 {
		o.ResponseBufferSize = uint32(len(o.ResponseBuffer))
	}
	if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
		if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterAttributesOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
	if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
		return err
	}
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.WriteData(o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		if o.ResponseBuffer != nil || o.ResponseBufferSize > 0 {
			_ptr_ippResponseBuffer := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
				dimSize1 := uint64(o.ResponseBufferSize)
				if err := w.WriteSize(dimSize1); err != nil {
					return err
				}
				sizeInfo := []uint64{
					dimSize1,
				}
				for i1 := range o.ResponseBuffer {
					i1 := i1
					if uint64(i1) >= sizeInfo[0] {
						break
					}
					if err := w.WriteData(o.ResponseBuffer[i1]); err != nil {
						return err
					}
				}
				for i1 := len(o.ResponseBuffer); uint64(i1) < sizeInfo[0]; i1++ {
					if err := w.WriteData(uint8(0)); err != nil {
						return err
					}
				}
				return nil
			})
			if err := w.WritePointer(&o.ResponseBuffer, _ptr_ippResponseBuffer); err != nil {
				return err
			}
		} else {
			if err := w.WritePointer(nil); err != nil {
				return err
			}
		}
		if err := w.WriteDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.WriteData(o.Return); err != nil {
			return err
		}
	}
	return nil
}

func (o *xxx_SetPrinterAttributesOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
	// ippResponseBufferSize {out} (1:{pointer=ref}*(1))(2:{alias=DWORD}(uint32))
	{
		if err := w.ReadData(&o.ResponseBufferSize); err != nil {
			return err
		}
	}
	// ippResponseBuffer {out} (1:{pointer=ref}*(2)*(1))(2:{alias=BYTE}[dim:0,size_is=ippResponseBufferSize](uchar))
	{
		_ptr_ippResponseBuffer := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
			sizeInfo := []uint64{
				0,
			}
			for sz1 := range sizeInfo {
				if err := w.ReadSize(&sizeInfo[sz1]); err != nil {
					return err
				}
			}
			if sizeInfo[0] > uint64(w.Len()) /* sanity-check */ {
				return fmt.Errorf("buffer overflow for size %d of array o.ResponseBuffer", sizeInfo[0])
			}
			o.ResponseBuffer = make([]byte, sizeInfo[0])
			for i1 := range o.ResponseBuffer {
				i1 := i1
				if err := w.ReadData(&o.ResponseBuffer[i1]); err != nil {
					return err
				}
			}
			return nil
		})
		_s_ippResponseBuffer := func(ptr interface{}) { o.ResponseBuffer = *ptr.(*[]byte) }
		if err := w.ReadPointer(&o.ResponseBuffer, _s_ippResponseBuffer, _ptr_ippResponseBuffer); err != nil {
			return err
		}
		if err := w.ReadDeferred(); err != nil {
			return err
		}
	}
	// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
	{
		if err := w.ReadData(&o.Return); err != nil {
			return err
		}
	}
	return nil
}

// SetPrinterAttributesRequest structure represents the RpcIppSetPrinterAttributes operation request
type SetPrinterAttributesRequest struct {
	Printer                     *Printer `idl:"name:hPrinter" json:"printer"`
	JobAttributeGroupBufferSize uint32   `idl:"name:jobAttributeGroupBufferSize" json:"job_attribute_group_buffer_size"`
	JobAttributeGroupBuffer     []byte   `idl:"name:jobAttributeGroupBuffer;size_is:(jobAttributeGroupBufferSize)" json:"job_attribute_group_buffer"`
}

func (o *SetPrinterAttributesRequest) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterAttributesOperation) *xxx_SetPrinterAttributesOperation {
	if op == nil {
		op = &xxx_SetPrinterAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.Printer = o.Printer
	op.JobAttributeGroupBufferSize = o.JobAttributeGroupBufferSize
	op.JobAttributeGroupBuffer = o.JobAttributeGroupBuffer
	return op
}

func (o *SetPrinterAttributesRequest) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterAttributesOperation) {
	if o == nil {
		return
	}
	o.Printer = op.Printer
	o.JobAttributeGroupBufferSize = op.JobAttributeGroupBufferSize
	o.JobAttributeGroupBuffer = op.JobAttributeGroupBuffer
}
func (o *SetPrinterAttributesRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRRequest(ctx, w)
}
func (o *SetPrinterAttributesRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterAttributesOperation{}
	if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}

// SetPrinterAttributesResponse structure represents the RpcIppSetPrinterAttributes operation response
type SetPrinterAttributesResponse struct {
	ResponseBufferSize uint32 `idl:"name:ippResponseBufferSize;pointer:ref" json:"response_buffer_size"`
	ResponseBuffer     []byte `idl:"name:ippResponseBuffer;size_is:(, ippResponseBufferSize);pointer:ref" json:"response_buffer"`
	// Return: The RpcIppSetPrinterAttributes return value.
	Return int32 `idl:"name:Return" json:"return"`
}

func (o *SetPrinterAttributesResponse) xxx_ToOp(ctx context.Context, op *xxx_SetPrinterAttributesOperation) *xxx_SetPrinterAttributesOperation {
	if op == nil {
		op = &xxx_SetPrinterAttributesOperation{}
	}
	if o == nil {
		return op
	}
	op.ResponseBufferSize = o.ResponseBufferSize
	op.ResponseBuffer = o.ResponseBuffer
	op.Return = o.Return
	return op
}

func (o *SetPrinterAttributesResponse) xxx_FromOp(ctx context.Context, op *xxx_SetPrinterAttributesOperation) {
	if o == nil {
		return
	}
	o.ResponseBufferSize = op.ResponseBufferSize
	o.ResponseBuffer = op.ResponseBuffer
	o.Return = op.Return
}
func (o *SetPrinterAttributesResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
	return o.xxx_ToOp(ctx, nil).MarshalNDRResponse(ctx, w)
}
func (o *SetPrinterAttributesResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
	_o := &xxx_SetPrinterAttributesOperation{}
	if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
		return err
	}
	o.xxx_FromOp(ctx, _o)
	return nil
}
