// d3dumddi.h
PFND3DDDI_UNLOCK Pfnd3dddiUnlock;
HRESULT Pfnd3dddiUnlock(
HANDLE hDevice,
const D3DDDIARG_UNLOCK *unnamedParam2
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The Unlock function unlocks a resource or a surface within the resource that was previously locked by the Lock function.
hDeviceA handle to the display device (graphics context).
unnamedParam2pData [in]
A pointer to a D3DDDIARG_UNLOCK structure that describes the resource or surface within the resource to unlock.
Unlock returns one of the following values:
| Return code | Description |
|---|---|
| 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. |
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.