msdmo: Fix calculation of array size in bytes.

This commit is contained in:
Andrew Talbot 2008-04-09 23:07:51 +01:00 committed by Alexandre Julliard
parent 1b24da3aa0
commit 6324670b31
1 changed files with 2 additions and 3 deletions

View File

@ -293,11 +293,11 @@ lend:
*/ */
HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[]) HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[])
{ {
#define NAME_SIZE 80 /* Size of szName[] */
WCHAR szguid[64]; WCHAR szguid[64];
HRESULT hres; HRESULT hres;
HKEY hrkey = 0; HKEY hrkey = 0;
HKEY hkey = 0; HKEY hkey = 0;
static const INT max_name_len = 80;
DWORD count; DWORD count;
TRACE("%s\n", debugstr_guid(clsidDMO)); TRACE("%s\n", debugstr_guid(clsidDMO));
@ -312,7 +312,7 @@ HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[])
if (ERROR_SUCCESS != hres) if (ERROR_SUCCESS != hres)
goto lend; goto lend;
count = NAME_SIZE; count = max_name_len * sizeof(WCHAR);
hres = RegQueryValueExW(hkey, NULL, NULL, NULL, hres = RegQueryValueExW(hkey, NULL, NULL, NULL,
(LPBYTE) szName, &count); (LPBYTE) szName, &count);
@ -324,7 +324,6 @@ lend:
RegCloseKey(hkey); RegCloseKey(hkey);
return hres; return hres;
#undef NAME_SIZE
} }