Decompiled CONFIG.EXE executable (#533)

* mxdirectdraw: no need to explicitly add a terminating '\0' in C

* mxstopwatch must include LIMITS.H for ULONG_MAX

* Add Config app

* 88.78%

* style fixes

* Test more CONFIG things

* Add a few assertions on MFC classes

* reformat

* actionSSSSSSSSSSSSSSS

* actions again

* decomplint needed a shebang

* Fix annotations of Message Map entries

* ci: We're building CONFIG.EXE, not CONFIG.DLL

* remove ninja.exe

* Fix CAboutDialog::GetMessageMap annotation

* format reloaded

* Fix global CConfigApp object annotation

* trigger worflows

* ci: request at least python 3

* oops :)

* curl CONFIGPROGRESS-OLD.TXT will fail

* Forget about actions/setup-python (for now)

* Annotation fixes

* Config tweaks and MxDirect3d annotations

* It's important to compare against the correct file

* Introduce common CDialog parent for CAboutDialog and CMainDialog

* format

* Remove CSerializer

---------

Co-authored-by: disinvite <disinvite@users.noreply.github.com>
This commit is contained in:
Anonymous Maarten
2024-02-07 12:11:45 +01:00
committed by GitHub
parent 917485247b
commit ccb6223d70
29 changed files with 1621 additions and 151 deletions

View File

