-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-01-16 um 08:44 schrieb Alex Henrie:
Star Trek Armada II needs GetCompressionTypes to return at least one value, see https://bugs.winehq.org/show_bug.cgi?id=29238
Is the game happy if you return DV_OK and set *pdwNumElements = 0?
MS-PCM is guaranteed to be present on Windows XP, and it's already implemented in Wine, so advertising this codec shouldn't cause any trouble.
Even though we have the codec we probably don't have the dpvoice infrastructure to hook up a dpvoice client to the codec, right? That's not necessarily a reason to reject the semi-stub though.
+extern HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) DECLSPEC_HIDDEN;
Please avoid hungarian notation names (dwThisIsAdWord, *pThisIsAPointer).
string_loc = (LPWSTR)((char*)pData + sizeof(pcm_type)); +
memcpy(pData, &pcm_type, sizeof(pcm_type)); + memcpy(string_loc, pcm_name, sizeof(pcm_name)); + pData->lpszName = string_loc;
I think there should be a nicer way to do this. I didn't test this with the compiler, but I guess you can do something like this:
struct { DVCOMPRESSIONINFO info; const WCHAR name[]; } codec = { {80, {0x8de12fd4,0x7cb3,0x48ce {0xa7,0xe8,0x9c,0x47,0xa2,0x2e,0x8a,0xc5}}, &codec.name, NULL, 0, 64000}}, {'M','S','-','P','C','M',' ','6','4',' ','k','b','i','t','/','s',0}; };
...
memcpy(pData, codec, sizeof(codec));
I don't know how well the variable-size array at the end of the struct works. It also won't easily work for more than one element.