Compartilhar via


PDD_IoControl (Compact 2013)

3/26/2014

This function sends IOCTL codes that are not part of the Wave or Mixer API to the audio driver's PDD layer.

Syntax

BOOL PDD_IoControl(
  PDWORD pdwOpenData,
  DWORD  dwCode,
  PBYTE  pBufIn,
  DWORD  dwLenIn,
  PBYTE  pBufOut,
  DWORD  dwLenOut,
  PDWORD pdwActualOut
);

Parameters

  • pdwOpenData
    Specifies a value returned from the messaging function.
  • dwCode
    I/O control operation to perform. These codes are device-specific and usually exposed to developers through a header file..
  • pBufIn
    Pointer to the buffer containing data to transfer to the PDD layer.
  • dwLenIn
    Number of bytes of data in the buffer specified for pBufIn.
  • pBufOut
    Pointer to the buffer used to transfer the output data from the device.
  • dwLenOut
    Maximum number of bytes in the buffer specified by pBufOut.
  • pdwActualOut
    Pointer to the DWORD buffer that this function uses to return the actual number of bytes received from the PDD layer.

Return Value

TRUE indicates success. FALSE indicates failure.

Remarks

This function allows the PDD layer to handle previously unrecognized IOCTL codes not sent with PDD_AudioMessage or PDD_WaveProc, such as those for power management. To implement this function, you must first initialize a global function pointer in the PDD layer. This is necessary so as to not break existing PDD implementations.

The following code sample shows how to initialize a global function pointer to allow an audio driver to handle new IOCTL calls:

// Example of how to override handling of other IOCTL messages (other than wave and mixer), e.g. to handle power manager IOCTLs.
// The MDD can init this global to a function to override default handling of unrecognized IoControl codes
extern PFN_IOCONTROL pfn_PDD_IoControl = PDD_IoControl;
BOOL PDD_IoControl(
             PDWORD pdwOpenData,
             DWORD  dwCode,
             PBYTE  pBufIn,
             DWORD  dwLenIn,
             PBYTE  pBufOut,
             DWORD  dwLenOut,
             PDWORD pdwActualOut
             )

Requirements

Header

waveddsi.h

See Also

Reference

Audio PDD Functions