@@ -2,13 +2,16 @@
#include <stdio.h> // for vsprintf
#if !defined(MXDIRECTX_FOR_CONFIG)
DECOMP_SIZE_ASSERT(MxAssignedDevice, 0xe4);
DECOMP_SIZE_ASSERT(MxDirect3D, 0x894);
#endif
DECOMP_SIZE_ASSERT(MxDevice, 0x1a4);
DECOMP_SIZE_ASSERT(MxDisplayMode, 0x0c);
DECOMP_SIZE_ASSERT(MxDriver, 0x190);
DECOMP_SIZE_ASSERT(MxDeviceEnumerate, 0x14);
#if !defined(MXDIRECTX_FOR_CONFIG)
// FUNCTION: LEGO1 0x1009b0a0
MxDirect3D::MxDirect3D()
{
@@ -332,7 +335,9 @@ MxAssignedDevice::~MxAssignedDevice()
m_deviceInfo = NULL;
}
}
#endif
// FUNCTION: CONFIG 0x00401180
// FUNCTION: LEGO1 0x1009ba80
MxDriver::MxDriver(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
{
@@ -344,6 +349,7 @@ MxDriver::MxDriver(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
Init(p_guid, p_driverDesc, p_driverName);
}
// FUNCTION: CONFIG 0x401280
// FUNCTION: LEGO1 0x1009bb80
MxDriver::~MxDriver()
{
@@ -358,6 +364,7 @@ MxDriver::~MxDriver()
}
}
// FUNCTION: CONFIG 0x00401330
// FUNCTION: LEGO1 0x1009bc30
void MxDriver::Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
{
@@ -401,6 +408,7 @@ MxDevice::MxDevice(
Init(p_guid, p_deviceDesc, p_deviceName, p_HWDesc, p_HELDesc);
}
// FUNCTION: CONFIG 0x401460
// FUNCTION: LEGO1 0x1009bd60
MxDevice::~MxDevice()
{
@@ -458,12 +466,20 @@ void MxDevice::Init(
}
}
// FUNCTION: CONFIG 0x004015c0
// FUNCTION: LEGO1 0x1009bec0
MxDeviceEnumerate::MxDeviceEnumerate()
{
m_initialized = FALSE;
}
// FUNCTION: CONFIG 0x401710
// FUNCTION: LEGO1 0x1009c010
MxDeviceEnumerate::~MxDeviceEnumerate()
{
}
// FUNCTION: CONFIG 0x00401770
// FUNCTION: LEGO1 0x1009c070
BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
{
@@ -525,6 +541,7 @@ BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc
return DDENUMRET_OK;
}
// FUNCTION: CONFIG 0x00401bc0
// FUNCTION: LEGO1 0x1009c4c0
void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...)
{
@@ -538,6 +555,7 @@ void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...)
OutputDebugString(buf);
}
// FUNCTION: CONFIG 0x00401bf0
// FUNCTION: LEGO1 0x1009c4f0
HRESULT CALLBACK MxDeviceEnumerate::DisplayModesEnumerateCallback(LPDDSURFACEDESC p_ddsd, LPVOID p_context)
{
@@ -545,6 +563,7 @@ HRESULT CALLBACK MxDeviceEnumerate::DisplayModesEnumerateCallback(LPDDSURFACEDES
return deviceEnumerate->EnumDisplayModesCallback(p_ddsd);
}
// FUNCTION: CONFIG 0x00401c10
// FUNCTION: LEGO1 0x1009c510
HRESULT CALLBACK MxDeviceEnumerate::DevicesEnumerateCallback(
LPGUID p_guid,
@@ -559,6 +578,7 @@ HRESULT CALLBACK MxDeviceEnumerate::DevicesEnumerateCallback(
return deviceEnumerate->EnumDevicesCallback(p_guid, p_deviceDesc, p_deviceName, p_HWDesc, p_HELDesc);
}
// FUNCTION: CONFIG 0x00401c40
// FUNCTION: LEGO1 0x1009c540
HRESULT MxDeviceEnumerate::EnumDisplayModesCallback(LPDDSURFACEDESC p_ddsd)
{
@@ -571,6 +591,7 @@ HRESULT MxDeviceEnumerate::EnumDisplayModesCallback(LPDDSURFACEDESC p_ddsd)
return DDENUMRET_OK;
}
// FUNCTION: CONFIG 0x00401cd0
// FUNCTION: LEGO1 0x1009c5d0
HRESULT MxDeviceEnumerate::EnumDevicesCallback(
LPGUID p_guid,
@@ -586,6 +607,7 @@ HRESULT MxDeviceEnumerate::EnumDevicesCallback(
return DDENUMRET_OK;
}
// FUNCTION: CONFIG 0x00401dc0
// FUNCTION: LEGO1 0x1009c6c0
int MxDeviceEnumerate::DoEnumerate()
{
@@ -603,6 +625,7 @@ int MxDeviceEnumerate::DoEnumerate()
return 0;
}
// FUNCTION: CONFIG 0x00401e10
// FUNCTION: LEGO1 0x1009c710
BOOL CALLBACK
MxDeviceEnumerate::DirectDrawEnumerateCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName, LPVOID p_context)
@@ -611,6 +634,7 @@ MxDeviceEnumerate::DirectDrawEnumerateCallback(LPGUID p_guid, LPSTR p_driverDesc
return deviceEnumerate->EnumDirectDrawCallback(p_guid, p_driverDesc, p_driverName);
}
// FUNCTION: CONFIG 0x00401e30
// FUNCTION: LEGO1 0x1009c730
const char* MxDeviceEnumerate::EnumerateErrorToString(HRESULT p_error)
{
@@ -815,6 +839,7 @@ const char* MxDeviceEnumerate::EnumerateErrorToString(HRESULT p_error)
}
}
// FUNCTION: CONFIG 0x00402560
// FUNCTION: LEGO1 0x1009ce60
int MxDeviceEnumerate::ParseDeviceName(const char* p_deviceId)
{
@@ -844,6 +869,7 @@ int MxDeviceEnumerate::ParseDeviceName(const char* p_deviceId)
return result;
}
// FUNCTION: CONFIG 0x00402620
// FUNCTION: LEGO1 0x1009cf20
int MxDeviceEnumerate::ProcessDeviceBytes(int p_deviceNum, GUID& p_guid)
{
@@ -891,6 +917,7 @@ int MxDeviceEnumerate::ProcessDeviceBytes(int p_deviceNum, GUID& p_guid)
return -1;
}
// FUNCTION: CONFIG 0x00402730
// FUNCTION: LEGO1 0x1009d030
int MxDeviceEnumerate::GetDevice(int p_deviceNum, MxDriver*& p_driver, MxDevice*& p_device)
{
@@ -915,6 +942,31 @@ int MxDeviceEnumerate::GetDevice(int p_deviceNum, MxDriver*& p_driver, MxDevice*
return -1;
}
#if defined(MXDIRECTX_FOR_CONFIG)
// FUNCTION: CONFIG 0x004027d0
int MxDeviceEnumerate::FormatDeviceName(char* p_buffer, const MxDriver* p_driver, const MxDevice* p_device) const
{
int number = 0;
for (list<MxDriver>::const_iterator it = m_list.begin(); it != m_list.end(); it++) {
if (&(*it) == p_driver) {
sprintf(
p_buffer,
"%d 0x%x 0x%x 0x%x 0x%x",
number,
((DWORD*) (p_device->m_guid))[0],
((DWORD*) (p_device->m_guid))[1],
((DWORD*) (p_device->m_guid))[2],
((DWORD*) (p_device->m_guid))[3]
);
return 0;
}
number++;
}
return -1;
}
#endif
// FUNCTION: CONFIG 0x00402860
// FUNCTION: LEGO1 0x1009d0d0
int MxDeviceEnumerate::FUN_1009d0d0()
{
@@ -951,17 +1003,18 @@ int MxDeviceEnumerate::FUN_1009d0d0()
i++;
}
return -1;
}
// FUNCTION: CONFIG 0x00402930
// FUNCTION: LEGO1 0x1009d1a0
int MxDeviceEnumerate::SupportsMMX()
{
int supports_mmx = SupportsCPUID();
if (supports_mmx) {
if (!SupportsCPUID()) {
return 0;
}
int supports_mmx;
#ifdef _MSC_VER
__asm {
__asm {
mov eax, 0x0 ; EAX=0: Highest Function Parameter and Manufacturer ID
#if _MSC_VER > 1100
cpuid ; Run CPUID
@@ -980,22 +1033,22 @@ int MxDeviceEnumerate::SupportsMMX()
bt edx, 0x17 ; Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF)
adc eax, eax ; Add with carry: EAX = EAX + EAX + CF = CF
mov supports_mmx, eax ; Save eax into C variable
}
#else
__asm__("movl $0x0, %%eax\n\t" // EAX=0: Highest Function Parameter and Manufacturer ID
"cpuid\n\t" // Run CPUID\n"
"mov $0x1, %%eax\n\t" // EAX=1: Processor Info and Feature Bits (unused)
"cpuid\n\t" // Run CPUID
"xorl %%eax, %%eax\n\t" // Zero EAX register
"btl $0x15, %%edx\n\t" // Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF)
"adc %%eax, %%eax" // Add with carry: EAX = EAX + EAX + CF = CF
: "=a"(supports_mmx) // supports_mmx == EAX
);
#endif
}
#else
__asm__("movl $0x0, %%eax\n\t" // EAX=0: Highest Function Parameter and Manufacturer ID
"cpuid\n\t" // Run CPUID\n"
"mov $0x1, %%eax\n\t" // EAX=1: Processor Info and Feature Bits (unused)
"cpuid\n\t" // Run CPUID
"xorl %%eax, %%eax\n\t" // Zero EAX register
"btl $0x15, %%edx\n\t" // Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF)
"adc %%eax, %%eax" // Add with carry: EAX = EAX + EAX + CF = CF
: "=a"(supports_mmx) // supports_mmx == EAX
);
#endif
return supports_mmx;
}
// FUNCTION: CONFIG 0x00402970
// FUNCTION: LEGO1 0x1009d1e0
int MxDeviceEnumerate::SupportsCPUID()
{
@@ -1027,6 +1080,7 @@ int MxDeviceEnumerate::SupportsCPUID()
return has_cpuid;
}
// FUNCTION: CONFIG 0x004029a0
// FUNCTION: LEGO1 0x1009d210
int MxDeviceEnumerate::FUN_1009d210()
{
@@ -1037,7 +1091,7 @@ int MxDeviceEnumerate::FUN_1009d210()
for (list<MxDriver>::iterator it = m_list.begin(); it != m_list.end();) {
MxDriver& driver = *it;
if (!FUN_1009d370(driver)) {
if (!DriverSupportsRequiredDisplayMode(driver)) {
m_list.erase(it++);
}
else {
@@ -1064,8 +1118,9 @@ int MxDeviceEnumerate::FUN_1009d210()
return m_list.empty() ? -1 : 0;
}
// FUNCTION: CONFIG 0x00402b00
// FUNCTION: LEGO1 0x1009d370
unsigned char MxDeviceEnumerate::FUN_1009d370(MxDriver& p_driver)
unsigned char MxDeviceEnumerate::DriverSupportsRequiredDisplayMode(MxDriver& p_driver)
{
for (list<MxDisplayMode>::iterator it = p_driver.m_displayModes.begin(); it != p_driver.m_displayModes.end();
it++) {
@@ -1079,6 +1134,7 @@ unsigned char MxDeviceEnumerate::FUN_1009d370(MxDriver& p_driver)
return FALSE;
}
// FUNCTION: CONFIG 0x00402b60
// FUNCTION: LEGO1 0x1009d3d0
unsigned char MxDeviceEnumerate::FUN_1009d3d0(MxDevice& p_device)
{
@@ -1087,7 +1143,8 @@ unsigned char MxDeviceEnumerate::FUN_1009d3d0(MxDevice& p_device)
}
if (p_device.m_HWDesc.dcmColorModel) {
return p_device.m_HWDesc.dwDeviceZBufferBitDepth & DDBD_16 && p_device.m_HWDesc.dpcTriCaps.dwTextureCaps & 1;
return p_device.m_HWDesc.dwDeviceZBufferBitDepth & DDBD_16 &&
p_device.m_HWDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE;
}
for (list<MxDevice>::iterator it = m_list.front().m_devices.begin(); it != m_list.front().m_devices.end(); it++) {

View File

@@ -7,6 +7,7 @@
#include <d3d.h>
#if !defined(MXDIRECTX_FOR_CONFIG)
class MxDirect3D;
// SIZE 0xe4
@@ -76,6 +77,7 @@ private:
BOOL m_unk0x88c; // 0x88c
undefined4 m_unk0x890; // 0x890
};
#endif
// SIZE 0x1a4
struct MxDevice {
@@ -137,36 +139,45 @@ struct MxDriver {
};
// clang-format off
// TEMPLATE: CONFIG 0x401000
// TEMPLATE: LEGO1 0x1009b900
// list<MxDevice,allocator<MxDevice> >::~list<MxDevice,allocator<MxDevice> >
// clang-format on
// clang-format off
// TEMPLATE: CONFIG 0x401070
// TEMPLATE: LEGO1 0x1009b970
// list<MxDisplayMode,allocator<MxDisplayMode> >::~list<MxDisplayMode,allocator<MxDisplayMode> >
// clang-format on
// TEMPLATE: CONFIG 0x4010e0
// TEMPLATE: LEGO1 0x1009b9e0
// List<MxDevice>::~List<MxDevice>
// TEMPLATE: CONFIG 0x401130
// TEMPLATE: LEGO1 0x1009ba30
// List<MxDisplayMode>::~List<MxDisplayMode>
// clang-format off
// TEMPLATE: CONFIG 0x401650
// TEMPLATE: LEGO1 0x1009bf50
// list<MxDriver,allocator<MxDriver> >::~list<MxDriver,allocator<MxDriver> >
// clang-format on
// TEMPLATE: CONFIG 0x4016c0
// TEMPLATE: LEGO1 0x1009bfc0
// List<MxDriver>::~List<MxDriver>
// Compiler-generated copy ctor
// SYNTHETIC: CONFIG 0x401990
// SYNTHETIC: LEGO1 0x1009c290
// MxDriver::MxDriver
// SYNTHETIC: CONFIG 0x401b00
// SYNTHETIC: LEGO1 0x1009c400
// list<MxDevice,allocator<MxDevice> >::insert
// SYNTHETIC: CONFIG 0x401b60
// SYNTHETIC: LEGO1 0x1009c460
// list<MxDisplayMode,allocator<MxDisplayMode> >::insert
@@ -176,13 +187,13 @@ struct MxDriver {
// SYNTHETIC: LEGO1 0x1009d470
// MxDevice::`scalar deleting destructor'
// VTABLE: CONFIG 0x00406000
// VTABLE: LEGO1 0x100db814
// SIZE 0x14
class MxDeviceEnumerate {
public:
MxDeviceEnumerate();
// FUNCTION: LEGO1 0x1009c010
~MxDeviceEnumerate() {}
~MxDeviceEnumerate();
virtual int DoEnumerate(); // vtable+0x00
@@ -199,9 +210,14 @@ public:
int ParseDeviceName(const char* p_deviceId);
int ProcessDeviceBytes(int p_deviceNum, GUID& p_guid);
int GetDevice(int p_deviceNum, MxDriver*& p_driver, MxDevice*& p_device);
#if defined(MXDIRECTX_FOR_CONFIG)
int FormatDeviceName(char* p_buffer, const MxDriver* p_driver, const MxDevice* p_device) const;
#endif
int FUN_1009d0d0();
int FUN_1009d210();
unsigned char FUN_1009d370(MxDriver& p_driver);
unsigned char DriverSupportsRequiredDisplayMode(MxDriver& p_driver);
unsigned char FUN_1009d3d0(MxDevice& p_device);
static void BuildErrorString(const char*, ...);
@@ -221,6 +237,8 @@ public:
friend class MxDirect3D;
const list<MxDriver>& GetDriverList() const { return m_list; }
private:
list<MxDriver> m_list; // 0x04
unsigned char m_initialized; // 0x10

View File

@@ -911,208 +911,208 @@ const char* MxDirectDraw::ErrorToString(HRESULT p_error)
{
switch (p_error) {
case DD_OK:
return "No error.\0";
return "No error.";
case DDERR_ALREADYINITIALIZED:
return "This object is already initialized.\0";
return "This object is already initialized.";
case DDERR_BLTFASTCANTCLIP:
return "Return if a clipper object is attached to the source surface passed into a BltFast call.\0";
return "Return if a clipper object is attached to the source surface passed into a BltFast call.";
case DDERR_CANNOTATTACHSURFACE:
return "This surface can not be attached to the requested surface.\0";
return "This surface can not be attached to the requested surface.";
case DDERR_CANNOTDETACHSURFACE:
return "This surface can not be detached from the requested surface.\0";
return "This surface can not be detached from the requested surface.";
case DDERR_CANTCREATEDC:
return "Windows can not create any more DCs.\0";
return "Windows can not create any more DCs.";
case DDERR_CANTDUPLICATE:
return "Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created.\0";
return "Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created.";
case DDERR_CLIPPERISUSINGHWND:
return "An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.\0";
return "An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.";
case DDERR_COLORKEYNOTSET:
return "No src color key specified for this operation.\0";
return "No src color key specified for this operation.";
case DDERR_CURRENTLYNOTAVAIL:
return "Support is currently not available.\0";
return "Support is currently not available.";
case DDERR_DIRECTDRAWALREADYCREATED:
return "A DirectDraw object representing this driver has already been created for this process.\0";
return "A DirectDraw object representing this driver has already been created for this process.";
case DDERR_EXCEPTION:
return "An exception was encountered while performing the requested operation.\0";
return "An exception was encountered while performing the requested operation.";
case DDERR_EXCLUSIVEMODEALREADYSET:
return "An attempt was made to set the cooperative level when it was already set to exclusive.\0";
return "An attempt was made to set the cooperative level when it was already set to exclusive.";
case DDERR_GENERIC:
return "Generic failure.\0";
return "Generic failure.";
case DDERR_HEIGHTALIGN:
return "Height of rectangle provided is not a multiple of reqd alignment.\0";
return "Height of rectangle provided is not a multiple of reqd alignment.";
case DDERR_HWNDALREADYSET:
return "The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or "
"palettes created.\0";
"palettes created.";
case DDERR_HWNDSUBCLASSED:
return "HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring "
"state.\0";
"state.";
case DDERR_IMPLICITLYCREATED:
return "This surface can not be restored because it is an implicitly created surface.\0";
return "This surface can not be restored because it is an implicitly created surface.";
case DDERR_INCOMPATIBLEPRIMARY:
return "Unable to match primary surface creation request with existing primary surface.\0";
return "Unable to match primary surface creation request with existing primary surface.";
case DDERR_INVALIDCAPS:
return "One or more of the caps bits passed to the callback are incorrect.\0";
return "One or more of the caps bits passed to the callback are incorrect.";
case DDERR_INVALIDCLIPLIST:
return "DirectDraw does not support the provided cliplist.\0";
return "DirectDraw does not support the provided cliplist.";
case DDERR_INVALIDDIRECTDRAWGUID:
return "The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.\0";
return "The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.";
case DDERR_INVALIDMODE:
return "DirectDraw does not support the requested mode.\0";
return "DirectDraw does not support the requested mode.";
case DDERR_INVALIDOBJECT:
return "DirectDraw received a pointer that was an invalid DIRECTDRAW object.\0";
return "DirectDraw received a pointer that was an invalid DIRECTDRAW object.";
case DDERR_INVALIDPARAMS:
return "One or more of the parameters passed to the function are incorrect.\0";
return "One or more of the parameters passed to the function are incorrect.";
case DDERR_INVALIDPIXELFORMAT:
return "The pixel format was invalid as specified.\0";
return "The pixel format was invalid as specified.";
case DDERR_INVALIDPOSITION:
return "Returned when the position of the overlay on the destination is no longer legal for that "
"destination.\0";
"destination.";
case DDERR_INVALIDRECT:
return "Rectangle provided was invalid.\0";
return "Rectangle provided was invalid.";
case DDERR_LOCKEDSURFACES:
return "Operation could not be carried out because one or more surfaces are locked.\0";
return "Operation could not be carried out because one or more surfaces are locked.";
case DDERR_NO3D:
return "There is no 3D present.\0";
return "There is no 3D present.";
case DDERR_NOALPHAHW:
return "Operation could not be carried out because there is no alpha accleration hardware present or "
"available.\0";
"available.";
case DDERR_NOBLTHW:
return "No blitter hardware present.\0";
return "No blitter hardware present.";
case DDERR_NOCLIPLIST:
return "No cliplist available.\0";
return "No cliplist available.";
case DDERR_NOCLIPPERATTACHED:
return "No clipper object attached to surface object.\0";
return "No clipper object attached to surface object.";
case DDERR_NOCOLORCONVHW:
return "Operation could not be carried out because there is no color conversion hardware present or "
"available.\0";
"available.";
case DDERR_NOCOLORKEY:
return "Surface doesn't currently have a color key\0";
return "Surface doesn't currently have a color key";
case DDERR_NOCOLORKEYHW:
return "Operation could not be carried out because there is no hardware support of the destination color "
"key.\0";
"key.";
case DDERR_NOCOOPERATIVELEVELSET:
return "Create function called without DirectDraw object method SetCooperativeLevel being called.\0";
return "Create function called without DirectDraw object method SetCooperativeLevel being called.";
case DDERR_NODC:
return "No DC was ever created for this surface.\0";
return "No DC was ever created for this surface.";
case DDERR_NODDROPSHW:
return "No DirectDraw ROP hardware.\0";
return "No DirectDraw ROP hardware.";
case DDERR_NODIRECTDRAWHW:
return "A hardware-only DirectDraw object creation was attempted but the driver did not support any "
"hardware.\0";
"hardware.";
case DDERR_NOEMULATION:
return "Software emulation not available.\0";
return "Software emulation not available.";
case DDERR_NOEXCLUSIVEMODE:
return "Operation requires the application to have exclusive mode but the application does not have exclusive "
"mode.\0";
"mode.";
case DDERR_NOFLIPHW:
return "Flipping visible surfaces is not supported.\0";
return "Flipping visible surfaces is not supported.";
case DDERR_NOGDI:
return "There is no GDI present.\0";
return "There is no GDI present.";
case DDERR_NOHWND:
return "Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel "
"HWND.\0";
"HWND.";
case DDERR_NOMIRRORHW:
return "Operation could not be carried out because there is no hardware present or available.\0";
return "Operation could not be carried out because there is no hardware present or available.";
case DDERR_NOOVERLAYDEST:
return "Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on "
"to establish a destination.\0";
"to establish a destination.";
case DDERR_NOOVERLAYHW:
return "Operation could not be carried out because there is no overlay hardware present or available.\0";
return "Operation could not be carried out because there is no overlay hardware present or available.";
case DDERR_NOPALETTEATTACHED:
return "No palette object attached to this surface.\0";
return "No palette object attached to this surface.";
case DDERR_NOPALETTEHW:
return "No hardware support for 16 or 256 color palettes.\0";
return "No hardware support for 16 or 256 color palettes.";
case DDERR_NORASTEROPHW:
return "Operation could not be carried out because there is no appropriate raster op hardware present or "
"available.\0";
"available.";
case DDERR_NOROTATIONHW:
return "Operation could not be carried out because there is no rotation hardware present or available.\0";
return "Operation could not be carried out because there is no rotation hardware present or available.";
case DDERR_NOSTRETCHHW:
return "Operation could not be carried out because there is no hardware support for stretching.\0";
return "Operation could not be carried out because there is no hardware support for stretching.";
case DDERR_NOT4BITCOLOR:
return "DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color "
"palette.\0";
"palette.";
case DDERR_NOT4BITCOLORINDEX:
return "DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color "
"index palette.\0";
"index palette.";
case DDERR_NOT8BITCOLOR:
return "DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.\0";
return "DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.";
case DDERR_NOTAOVERLAYSURFACE:
return "Returned when an overlay member is called for a non-overlay surface.\0";
return "Returned when an overlay member is called for a non-overlay surface.";
case DDERR_NOTEXTUREHW:
return "Operation could not be carried out because there is no texture mapping hardware present or "
"available.\0";
"available.";
case DDERR_NOTFLIPPABLE:
return "An attempt has been made to flip a surface that is not flippable.\0";
return "An attempt has been made to flip a surface that is not flippable.";
case DDERR_NOTFOUND:
return "Requested item was not found.\0";
return "Requested item was not found.";
case DDERR_NOTLOCKED:
return "Surface was not locked. An attempt to unlock a surface that was not locked at all, or by this "
"process, has been attempted.\0";
"process, has been attempted.";
case DDERR_NOTPALETTIZED:
return "The surface being used is not a palette-based surface.\0";
return "The surface being used is not a palette-based surface.";
case DDERR_NOVSYNCHW:
return "Operation could not be carried out because there is no hardware support for vertical blank "
"synchronized operations.\0";
"synchronized operations.";
case DDERR_NOZBUFFERHW:
return "Operation could not be carried out because there is no hardware support for zbuffer blitting.\0";
return "Operation could not be carried out because there is no hardware support for zbuffer blitting.";
case DDERR_NOZOVERLAYHW:
return "Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support "
"z layering of overlays.\0";
"z layering of overlays.";
case DDERR_OUTOFCAPS:
return "The hardware needed for the requested operation has already been allocated.\0";
return "The hardware needed for the requested operation has already been allocated.";
case DDERR_OUTOFMEMORY:
return "DirectDraw does not have enough memory to perform the operation.\0";
return "DirectDraw does not have enough memory to perform the operation.";
case DDERR_OUTOFVIDEOMEMORY:
return "DirectDraw does not have enough memory to perform the operation.\0";
return "DirectDraw does not have enough memory to perform the operation.";
case DDERR_OVERLAYCANTCLIP:
return "The hardware does not support clipped overlays.\0";
return "The hardware does not support clipped overlays.";
case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
return "Can only have ony color key active at one time for overlays.\0";
return "Can only have ony color key active at one time for overlays.";
case DDERR_OVERLAYNOTVISIBLE:
return "Returned when GetOverlayPosition is called on a hidden overlay.\0";
return "Returned when GetOverlayPosition is called on a hidden overlay.";
case DDERR_PALETTEBUSY:
return "Access to this palette is being refused because the palette is already locked by another thread.\0";
return "Access to this palette is being refused because the palette is already locked by another thread.";
case DDERR_PRIMARYSURFACEALREADYEXISTS:
return "This process already has created a primary surface.\0";
return "This process already has created a primary surface.";
case DDERR_REGIONTOOSMALL:
return "Region passed to Clipper::GetClipList is too small.\0";
return "Region passed to Clipper::GetClipList is too small.";
case DDERR_SURFACEALREADYATTACHED:
return "This surface is already attached to the surface it is being attached to.\0";
return "This surface is already attached to the surface it is being attached to.";
case DDERR_SURFACEALREADYDEPENDENT:
return "This surface is already a dependency of the surface it is being made a dependency of.\0";
return "This surface is already a dependency of the surface it is being made a dependency of.";
case DDERR_SURFACEBUSY:
return "Access to this surface is being refused because the surface is already locked by another thread.\0";
return "Access to this surface is being refused because the surface is already locked by another thread.";
case DDERR_SURFACEISOBSCURED:
return "Access to surface refused because the surface is obscured.\0";
return "Access to surface refused because the surface is obscured.";
case DDERR_SURFACELOST:
return "Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface "
"object representing this surface should have Restore called on it.\0";
"object representing this surface should have Restore called on it.";
case DDERR_SURFACENOTATTACHED:
return "The requested surface is not attached.\0";
return "The requested surface is not attached.";
case DDERR_TOOBIGHEIGHT:
return "Height requested by DirectDraw is too large.\0";
return "Height requested by DirectDraw is too large.";
case DDERR_TOOBIGSIZE:
return "Size requested by DirectDraw is too large, but the individual height and width are OK.\0";
return "Size requested by DirectDraw is too large, but the individual height and width are OK.";
case DDERR_TOOBIGWIDTH:
return "Width requested by DirectDraw is too large.\0";
return "Width requested by DirectDraw is too large.";
case DDERR_UNSUPPORTED:
return "Action not supported.\0";
return "Action not supported.";
case DDERR_UNSUPPORTEDFORMAT:
return "FOURCC format requested is unsupported by DirectDraw.\0";
return "FOURCC format requested is unsupported by DirectDraw.";
case DDERR_UNSUPPORTEDMASK:
return "Bitmask in the pixel format requested is unsupported by DirectDraw.\0";
return "Bitmask in the pixel format requested is unsupported by DirectDraw.";
case DDERR_VERTICALBLANKINPROGRESS:
return "Vertical blank is in progress.\0";
return "Vertical blank is in progress.";
case DDERR_WASSTILLDRAWING:
return "Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is "
"incomplete.\0";
"incomplete.";
case DDERR_WRONGMODE:
return "This surface can not be restored because it was created in a different mode.\0";
return "This surface can not be restored because it was created in a different mode.";
case DDERR_XALIGN:
return "Rectangle provided was not horizontally aligned on required boundary.\0";
return "Rectangle provided was not horizontally aligned on required boundary.";
default:
return "Unrecognized error value.\0";
return "Unrecognized error value.";
}
}

View File

@@ -3,6 +3,7 @@
#include "assert.h"
#include <limits.h> // ULONG_MAX
#include <math.h>
#include <windows.h>