From 42e71f0a9a431ffa954ccade6ff60d73c54de2e1 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 24 Nov 2003 17:24:29 +0000 Subject: [PATCH] implemented WlxInitialize() svn path=/trunk/; revision=6786 --- reactos/lib/msgina/Makefile | 4 +-- reactos/lib/msgina/msgina.c | 55 +++++++++++++++++++++++++++++++++---- reactos/lib/msgina/msgina.h | 10 +++++++ reactos/lib/msgina/stubs.c | 18 +----------- 4 files changed, 62 insertions(+), 25 deletions(-) diff --git a/reactos/lib/msgina/Makefile b/reactos/lib/msgina/Makefile index 5e8f3076542..03b98daa0ce 100644 --- a/reactos/lib/msgina/Makefile +++ b/reactos/lib/msgina/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2003/11/24 15:28:54 weiden Exp $ +# $Id: Makefile,v 1.3 2003/11/24 17:24:29 weiden Exp $ PATH_TO_TOP = ../.. @@ -18,7 +18,7 @@ TARGET_CFLAGS = \ TARGET_LFLAGS = -nostartfiles -nostdlib -TARGET_SDKLIBS = ntdll.a +TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_GCCLIBS = gcc diff --git a/reactos/lib/msgina/msgina.c b/reactos/lib/msgina/msgina.c index d6b6a1b1121..2a40e0e2b89 100644 --- a/reactos/lib/msgina/msgina.c +++ b/reactos/lib/msgina/msgina.c @@ -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.2 2003/11/24 15:28:54 weiden Exp $ +/* $Id: msgina.c,v 1.3 2003/11/24 17:24:29 weiden Exp $ * * PROJECT: ReactOS msgina.dll * FILE: lib/msgina/msgina.c @@ -29,6 +29,9 @@ #include #include "msgina.h" +extern HINSTANCE hDllInstance; + + /* * @implemented */ @@ -37,7 +40,7 @@ WlxNegotiate( DWORD dwWinlogonVersion, PDWORD pdwDllVersion) { - if(dwWinlogonVersion < GINA_VERSION) + if(!pdwDllVersion || (dwWinlogonVersion < GINA_VERSION)) return FALSE; *pdwDllVersion = GINA_VERSION; @@ -45,17 +48,57 @@ WlxNegotiate( return TRUE; } + +/* + * @implemented + */ +BOOL WINAPI +WlxInitialize( + LPWSTR lpWinsta, + HANDLE hWlx, + PVOID pvReserved, + PVOID pWinlogonFunctions, + PVOID *pWlxContext) +{ + PGINA_CONTEXT pgContext; + + pgContext = (PGINA_CONTEXT)LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, sizeof(GINA_CONTEXT)); + if(!pgContext) + return FALSE; + + /* return the context to winlogon */ + *pWlxContext = (PVOID)pgContext; + + pgContext->hDllInstance = hDllInstance; + + /* save pointer to dispatch table */ + pgContext->pWlxFuncs = (PWLX_DISPATCH_VERSION_1_3) pWinlogonFunctions; + + /* save the winlogon handle used to call the dispatch functions */ + pgContext->hWlx = hWlx; + + /* save window station */ + pgContext->station = lpWinsta; + + /* notify winlogon that we will use the default SAS */ + pgContext->pWlxFuncs->WlxUseCtrlAltDel(hWlx); + + return TRUE; +} + + BOOL STDCALL DllMain( - PVOID hinstDll, - ULONG dwReason, - PVOID reserved) + HINSTANCE hinstDLL, + DWORD dwReason, + LPVOID lpvReserved) { switch (dwReason) { case DLL_PROCESS_ATTACH: - break; + /* fall through */ case DLL_THREAD_ATTACH: + hDllInstance = hinstDLL; break; case DLL_THREAD_DETACH: break; diff --git a/reactos/lib/msgina/msgina.h b/reactos/lib/msgina/msgina.h index e0739abb95a..bb43e66ce6c 100644 --- a/reactos/lib/msgina/msgina.h +++ b/reactos/lib/msgina/msgina.h @@ -3,6 +3,16 @@ #define GINA_VERSION (WLX_VERSION_1_0) +typedef struct { + HANDLE hWlx; + LPWSTR station; + PWLX_DISPATCH_VERSION_1_3 pWlxFuncs; + HANDLE hDllInstance; + HANDLE UserToken; +} GINA_CONTEXT, *PGINA_CONTEXT; + +HINSTANCE hDllInstance; + #endif /* __MSGINA_H */ /* EOF */ diff --git a/reactos/lib/msgina/stubs.c b/reactos/lib/msgina/stubs.c index deeebb31944..8be45c9be82 100644 --- a/reactos/lib/msgina/stubs.c +++ b/reactos/lib/msgina/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.2 2003/11/24 15:28:54 weiden Exp $ +/* $Id: stubs.c,v 1.3 2003/11/24 17:24:29 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS msgina.dll @@ -76,22 +76,6 @@ WlxDisplaySASNotice( } -/* - * @unimplemented - */ -BOOL WINAPI -WlxInitialize( - LPWSTR lpWinsta, - HANDLE hWlx, - PVOID pvReserved, - PVOID pWinlogonFunctions, - PVOID *pWlxContext) -{ - UNIMPLEMENTED; - return FALSE; -} - - /* * @unimplemented */