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