mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:26:09 +00:00
[MSDMO] Sync with Wine Staging 3.9. CORE-14656
This commit is contained in:
parent
e467e5ff1b
commit
20e02be701
2 changed files with 37 additions and 23 deletions
|
@ -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))
|
||||||
|
@ -571,7 +585,7 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pInTypes = (DMO_PARTIAL_MEDIATYPE*) szValue;
|
pInTypes = (DMO_PARTIAL_MEDIATYPE *)szValue;
|
||||||
|
|
||||||
TRACE("read %d intypes for %s:\n", cInTypes, debugstr_w(szKey));
|
TRACE("read %d intypes for %s:\n", cInTypes, debugstr_w(szKey));
|
||||||
for (i = 0; i < cInTypes; i++) {
|
for (i = 0; i < cInTypes; i++) {
|
||||||
|
@ -584,10 +598,10 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
for (j = 0; j < cInTypes; j++)
|
for (j = 0; j < cInTypes; j++)
|
||||||
{
|
{
|
||||||
if (IsMediaTypeEqual(&pInTypes[j], &This->pInTypes[i]))
|
if (IsMediaTypeEqual(&pInTypes[j], &This->pInTypes[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j >= cInTypes)
|
if (j >= cInTypes)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,13 +622,13 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
sizeof(szValue)/sizeof(DMO_PARTIAL_MEDIATYPE),
|
sizeof(szValue)/sizeof(DMO_PARTIAL_MEDIATYPE),
|
||||||
(DMO_PARTIAL_MEDIATYPE*)szValue);
|
(DMO_PARTIAL_MEDIATYPE*)szValue);
|
||||||
|
|
||||||
if (FAILED(hres))
|
if (FAILED(hres))
|
||||||
{
|
{
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pOutTypes = (DMO_PARTIAL_MEDIATYPE*) szValue;
|
pOutTypes = (DMO_PARTIAL_MEDIATYPE *)szValue;
|
||||||
|
|
||||||
TRACE("read %d outtypes for %s:\n", cOutTypes, debugstr_w(szKey));
|
TRACE("read %d outtypes for %s:\n", cOutTypes, debugstr_w(szKey));
|
||||||
for (i = 0; i < cOutTypes; i++) {
|
for (i = 0; i < cOutTypes; i++) {
|
||||||
|
@ -627,10 +641,10 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
for (j = 0; j < cOutTypes; j++)
|
for (j = 0; j < cOutTypes; j++)
|
||||||
{
|
{
|
||||||
if (IsMediaTypeEqual(&pOutTypes[j], &This->pOutTypes[i]))
|
if (IsMediaTypeEqual(&pOutTypes[j], &This->pOutTypes[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j >= cOutTypes)
|
if (j >= cOutTypes)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,26 +655,26 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Media object wasn't filtered so add it to return list */
|
/* Media object wasn't filtered so add it to return list */
|
||||||
Names[count] = NULL;
|
Names[count] = NULL;
|
||||||
len = MAX_PATH * sizeof(WCHAR);
|
len = MAX_PATH * sizeof(WCHAR);
|
||||||
ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len);
|
ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len);
|
||||||
if (ERROR_SUCCESS == ret)
|
if (ERROR_SUCCESS == ret)
|
||||||
{
|
{
|
||||||
Names[count] = CoTaskMemAlloc((strlenW(szValue) + 1) * sizeof(WCHAR));
|
Names[count] = CoTaskMemAlloc((strlenW(szValue) + 1) * sizeof(WCHAR));
|
||||||
if (Names[count])
|
if (Names[count])
|
||||||
strcpyW(Names[count], szValue);
|
strcpyW(Names[count], szValue);
|
||||||
}
|
}
|
||||||
wsprintfW(szGuidKey,szToGuidFmt,szNextKey);
|
wsprintfW(szGuidKey,szToGuidFmt,szNextKey);
|
||||||
CLSIDFromString(szGuidKey, &pCLSID[count]);
|
CLSIDFromString(szGuidKey, &pCLSID[count]);
|
||||||
|
|
||||||
TRACE("found match %s %s\n", debugstr_w(szValue), debugstr_w(szNextKey));
|
TRACE("found match %s %s\n", debugstr_w(szValue), debugstr_w(szNextKey));
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
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);
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue