DirectDraw Return Codes

Header: ddraw.h

Errors are represented by negative values and cannot be combined. This table lists the values that can be returned by all methods of the DirectDraw Interfaces and DirectDraw Functions. For a list of the error codes that each method or function can return, see the method or function description.

SymbolicCodeDescription
DD_OKThe request completed successfully.
DDERR_ALREADYINITIALIZEDThe object has already been initialized.
DDERR_BLTFASTCANTCLIPA DirectDrawClipper object is attached to a source surface that has passed into a call to the [**IDirectDrawSurface7::BltFast**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdrawsurface7-bltfast) method.
DDERR_CANNOTATTACHSURFACEA surface cannot be attached to another requested surface.
DDERR_CANNOTDETACHSURFACEA surface cannot be detached from another requested surface.
DDERR_CANTCREATEDCWindows cannot create any more device contexts (DCs), or a DC has requested a palette-indexed surface when the surface had no palette and the display mode was not palette-indexed (in this case, DirectDraw cannot select a proper palette into the DC).
DDERR_CANTDUPLICATEPrimary and 3-D surfaces, or surfaces that are implicitly created, cannot be duplicated.
DDERR_CANTLOCKSURFACEAccess to this surface is refused because an attempt was made to lock the primary surface without Display Control Interface (DCI) support.
DDERR_CANTPAGELOCKAn attempt to page-lock a surface failed. Page lock does not work on a display-memory surface or an emulated primary surface.
DDERR_CANTPAGEUNLOCKAn attempt to page-unlock a surface failed. Page unlock does not work on a display-memory surface or an emulated primary surface.
DDERR_CLIPPERISUSINGHWNDAn attempt was made to set a clip list for a DirectDrawClipper object that is already monitoring a window handle.
DDERR_COLORKEYNOTSETNo source color key is specified for this operation.
DDERR_CURRENTLYNOTAVAILNo support is currently available.
DDERR_DDSCAPSCOMPLEXREQUIREDNew for DirectX 7.0. The surface requires the DDSCAPS_COMPLEX flag.
DDERR_DCALREADYCREATEDA device context (DC) has already been returned for this surface. Only one DC can be retrieved for each surface. **>DDERR_DEVICEDOESNTOWNSURFACE** Surfaces created by one DirectDraw device cannot be used directly by another DirectDraw device. **>DDERR_DIRECTDRAWALREADYCREATED** A DirectDraw object representing this driver has already been created for this process.
DDERR_EXCEPTIONAn exception was encountered while performing the requested operation.
DDERR_EXCLUSIVEMODEALREADYSETAn attempt was made to set the cooperative level when it was already set to exclusive.
DDERR_EXPIREDThe data has expired and is therefore no longer valid.
DDERR_GENERICThere is an undefined error condition.
DDERR_HEIGHTALIGNThe height of the provided rectangle is not a multiple of the required alignment.
DDERR_HWNDALREADYSETThe DirectDraw cooperative-level window handle has already been set. It cannot be reset while the process has surfaces or palettes created.
DDERR_HWNDSUBCLASSEDDirectDraw is prevented from restoring state because the DirectDraw cooperative-level window handle has been subclassed.
DDERR_IMPLICITLYCREATEDThe surface cannot be restored because it is an implicitly created surface.
DDERR_INCOMPATIBLEPRIMARYThe primary surface creation request does not match the existing primary surface.
DDERR_INVALIDCAPSOne or more of the capability bits passed to the callback function are incorrect.
DDERR_INVALIDCLIPLISTDirectDraw does not support the provided clip list.
DDERR_INVALIDDIRECTDRAWGUIDThe globally unique identifier (GUID) passed to the [**DirectDrawCreate**](/windows/desktop/api/Ddraw/nf-ddraw-directdrawcreate) function is not a valid DirectDraw driver identifier.
DDERR_INVALIDMODEDirectDraw does not support the requested mode.
DDERR_INVALIDOBJECTDirectDraw received a pointer that was an invalid DirectDraw object.
DDERR_INVALIDPARAMSOne or more of the parameters passed to the method are incorrect.
DDERR_INVALIDPIXELFORMATThe pixel format was invalid as specified.
DDERR_INVALIDPOSITIONThe position of the overlay on the destination is no longer valid.
DDERR_INVALIDRECTThe provided rectangle was invalid.
DDERR_INVALIDSTREAMThe specified stream contains invalid data.
DDERR_INVALIDSURFACETYPEThe surface was of the wrong type.
DDERR_LOCKEDSURFACESOne or more surfaces are locked, causing the failure of the requested operation.
DDERR_MOREDATAThere is more data available than the specified buffer size can hold.
DDERR_NEWMODENew for DirectX 7.0. When [**IDirectDraw7::StartModeTest**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdraw7-startmodetest) is called with the DDSMT_ISTESTREQUIRED flag, it might return this value to denote that some or all of the resolutions can and should be tested. [**IDirectDraw7::EvaluateMode**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdraw7-evaluatemode) returns this value to indicate that the test has switched to a new display mode.
DDERR_NO3DNo 3-D hardware or emulation is present.
DDERR_NOALPHAHWNo alpha-acceleration hardware is present or available, causing the failure of the requested operation.
DDERR_NOBLTHWNo bit block transferring hardware is present.
DDERR_NOCLIPLISTNo clip list is available.
DDERR_NOCLIPPERATTACHEDNo DirectDrawClipper object is attached to the surface object.
DDERR_NOCOLORCONVHWNo color-conversion hardware is present or available.
DDERR_NOCOLORKEYThe surface does not currently have a color key.
DDERR_NOCOLORKEYHWThere is no hardware support for the destination color key.
DDERR_NOCOOPERATIVELEVELSETA create function was called without the [**IDirectDraw7::SetCooperativeLevel**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdraw7-setcooperativelevel) method.
DDERR_NODCNo device context (DC) has ever been created for this surface.
DDERR_NODDROPSHWNo DirectDraw raster-operation (ROP) hardware is available.
DDERR_NODIRECTDRAWHWHardware-only DirectDraw object creation is not possible; the driver does not support any hardware.
DDERR_NODIRECTDRAWSUPPORTDirectDraw support is not possible with the current display driver.
DDERR_NODRIVERSUPPORTNew for DirectX 7.0. Testing cannot proceed because the display adapter driver does not enumerate refresh rates.
DDERR_NOEMULATIONSoftware emulation is not available.
DDERR_NOEXCLUSIVEMODEThe operation requires the application to have exclusive mode, but the application does not have exclusive mode.
DDERR_NOFLIPHWFlipping visible surfaces is not supported.
DDERR_NOFOCUSWINDOWAn attempt was made to create or set a device window without first setting the focus window.
DDERR_NOGDINo GDI is present.
DDERR_NOHWNDClipper notification requires a window handle, or no window handle has been previously set as the cooperative level window handle.
DDERR_NOMIPMAPHWNo mipmap-capable texture mapping hardware is present or available.
DDERR_NOMIRRORHWNo mirroring hardware is present or available.
DDERR_NOMONITORINFORMATIONNew for DirectX 7.0. Testing cannot proceed because the monitor has no associated EDID data.
DDERR_NONONLOCALVIDMEMAn attempt was made to allocate nonlocal video memory from a device that does not support nonlocal video memory.
DDERR_NOOPTIMIZEHWThe device does not support optimized surfaces.
DDERR_NOOVERLAYDESTThe [**IDirectDrawSurface7::GetOverlayPosition**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdrawsurface7-getoverlayposition) method is called on an overlay that the [**IDirectDrawSurface7::UpdateOverlay**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdrawsurface7-updateoverlay) method has not been called on to establish as a destination.
DDERR_NOOVERLAYHWNo overlay hardware is present or available.
DDERR_NOPALETTEATTACHEDNo palette object is attached to this surface.
DDERR_NOPALETTEHWThere is no hardware support for 16- or 256-color palettes.
DDERR_NORASTEROPHWNo appropriate raster-operation hardware is present or available.
DDERR_NOROTATIONHWNo rotation hardware is present or available.
DDERR_NOSTEREOHARDWAREThere is no stereo hardware present or available.
DDERR_NOSTRETCHHWThere is no hardware support for stretching.
DDERR_NOSURFACELEFTThere is no hardware present that supports stereo surfaces.
DDERR_NOT4BITCOLORThe DirectDrawSurface object is not using a 4-bit color palette, and the requested operation requires a 4-bit color palette.
DDERR_NOT4BITCOLORINDEXThe DirectDrawSurface object is not using a 4-bit color index palette, and the requested operation requires a 4-bit color index palette.
DDERR_NOT8BITCOLORThe DirectDrawSurface object is not using an 8-bit color palette, and the requested operation requires an 8-bit color palette.
DDERR_NOTAOVERLAYSURFACEAn overlay component is called for a nonoverlay surface.
DDERR_NOTEXTUREHWThe operation cannot be carried out because no texture-mapping hardware is present or available.
DDERR_NOTFLIPPABLEAn attempt was made to flip a surface that cannot be flipped.
DDERR_NOTFOUNDThe requested item was not found.
DDERR_NOTINITIALIZEDAn attempt was made to call an interface method of a DirectDraw object created by [**CoCreateInstance**](/windows/desktop/api/combaseapi/nf-combaseapi-cocreateinstance) before the object was initialized.
DDERR_NOTLOADEDThe surface is an optimized surface, but it has not yet been allocated any memory.
DDERR_NOTLOCKEDAn attempt was made to unlock a surface that was not locked.
DDERR_NOTPAGELOCKEDAn attempt was made to page-unlock a surface with no outstanding page locks.
DDERR_NOTPALETTIZEDThe surface being used is not a palette-based surface.
DDERR_NOVSYNCHWThere is no hardware support for vertical blank synchronized operations.
DDERR_NOZBUFFERHWThe operation to create a z-buffer in display memory or to perform a bit block transfer (bitblt), using a z-buffer cannot be carried out because there is no hardware support for z-buffers.
DDERR_NOZOVERLAYHWThe overlay surfaces cannot be z-layered, based on the z-order because the hardware does not support z-ordering of overlays.
DDERR_OUTOFCAPSThe hardware needed for the requested operation has already been allocated.
DDERR_OUTOFMEMORYDirectDraw does not have enough memory to perform the operation.
DDERR_OUTOFVIDEOMEMORYDirectDraw does not have enough display memory to perform the operation.
DDERR_OVERLAPPINGRECTSThe source and destination rectangles are on the same surface and overlap each other.
DDERR_OVERLAYCANTCLIPThe hardware does not support clipped overlays.
DDERR_OVERLAYCOLORKEYONLYONEACTIVEAn attempt was made to have more than one color key active on an overlay.
DDERR_OVERLAYNOTVISIBLEThe [**IDirectDrawSurface7::GetOverlayPosition**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdrawsurface7-getoverlayposition) method was called on a hidden overlay.
DDERR_PALETTEBUSYAccess to this palette is refused because the palette is locked by another thread.
DDERR_PRIMARYSURFACEALREADYEXISTSThis process has already created a primary surface.
DDERR_REGIONTOOSMALLThe region passed to the [**IDirectDrawClipper::GetClipList**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdrawclipper-getcliplist) method is too small.
DDERR_SURFACEALREADYATTACHEDAn attempt was made to attach a surface to another surface to which it is already attached.
DDERR_SURFACEALREADYDEPENDENTAn attempt was made to make a surface a dependency of another surface on which it is already dependent.
DDERR_SURFACEBUSYAccess to the surface is refused because the surface is locked by another thread.
DDERR_SURFACEISOBSCUREDAccess to the surface is refused because the surface is obscured.
DDERR_SURFACELOSTAccess to the surface is refused because the surface memory is gone. Call the [**IDirectDrawSurface7::Restore**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdrawsurface7-restore) method on this surface to restore the memory associated with it.
DDERR_SURFACENOTATTACHEDThe requested surface is not attached.
DDERR_TESTFINISHEDNew for DirectX 7.0. When returned by the [**IDirectDraw7::StartModeTest**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdraw7-startmodetest) method, this value means that no test could be initiated because all the resolutions chosen for testing already have refresh rate information in the registry. When returned by [**IDirectDraw7::EvaluateMode**](/windows/desktop/api/Ddraw/nf-ddraw-idirectdraw7-evaluatemode), the value means that DirectDraw has completed a refresh rate test.
DDERR_TOOBIGHEIGHTThe height requested by DirectDraw is too large.
DDERR_TOOBIGSIZEThe size requested by DirectDraw is too large. However, the individual height and width are valid sizes.
DDERR_TOOBIGWIDTHThe width requested by DirectDraw is too large.
DDERR_UNSUPPORTEDThe operation is not supported.
DDERR_UNSUPPORTEDFORMATThe pixel format requested is not supported by DirectDraw.
DDERR_UNSUPPORTEDMASKThe bitmask in the pixel format requested is not supported by DirectDraw.
DDERR_UNSUPPORTEDMODEThe display is currently in an unsupported mode.
DDERR_VERTICALBLANKINPROGRESSA vertical blank is in progress.
DDERR_VIDEONOTACTIVEThe video port is not active.
DDERR_WASSTILLDRAWINGThe previous bitblt operation that is transferring information to or from this surface is incomplete.
DDERR_WRONGMODEThis surface cannot be restored because it was created in a different mode.
DDERR_XALIGNThe provided rectangle was not horizontally aligned on a required boundary.
116 entries

Article text from the Win32 documentation (opens in a new tab), by Microsoft, under the CC BY 4.0 (opens in a new tab) licence.