ConvertDevModeToPrintTicketThunk2 function

[This function is not supported and might be disabled or deleted in future versions of Windows. PTConvertDevModeToPrintTicket provides equivalent functionality and should be used instead.]

Converts a DEVMODE structure to a print ticket.


HRESULT ConvertDevModeToPrintTicketThunk2(
  _In_  HPTPROVIDER hProvider,
  _In_  BYTE        *pDevmode,
  _In_  ULONG       cbSize,
  _In_  DWORD       scope,
  _Out_ BYTE        **ppPrintTicket,
  _Out_ INT         *pcbPrintTicketLength


hProvider [in]

A handle to an open print ticket provider. This handle is returned by the BindPTProviderThunk function.

pDevmode [in]

A pointer to the DEVMODE to convert.

cbSize [in]

The size, in bytes, of the DEVMODE passed in pDevmode.

scope [in]

A value that specifies the scope of ppPrintTicket. This value can specify a single page, an entire document, or all documents in the print job. The value of this parameter must be a member of the EPrintTicketScope enumeration, cast as a DWORD.

ppPrintTicket [out]

The address of the buffer that contains a print ticket that represents the DEVMODE passed in pDevmode. This function calls CoTaskMemAlloc to allocate this buffer. When the buffer is no longer needed, the caller must free it by calling CoTaskMemFree.

pcbPrintTicketLength [out]

The size, in bytes, of the print ticket returned in ppPrintTicket.

Return value

If the method succeeds, it returns S_OK; otherwise, it returns an HRESULT error code. For more information about COM error codes, see Error Handling.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]



See also

Print Schema
Print Spooler API Functions