Pass session pointer to CreateWindowEx.

svn path=/trunk/; revision=21243
This commit is contained in:
Eric Kohl 2006-03-06 23:13:34 +00:00
parent 794b5e6044
commit 6754e0b5af

View file

@ -1,5 +1,4 @@
/* $Id$ /*
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: services/winlogon/sas.c * FILE: services/winlogon/sas.c
@ -200,7 +199,7 @@ HandleExitWindows(PWLSESSION Session, DWORD RequestingProcessId, UINT Flags)
LRESULT CALLBACK LRESULT CALLBACK
SASProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 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) if(!Session)
{ {
return DefWindowProc(hwnd, uMsg, wParam, lParam); return DefWindowProc(hwnd, uMsg, wParam, lParam);
@ -222,6 +221,12 @@ SASProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
case WM_CREATE: 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)) if(!SetupSAS(Session, hwnd))
{ {
/* Fail! */ /* Fail! */
@ -265,16 +270,13 @@ InitializeSAS(PWLSESSION Session)
/* create invisible SAS window */ /* create invisible SAS window */
Session->SASWindow = CreateWindowEx(0, WINLOGON_SAS_CLASS, WINLOGON_SAS_TITLE, WS_POPUP, 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) if(!Session->SASWindow)
{ {
DPRINT1("WL: Failed to create SAS window\n"); DPRINT1("WL: Failed to create SAS window\n");
return FALSE; 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 */ /* Register SAS window to receive SAS notifications */
if(!SetLogonNotifyWindow(Session->SASWindow, Session->InteractiveWindowStation)) if(!SetLogonNotifyWindow(Session->SASWindow, Session->InteractiveWindowStation))
{ {