SendRecvBidiData function

A print provider DLL's SendRecvBidiData function supports bidirectional communication between an application and a printer or print server.

Syntax

DWORD SendRecvBidiData(
  _In_  HANDLE                   hPrinter,
  _In_  LPCTSTR                  pAction,
  _In_  PBIDI_REQUEST_CONTAINER  pReqData,
  _Out_ PBIDI_RESPONSE_CONTAINER *ppResData
);

Parameters

  • hPrinter [in]
    Specifies a caller-supplied printer handle.

  • pAction [in]
    Pointer to a caller-supplied Unicode string that contains the requested action. The value of this parameter should be one of the BIDI_ACTION_XXX constants described in the Microsoft Windows SDK documentation.

  • pReqData [in]
    Pointer to a caller-supplied BIDI_REQUEST_CONTAINER structure that contains the bidi request data.

  • ppResData [out]
    Is a caller-supplied pointer to a memory location that will receive the address of a caller-allocated BIDI_RESPONSE_CONTAINER structure. This structure contains the bidi response.

Return value

If the operation succeeds, the SendRecvBidiData function returns ERROR_SUCCESS. Otherwise, it returns a Win32 error code.

Remarks

Print providers optionally can define a SendRecvBidiData function and include the function's address in the fpSendRecvBidiData member of a Windows XP PRINTPROVIDOR structure.

The function's hPrinter parameter uses the printer handle supplied by the OpenPrinter function. Applications access bidi APIs by way of the IBidiSpooler and IBidiRequest COM interfaces. When an application calls IBidiSpooler-->BidiDevice, the COM implementation calls the OpenPrinter function to obtain a printer handle. Then, when the application calls IBidiSpooler-->SendRecvData, the COM implementation calls the print provider's SendRecvBidiData function. For more information about these COM interfaces and OpenPrinter, see the Windows SDK documentation.

Typically, in a network print provider DLL, SendRecvBidiData calls the network APIs to obtain bidirectional data from the printer and then sends the response back to the caller.

A language monitor can call a print provider's SendRecvBidiData function outside a StartDocPrinter/EndDocPrinter function pair (both are described in the Windows SDK documentation). A print provider DLL's SendRecvBidiData function must be able to handle such calls.

Requirements

Target platform

Desktop

Version

This function is available in Windows XP and later operating systems.

Header

Winsplp.h (include Winsplp.h)

Library

WinSpool.lib

DLL

WinSpool.drv

See also

BIDI_REQUEST_CONTAINER

BIDI_REQUEST_CONTAINER

SendRecvBidiDataFromPort

PRINTPROVIDOR

 

 

Send comments about this topic to Microsoft