Author: hpoussin
Date: Tue Sep 26 23:18:02 2006
New Revision: 24278
URL:
http://svn.reactos.org/svn/reactos?rev=24278&view=rev
Log:
Fix some warnings in winlogon code
Change winlogon registry key to "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon" for compatibility reasons, as some programs read it
directly
Modified:
trunk/reactos/base/system/userinit/userinit.c
trunk/reactos/base/system/winlogon/sas.c
trunk/reactos/base/system/winlogon/screensaver.c
trunk/reactos/base/system/winlogon/setup.c
trunk/reactos/base/system/winlogon/winlogon.c
trunk/reactos/base/system/winlogon/winlogon.h
trunk/reactos/base/system/winlogon/wlx.c
trunk/reactos/boot/bootdata/hivesft.inf
trunk/reactos/dll/win32/msgina/msgina.c
Modified: trunk/reactos/base/system/userinit/userinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/userinit/useri…
==============================================================================
--- trunk/reactos/base/system/userinit/userinit.c (original)
+++ trunk/reactos/base/system/userinit/userinit.c Tue Sep 26 23:18:02 2006
@@ -118,7 +118,7 @@
BOOL ConsoleShell = IsConsoleShell();
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- L"SOFTWARE\\ReactOS\\Windows NT\\CurrentVersion\\Winlogon",
+ L"SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\Winlogon",
0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
{
Size = MAX_PATH * sizeof(WCHAR);
Modified: trunk/reactos/base/system/winlogon/sas.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/sas.c…
==============================================================================
--- trunk/reactos/base/system/winlogon/sas.c (original)
+++ trunk/reactos/base/system/winlogon/sas.c Tue Sep 26 23:18:02 2006
@@ -37,7 +37,7 @@
BOOL
SetDefaultLanguage(
- IN BOOL UserProfile)
+ IN BOOLEAN UserProfile)
{
HKEY BaseKey;
LPCWSTR SubKey;
@@ -114,7 +114,7 @@
}
/* Convert Value to a Lcid */
- ValueString.Length = ValueString.MaximumLength = dwSize;
+ ValueString.Length = ValueString.MaximumLength = (USHORT)dwSize;
ValueString.Buffer = Value;
Status = RtlUnicodeStringToInteger(&ValueString, 16, &Lcid);
if (!NT_SUCCESS(Status))
@@ -146,7 +146,7 @@
HandleLogon(
IN OUT PWLSESSION Session)
{
- PROFILEINFOW ProfileInfo;
+ PROFILEINFOW ProfileInfo = { 0 };
LPVOID lpEnvironment = NULL;
BOOLEAN Old;
@@ -177,7 +177,8 @@
TRUE))
{
ERR("WL: CreateEnvironmentBlock() failed\n");
- UnloadUserProfile(WLSession->UserToken, ProfileInfo.hProfile);
+ if (!(Session->Options & WLX_LOGON_OPT_NO_PROFILE))
+ UnloadUserProfile(WLSession->UserToken, ProfileInfo.hProfile);
CloseHandle(Session->UserToken);
return FALSE;
}
@@ -317,13 +318,15 @@
return STATUS_SUCCESS;
}
-static INT_PTR CALLBACK
+static BOOL CALLBACK
ShutdownComputerWindowProc(
IN HWND hwndDlg,
IN UINT uMsg,
IN WPARAM wParam,
IN LPARAM lParam)
{
+ UNREFERENCED_PARAMETER(lParam);
+
switch (uMsg)
{
case WM_COMMAND:
@@ -689,7 +692,7 @@
Session = (PWLSESSION)((LPCREATESTRUCT)lParam)->lpCreateParams;
/* Save the Session pointer */
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)Session);
+ SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)Session);
return RegisterHotKeys(Session, hwndDlg);
}
Modified: trunk/reactos/base/system/winlogon/screensaver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/scree…
==============================================================================
--- trunk/reactos/base/system/winlogon/screensaver.c (original)
+++ trunk/reactos/base/system/winlogon/screensaver.c Tue Sep 26 23:18:02 2006
@@ -202,29 +202,31 @@
}
#endif
- if (!(Session->hScreenSaverParametersChanged = CreateEventW(NULL, FALSE, FALSE,
NULL)))
+ Session->hScreenSaverParametersChanged = CreateEventW(NULL, FALSE, FALSE, NULL);
+ if (!Session->hScreenSaverParametersChanged)
{
WARN("WL: Unable to create screen saver event (error %lu)\n",
GetLastError());
- }
- else if (!(Session->hEndOfScreenSaverThread = CreateEventW(NULL, FALSE, FALSE,
NULL)))
+ return TRUE;
+ }
+ Session->hEndOfScreenSaverThread = CreateEventW(NULL, FALSE, FALSE, NULL);
+ if (!Session->hEndOfScreenSaverThread)
{
WARN("WL: Unable to create screen saver event (error %lu)\n",
GetLastError());
CloseHandle(Session->hScreenSaverParametersChanged);
- }
+ return TRUE;
+ }
+
+ ScreenSaverThread = CreateThread(
+ NULL,
+ 0,
+ ScreenSaverThreadMain,
+ Session,
+ 0,
+ NULL);
+ if (ScreenSaverThread)
+ CloseHandle(ScreenSaverThread);
else
- {
- ScreenSaverThread = CreateThread(
- NULL,
- 0,
- ScreenSaverThreadMain,
- Session,
- 0,
- NULL);
- if (ScreenSaverThread)
- CloseHandle(ScreenSaverThread);
- else
- WARN("WL: Unable to start screen saver thread\n");
- }
+ WARN("WL: Unable to start screen saver thread\n");
return TRUE;
}
Modified: trunk/reactos/base/system/winlogon/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/setup…
==============================================================================
--- trunk/reactos/base/system/winlogon/setup.c (original)
+++ trunk/reactos/base/system/winlogon/setup.c Tue Sep 26 23:18:02 2006
@@ -109,7 +109,7 @@
STARTUPINFOW StartupInfo;
WCHAR Shell[MAX_PATH];
WCHAR CommandLine[MAX_PATH];
- BOOLEAN Result;
+ BOOL Result;
DWORD dwError;
HKEY hKey;
DWORD dwType;
Modified: trunk/reactos/base/system/winlogon/winlogon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
==============================================================================
--- trunk/reactos/base/system/winlogon/winlogon.c (original)
+++ trunk/reactos/base/system/winlogon/winlogon.c Tue Sep 26 23:18:02 2006
@@ -24,7 +24,7 @@
static BOOL
StartServicesManager(VOID)
{
- HANDLE ServicesInitEvent;
+ HANDLE ServicesInitEvent = NULL;
STARTUPINFOW StartupInfo;
PROCESS_INFORMATION ProcessInformation;
DWORD Count;
@@ -154,7 +154,7 @@
OUT HKEY *WinLogonKey)
{
return ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- L"SOFTWARE\\ReactOS\\Windows
NT\\CurrentVersion\\WinLogon",
+ L"SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\WinLogon",
0,
KEY_QUERY_VALUE,
WinLogonKey);
@@ -302,7 +302,7 @@
return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context);
}
-static INT_PTR CALLBACK
+static BOOL CALLBACK
GinaLoadFailedWindowProc(
IN HWND hwndDlg,
IN UINT uMsg,
@@ -362,6 +362,10 @@
#endif
MSG Msg;
+ UNREFERENCED_PARAMETER(hPrevInstance);
+ UNREFERENCED_PARAMETER(lpCmdLine);
+ UNREFERENCED_PARAMETER(nShowCmd);
+
hAppInstance = hInstance;
if (!RegisterLogonProcess(GetCurrentProcessId(), TRUE))
@@ -370,7 +374,6 @@
HandleShutdown(NULL, WLX_SAS_ACTION_SHUTDOWN_POWER_OFF);
NtShutdownSystem(ShutdownNoReboot);
ExitProcess(0);
- return 0;
}
WLSession = (PWLSESSION)HeapAlloc(GetProcessHeap(), 0, sizeof(WLSESSION));
@@ -380,7 +383,6 @@
ERR("WL: Could not allocate memory for winlogon instance\n");
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, 0, 0, 0);
ExitProcess(1);
- return 1;
}
WLSession->DialogTimeout = 120; /* 2 minutes */
@@ -389,7 +391,6 @@
ERR("WL: Could not create window station and desktops\n");
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, 0, 0, 0);
ExitProcess(1);
- return 1;
}
LockWorkstation(WLSession);
@@ -398,7 +399,6 @@
ERR("WL: Could not start services.exe\n");
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, 0, 0, 0);
ExitProcess(1);
- return 1;
}
/* Check for pending setup */
@@ -415,7 +415,6 @@
HandleShutdown(WLSession, WLX_SAS_ACTION_SHUTDOWN_REBOOT);
ExitProcess(0);
- return 0;
}
if (!StartLsass())
@@ -423,7 +422,6 @@
DPRINT1("WL: Failed to start lsass.exe service (error %lu)\n",
GetLastError());
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, 0, 0, 0);
ExitProcess(1);
- return 1;
}
/* Load and initialize gina */
@@ -433,7 +431,6 @@
DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_GINALOADFAILED), 0,
GinaLoadFailedWindowProc, (LPARAM)L"");
HandleShutdown(WLSession, WLX_SAS_ACTION_SHUTDOWN_REBOOT);
ExitProcess(1);
- return 1;
}
DisplayStatusMessage(WLSession, WLSession->WinlogonDesktop,
IDS_REACTOSISSTARTINGUP);
@@ -475,7 +472,6 @@
{
ERR("WL: Failed to initialize SAS\n");
ExitProcess(2);
- return 2;
}
//DisplayStatusMessage(Session, Session->WinlogonDesktop,
IDS_PREPARENETWORKCONNECTIONS);
Modified: trunk/reactos/base/system/winlogon/winlogon.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
==============================================================================
--- trunk/reactos/base/system/winlogon/winlogon.h (original)
+++ trunk/reactos/base/system/winlogon/winlogon.h Tue Sep 26 23:18:02 2006
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- * COPYRIGHT: See COPYING in the top level directory
+/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS winlogon
* FILE: subsys/system/winlogon/winlogon.h
* PURPOSE: Winlogon
@@ -180,7 +179,7 @@
/* sas.c */
BOOL
SetDefaultLanguage(
- IN BOOL UserProfile);
+ IN BOOLEAN UserProfile);
BOOL
InitializeSAS(
Modified: trunk/reactos/base/system/winlogon/wlx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/wlx.c…
==============================================================================
--- trunk/reactos/base/system/winlogon/wlx.c (original)
+++ trunk/reactos/base/system/winlogon/wlx.c Tue Sep 26 23:18:02 2006
@@ -18,7 +18,7 @@
static DLGPROC PreviousWindowProc;
static UINT_PTR IdTimer;
-static INT_PTR CALLBACK
+static BOOL CALLBACK
DefaultWlxWindowProc(
IN HWND hwndDlg,
IN UINT uMsg,
@@ -120,6 +120,11 @@
HANDLE hProcess,
HANDLE hThread)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(hToken);
+ UNREFERENCED_PARAMETER(hProcess);
+ UNREFERENCED_PARAMETER(hThread);
+
UNIMPLEMENTED;
return 0;
}
@@ -135,6 +140,8 @@
LPWSTR lpszTitle,
UINT fuStyle)
{
+ UNREFERENCED_PARAMETER(hWlx);
+
TRACE("WlxMessageBox()\n");
/* FIXME: Provide a custom window proc to be able to handle timeout */
return MessageBoxW(hwndOwner, lpszText, lpszTitle, fuStyle);
@@ -151,6 +158,8 @@
HWND hwndOwner,
DLGPROC dlgprc)
{
+ UNREFERENCED_PARAMETER(hWlx);
+
TRACE("WlxDialogBox()\n");
if (PreviousWindowProc != NULL)
@@ -171,6 +180,8 @@
DLGPROC dlgprc,
LPARAM dwInitParam)
{
+ UNREFERENCED_PARAMETER(hWlx);
+
TRACE("WlxDialogBoxParam()\n");
if (PreviousWindowProc != NULL)
@@ -190,6 +201,8 @@
HWND hwndOwner,
DLGPROC dlgprc)
{
+ UNREFERENCED_PARAMETER(hWlx);
+
TRACE("WlxDialogBoxIndirect()\n");
if (PreviousWindowProc != NULL)
@@ -210,6 +223,8 @@
DLGPROC dlgprc,
LPARAM dwInitParam)
{
+ UNREFERENCED_PARAMETER(hWlx);
+
TRACE("WlxDialogBoxIndirectParam()\n");
if (PreviousWindowProc != NULL)
@@ -255,6 +270,10 @@
PWLX_MPR_NOTIFY_INFO pMprInfo,
DWORD dwChangeInfo)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(pMprInfo);
+ UNREFERENCED_PARAMETER(dwChangeInfo);
+
UNIMPLEMENTED;
return 0;
}
@@ -267,6 +286,9 @@
HANDLE hWlx,
PWLX_DESKTOP* ppDesktop)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(ppDesktop);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -279,6 +301,9 @@
HANDLE hWlx,
PWLX_DESKTOP pDesktop)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(pDesktop);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -294,6 +319,12 @@
PWSTR pszDesktopName,
PWLX_DESKTOP* ppDesktop)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(hToken);
+ UNREFERENCED_PARAMETER(Flags);
+ UNREFERENCED_PARAMETER(pszDesktopName);
+ UNREFERENCED_PARAMETER(ppDesktop);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -309,6 +340,12 @@
PWSTR ProviderName,
PVOID Reserved)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(pMprInfo);
+ UNREFERENCED_PARAMETER(dwChangeInfo);
+ UNREFERENCED_PARAMETER(ProviderName);
+ UNREFERENCED_PARAMETER(Reserved);
+
UNIMPLEMENTED;
return 0;
}
@@ -322,6 +359,10 @@
PWLX_DESKTOP pDesktop,
HANDLE hToken)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(pDesktop);
+ UNREFERENCED_PARAMETER(hToken);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -422,6 +463,8 @@
WlxWin31Migrate(
HANDLE hWlx)
{
+ UNREFERENCED_PARAMETER(hWlx);
+
UNIMPLEMENTED;
}
@@ -432,6 +475,8 @@
WlxQueryClientCredentials(
PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred)
{
+ UNREFERENCED_PARAMETER(pCred);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -443,6 +488,8 @@
WlxQueryInetConnectorCredentials(
PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred)
{
+ UNREFERENCED_PARAMETER(pCred);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -467,6 +514,11 @@
WCHAR* UserName,
WCHAR* Domain)
{
+ UNREFERENCED_PARAMETER(hWlx);
+ UNREFERENCED_PARAMETER(pTSData);
+ UNREFERENCED_PARAMETER(UserName);
+ UNREFERENCED_PARAMETER(Domain);
+
UNIMPLEMENTED;
return 0;
}
@@ -478,6 +530,8 @@
WlxQueryConsoleSwitchCredentials(
PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 pCred)
{
+ UNREFERENCED_PARAMETER(pCred);
+
UNIMPLEMENTED;
return 0;
}
@@ -489,6 +543,8 @@
WlxQueryTsLogonCredentials(
PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCred)
{
+ UNREFERENCED_PARAMETER(pCred);
+
UNIMPLEMENTED;
return FALSE;
}
@@ -588,7 +644,8 @@
/* Terminate string */
GinaDll[MAX_PATH] = '\0';
- if (!(hGina = LoadLibraryW(GinaDll)))
+ hGina = LoadLibraryW(GinaDll);
+ if (!hGina)
goto cleanup;
Functions->WlxNegotiate = (PFWLXNEGOTIATE)GetProcAddress(hGina,
"WlxNegotiate");
Modified: trunk/reactos/boot/bootdata/hivesft.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesft.inf (original)
+++ trunk/reactos/boot/bootdata/hivesft.inf Tue Sep 26 23:18:02 2006
@@ -738,14 +738,14 @@
HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FAT",0x00000000,"ufat.dll"
HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FAT32",0x00000000,"ufat.dll"
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","ConsoleShell",0x00020000,"%SystemRoot%\system32\cmd.exe"
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","StartLsass",0x00010001,0x00000001
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe"
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","AutoAdminLogon",0x00000000,"1"
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","DefaultUserName",0x00000000,"Administrator"
-HKLM,"SOFTWARE\ReactOS\Windows
NT\CurrentVersion\Winlogon","DefaultPassword",0x00000000,"Secret"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","ConsoleShell",0x00020000,"%SystemRoot%\system32\cmd.exe"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","StartLsass",0x00010001,0x00000001
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","AutoAdminLogon",0x00000000,"1"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","DefaultUserName",0x00000000,"Administrator"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon","DefaultPassword",0x00000000,"Secret"
;Time Zone Servers
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","1",0x00000000,"pool.ntp.org"
Modified: trunk/reactos/dll/win32/msgina/msgina.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?…
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.c (original)
+++ trunk/reactos/dll/win32/msgina/msgina.c Tue Sep 26 23:18:02 2006
@@ -239,7 +239,7 @@
TRACE("WlxActivateUserShell()\n");
/* get the path of userinit */
if(RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- L"SOFTWARE\\ReactOS\\Windows NT\\CurrentVersion\\Winlogon",
+ L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
{ERR("GINA: Failed: 1\n");
VirtualFree(pEnvironment, 0, MEM_RELEASE);
@@ -419,7 +419,7 @@
rc = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
- L"SOFTWARE\\ReactOS\\Windows NT\\CurrentVersion\\WinLogon",
+ L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon",
0,
KEY_QUERY_VALUE,
&WinLogonKey);