Author: akhaldi
Date: Tue Jul 21 23:28:13 2015
New Revision: 68525
URL:
http://svn.reactos.org/svn/reactos?rev=68525&view=rev
Log:
[MSDMO] Sync with Wine Staging 1.7.47. CORE-9924
Modified:
trunk/reactos/dll/directx/wine/msdmo/dmoreg.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/directx/wine/msdmo/dmoreg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/msdmo/dmo…
==============================================================================
--- trunk/reactos/dll/directx/wine/msdmo/dmoreg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/msdmo/dmoreg.c [iso-8859-1] Tue Jul 21 23:28:13 2015
@@ -80,7 +80,7 @@
IEnumDMO IEnumDMO_iface;
LONG ref;
DWORD index;
- const GUID* guidCategory;
+ GUID category;
DWORD dwFlags;
DWORD cInTypes;
DMO_PARTIAL_MEDIATYPE *pInTypes;
@@ -179,25 +179,26 @@
HKEY hkey = 0;
HKEY hckey = 0;
HKEY hclskey = 0;
+ LONG ret;
TRACE("%s %s %s\n", debugstr_w(szName), debugstr_guid(clsidDMO),
debugstr_guid(guidCategory));
if (IsEqualGUID(guidCategory, &GUID_NULL))
return E_INVALIDARG;
- hres = RegCreateKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, NULL,
+ ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hrkey, NULL);
- if (ERROR_SUCCESS != hres)
+ if (ret)
+ return HRESULT_FROM_WIN32(ret);
+
+ /* Create clsidDMO key under MediaObjects */
+ ret = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL,
+ REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL);
+ if (ret)
goto lend;
- /* Create clsidDMO key under MediaObjects */
- hres = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL,
- REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL);
- if (ERROR_SUCCESS != hres)
- goto lend;
-
/* Set default Name value */
- hres = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName,
+ ret = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName,
(strlenW(szName) + 1) * sizeof(WCHAR));
/* Set InputTypes */
@@ -209,28 +210,28 @@
if (dwFlags & DMO_REGISTERF_IS_KEYED)
{
/* Create Keyed key */
- hres = RegCreateKeyExW(hkey, szDMOKeyed, 0, NULL,
+ ret = RegCreateKeyExW(hkey, szDMOKeyed, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hckey, NULL);
- if (ERROR_SUCCESS != hres)
+ if (ret)
goto lend;
RegCloseKey(hckey);
}
/* Register the category */
- hres = RegCreateKeyExW(hrkey, szDMOCategories, 0, NULL,
+ ret = RegCreateKeyExW(hrkey, szDMOCategories, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hckey, NULL);
- if (ERROR_SUCCESS != hres)
+ if (ret)
goto lend;
RegCloseKey(hkey);
- hres = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL,
+ ret = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL);
- if (ERROR_SUCCESS != hres)
+ if (ret)
goto lend;
- hres = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL,
+ ret = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hclskey, NULL);
- if (ERROR_SUCCESS != hres)
+ if (ret)
goto lend;
lend:
@@ -243,6 +244,7 @@
if (hrkey)
RegCloseKey(hrkey);
+ hres = HRESULT_FROM_WIN32(ret);
TRACE(" hresult=0x%08x\n", hres);
return hres;
}
@@ -317,56 +319,53 @@
/***************************************************************
* DMOGetName (MSDMO.@)
*
- * Get DMP Name from the registry
- */
-HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[])
-{
+ * Get DMO Name from the registry
+ */
+HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR name[])
+{
+ static const INT max_name_len = 80*sizeof(WCHAR);
+ DWORD count = max_name_len;
WCHAR szguid[64];
- HKEY hrkey = 0;
- HKEY hkey = 0;
- static const INT max_name_len = 80;
- DWORD count;
+ HKEY hrkey, hkey;
LONG ret;
- TRACE("%s\n", debugstr_guid(clsidDMO));
-
- ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &hrkey);
- if (ERROR_SUCCESS != ret)
- goto lend;
+ TRACE("%s %p\n", debugstr_guid(clsidDMO), name);
+
+ if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &hrkey))
+ return E_FAIL;
ret = RegOpenKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, KEY_READ, &hkey);
- if (ERROR_SUCCESS != ret)
- goto lend;
-
- count = max_name_len * sizeof(WCHAR);
- ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE) szName, &count);
-
- TRACE(" szName=%s\n", debugstr_w(szName));
-lend:
- if (hkey)
- RegCloseKey(hrkey);
- if (hkey)
- RegCloseKey(hkey);
-
- return HRESULT_FROM_WIN32(ret);
-}
-
-/**************************************************************************
-* IEnumDMOImpl_Destructor
-*/
-static BOOL IEnumDMOImpl_Destructor(IEnumDMOImpl* This)
-{
- TRACE("%p\n", This);
-
- if (This->hkey)
- RegCloseKey(This->hkey);
-
- HeapFree(GetProcessHeap(), 0, This->pInTypes);
- HeapFree(GetProcessHeap(), 0, This->pOutTypes);
-
- return TRUE;
-}
-
+ RegCloseKey(hrkey);
+ if (ret)
+ return E_FAIL;
+
+ ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)name, &count);
+ RegCloseKey(hkey);
+
+ if (!ret && count > 1)
+ {
+ TRACE("name=%s\n", debugstr_w(name));
+ return S_OK;
+ }
+
+ name[0] = 0;
+ return S_FALSE;
+}
+
+static HRESULT dup_partial_mediatype(const DMO_PARTIAL_MEDIATYPE *types, DWORD count,
DMO_PARTIAL_MEDIATYPE **ret)
+{
+ *ret = NULL;
+
+ if (count == 0)
+ return S_OK;
+
+ *ret = HeapAlloc(GetProcessHeap(), 0, count*sizeof(*types));
+ if (!*ret)
+ return E_OUTOFMEMORY;
+
+ memcpy(*ret, types, count*sizeof(*types));
+ return S_OK;
+}
/**************************************************************************
* IEnumDMO_Constructor
@@ -381,8 +380,7 @@
IEnumDMO **obj)
{
IEnumDMOImpl* lpedmo;
- HRESULT hr = S_OK;
- UINT size;
+ HRESULT hr;
LONG ret;
*obj = NULL;
@@ -394,34 +392,18 @@
lpedmo->IEnumDMO_iface.lpVtbl = &edmovt;
lpedmo->ref = 1;
lpedmo->index = -1;
- lpedmo->guidCategory = guidCategory;
+ lpedmo->category = *guidCategory;
lpedmo->dwFlags = dwFlags;
-
- if (cInTypes > 0)
- {
- size = cInTypes * sizeof(DMO_PARTIAL_MEDIATYPE);
- lpedmo->pInTypes = HeapAlloc(GetProcessHeap(), 0, size);
- if (!lpedmo->pInTypes)
- {
- hr = E_OUTOFMEMORY;
- goto lerr;
- }
- memcpy(lpedmo->pInTypes, pInTypes, size);
- lpedmo->cInTypes = cInTypes;
- }
-
- if (cOutTypes > 0)
- {
- size = cOutTypes * sizeof(DMO_PARTIAL_MEDIATYPE);
- lpedmo->pOutTypes = HeapAlloc(GetProcessHeap(), 0, size);
- if (!lpedmo->pOutTypes)
- {
- hr = E_OUTOFMEMORY;
- goto lerr;
- }
- memcpy(lpedmo->pOutTypes, pOutTypes, size);
- lpedmo->cOutTypes = cOutTypes;
- }
+ lpedmo->cInTypes = cInTypes;
+ lpedmo->cOutTypes = cOutTypes;
+
+ hr = dup_partial_mediatype(pInTypes, cInTypes, &lpedmo->pInTypes);
+ if (FAILED(hr))
+ goto lerr;
+
+ hr = dup_partial_mediatype(pOutTypes, cOutTypes, &lpedmo->pOutTypes);
+ if (FAILED(hr))
+ goto lerr;
/* If not filtering by category enum from media objects root */
if (IsEqualGUID(guidCategory, &GUID_NULL))
@@ -434,8 +416,7 @@
WCHAR szguid[64];
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)))
hr = HRESULT_FROM_WIN32(ret);
}
@@ -443,10 +424,7 @@
lerr:
if (FAILED(hr))
- {
- IEnumDMOImpl_Destructor(lpedmo);
- HeapFree(GetProcessHeap(), 0, lpedmo);
- }
+ IEnumDMO_Release(&lpedmo->IEnumDMO_iface);
else
{
TRACE("returning %p\n", lpedmo);
@@ -482,7 +460,7 @@
IsEqualIID(riid, &IID_IUnknown))
{
*ppvObj = iface;
- IEnumDMO_fnAddRef(iface);
+ IEnumDMO_AddRef(iface);
}
return *ppvObj ? S_OK : E_NOINTERFACE;
@@ -500,8 +478,11 @@
if (!refCount)
{
- IEnumDMOImpl_Destructor(This);
- HeapFree(GetProcessHeap(),0,This);
+ if (This->hkey)
+ RegCloseKey(This->hkey);
+ HeapFree(GetProcessHeap(), 0, This->pInTypes);
+ HeapFree(GetProcessHeap(), 0, This->pOutTypes);
+ HeapFree(GetProcessHeap(), 0, This);
}
return refCount;
}
@@ -517,7 +498,6 @@
WCHAR ** Names,
DWORD * pcItemsFetched)
{
- FILETIME ft;
HKEY hkey;
WCHAR szNextKey[MAX_PATH];
WCHAR szGuidKey[64];
@@ -540,7 +520,7 @@
This->index++;
len = MAX_PATH;
- ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL,
NULL, NULL, &ft);
+ ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL,
NULL, NULL, NULL);
if (ret != ERROR_SUCCESS)
{
hres = HRESULT_FROM_WIN32(ret);
@@ -563,6 +543,7 @@
wsprintfW(szKey, szCat2Fmt, szDMORootKey, szNextKey);
ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey);
+ TRACE("testing %s\n", debugstr_w(szKey));
if (This->pInTypes)
{
@@ -581,6 +562,12 @@
}
pInTypes = (DMO_PARTIAL_MEDIATYPE*) szValue;
+
+ TRACE("read %d intypes for %s:\n", cInTypes, debugstr_w(szKey));
+ for (i = 0; i < cInTypes; i++) {
+ TRACE("intype %d: type %s, subtype %s\n", i,
debugstr_guid(&pInTypes[i].type),
+ debugstr_guid(&pInTypes[i].subtype));
+ }
for (i = 0; i < This->cInTypes; i++)
{
@@ -619,6 +606,12 @@
pOutTypes = (DMO_PARTIAL_MEDIATYPE*) szValue;
+ TRACE("read %d outtypes for %s:\n", cOutTypes, debugstr_w(szKey));
+ for (i = 0; i < cOutTypes; i++) {
+ TRACE("outtype %d: type %s, subtype %s\n", i,
debugstr_guid(&pOutTypes[i].type),
+ debugstr_guid(&pOutTypes[i].subtype));
+ }
+
for (i = 0; i < This->cOutTypes; i++)
{
for (j = 0; j < cOutTypes; j++)
@@ -644,7 +637,7 @@
ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len);
if (ERROR_SUCCESS == ret)
{
- Names[count] = HeapAlloc(GetProcessHeap(), 0, (strlenW(szValue) + 1) *
sizeof(WCHAR));
+ Names[count] = CoTaskMemAlloc((strlenW(szValue) + 1) * sizeof(WCHAR));
if (Names[count])
strcpyW(Names[count], szValue);
}
@@ -700,7 +693,7 @@
{
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
TRACE("(%p)->(%p)\n", This, ppEnum);
- return IEnumDMO_Constructor(This->guidCategory, This->dwFlags,
This->cInTypes, This->pInTypes,
+ return IEnumDMO_Constructor(&This->category, This->dwFlags,
This->cInTypes, This->pInTypes,
This->cOutTypes, This->pOutTypes, ppEnum);
}
@@ -711,18 +704,35 @@
* Enumerate DirectX Media Objects in the registry.
*/
HRESULT WINAPI DMOEnum(
- REFGUID guidCategory,
- DWORD dwFlags,
+ REFGUID category,
+ DWORD flags,
DWORD cInTypes,
const DMO_PARTIAL_MEDIATYPE *pInTypes,
DWORD cOutTypes,
const DMO_PARTIAL_MEDIATYPE *pOutTypes,
IEnumDMO **ppEnum)
{
- TRACE("guidCategory=%p dwFlags=0x%08x cInTypes=%d cOutTypes=%d\n",
- guidCategory, dwFlags, cInTypes, cOutTypes);
-
- return IEnumDMO_Constructor(guidCategory, dwFlags, cInTypes,
+ TRACE("%s 0x%08x %d %p %d %p %p\n", debugstr_guid(category), flags,
cInTypes, pInTypes,
+ cOutTypes, pOutTypes, ppEnum);
+
+ if (TRACE_ON(msdmo))
+ {
+ DWORD i;
+ if (cInTypes)
+ {
+ for (i = 0; i < cInTypes; i++)
+ TRACE("intype %d - type %s, subtype %s\n", i,
debugstr_guid(&pInTypes[i].type),
+ debugstr_guid(&pInTypes[i].subtype));
+ }
+
+ if (cOutTypes) {
+ for (i = 0; i < cOutTypes; i++)
+ TRACE("outtype %d - type %s, subtype %s\n", i,
debugstr_guid(&pOutTypes[i].type),
+ debugstr_guid(&pOutTypes[i].subtype));
+ }
+ }
+
+ return IEnumDMO_Constructor(category, flags, cInTypes,
pInTypes, cOutTypes, pOutTypes, ppEnum);
}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jul 21 23:28:13 2015
@@ -38,7 +38,7 @@
reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-1.7.47
reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.47
-reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.37
+reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.47
reactos/dll/directx/wine/qedit # Synced to WineStaging-1.7.37
reactos/dll/directx/wine/quartz # Synced to WineStaging-1.7.37
reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.7.37