pfnUpdateOverlayCb routine

The pfnUpdateOverlayCb function modifies a kernel-mode overlay object.

Syntax


PFND3DDDI_UPDATEOVERLAYCB pfnUpdateOverlayCb;

__checkReturn HRESULT APIENTRY CALLBACK pfnUpdateOverlayCb(
  _In_  HANDLE hDevice,
  _In_  const D3DDDICB_UPDATEOVERLAY *pData
)
{ ... }

Parameters

hDevice [in]

A handle to the display device (graphics context).

pData [in]

A pointer to a D3DDDICB_UPDATEOVERLAY structure that describes how to modify the overlay.

Return value

pfnUpdateOverlayCb returns one of the following values:

Return codeDescription
S_OK

The overlay object was successfully modified.

D3DDDIERR_NOTAVAILABLE

pfnUpdateOverlayCb failed because of a lack of overlay hardware or bandwidth.

E_INVALIDARG

Parameters were validated and determined to be incorrect.

E_OUTOFMEMORY

pfnUpdateOverlayCb could not allocate memory that was required for it to complete.

 

This function might also return other HRESULT values.

Examples

The following code example shows how to modify a kernel-mode overlay object.


HRESULT CD3DContext::UpdateOverlay(CONST D3DDDIARG_UPDATEOVERLAY* pUpdateOverlay) {
    D3DDDICB_UPDATEOVERLAY UpdateCB;
    DWORD_PTR dwResource = (DWORD_PTR) pUpdateOverlay->OverlayInfo.hResource;
    dwResource += pUpdateOverlay->OverlayInfo.SubResourceIndex;
    LONG dwTempPitch;

    UpdateCB.hKernelOverlay = (D3DKMT_HANDLE) g_hOverlay;
    UpdateCB.OverlayInfo.hAllocation = R200GetAllocationHandle(m_pR200Ctx,
                                    (DWORD)dwResource,
                                     &dwTempPitch);

    UpdateCB.OverlayInfo.DstRect.left = pUpdateOverlay->OverlayInfo.DstRect.left;
    UpdateCB.OverlayInfo.DstRect.right = pUpdateOverlay->OverlayInfo.DstRect.right;
    UpdateCB.OverlayInfo.DstRect.top = pUpdateOverlay->OverlayInfo.DstRect.top;
    UpdateCB.OverlayInfo.DstRect.bottom = pUpdateOverlay->OverlayInfo.DstRect.bottom;

    UpdateCB.OverlayInfo.SrcRect.left = pUpdateOverlay->OverlayInfo.SrcRect.left;
    UpdateCB.OverlayInfo.SrcRect.right = pUpdateOverlay->OverlayInfo.SrcRect.right;
    UpdateCB.OverlayInfo.SrcRect.top = pUpdateOverlay->OverlayInfo.SrcRect.top;
    UpdateCB.OverlayInfo.SrcRect.bottom = pUpdateOverlay->OverlayInfo.SrcRect.bottom;

    UpdateCB.OverlayInfo.pPrivateDriverData = "This is a test";
    UpdateCB.OverlayInfo.PrivateDriverDataSize = 10;

    HRESULT hr = m_d3dCallbacks.pfnUpdateOverlayCb(m_hD3D, &UpdateCB);

    return S_OK;
}

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

D3dumddi.h (include D3dumddi.h)

See also

D3DDDI_DEVICECALLBACKS
D3DDDICB_UPDATEOVERLAY

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft