Hi,
as I did not find anything in the Wiki maybe a stupid question: If I want an application to use DDRAW4 functions in Wine instead of DDRAW7, how can I accomplish that?
Thanks in advance.
Markus
Am Sonntag, den 11.10.2009, 12:40 +0200 schrieb Markus Stockhausen:
Hi,
as I did not find anything in the Wiki maybe a stupid question: If I want an application to use DDRAW4 functions in Wine instead of DDRAW7, how can I accomplish that?
Thanks in advance.
Markus
Sorry, wrong forum.
Am 11.10.2009 um 12:40 schrieb Markus Stockhausen:
Hi,
as I did not find anything in the Wiki maybe a stupid question: If I want an application to use DDRAW4 functions in Wine instead of DDRAW7, how can I accomplish that?
You can't.
Except if you have the sourcecode. In that case you have to reprogram the app to use IDirectDraw4 and friends, rather than IDirectDraw7. Which ddraw version an app uses isn't a setting you can change - its hardcoded into the app, just like usually its hardcoded whether an app uses opengl or d3d.
Am Sonntag, den 11.10.2009, 12:47 +0200 schrieb Stefan Dösinger:
Which ddraw version an app uses isn't a setting you can change - its hardcoded into the app, just like usually its hardcoded whether an app uses opengl or d3d.
Then I'm somehow in trouble. How can one explain the following error: Application calls IDirectDraw GetDeviceIdentifier of DDRAW7 but only reserves memory with sizeof(DDEVICEIDENTIFIER) instead of sizeof(DDEVICEIDENTIFIER2) bytes. Wine returns the required structure but with the contents of dwWHQLLevel stack contents are overwritten.
Markus
Am Sonntag, den 11.10.2009, 13:18 +0200 schrieb Markus Stockhausen:
Then I'm somehow in trouble. How can one explain the following error: Application calls IDirectDraw GetDeviceIdentifier of DDRAW7 but only reserves memory with sizeof(DDEVICEIDENTIFIER) instead of sizeof(DDEVICEIDENTIFIER2) bytes. Wine returns the required structure but with the contents of dwWHQLLevel stack contents are overwritten.
Markus
Source of error was found. DDEVICEIDENTIFIER2 is aligned to 8 bytes and therefore 4 bytes too large (at least on my 64 bit Linux). Should a patch include a pragma pack handling in the ddraw.h file itself or is there any other location where one can fix that?
Best regards.
Markus
Am 11.10.2009 um 14:42 schrieb Markus Stockhausen:
Am Sonntag, den 11.10.2009, 13:18 +0200 schrieb Markus Stockhausen:
Then I'm somehow in trouble. How can one explain the following error: Application calls IDirectDraw GetDeviceIdentifier of DDRAW7 but only reserves memory with sizeof(DDEVICEIDENTIFIER) instead of sizeof(DDEVICEIDENTIFIER2) bytes. Wine returns the required structure but with the contents of dwWHQLLevel stack contents are overwritten.
Markus
Source of error was found. DDEVICEIDENTIFIER2 is aligned to 8 bytes and therefore 4 bytes too large (at least on my 64 bit Linux). Should a patch include a pragma pack handling in the ddraw.h file itself or is there any other location where one can fix that?
Does a pragma pack fix the issue? If yes, then that's probably the correct fix.
Its probably worth writing a test that allocates e.g. a char data[64], then passes this to GetDeviceIdentifier, fill it with non-zero data, and check how much is overwritten.
Otoh I find it strange that the struct is aligned to 8 bytes. Are you running wine in 64 bit? Or do you have some other compiler flags that make the compiler use 8 byte alignment?
Am Sonntag, den 11.10.2009, 17:15 +0200 schrieb Stefan Dösinger:
Does a pragma pack fix the issue? If yes, then that's probably the correct fix.
Its probably worth writing a test that allocates e.g. a char data[64], then passes this to GetDeviceIdentifier, fill it with non-zero data, and check how much is overwritten.
Otoh I find it strange that the struct is aligned to 8 bytes. Are you running wine in 64 bit? Or do you have some other compiler flags that make the compiler use 8 byte alignment?
You are right.
- I'm working on 64 bit (gcc 4.3.3) - #pragma pack(push,4) / #pragma pack(pop) around DDDEVICEIDENTIFIER2 fixes the behaviour - a testcase fails without pragma:
ok(sizeof(DDDEVICEIDENTIFIER2)==0x42c, "DDDEVICEIDENTIFIER2 too large (misaligned)\n");
I'll send a patch