PFND3DDDI_UNLOCKASYNC callback function

The UnlockAsync function unlocks a resource or a surface within the resource that the LockAsync function previously locked.

Syntax


PFND3DDDI_UNLOCKASYNC UnlockAsync;

__checkReturn HRESULT APIENTRY UnlockAsync(
  _In_       HANDLE                hDevice,
  _In_ const D3DDDIARG_UNLOCKASYNC *pData
)
{ ... }

Parameters

hDevice [in]

A handle to a display device (that is, the graphics context).

pData [in]

A pointer to a D3DDDIARG_UNLOCKASYNC structure that describes the resource or surface within the resource to unlock.

Return value

UnlockAsync returns one of the following values:

Return codeDescription
S_OK

The resource is successfully unlocked.

E_OUTOFMEMORY

UnlockAsync could not allocate the required memory for it to complete.

E_INVALIDARG

The resource that D3DDDIARG_UNLOCKASYNC describes was not locked by a previous call to the driver's LockAsync function.

 

Remarks

A user-mode display driver should call the pfnUnlockCb function with the appropriate allocation handle after the UnlockAsync function is called.

A user-mode display driver optionally implements UnlockAsync; the Microsoft Direct3D runtime calls UnlockAsync only if the driver implements the LockAsync, UnlockAsync, and Rename functions.

Like LockAsync, UnlockAsync is called on the main application thread while most other calls to the user-mode display driver functions are made on a worker thread (on multiple-processor computers).

If a user-mode display driver exposes a DDI version of 0x0000000B or greater (the driver returns this value in the DriverVersion member of the D3D10DDIARG_OPENADAPTER structure in a call to the driver's OpenAdapter function), the Direct3D runtime will call UnlockAsync in a reentrant manner. When the runtime calls UnlockAsync in a reentrant manner, one thread can execute inside UnlockAsync while another thread that references the same display device executes inside of another user-mode display driver function.

Requirements

Target platform

Version

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

Header

D3dumddi.h (include D3dumddi.h)

See also

D3DDDI_DEVICEFUNCS
D3DDDIARG_UNLOCKASYNC
LockAsync
pfnUnlockCb
Rename

 

 

Send comments about this topic to Microsoft

Show: