[MSDMO] Sync with Wine Staging 3.9. CORE-14656

This commit is contained in:
Amine Khaldi 2018-05-27 03:59:47 +01:00
parent e467e5ff1b
commit 20e02be701
2 changed files with 37 additions and 23 deletions

View file

@ -29,7 +29,6 @@
#include "objbase.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "initguid.h"
#include "dmo.h"
WINE_DEFAULT_DEBUG_CHANNEL(msdmo);
@ -118,6 +117,16 @@ static LPWSTR GUIDToString(LPWSTR lpwstr, REFGUID lpcguid)
return lpwstr;
}
static HRESULT string_to_guid(const WCHAR *string, GUID *guid)
{
WCHAR buffer[39];
buffer[0] = '{';
strcpyW(buffer + 1, string);
buffer[37] = '}';
buffer[38] = 0;
return CLSIDFromString(buffer, guid);
}
static BOOL IsMediaTypeEqual(const DMO_PARTIAL_MEDIATYPE* mt1, const DMO_PARTIAL_MEDIATYPE* mt2)
{
@ -391,7 +400,6 @@ static HRESULT IEnumDMO_Constructor(
{
IEnumDMOImpl* lpedmo;
HRESULT hr;
LONG ret;
*obj = NULL;
@ -406,6 +414,7 @@ static HRESULT IEnumDMO_Constructor(
lpedmo->dwFlags = dwFlags;
lpedmo->cInTypes = cInTypes;
lpedmo->cOutTypes = cOutTypes;
lpedmo->hkey = NULL;
hr = dup_partial_mediatype(pInTypes, cInTypes, &lpedmo->pInTypes);
if (FAILED(hr))
@ -418,8 +427,7 @@ static HRESULT IEnumDMO_Constructor(
/* If not filtering by category enum from media objects root */
if (IsEqualGUID(guidCategory, &GUID_NULL))
{
if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &lpedmo->hkey)))
hr = HRESULT_FROM_WIN32(ret);
RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &lpedmo->hkey);
}
else
{
@ -427,8 +435,7 @@ static HRESULT IEnumDMO_Constructor(
WCHAR szKey[MAX_PATH];
wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, GUIDToString(szguid, guidCategory));
if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey)))
hr = HRESULT_FROM_WIN32(ret);
RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey);
}
lerr:
@ -517,14 +524,18 @@ static HRESULT WINAPI IEnumDMO_fnNext(
UINT count = 0;
HRESULT hres = S_OK;
LONG ret;
GUID guid;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
TRACE("(%p)->(%d %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched);
if (!pCLSID || !Names || !pcItemsFetched)
if (!pCLSID || !Names)
return E_POINTER;
if (!pcItemsFetched && cItemsToFetch > 1)
return E_INVALIDARG;
while (count < cItemsToFetch)
{
This->index++;
@ -537,6 +548,9 @@ static HRESULT WINAPI IEnumDMO_fnNext(
break;
}
if (string_to_guid(szNextKey, &guid) != S_OK)
continue;
TRACE("found %s\n", debugstr_w(szNextKey));
if (!(This->dwFlags & DMO_ENUMF_INCLUDE_KEYED))
@ -659,8 +673,8 @@ static HRESULT WINAPI IEnumDMO_fnNext(
count++;
}
*pcItemsFetched = count;
if (*pcItemsFetched < cItemsToFetch)
if (pcItemsFetched) *pcItemsFetched = count;
if (count < cItemsToFetch)
hres = S_FALSE;
TRACE("<-- %i found\n",count);

View file

@ -37,7 +37,7 @@ reactos/dll/directx/wine/dplay # Synced to WineStaging-3.3
reactos/dll/directx/wine/dplayx # Synced to WineStaging-3.3
reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-3.3
reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.3
reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.9
reactos/dll/directx/wine/qedit # Synced to WineStaging-3.3
reactos/dll/directx/wine/quartz # Synced to WineStaging-3.3
reactos/dll/directx/wine/wined3d # Synced to WineStaging-3.9