Blt
Expand Minimize

Unlock routine

The Unlock function unlocks a resource or a surface within the resource that was previously locked by the Lock function.

Syntax


PFND3DDDI_UNLOCK Unlock;

__checkReturn HRESULT APIENTRY Unlock(
  _In_  HANDLE hDevice,
  _In_  const D3DDDIARG_UNLOCK *pData
)
{ ... }

Parameters

hDevice [in]

A handle to the display device (graphics context).

pData [in]

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

Return value

Unlock returns one of the following values:

Return codeDescription
S_OK

The resource is successfully unlocked.

E_OUTOFMEMORY

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

E_INVALIDARG

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

 

Remarks

These comments are analogous to the description in the Remarks section of the Lock reference page.

The user-mode display driver must call the Microsoft Direct3D runtime's pfnUnlockCb function after Unlock is called. In this pfnUnlockCb call, the user-mode display driver passes an allocation handle. Before calling pfnUnlockCb, the user-mode display driver must first map the surface to an appropriate allocation.

The runtime calls the user-mode display driver's Unlock function to unlock preallocated system memory surfaces as well. The runtime sets the NotifyOnly bit-field flag in the Flags member of the D3DDDIARG_UNLOCK structure that is pointed to by pData to differentiate Unlock calls that unlock preallocated system memory from other Unlock calls. If the user-mode display driver's Lock function called pfnLockCb to lock the system memory allocation that corresponds to the surface, it must also call pfnUnlockCb. Not calling pfnUnlockCb stops the coordination between the runtime, the user-mode display driver, and the display miniport driver.

Requirements

Version

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

Header

D3dumddi.h (include D3dumddi.h)

See also

D3DDDIARG_UNLOCK
D3DDDI_DEVICEFUNCS
Lock
pfnLockCb
pfnUnlockCb

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft