Commit in reactos/lib/msgina on MAIN
msgina.c+79-11.8 -> 1.9
stubs.c+1-201.6 -> 1.7
+80-21
2 modified files
basic implementation of WlxLoggedOutSAS()

reactos/lib/msgina
msgina.c 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- msgina.c	27 Mar 2004 23:24:51 -0000	1.8
+++ msgina.c	28 Mar 2004 12:19:07 -0000	1.9
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: msgina.c,v 1.8 2004/03/27 23:24:51 weiden Exp $
+/* $Id: msgina.c,v 1.9 2004/03/28 12:19:07 weiden Exp $
  *
  * PROJECT:         ReactOS msgina.dll
  * FILE:            lib/msgina/msgina.c
@@ -459,6 +459,84 @@
 }
 
 
+static PWSTR
+DuplicationString(PWSTR Str)
+{
+  DWORD cb;
+  PWSTR NewStr;
+
+  cb = (wcslen(Str) + 1) * sizeof(WCHAR);
+  if((NewStr = LocalAlloc(LMEM_FIXED, cb)))
+  {
+    memcpy(NewStr, Str, cb);
+  }
+  return NewStr;
+}
+
+
+/*
+ * @unimplemented
+ */
+int WINAPI
+WlxLoggedOutSAS(
+	PVOID                pWlxContext,
+	DWORD                dwSasType,
+	PLUID                pAuthenticationId,
+	PSID                 pLogonSid,
+	PDWORD               pdwOptions,
+	PHANDLE              phToken,
+	PWLX_MPR_NOTIFY_INFO pNprNotifyInfo,
+	PVOID                *pProfile)
+{
+  PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
+  TOKEN_STATISTICS Stats;
+  DWORD cbStats;
+
+  if(!phToken)
+  {
+    DbgPrint("msgina: phToken == NULL!\n");
+    return WLX_SAS_ACTION_NONE;
+  }
+
+  if(!LogonUser(L"Administrator", NULL, L"Secrect",
+                LOGON32_LOGON_INTERACTIVE, /* FIXME - use LOGON32_LOGON_UNLOCK instead! */
+                LOGON32_PROVIDER_DEFAULT,
+                phToken))
+  {
+    DbgPrint("msgina: Logonuser() failed\n");
+    return WLX_SAS_ACTION_NONE;
+  }
+  
+  if(!(*phToken))
+  {
+    DbgPrint("msgina: *phToken == NULL!\n");
+    return WLX_SAS_ACTION_NONE;
+  }
+
+  pgContext->UserToken =*phToken;
+  
+  *pdwOptions = 0;
+  *pProfile =NULL; 
+  
+  if(!GetTokenInformation(*phToken,
+                          TokenStatistics,
+                          (PVOID)&Stats,
+                          sizeof(TOKEN_STATISTICS),
+                          &cbStats))
+  {
+    DbgPrint("msgina: Couldn't get Autentication id from user token!\n");
+    return WLX_SAS_ACTION_NONE;
+  }
+  *pAuthenticationId = Stats.AuthenticationId; 
+  pNprNotifyInfo->pszUserName = DuplicationString(L"Administrator");
+  pNprNotifyInfo->pszDomain = NULL;
+  pNprNotifyInfo->pszPassword = DuplicationString(L"Secret");
+  pNprNotifyInfo->pszOldPassword = NULL;
+
+  return WLX_SAS_ACTION_LOGON;
+}
+
+
 BOOL STDCALL
 DllMain(
 	HINSTANCE hinstDLL,

reactos/lib/msgina
stubs.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- stubs.c	27 Mar 2004 23:24:51 -0000	1.6
+++ stubs.c	28 Mar 2004 12:19:07 -0000	1.7
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.6 2004/03/27 23:24:51 weiden Exp $
+/* $Id: stubs.c,v 1.7 2004/03/28 12:19:07 weiden Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS msgina.dll
@@ -77,25 +77,6 @@
 /*
  * @unimplemented
  */
-int WINAPI
-WlxLoggedOutSAS(
-	PVOID                pWlxContext,
-	DWORD                dwSasType,
-	PLUID                pAuthenticationId,
-	PSID                 pLogonSid,
-	PDWORD               pdwOptions,
-	PHANDLE              phToken,
-	PWLX_MPR_NOTIFY_INFO pNprNotifyInfo,
-	PVOID                *pProfile)
-{
-  UNIMPLEMENTED;
-  return 0;
-}
-
-
-/*
- * @unimplemented
- */
 VOID WINAPI
 WlxLogoff(
 	PVOID pWlxContext)
CVSspam 0.2.8