From 6754e0b5afeabdaa0e8c52abb47cac4bd568f1ee Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 6 Mar 2006 23:13:34 +0000 Subject: [PATCH] Pass session pointer to CreateWindowEx. svn path=/trunk/; revision=21243 --- reactos/base/system/winlogon/sas.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/reactos/base/system/winlogon/sas.c b/reactos/base/system/winlogon/sas.c index 7c3b64645fa..be2eaa97499 100644 --- a/reactos/base/system/winlogon/sas.c +++ b/reactos/base/system/winlogon/sas.c @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: services/winlogon/sas.c @@ -200,7 +199,7 @@ HandleExitWindows(PWLSESSION Session, DWORD RequestingProcessId, UINT Flags) LRESULT CALLBACK SASProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - PWLSESSION Session = (PWLSESSION)GetWindowLongPtr(hwnd, GWL_USERDATA); + PWLSESSION Session = (PWLSESSION)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(!Session) { return DefWindowProc(hwnd, uMsg, wParam, lParam); @@ -222,6 +221,12 @@ SASProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } case WM_CREATE: { + /* Get the session pointer from the create data */ + Session = (PWLSESSION)((LPCREATESTRUCT)lParam)->lpCreateParams; + + /* Save the Session pointer */ + SetWindowLongPtr(Session->SASWindow, GWLP_USERDATA, (DWORD_PTR)Session); + if(!SetupSAS(Session, hwnd)) { /* Fail! */ @@ -265,16 +270,13 @@ InitializeSAS(PWLSESSION Session) /* create invisible SAS window */ Session->SASWindow = CreateWindowEx(0, WINLOGON_SAS_CLASS, WINLOGON_SAS_TITLE, WS_POPUP, - 0, 0, 0, 0, 0, 0, hAppInstance, NULL); + 0, 0, 0, 0, 0, 0, hAppInstance, Session); if(!Session->SASWindow) { DPRINT1("WL: Failed to create SAS window\n"); return FALSE; } - /* Save the Session pointer so the window proc can access it */ - SetWindowLongPtr(Session->SASWindow, GWL_USERDATA, (DWORD_PTR)Session); - /* Register SAS window to receive SAS notifications */ if(!SetLogonNotifyWindow(Session->SASWindow, Session->InteractiveWindowStation)) {