Errors are represented by negative values and cannot be combined. This table lists the values that can be returned by all IDirectDraw, IDirectDrawSurface, IDirectDrawPalette, and IDirectDrawClipper methods. For a list of the error codes each method is capable of returning, see the individual method descriptions.
The request completed successfully.
The object has already been initialized.
A clipper object is attached to a source surface that has passed into a call to the IDirectDrawSurface::BltFast method.
A surface cannot be attached to another requested surface.
A surface cannot be detached from another requested surface.
Windows cannot create any more device contexts (DCs).
Primary and 3D surfaces, or surfaces that are implicitly created, cannot be duplicated.
Access to this surface is refused because an attempt was made to lock the primary surface without DCI support.
An attempt to page lock a surface failed. Page lock will not work on a display memory surface or an emulated primary surface.
An attempt to page unlock a surface failed. Page unlock will not work on a display memory surface or an emulated primary surface.
An attempt was made to set a clip list for a clipper object that is already monitoring an hWnd.
No source color key is specified for this operation.
No support is currently available.
A device context has already been returned for this surface. Only one device context can be retrieved for each surface.
DDERR_DIRECTDRAWALREADYCREATED
A DirectDraw object representing this driver has already been created for this process.
An exception was encountered while performing the requested operation.
An attempt was made to set the cooperative level when it was already set to exclusive.
There is an undefined error condition.
The height of the provided rectangle is not a multiple of the required alignment.
The DirectDraw CooperativeLevel HWND has already been set. It cannot be reset while the process has surfaces or palettes created.
DirectDraw is prevented from restoring state because the DirectDraw CooperativeLevel HWND has been subclassed.
The surface cannot be restored because it is an implicitly created surface.
The primary surface creation request does not match with the existing primary surface.
One or more of the capability bits passed to the callback function are incorrect.
DirectDraw does not support the provided clip list.
The GUID passed to the DirectDrawCreate function is not a valid DirectDraw driver identifier.
DirectDraw does not support the requested mode.
DirectDraw received a pointer that was an invalid DirectDraw object.
One or more of the parameters passed to the method are incorrect.
The pixel format was invalid as specified.
The position of the overlay on the destination is no longer legal.
The provided rectangle was invalid.
The requested operation could not be performed because the surface was of the wrong type.
One or more surfaces are locked, causing the failure of the requested operation.
No 3D is present.
No alpha acceleration hardware is present or available, causing the failure of the requested operation.
No blitter hardware is present.
No clip list is available.
No clipper object is attached to the surface object.
The operation cannot be carried out because no color conversion hardware is present or available.
The surface does not currently have a color key.
The operation cannot be carried out because there is no hardware support for the destination color key.
A create function is called without the IDirectDraw::SetCooperativeLevel method being called.
No device context (DC) has ever been created for this surface.
No DirectDraw raster operation (ROP) hardware is available.
Hardware-only DirectDraw object creation is not possible; the driver does not support any hardware.
DirectDraw support is not possible with the current display driver.
Software emulation is not available.
The operation requires the application to have exclusive mode, but the application does not have exclusive mode.
Flipping visible surfaces is not supported.
No GDI is present.
Clipper notification requires an HWND, or no HWND has been previously set as the CooperativeLevel HWND.
The operation cannot be carried out because no mipmap texture mapping hardware is present or available.
The operation cannot be carried out because no mirroring hardware is present or available.
The IDirectDrawSurface::GetOverlayPosition method is called on an overlay that the IDirectDrawSurface::UpdateOverlay method has not been called on to establish a destination.
The operation cannot be carried out because no overlay hardware is present or available.
No palette object is attached to this surface.
There is no hardware support for 16- or 256-color palettes.
The operation cannot be carried out because no appropriate raster operation hardware is present or available.
The operation cannot be carried out because no rotation hardware is present or available.
The operation cannot be carried out because there is no hardware support for stretching.
The DirectDrawSurface is not using a 4-bit color palette and the requested operation requires a 4-bit color palette.
The DirectDrawSurface is not using a 4-bit color index palette and the requested operation requires a 4-bit color index palette.
The DirectDrawSurface is not using an 8-bit color palette and the requested operation requires an 8-bit color palette.
An overlay component is called for a non-overlay surface
The operation cannot be carried out because no texture mapping hardware is present or available.
An attempt has been made to flip a surface that cannot be flipped.
The requested item was not found.
An attempt was made to invoke an interface method of a DirectDraw object created by CoCreateInstance before the object was initialized.
An attempt is made to unlock a surface that was not locked.
An attempt is made to page unlock a surface with no outstanding page locks.
The surface being used is not a palette-based surface.
The operation cannot be carried out because there is no hardware support for vertical blank synchronized operations.
The operation cannot be carried out because there is no hardware support for z-buffers when creating a z-buffer in display memory or when performing a z-aware blit.
The overlay surfaces cannot be z-layered based on their BltOrder because the hardware does not support z-layering of overlays.
The hardware needed for the requested operation has already been allocated.
DirectDraw does not have enough memory to perform the operation.
DirectDraw does not have enough display memory to perform the operation.
The hardware does not support clipped overlays.
DDERR_OVERLAYCOLORKEYONLYONEACTIVE
An attempt was made to have more than one color key active on an overlay.
The IDirectDrawSurface::GetOverlayPosition method is called on a hidden overlay.
Access to this palette is refused because the palette is locked by another thread.
DDERR_PRIMARYSURFACEALREADYEXISTS
This process has already created a primary surface.
The region passed to the IDirectDrawClipper::GetClipList method is too small.
An attempt was made to attach a surface to another surface to which it is already attached.
An attempt was made to make a surface a dependency of another surface to which it is already dependent.
Access to this surface is refused because the surface is locked by another thread.
Access to the surface is refused because the surface is obscured.
Access to this surface is refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have the IDirectDrawSurface::Restore method called on it.
The requested surface is not attached.
The height requested by DirectDraw is too large.
The size requested by DirectDraw is too large. However, the individual height and width are OK.
The width requested by DirectDraw is too large.
The operation is not supported.
The FourCC format requested is not supported by DirectDraw.
The bitmask in the pixel format requested is not supported by DirectDraw.
The display is currently in an unsupported mode.
A vertical blank is in progress.
The previous blit operation that is transferring information to or from this surface is incomplete.
This surface cannot be restored because it was created in a different mode.
The provided rectangle was not horizontally aligned on a required boundary.