Use W32API.
Modified: trunk/reactos/include/lsass/lsass.h
Modified: trunk/reactos/lib/secur32/lsa.c
Modified: trunk/reactos/lib/secur32/secur32.xml

Modified: trunk/reactos/include/lsass/lsass.h
--- trunk/reactos/include/lsass/lsass.h	2005-06-17 08:05:58 UTC (rev 15952)
+++ trunk/reactos/include/lsass/lsass.h	2005-06-17 08:08:58 UTC (rev 15953)
@@ -95,20 +95,23 @@
    LSA_OPERATIONAL_MODE OperationalMode;
 } LSASS_REGISTER_LOGON_PROCESS_REPLY, *PLSASS_REGISTER_LOGON_PROCESS_REPLY;
 
-typedef struct _LSASS_REQUEST
+typedef union _LSASS_REQUEST
 {
    LPC_MESSAGE Header;
-   ULONG Type;
-   union
-     {
-	LSASS_REGISTER_LOGON_PROCESS_REQUEST RegisterLogonProcessRequest;
-	LSASS_LOGON_USER_REQUEST LogonUserRequest;
-	LSASS_CALL_AUTHENTICATION_PACKAGE_REQUEST 
-	  CallAuthenticationPackageRequest;
-	LSASS_DEREGISTER_LOGON_PROCESS_REPLY DeregisterLogonProcessRequest;
-	LSASS_LOOKUP_AUTHENTICATION_PACKAGE_REQUEST
-	  LookupAuthenticationPackageRequest;
-     } d;
+   struct {
+      UCHAR LpcHeader[LPC_MESSAGE_BASE_SIZE];
+      ULONG Type;
+      union
+        {
+           LSASS_REGISTER_LOGON_PROCESS_REQUEST RegisterLogonProcessRequest;
+           LSASS_LOGON_USER_REQUEST LogonUserRequest;
+           LSASS_CALL_AUTHENTICATION_PACKAGE_REQUEST 
+             CallAuthenticationPackageRequest;
+           LSASS_DEREGISTER_LOGON_PROCESS_REPLY DeregisterLogonProcessRequest;
+           LSASS_LOOKUP_AUTHENTICATION_PACKAGE_REQUEST
+             LookupAuthenticationPackageRequest;
+        } d;
+   };
 } LSASS_REQUEST, *PLSASS_REQUEST;
 
 typedef struct _LSASS_REPLY

Modified: trunk/reactos/lib/secur32/lsa.c
--- trunk/reactos/lib/secur32/lsa.c	2005-06-17 08:05:58 UTC (rev 15952)
+++ trunk/reactos/lib/secur32/lsa.c	2005-06-17 08:08:58 UTC (rev 15953)
@@ -11,9 +11,9 @@
 /* INCLUDES ******************************************************************/
 
 #include <windows.h>
-#include <ddk/ntddk.h>
+#include <ntsecapi.h>
+#include <lsass/lsass.h>
 #include <rosrtl/string.h>
-#include <lsass/lsass.h>
 #include <string.h>
 
 /* GLOBALS *******************************************************************/
@@ -83,9 +83,9 @@
    Reply = (PLSASS_REPLY)RawReply;
    
    Request->Header.DataSize = sizeof(LSASS_REQUEST) + SubmitBufferLength -
-     sizeof(LPC_MESSAGE);
+     LPC_MESSAGE_BASE_SIZE;
    Request->Header.MessageSize = 
-     Request->Header.DataSize + sizeof(LPC_MESSAGE);
+     Request->Header.DataSize + LPC_MESSAGE_BASE_SIZE;
    Request->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE;
    Request->d.CallAuthenticationPackageRequest.AuthenticationPackage =
      AuthenticationPackage;
@@ -146,9 +146,9 @@
    
    Request = (PLSASS_REQUEST)RawRequest;
    Request->Header.DataSize = sizeof(LSASS_REQUEST) + PackageName->Length -
-     sizeof(LPC_MESSAGE);
+     LPC_MESSAGE_BASE_SIZE;
    Request->Header.MessageSize = Request->Header.DataSize +
-     sizeof(LPC_MESSAGE);
+     LPC_MESSAGE_BASE_SIZE;
    Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE;
    
    Status = NtRequestWaitReplyPort(LsaHandle,
@@ -196,7 +196,7 @@
    UCHAR RawReply[MAX_MESSAGE_DATA];
    NTSTATUS Status;
    
-   RequestLength = sizeof(LSASS_REQUEST) - sizeof(LPC_MESSAGE);
+   RequestLength = sizeof(LSASS_REQUEST) - LPC_MESSAGE_BASE_SIZE;
    RequestLength = RequestLength + (OriginName->Length * sizeof(WCHAR));
    RequestLength = RequestLength + AuthenticationInformationLength;
    RequestLength = RequestLength + 
@@ -236,8 +236,8 @@
    Request->d.LogonUserRequest.SourceContext = *SourceContext;
    
    Request->Type = LSASS_REQUEST_LOGON_USER;
-   Request->Header.DataSize = RequestLength - sizeof(LPC_MESSAGE);
-   Request->Header.MessageSize = RequestLength + sizeof(LPC_MESSAGE);
+   Request->Header.DataSize = RequestLength - LPC_MESSAGE_BASE_SIZE;
+   Request->Header.MessageSize = RequestLength + LPC_MESSAGE_BASE_SIZE;
    
    Reply = (PLSASS_REPLY)RawReply;
    
@@ -303,12 +303,13 @@
    
    Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS;
    Request.Header.DataSize = sizeof(LSASS_REQUEST) - 
-     sizeof(LPC_MESSAGE);
+     LPC_MESSAGE_BASE_SIZE;
    Request.Header.MessageSize = sizeof(LSASS_REQUEST);
    
    Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length;
-   wcscpy(Request.d.RegisterLogonProcessRequest.LogonProcessNameBuffer,
-	  LsaLogonProcessName->Buffer);
+   memcpy(Request.d.RegisterLogonProcessRequest.LogonProcessNameBuffer,
+	  LsaLogonProcessName->Buffer,
+	  Request.d.RegisterLogonProcessRequest.Length);
    
    Status = NtRequestWaitReplyPort(*Handle,
 				   &Request.Header,

Modified: trunk/reactos/lib/secur32/secur32.xml
--- trunk/reactos/lib/secur32/secur32.xml	2005-06-17 08:05:58 UTC (rev 15952)
+++ trunk/reactos/lib/secur32/secur32.xml	2005-06-17 08:08:58 UTC (rev 15953)
@@ -2,6 +2,7 @@
 	<importlibrary definition="secur32.def" />
 	<include base="secur32">.</include>
 	<define name="__SECUR32__" />
+	<define name="__USE_W32API" />
 	<library>ntdll</library>
 	<library>kernel32</library>
 	<library>advapi32</library>