#include "msgina.h"
-#include <winreg.h>
#include <winsvc.h>
#include <userenv.h>
#include <ndk/sefuncs.h>
-#include <strsafe.h>
HINSTANCE hDllInstance;
pgContext->bDontDisplayLastUserName = TRUE;
}
- dwSize = 256 * sizeof(WCHAR);
+ dwSize = sizeof(pgContext->UserName);
rc = RegQueryValueExW(hKey,
L"DefaultUserName",
NULL,
(LPBYTE)&pgContext->UserName,
&dwSize);
- dwSize = 256 * sizeof(WCHAR);
+ dwSize = sizeof(pgContext->Domain);
rc = RegQueryValueExW(hKey,
L"DefaultDomain",
NULL,
pgContext->station = lpWinsta;
/* Clear status window handle */
- pgContext->hStatusWindow = 0;
+ pgContext->hStatusWindow = NULL;
/* Notify winlogon that we will use the default SAS */
pgContext->pWlxFuncs->WlxUseCtrlAltDel(hWlx);
* HKCU\Control Panel\Desktop : ScreenSaverIsSecure
*/
+ // FIXME: User impersonation!!
+
rc = RegOpenKeyExW(HKEY_CURRENT_USER,
L"Control Panel\\Desktop",
0,
wcscpy(pgContext->UserName, UserName);
if (Domain == NULL || wcslen(Domain) == 0)
{
- dwLength = 256;
+ dwLength = _countof(pgContext->Domain);
GetComputerNameW(pgContext->Domain, &dwLength);
}
else
}
result = CreateProfile(pgContext, UserName, Domain, Password);
- if (result == TRUE)
+ if (result)
{
- ZeroMemory(pgContext->Password, 256 * sizeof(WCHAR));
+ ZeroMemory(pgContext->Password, sizeof(pgContext->Password));
wcscpy(pgContext->Password, Password);
NotifyBootConfigStatus(TRUE);
return;
}
- if (pgContext->bAutoAdminLogon == TRUE)
+ if (pgContext->bAutoAdminLogon)
{
/* Don't display the window, we want to do an automatic logon */
pgContext->AutoLogonState = AUTOLOGON_ONCE;
else
pgContext->AutoLogonState = AUTOLOGON_DISABLED;
- if (pgContext->bDisableCAD == TRUE)
+ if (pgContext->bDisableCAD)
{
pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
return;
TRACE("WlxDisplayLockedNotice()\n");
- if (pgContext->bDisableCAD == TRUE)
+ if (pgContext->bDisableCAD)
{
pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
return;