Francois Gouget : advapi32: RegGetValueW() must return the required buffer size in bytes, not WCHARs.

Alexandre Julliard julliard at winehq.org
Fri Jan 11 07:20:21 CST 2008


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri Jan 11 09:52:05 2008 +0100

advapi32: RegGetValueW() must return the required buffer size in bytes, not WCHARs.

---

 dlls/advapi32/registry.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index dec2e4a..dda68e2 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -1504,7 +1504,7 @@ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue,
             if (dwType == REG_EXPAND_SZ)
             {
                 cbData = ExpandEnvironmentStringsW(pvBuf, pvData,
-                                                   pcbData ? *pcbData : 0);
+                                                   pcbData ? *pcbData : 0) * sizeof(WCHAR);
                 dwType = REG_SZ;
                 if(pvData && pcbData && cbData > *pcbData)
                     ret = ERROR_MORE_DATA;




More information about the wine-cvs mailing list