Author: sserapion
Date: Sat May  7 20:03:54 2011
New Revision: 51630

URL: http://svn.reactos.org/svn/reactos?rev=51630&view=rev
Log:
Fix lsalib build.

Modified:
    branches/sspi-bringup/reactos/lib/lsalib/lsa.c

Modified: branches/sspi-bringup/reactos/lib/lsalib/lsa.c
URL: 
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/lib/lsalib/lsa.c?rev=51630&r1=51629&r2=51630&view=diff
==============================================================================
--- branches/sspi-bringup/reactos/lib/lsalib/lsa.c [iso-8859-1] (original)
+++ branches/sspi-bringup/reactos/lib/lsalib/lsa.c [iso-8859-1] Sat May  7 
20:03:54 2011
@@ -15,10 +15,6 @@
 
 #define NDEBUG
 #include <debug.h>
-
-/* GLOBALS *******************************************************************/
-
-extern HANDLE Secur32Heap;
 
 /* FUNCTIONS *****************************************************************/
 
@@ -112,7 +108,7 @@
     }
 
     OutBufferSize = Reply->d.CallAuthenticationPackageReply.OutBufferLength;
-    *ProtocolReturnBuffer = RtlAllocateHeap(Secur32Heap,
+    *ProtocolReturnBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
                                             0,
                                             OutBufferSize);
     *ReturnBufferLength = OutBufferSize;
@@ -130,7 +126,7 @@
 NTSTATUS WINAPI
 LsaFreeReturnBuffer(PVOID Buffer)
 {
-    return RtlFreeHeap(Secur32Heap, 0, Buffer);
+    return RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
 }
 
 
@@ -260,7 +256,7 @@
         return Status;
     }
 
-    *ProfileBuffer = RtlAllocateHeap(Secur32Heap,
+    *ProfileBuffer = RtlAllocateHeap(RtlGetProcessHeap(),
                                      0,
                                      
Reply->d.LogonUserReply.ProfileBufferLength);
     memcpy(*ProfileBuffer,
@@ -280,6 +276,14 @@
 /*
  * @implemented
  */
+
+/* 
+   msdn:
+   The LsaRegisterLogonProcess function verifies that the application making 
the 
+   function call is a logon process by checking that it has the SeTcbPrivilege 
privilege set.
+   It also opens the application's process for PROCESS_DUP_HANDLE access in 
anticipation of 
+   future LSA authentication calls.
+*/
 NTSTATUS WINAPI
 LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName,
                         PHANDLE Handle,
@@ -290,8 +294,8 @@
     ULONG ConnectInfoLength;
     NTSTATUS Status;
     LSASS_CONNECT_DATA ConnectInfo;
-//    LSASS_REQUEST Request;
-//    LSASS_REPLY Reply;
+    //LSASS_REQUEST Request;
+    //LSASS_REPLY Reply;
 
     /* Check the logon process name length */
     if (LsaLogonProcessName->Length > LSASS_MAX_LOGON_PROCESS_NAME_LENGTH)
@@ -323,10 +327,10 @@
                            &ConnectInfoLength);
     if (!NT_SUCCESS(Status))
     {
-        return Status;
-    }
-
-    return Status;
+        DPRINT1("ZwConnectPort LsaAuthenticationPort failed with %x\n", 
Status);
+        return Status;
+    }
+
 #if 0
     Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS;
     Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) -
@@ -343,21 +347,23 @@
                                     &Reply.Header);
     if (!NT_SUCCESS(Status))
     {
+        DPRINT1("ZwRequestWaitReplyPort failed with %x\n", Status);
+        *Handle = NULL;
+        return Status;
+    }
+
+    if (!NT_SUCCESS(Reply.Status))
+    {
 //        NtClose(*Handle);
 //        *Handle = NULL;
         return Status;
     }
 
-    if (!NT_SUCCESS(Reply.Status))
-    {
-//        NtClose(*Handle);
-//        *Handle = NULL;
-        return Status;
-    }
-
     *OperationalMode = Reply.d.RegisterLogonProcessReply.OperationalMode;
 
     return Reply.Status;
+#else
+    return Status;
 #endif
 }
 


Reply via email to