From 60cb73b573d139f49b4445318ce3762685a9ff87 Mon Sep 17 00:00:00 2001 From: Dan Kegel Date: Mon, 12 Mar 2007 09:16:28 -0700 Subject: [PATCH] advapi32: RegGetKeySecurity needs to pass length of struct to caller. --- dlls/advapi32/registry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 6589a2351a1..7f673c03bda 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; } -- 2.11.4.GIT