Author: ekohl
Date: Sat Nov 9 13:06:42 2013
New Revision: 60892
URL:
http://svn.reactos.org/svn/reactos?rev=60892&view=rev
Log:
[SAMLIB]
Fix the SamQuerySecurityObject implementation.
Modified:
trunk/reactos/dll/win32/samlib/samlib.c
Modified: trunk/reactos/dll/win32/samlib/samlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.c?…
==============================================================================
--- trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] Sat Nov 9 13:06:42 2013
@@ -1609,31 +1609,37 @@
IN SECURITY_INFORMATION SecurityInformation,
OUT PSECURITY_DESCRIPTOR *SecurityDescriptor)
{
- SAMPR_SR_SECURITY_DESCRIPTOR LocalSecurityDescriptor;
- PSAMPR_SR_SECURITY_DESCRIPTOR pLocalSecurityDescriptor;
+ PSAMPR_SR_SECURITY_DESCRIPTOR SamSecurityDescriptor = NULL;
NTSTATUS Status;
TRACE("SamQuerySecurityObject(%p %lu %p)\n",
ObjectHandle, SecurityInformation, SecurityDescriptor);
- LocalSecurityDescriptor.Length = 0;
- LocalSecurityDescriptor.SecurityDescriptor = NULL;
-
- RpcTryExcept
- {
- pLocalSecurityDescriptor = &LocalSecurityDescriptor;
-
+ *SecurityDescriptor = NULL;
+
+ RpcTryExcept
+ {
Status = SamrQuerySecurityObject((SAMPR_HANDLE)ObjectHandle,
SecurityInformation,
- &pLocalSecurityDescriptor);
- }
- RpcExcept(EXCEPTION_EXECUTE_HANDLER)
- {
- Status = I_RpcMapWin32Status(RpcExceptionCode());
- }
- RpcEndExcept;
-
- *SecurityDescriptor = LocalSecurityDescriptor.SecurityDescriptor;
+ &SamSecurityDescriptor);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ TRACE("SamSecurityDescriptor: %p\n", SamSecurityDescriptor);
+
+ if (SamSecurityDescriptor != NULL)
+ {
+ TRACE("SamSecurityDescriptor->Length: %lu\n",
SamSecurityDescriptor->Length);
+ TRACE("SamSecurityDescriptor->SecurityDescriptor: %p\n",
SamSecurityDescriptor->SecurityDescriptor);
+
+ *SecurityDescriptor = SamSecurityDescriptor->SecurityDescriptor;
+
+ midl_user_free(SamSecurityDescriptor);
+ }
return Status;
}