d3d9.dllGetData
Microsoft DirectX 9.0 SDK Update (October 2004)

IDirect3DQuery9::GetData Method


Polls a queried resource to get the query state or a query result. For more information about queries, see Queries.

Syntax

HRESULT GetData(      

    void* pData,     DWORD dwSize,     DWORD dwGetDataFlags );

Parameters

pData
[in, out] Pointer to a buffer containing the query data. The user is responsible for allocating this. pData may be NULL only if dwSize is 0.
dwSize
[in] Number of bytes of data in pData. If you set dwSize to zero, you can use this method to poll the resource for the query status. See remarks.
dwGetDataFlags
[in] Data flags specifying the query type. Valid values are either 0 or D3DGETDATA_FLUSH. Use D3DGETDATA_FLUSH to flush internally batched queries to the driver. For applications writing their own version of waiting, a query result is not realized until the driver receives a flush.

Return Value

The return type identifies the query state (see Queries). The method returns S_OK if the query data is available and S_FALSE if it is not. These are considered successful return values. If the method fails when D3DGETDATA_FLUSH is used, the return value can be D3DERR_DEVICELOST.

Remarks

It is possible to lose the device while polling for query status. When D3DGETDATA_FLUSH is specified, this method will return D3DERR_DEVICELOST in response to a lost device. This allows an application to prevent threads from endlessly polling due to a lost device (which cannot respond to the query).



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.