Dan Kegel : advapi32: RegGetKeySecurity needs to pass length of struct to caller.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Mar 13 07:55:57 CDT 2007


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

Author: Dan Kegel <dank at kegel.com>
Date:   Mon Mar 12 09:16:28 2007 -0700

advapi32: RegGetKeySecurity needs to pass length of struct to caller.

---

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

diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 6589a23..7f673c0 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -2234,8 +2234,10 @@ LONG WINAPI RegGetKeySecurity( HKEY hkey, SECURITY_INFORMATION SecurityInformati
 
     /* FIXME: Check for valid SecurityInformation values */
 
-    if (*lpcbSecurityDescriptor < sizeof(SECURITY_DESCRIPTOR))
+    if (*lpcbSecurityDescriptor < sizeof(SECURITY_DESCRIPTOR)) {
+	*lpcbSecurityDescriptor = sizeof(SECURITY_DESCRIPTOR);
         return ERROR_INSUFFICIENT_BUFFER;
+    }
 
     FIXME("(%p,%d,%p,%d): stub\n",hkey,SecurityInformation,
           pSecurityDescriptor,lpcbSecurityDescriptor?*lpcbSecurityDescriptor:0);
@@ -2243,6 +2245,7 @@ LONG WINAPI RegGetKeySecurity( HKEY hkey, SECURITY_INFORMATION SecurityInformati
     /* Do not leave security descriptor filled with garbage */
     RtlCreateSecurityDescriptor(pSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION);
 
+    *lpcbSecurityDescriptor = sizeof(SECURITY_DESCRIPTOR);
     return ERROR_SUCCESS;
 }
 




More information about the wine-cvs mailing list