Andrew Talbot : msdmo: Fix calculation of array size in bytes.

Alexandre Julliard julliard at winehq.org
Thu Apr 10 04:39:25 CDT 2008


Module: wine
Branch: master
Commit: 6324670b312c93e3c14ba2caf186caf7bc519d90
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6324670b312c93e3c14ba2caf186caf7bc519d90

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Wed Apr  9 23:07:51 2008 +0100

msdmo: Fix calculation of array size in bytes.

---

 dlls/msdmo/dmoreg.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

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




More information about the wine-cvs mailing list