msdmo: Array parameter is passed to function as pointer so loses size information

Andrew Talbot andrew.talbot at talbotville.com
Mon Apr 7 16:39:33 CDT 2008


Changelog:
    msdmo: Array parameter is passed to function as pointer so loses size information.

diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c
index 9560234..f6d71bd 100644
--- a/dlls/msdmo/dmoreg.c
+++ b/dlls/msdmo/dmoreg.c
@@ -291,8 +291,9 @@ lend:
  *
  * Get DMP Name from the registry
  */
-HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[80])
+HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[])
 {
+#define NAME_SIZE   80  /* Size of szName[] */
     WCHAR szguid[64];
     HRESULT hres;
     HKEY hrkey = 0;
@@ -311,7 +312,7 @@ HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[80])
     if (ERROR_SUCCESS != hres)
         goto lend;
 
-    count = sizeof(szName);
+    count = NAME_SIZE;
     hres = RegQueryValueExW(hkey, NULL, NULL, NULL, 
         (LPBYTE) szName, &count); 
 
@@ -323,6 +324,7 @@ lend:
         RegCloseKey(hkey);
 
     return hres;
+#undef NAME_SIZE
 }
 
 



More information about the wine-patches mailing list