Re: [PATCH (try 3) 2/2] dpvoice: Turn GetCompressionTypes into a semi-stub.
-----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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUuUNyAAoJEN0/YqbEcdMwb/wP/3QuWJc0dQtO7tcPo/alre6S ASLeDH+5+F+LBTwFBnlNJhkizO7PtpRUCqH6k0fxGtSprsNMnyu3T/KqBPTku8kx XUhS4jNcV6lDzSvruKEHx4m+Lrpgs/onSK4pLUa9cP0FvZgKpLA+XTJtXgOuX40K 31/TOW/DRq6gXeGE11Oxz97Vx2mILfhmLfhtIeTRA4RpkGyMlWlKST9l3xyNn0dt ystZG62OWVnljq/g2U8Ce4n+zz97Hlxzkk7uB4ZI2/m8/EBdGEhOgGTsUdEulu6P cChWJqzJOo8zxJr+RXeWnQN38V2yKW6CwxnIQ90INKd1WV1NvGZfiYDMXdUBMrYm XrQ4A6xaLwfCIVgzJ1wyPDGYFb92sOr34ly3v/fTuQNb2DnamdgENhw/Gj9APsIS ErfHiTgoWGbh77WuRm2GC/GfxpOsK2lpnO2uwXcrWXyYy8u2GP9zEhHLl3ohcG2+ dEL7Q0MABEitbGQJ4qTbpNffFIbLwWdKcKEP67gBFM2T937/4z5ISce0WlI6SBHX l+yXKK/vSJ1U+/B2i+fsbyFOr0rQMCIt1k6uAOlnPM29uwZOjJtG3gCp6BbK+vqw Jc2yGJl3PdAjwfHuHGTakWx6EflZLLGqqcLXWnfs3gzgExHnbHGZaOdKDYx+qsqz cEUAmwJUxAcp6cMGiuQX =ue9K -----END PGP SIGNATURE-----
participants (1)
-
Stefan Dösinger