ReactOS 0.4.17-dev-573-g8315b8c
globals.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ADMIN_INFO
 
struct  _ITEMSDATA
 
struct  _REGISTRATIONNOTIFY
 

Macros

#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)
 
#define PM_ITEM_START   (WM_APP + 2)
 
#define PM_ITEM_END   (WM_APP + 3)
 
#define PM_STEP_START   (WM_APP + 4)
 
#define PM_STEP_END   (WM_APP + 5)
 
#define PM_ITEMS_DONE   (WM_APP + 6)
 

Typedefs

typedef struct _ADMIN_INFO ADMIN_INFO
 
typedef struct _ADMIN_INFOPADMIN_INFO
 
typedef struct _ITEMSDATA ITEMSDATA
 
typedef struct _ITEMSDATAPITEMSDATA
 
typedef struct _REGISTRATIONNOTIFY REGISTRATIONNOTIFY
 
typedef struct _REGISTRATIONNOTIFYPREGISTRATIONNOTIFY
 

Functions

HRESULT InstallOptionalComponents (_In_ PITEMSDATA pItemsData)
 
HRESULT RunCommandAndWait (_In_ PWCHAR Command)
 
BOOL RegisterTypeLibraries (_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ HINF hinf, _In_ LPCWSTR szSection)
 
VOID InstallStartMenuItems (_In_ PITEMSDATA pItemsData)
 
BOOL InstallNetworkComponent (_In_ PWSTR pszComponentId)
 
LONG CountSecuritySteps (VOID)
 
DWORD InstallSecurity (_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
 
NTSTATUS SetAdministratorPassword (LPCWSTR Password)
 
VOID SetAutoAdminLogon (VOID)
 
VOID InstallWizard (VOID)
 
VOID GetSetupInfPath (PWSTR szPath, UINT cchMax)
 

Variables

HINSTANCE hDllInstance
 
HINF hSysSetupInf
 
ADMIN_INFO AdminInfo
 

Macro Definition Documentation

◆ PM_ITEM_END

#define PM_ITEM_END   (WM_APP + 3)

Definition at line 57 of file globals.h.

◆ PM_ITEM_START

#define PM_ITEM_START   (WM_APP + 2)

Definition at line 52 of file globals.h.

◆ PM_ITEMS_DONE

#define PM_ITEMS_DONE   (WM_APP + 6)

Definition at line 64 of file globals.h.

◆ PM_REGISTRATION_NOTIFY

#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)

Definition at line 45 of file globals.h.

◆ PM_STEP_END

#define PM_STEP_END   (WM_APP + 5)

Definition at line 63 of file globals.h.

◆ PM_STEP_START

#define PM_STEP_START   (WM_APP + 4)

Definition at line 62 of file globals.h.

Typedef Documentation

◆ ADMIN_INFO

◆ ITEMSDATA

◆ PADMIN_INFO

◆ PITEMSDATA

◆ PREGISTRATIONNOTIFY

◆ REGISTRATIONNOTIFY

Function Documentation

◆ CountSecuritySteps()

LONG CountSecuritySteps ( VOID  )

Definition at line 1607 of file security.c.

1608{
1609 HINF hSecurityInf;
1610 PWSTR pszSecurityInf;
1611 LONG Steps = 0;
1612
1613// if (IsServer())
1614// pszSecurityInf = L"defltsv.inf";
1615// else
1616 pszSecurityInf = L"defltwk.inf";
1617
1618 Steps += 10; // InstallBuiltinAccounts();
1619
1620 hSecurityInf = SetupOpenInfFileW(pszSecurityInf,
1621 NULL,
1623 NULL);
1624 if (hSecurityInf != INVALID_HANDLE_VALUE)
1625 {
1626 /* Count InstallPrivilege steps */
1627 Steps += SetupGetLineCountW(hSecurityInf, L"Privilege Rights");
1628
1629 Steps += SetupGetLineCountW(hSecurityInf, L"Registry Values");
1630
1631 Steps += SetupGetLineCountW(hSecurityInf, L"Application Log");
1632 Steps += SetupGetLineCountW(hSecurityInf, L"Security Log");
1633 Steps += SetupGetLineCountW(hSecurityInf, L"System Log");
1634
1635 Steps += SetupGetLineCountW(hSecurityInf, L"System Access");
1636
1637 Steps += SetupGetLineCountW(hSecurityInf, L"Event Audit");
1638
1639 SetupCloseInfFile(hSecurityInf);
1640 }
1641
1642 Steps++; // SetPrimaryDomain
1643
1644 return Steps;
1645}
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1501
#define L(x)
Definition: resources.c:13
#define INF_STYLE_WIN4
Definition: infsupp.h:43
long LONG
Definition: pedump.c:60
uint16_t * PWSTR
Definition: typedefs.h:56
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45

Referenced by SaveSettings().

◆ GetSetupInfPath()

VOID GetSetupInfPath ( PWSTR  szPath,
UINT  cchMax 
)

Definition at line 57 of file wizard.c.

58{
60 wcscat(szPath, L"\\$winnt$.inf");
61}
UINT cchMax
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2232
LPCWSTR szPath
Definition: env.c:37
wcscat

Referenced by PreprocessUnattend(), ProcessSetupInf(), and SetInstallationCompleted().

◆ InstallNetworkComponent()

BOOL InstallNetworkComponent ( _In_ PWSTR  pszComponentId)

Definition at line 467 of file netinstall.c.

469{
471 HKEY hInstanceKey = NULL;
472 BOOL bResult = FALSE;
473
474 DPRINT("InstallNetworkComponent(%S)\n", pszComponentId);
475
477
478 if (!ScanForInfFile(pszComponentId, &ComponentInfo))
479 goto done;
480
481 DPRINT("Characteristics: 0x%lx\n", ComponentInfo.dwCharacteristics);
482 DPRINT("ComponentId: %S\n", ComponentInfo.pszComponentId);
483 DPRINT("Description: %S\n", ComponentInfo.pszDescription);
484 DPRINT("InfPath: %S\n", ComponentInfo.pszInfPath);
485 DPRINT("InfSection: %S\n", ComponentInfo.pszInfSection);
486 DPRINT("ClassGuid: %S\n", ComponentInfo.pszClassGuid);
487
489 &hInstanceKey))
490 {
491 DPRINT1("CreateInstanceKey() failed (Error %lx)\n", GetLastError());
492 goto done;
493 }
494
496 hInstanceKey,
497 ComponentInfo.pszInfPath,
498 ComponentInfo.pszInfSection))
499 {
500 DPRINT1("InstallInfSections() failed (Error %lx)\n", GetLastError());
501 goto done;
502 }
503
504 bResult = TRUE;
505
506done:
507 if (hInstanceKey != NULL)
508 RegCloseKey(hInstanceKey);
509
510 if (ComponentInfo.pszInfPath)
511 HeapFree(GetProcessHeap(), 0, ComponentInfo.pszInfPath);
512
513 if (ComponentInfo.pszInfSection)
514 HeapFree(GetProcessHeap(), 0, ComponentInfo.pszInfSection);
515
516 if (ComponentInfo.pszComponentId)
517 HeapFree(GetProcessHeap(), 0, ComponentInfo.pszComponentId);
518
519 if (ComponentInfo.pszDescription)
520 HeapFree(GetProcessHeap(), 0, ComponentInfo.pszDescription);
521
522 if (ComponentInfo.pszClassGuid)
523 HeapFree(GetProcessHeap(), 0, ComponentInfo.pszClassGuid);
524
525 return bResult;
526}
#define DPRINT1
Definition: precomp.h:8
#define RegCloseKey(hKey)
Definition: registry.h:49
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ZeroMemory
Definition: minwinbase.h:31
#define DPRINT
Definition: sndvol32.h:73
static BOOL InstallInfSections(_In_ HWND hWnd, _In_ HKEY hKey, _In_ LPCWSTR InfFile, _In_ LPCWSTR InfSection)
Definition: netinstall.c:36
static BOOL CreateInstanceKey(_In_ PCOMPONENT_INFO pComponentInfo, _Out_ PHKEY pInstanceKey)
Definition: netinstall.c:114
static BOOL ScanForInfFile(_In_ PWSTR pszComponentId, _In_ PCOMPONENT_INFO pComponentInfo)
Definition: netinstall.c:401
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ InstallOptionalComponents()

HRESULT InstallOptionalComponents ( _In_ PITEMSDATA  pItemsData)

Definition at line 135 of file addons.c.

137{
138 HRESULT hr = S_OK;
139 PSETUPDATA pSetupData;
141 RappsConsent Consent = NOT_ASKED;
142
143 /* The last element in Addons is null, don't count it as a step. */
144 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 3, (LPARAM)(ARRAYSIZE(Addons) - 1));
145 pSetupData = (PSETUPDATA)GetWindowLongPtr(pItemsData->hwndDlg, GWLP_USERDATA);
146
147 if (pSetupData->UnattendSetup)
148 Consent = pSetupData->RappsDownload ? APPROVED : DENIED;
149
150 for (DWORD i = 0; i < ARRAYSIZE(Addons); i++)
151 {
152 if (Addons[i].AddonPath == NULL
153 || Addons[i].CreateProcessFormatString == NULL
154 || Addons[i].RappsId == NULL)
155 continue;
156
157 hr = InstallAddon(&Addons[i], &Consent, pItemsData, &Notify);
158
159 /* Cancelling rapps install is not an error. Reset hr to S_OK. */
161 hr = S_OK;
162
163 if (!SUCCEEDED(hr))
164 {
165 WCHAR szMessage[256], szCaption[64];
168 MessageBoxW(NULL, szMessage, szCaption,
170 break;
171 }
172 }
173
174 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 3, HRESULT_CODE(hr));
175 return hr;
176}
struct _SETUPDATA * PSETUPDATA
static HINSTANCE hDllInstance
Definition: clb.c:9
HRESULT hr
Definition: delayimp.cpp:582
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define PM_ITEM_START
Definition: globals.h:52
#define PM_ITEM_END
Definition: globals.h:57
#define IDS_INSTALLADDONSFAILEDMESSAGE
Definition: resource.h:193
#define IDS_INSTALLADDONSCAPTION
Definition: resource.h:191
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
LONG_PTR LPARAM
Definition: minwindef.h:175
short WCHAR
Definition: pedump.c:58
#define LoadStringW
Definition: utils.h:64
BOOL UnattendSetup
Definition: syssetup.h:50
BOOL RappsDownload
Definition: syssetup.h:51
#define GetWindowLongPtr
Definition: treelist.c:73
#define GWLP_USERDATA
Definition: treelist.c:63
@ APPROVED
Definition: addons.c:14
@ DENIED
Definition: addons.c:15
@ NOT_ASKED
Definition: addons.c:13
HRESULT InstallAddon(_In_ PCADDON_INSTALL_DATA pInstallData, _Inout_ RappsConsent *Consent, _In_ PITEMSDATA pItemsData, _Inout_ PREGISTRATIONNOTIFY pNotify)
Definition: addons.c:67
enum _RappsConsent RappsConsent
static const ADDON_INSTALL_DATA Addons[]
Definition: addons.c:28
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_CANCELLED
Definition: winerror.h:1055
#define HRESULT_CODE(hr)
Definition: winerror.h:188
#define MB_TOPMOST
Definition: winuser.h:836
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define SendMessage
Definition: winuser.h:6009
#define MB_OK
Definition: winuser.h:801
#define MB_ICONWARNING
Definition: winuser.h:797

Referenced by ItemCompletionThread().

◆ InstallSecurity()

DWORD InstallSecurity ( _In_ PITEMSDATA  pItemsData,
_In_ PREGISTRATIONNOTIFY  pNotify 
)

Definition at line 1648 of file security.c.

1651{
1652 HINF hSecurityInf;
1653 PWSTR pszSecurityInf;
1654
1655// if (IsServer())
1656// pszSecurityInf = L"defltsv.inf";
1657// else
1658 pszSecurityInf = L"defltwk.inf";
1659
1660 InstallBuiltinAccounts(pItemsData, pNotify);
1661
1662 hSecurityInf = SetupOpenInfFileW(pszSecurityInf,
1663 NULL,
1665 NULL);
1666 if (hSecurityInf != INVALID_HANDLE_VALUE)
1667 {
1668 InstallPrivileges(hSecurityInf, pItemsData, pNotify);
1669 ApplyRegistryValues(hSecurityInf, pItemsData, pNotify);
1670
1671 ApplyEventlogSettings(hSecurityInf, pItemsData, pNotify, L"Application Log", L"Application");
1672 ApplyEventlogSettings(hSecurityInf, pItemsData, pNotify, L"Security Log", L"Security");
1673 ApplyEventlogSettings(hSecurityInf, pItemsData, pNotify, L"System Log", L"System");
1674
1675 ApplyPasswordSettings(hSecurityInf, pItemsData, pNotify, L"System Access");
1676 ApplyLockoutSettings(hSecurityInf, L"System Access");
1677 ApplyAccountSettings(hSecurityInf, L"System Access");
1678
1679 ApplyAuditEvents(hSecurityInf);
1680
1681 SetupCloseInfFile(hSecurityInf);
1682 }
1683
1684 /* Hack */
1685 SetPrimaryDomain(L"WORKGROUP", NULL);
1686
1687 return ERROR_SUCCESS;
1688}
#define ERROR_SUCCESS
Definition: deptool.c:10
static VOID ApplyAuditEvents(_In_ HINF hSecurityInf)
Definition: security.c:1469
static VOID ApplyLockoutSettings(_In_ HINF hSecurityInf, _In_ PWSTR pszSectionName)
Definition: security.c:1030
static NTSTATUS SetPrimaryDomain(LPCWSTR DomainName, PSID DomainSid)
Definition: security.c:153
static VOID ApplyRegistryValues(_In_ HINF hSecurityInf, _In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
Definition: security.c:454
static VOID InstallPrivileges(_In_ HINF hSecurityInf, _In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
Definition: security.c:304
static VOID ApplyAccountSettings(_In_ HINF hSecurityInf, _In_ PWSTR pszSectionName)
Definition: security.c:1370
static VOID ApplyPasswordSettings(_In_ HINF hSecurityInf, _In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ PWSTR pszSectionName)
Definition: security.c:821
static VOID InstallBuiltinAccounts(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
Definition: security.c:237
static VOID ApplyEventlogSettings(_In_ HINF hSecurityInf, _In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ PWSTR pszSectionName, _In_ PWSTR pszLogName)
Definition: security.c:660

Referenced by SaveSettings().

◆ InstallStartMenuItems()

VOID InstallStartMenuItems ( _In_ PITEMSDATA  pItemsData)

Definition at line 314 of file install.c.

316{
317 HINF hShortcutsInf1 = INVALID_HANDLE_VALUE;
318 HINF hShortcutsInf2 = INVALID_HANDLE_VALUE;
319 LONG Steps = 0;
320 DWORD LastError = 0;
322
323 ZeroMemory(&Notify, sizeof(Notify));
324
325 hShortcutsInf1 = SetupOpenInfFileW(L"shortcuts.inf",
326 NULL,
328 NULL);
329 if (hShortcutsInf1 == INVALID_HANDLE_VALUE)
330 {
331 DPRINT1("Failed to open shortcuts.inf");
332 return;
333 }
334
335 hShortcutsInf2 = SetupOpenInfFileW(L"rosapps_shortcuts.inf",
336 NULL,
338 NULL);
339
340 Steps = CountShortcuts(hShortcutsInf1, L"ShortcutFolders");
341 if (hShortcutsInf2 != INVALID_HANDLE_VALUE)
342 Steps += CountShortcuts(hShortcutsInf2, L"ShortcutFolders");
343
344 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 1, (LPARAM)Steps);
345
346 if (!CreateShortcuts(pItemsData, &Notify, hShortcutsInf1, L"ShortcutFolders"))
347 {
348 DPRINT1("CreateShortcuts() failed");
349 goto done;
350 }
351
352 if (hShortcutsInf2 != INVALID_HANDLE_VALUE)
353 {
354 if (!CreateShortcuts(pItemsData, &Notify, hShortcutsInf2, L"ShortcutFolders"))
355 {
356 DPRINT1("CreateShortcuts(rosapps) failed");
357 goto done;
358 }
359 }
360
361done:
362 if (hShortcutsInf2 != INVALID_HANDLE_VALUE)
363 SetupCloseInfFile(hShortcutsInf2);
364
365 if (hShortcutsInf1 != INVALID_HANDLE_VALUE)
366 SetupCloseInfFile(hShortcutsInf1);
367
368 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 1, LastError);
369}
static BOOL CreateShortcuts(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ HINF hinf, _In_ LPCWSTR szSection)
Definition: install.c:244
static LONG CountShortcuts(_In_ HINF hinf, _In_ LPCWSTR szSection)
Definition: install.c:288

Referenced by ItemCompletionThread().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 3473 of file wizard.c.

3474{
3475 PROPSHEETHEADER psh = {0};
3476 HPROPSHEETPAGE *phpage = NULL;
3477 PROPSHEETPAGE psp = {0};
3478 UINT nPages = 0;
3479 HWND hWnd;
3480 MSG msg;
3481 PSETUPDATA pSetupData = NULL;
3482 HMODULE hNetShell = NULL;
3484 DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3485
3486 LogItem(L"BEGIN_SECTION", L"InstallWizard");
3487
3488 /* Allocate setup data */
3489 pSetupData = HeapAlloc(GetProcessHeap(),
3491 sizeof(SETUPDATA));
3492 if (pSetupData == NULL)
3493 {
3494 LogItem(NULL, L"SetupData allocation failed!");
3496 L"Setup failed to allocate global data!",
3497 L"ReactOS Setup",
3499 goto done;
3500 }
3502
3503 hNetShell = LoadLibraryW(L"netshell.dll");
3504 if (hNetShell != NULL)
3505 {
3506 DPRINT("Netshell.dll loaded!\n");
3507
3508 pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3509 "NetSetupRequestWizardPages");
3510 if (pfn != NULL)
3511 {
3512 pfn(&dwNetworkPageCount, NULL, NULL);
3513 dwPageCount += dwNetworkPageCount;
3514 }
3515 }
3516
3517 DPRINT("PageCount: %lu\n", dwPageCount);
3518
3519 phpage = HeapAlloc(GetProcessHeap(),
3521 dwPageCount * sizeof(HPROPSHEETPAGE));
3522 if (phpage == NULL)
3523 {
3524 LogItem(NULL, L"Page array allocation failed!");
3526 L"Setup failed to allocate page array!",
3527 L"ReactOS Setup",
3529 goto done;
3530 }
3531
3532 /* Process the $winnt$.inf setup file */
3533 ProcessSetupInf(pSetupData);
3534
3535 /* Create the Welcome page */
3536 psp.dwSize = sizeof(PROPSHEETPAGE);
3537 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3538 psp.hInstance = hDllInstance;
3539 psp.lParam = (LPARAM)pSetupData;
3540 psp.pfnDlgProc = WelcomeDlgProc;
3541 psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3542 phpage[nPages++] = CreatePropertySheetPage(&psp);
3543
3544 /* Create the Acknowledgements page */
3545 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3546 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3547 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3548 psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3549 psp.pfnDlgProc = AckPageDlgProc;
3550 phpage[nPages++] = CreatePropertySheetPage(&psp);
3551
3552 /* Create the Installation Type page */
3553 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3554 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_INSTALLATIONTITLE);
3555 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_INSTALLATIONSUBTITLE);
3556 psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLATION);
3557 psp.pfnDlgProc = InstallTypePageDlgProc;
3558 phpage[nPages++] = CreatePropertySheetPage(&psp);
3559
3560 /* Create the Locale page */
3561 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3562 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3563 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3564 psp.pfnDlgProc = LocalePageDlgProc;
3565 psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3566 phpage[nPages++] = CreatePropertySheetPage(&psp);
3567
3568 /* Create the Owner page */
3569 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3570 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3571 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3572 psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3573 psp.pfnDlgProc = OwnerPageDlgProc;
3574 phpage[nPages++] = CreatePropertySheetPage(&psp);
3575
3576 /* Create the Computer page */
3577 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3578 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3579 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3580 psp.pfnDlgProc = ComputerPageDlgProc;
3581 psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3582 phpage[nPages++] = CreatePropertySheetPage(&psp);
3583
3584 /* Create the DateTime page */
3585 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3586 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3587 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3588 psp.pfnDlgProc = DateTimePageDlgProc;
3589 psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3590 phpage[nPages++] = CreatePropertySheetPage(&psp);
3591
3592 /* Create the theme selection page */
3593 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3594 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3595 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3596 psp.pfnDlgProc = ThemePageDlgProc;
3597 psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3598 phpage[nPages++] = CreatePropertySheetPage(&psp);
3599
3602
3603 if (pfn)
3604 {
3605 pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3606 nPages += dwNetworkPageCount;
3607 }
3608
3609 /* Create the Process page */
3610 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3611 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3612 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3613 psp.pfnDlgProc = ProcessPageDlgProc;
3614 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3615 phpage[nPages++] = CreatePropertySheetPage(&psp);
3616
3617 /* Create the Finish page */
3618 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3619 psp.pfnDlgProc = FinishDlgProc;
3620 psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3621 phpage[nPages++] = CreatePropertySheetPage(&psp);
3622
3623 ASSERT(nPages == dwPageCount);
3624
3625 /* Create the property sheet */
3626 psh.dwSize = sizeof(PROPSHEETHEADER);
3627 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3628 psh.hInstance = hDllInstance;
3629 psh.hwndParent = NULL;
3630 psh.nPages = nPages;
3631 psh.nStartPage = 0;
3632 psh.phpage = phpage;
3633 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3634 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3635
3636 /* Create title font */
3637 pSetupData->hTitleFont = CreateTitleFont();
3638 pSetupData->hBoldFont = CreateBoldFont();
3639
3640 /* Display the wizard */
3641 hWnd = (HWND)PropertySheet(&psh);
3643
3644 while (GetMessage(&msg, NULL, 0, 0))
3645 {
3646 if (!IsDialogMessage(hWnd, &msg))
3647 {
3650 }
3651 }
3652
3653 DeleteObject(pSetupData->hBoldFont);
3654 DeleteObject(pSetupData->hTitleFont);
3655
3656 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3657 SetupCloseInfFile(pSetupData->hSetupInf);
3658
3659done:
3660 if (phpage != NULL)
3661 HeapFree(GetProcessHeap(), 0, phpage);
3662
3663 if (hNetShell != NULL)
3664 FreeLibrary(hNetShell);
3665
3666 if (pSetupData != NULL)
3667 HeapFree(GetProcessHeap(), 0, pSetupData);
3668
3669 LogItem(L"END_SECTION", L"InstallWizard");
3670}
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define IDB_HEADER
Definition: resource.h:30
#define IDS_PROCESSSUBTITLE
Definition: resource.h:109
#define IDS_PROCESSTITLE
Definition: resource.h:108
#define IDB_WATERMARK
Definition: resource.h:13
#define IDD_PROCESSPAGE
Definition: resource.h:69
#define IDD_FINISHPAGE
Definition: resource.h:74
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
HANDLE HWND
Definition: compat.h:19
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:137
#define IDS_INSTALLATIONSUBTITLE
Definition: resource.h:177
#define IDS_LOCALESUBTITLE
Definition: resource.h:127
#define IDD_ACKPAGE
Definition: resource.h:44
#define IDS_ACKTITLE
Definition: resource.h:117
#define IDD_OWNERPAGE
Definition: resource.h:48
#define IDS_OWNERSUBTITLE
Definition: resource.h:121
#define IDD_INSTALLATION
Definition: resource.h:112
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:124
#define IDS_INSTALLATIONTITLE
Definition: resource.h:176
#define IDS_DATETIMESUBTITLE
Definition: resource.h:132
#define IDS_LOCALETITLE
Definition: resource.h:126
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:138
#define IDS_COMPUTERTITLE
Definition: resource.h:123
#define IDD_THEMEPAGE
Definition: resource.h:92
#define IDD_COMPUTERPAGE
Definition: resource.h:52
#define IDS_OWNERTITLE
Definition: resource.h:120
#define IDS_ACKSUBTITLE
Definition: resource.h:118
#define IDS_DATETIMETITLE
Definition: resource.h:131
pKey DeleteObject()
unsigned int UINT
Definition: sysinfo.c:13
#define ASSERT(a)
Definition: mode.c:44
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_MODELESS
Definition: prsht.h:50
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PropertySheet
Definition: prsht.h:400
#define PROPSHEETPAGE
Definition: prsht.h:389
INSTALLATION_TYPE InstallationType
Definition: syssetup.h:65
HFONT hBoldFont
Definition: reactos.h:132
UINT uPostNetworkWizardPage
Definition: syssetup.h:63
HFONT hTitleFont
Definition: reactos.h:131
UINT uFirstNetworkWizardPage
Definition: syssetup.h:62
HINF hSetupInf
Definition: syssetup.h:60
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:199
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:88
static INT_PTR CALLBACK FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2786
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1129
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1564
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:879
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1980
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:109
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:3339
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3470
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2126
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:294
static INT_PTR CALLBACK InstallTypePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:725
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2631
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:102
@ INSTALLATION_TYPE_DEFAULT
Definition: syssetup.h:34
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IsDialogMessage
Definition: winuser.h:5975
#define MB_ICONERROR
Definition: winuser.h:798
#define GetMessage
Definition: winuser.h:5956
#define SW_SHOW
Definition: winuser.h:786
#define DispatchMessage
Definition: winuser.h:5931

Referenced by InstallReactOS().

◆ RegisterTypeLibraries()

BOOL RegisterTypeLibraries ( _In_ PITEMSDATA  pItemsData,
_In_ PREGISTRATIONNOTIFY  pNotify,
_In_ HINF  hinf,
_In_ LPCWSTR  szSection 
)

Definition at line 540 of file install.c.

545{
546 INFCONTEXT InfContext;
547 BOOL res;
550 INT csidl;
551 LPWSTR p;
553 HRESULT hret;
554
555 /* Begin iterating the entries in the inf section */
556 res = SetupFindFirstLine(hinf, szSection, NULL, &InfContext);
557 if (!res) return FALSE;
558
559 do
560 {
561 /* Get the name of the current type library */
562 if (!SetupGetStringFieldW(&InfContext, 1, szName, ARRAYSIZE(szName), NULL))
563 {
564 FatalError("SetupGetStringFieldW failed\n");
565 continue;
566 }
567
568 if (!SetupGetIntField(&InfContext, 2, &csidl))
569 csidl = CSIDL_SYSTEM;
570
571 hret = SHGetFolderPathW(NULL, csidl, NULL, 0, szPath);
572 if (FAILED(hret))
573 {
574 FatalError("SHGetFolderPathW failed hret=0x%lx\n", hret);
575 continue;
576 }
577
579 wcscpy(p, szName);
580
581 if (pItemsData && pNotify)
582 {
583 pNotify->Progress++;
584 pNotify->CurrentItem = szName;
585
586 DPRINT("RegisterTypeLibraries: Start step %ld\n", pNotify->Progress);
587 SendMessage(pItemsData->hwndDlg, PM_STEP_START, 0, (LPARAM)pNotify);
588 }
589
591 if (hmod == NULL)
592 {
593 FatalError("LoadLibraryW failed\n");
594 continue;
595 }
596
598
599 if (pItemsData && pNotify)
600 {
601 DPRINT("RegisterTypeLibraries: End step %ld\n", pNotify->Progress);
602 SendMessage(pItemsData->hwndDlg, PM_STEP_END, 0, (LPARAM)pNotify);
603 }
604
605 } while (SetupFindNextLine(&InfContext, &InfContext));
606
607 return TRUE;
608}
HRESULT __wine_register_resources(HMODULE module)
Definition: register.c:112
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2717
#define PM_STEP_START
Definition: globals.h:62
#define PM_STEP_END
Definition: globals.h:63
static VOID FatalError(char *pszFmt,...)
Definition: install.c:54
GLuint res
Definition: glext.h:9613
GLfloat GLfloat p
Definition: glext.h:8902
#define FAILED(hr)
Definition: intsafe.h:51
static NTSTATUS *static PWSTR CURDIR *static HMODULE hmod
Definition: security.c:104
#define PathAddBackslash
Definition: pathcch.h:300
static const WCHAR szName[]
Definition: powrprof.c:45
wcscpy
#define SetupFindFirstLine
Definition: setupapi.h:2645
#define CSIDL_SYSTEM
Definition: shlobj.h:2227
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:148
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82

Referenced by InstallLiveCD(), and RegisterComponents().

◆ RunCommandAndWait()

HRESULT RunCommandAndWait ( _In_ PWCHAR  Command)

Definition at line 37 of file addons.c.

39{
40 STARTUPINFOW si = { sizeof(si) };
42 DWORD ExitCode = 0;
43
45 0, NULL, NULL, &si, &pi))
46 {
48 GetExitCodeProcess(pi.hProcess, &ExitCode);
51 if (ExitCode == 0)
52 return S_OK;
53 }
54
56}
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4441
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1165
#define INFINITE
Definition: serial.h:102
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
Definition: shell.h:41
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

Referenced by InstallAddon(), ProcessDetachedProgram(), and SetInstallationCompleted().

◆ SetAdministratorPassword()

NTSTATUS SetAdministratorPassword ( LPCWSTR  Password)

Definition at line 1692 of file security.c.

1693{
1695 PUSER_ACCOUNT_NAME_INFORMATION AccountNameInfo = NULL;
1696 USER_SET_PASSWORD_INFORMATION PasswordInfo;
1698 LSA_HANDLE PolicyHandle = NULL;
1699 SAM_HANDLE ServerHandle = NULL;
1700 SAM_HANDLE DomainHandle = NULL;
1701 SAM_HANDLE UserHandle = NULL;
1703
1704 DPRINT("SYSSETUP: SetAdministratorPassword(%p)\n", Password);
1705
1708
1712 &PolicyHandle);
1713 if (Status != STATUS_SUCCESS)
1714 {
1715 DPRINT1("LsaOpenPolicy() failed (Status: 0x%08lx)\n", Status);
1716 return Status;
1717 }
1718
1719 Status = LsaQueryInformationPolicy(PolicyHandle,
1721 (PVOID *)&OrigInfo);
1722 if (!NT_SUCCESS(Status))
1723 {
1724 DPRINT1("LsaQueryInformationPolicy() failed (Status: 0x%08lx)\n", Status);
1725 goto done;
1726 }
1727
1729 &ServerHandle,
1731 NULL);
1732 if (!NT_SUCCESS(Status))
1733 {
1734 DPRINT1("SamConnect() failed (Status: 0x%08lx)\n", Status);
1735 goto done;
1736 }
1737
1738 Status = SamOpenDomain(ServerHandle,
1740 OrigInfo->DomainSid,
1741 &DomainHandle);
1742 if (!NT_SUCCESS(Status))
1743 {
1744 DPRINT1("SamOpenDomain() failed (Status: 0x%08lx)\n", Status);
1745 goto done;
1746 }
1747
1748 Status = SamOpenUser(DomainHandle,
1751 &UserHandle);
1752 if (!NT_SUCCESS(Status))
1753 {
1754 DPRINT1("SamOpenUser() failed (Status %08lx)\n", Status);
1755 goto done;
1756 }
1757
1758 RtlInitUnicodeString(&PasswordInfo.Password, Password);
1759 PasswordInfo.PasswordExpired = FALSE;
1760
1761 Status = SamSetInformationUser(UserHandle,
1763 &PasswordInfo);
1764 if (!NT_SUCCESS(Status))
1765 {
1766 DPRINT1("SamSetInformationUser() failed (Status %08lx)\n", Status);
1767 goto done;
1768 }
1769
1770 Status = SamQueryInformationUser(UserHandle,
1772 (PVOID*)&AccountNameInfo);
1773 if (!NT_SUCCESS(Status))
1774 {
1775 DPRINT1("SamQueryInformationUser() failed (Status 0x%08lx)\n", Status);
1776 goto done;
1777 }
1778
1779 AdminInfo.Name = RtlAllocateHeap(RtlGetProcessHeap(),
1781 AccountNameInfo->UserName.Length + sizeof(WCHAR));
1782 if (AdminInfo.Name != NULL)
1784 AccountNameInfo->UserName.Buffer,
1785 AccountNameInfo->UserName.Length);
1786
1787 AdminInfo.Domain = RtlAllocateHeap(RtlGetProcessHeap(),
1789 OrigInfo->DomainName.Length + sizeof(WCHAR));
1790 if (AdminInfo.Domain != NULL)
1792 OrigInfo->DomainName.Buffer,
1793 OrigInfo->DomainName.Length);
1794
1795 AdminInfo.Password = RtlAllocateHeap(RtlGetProcessHeap(),
1796 0,
1797 (wcslen(Password) + 1) * sizeof(WCHAR));
1798 if (AdminInfo.Password != NULL)
1800
1801 DPRINT("Administrator Name: %S\n", AdminInfo.Name);
1802 DPRINT("Administrator Domain: %S\n", AdminInfo.Domain);
1803 DPRINT("Administrator Password: %S\n", AdminInfo.Password);
1804
1805done:
1806 if (AccountNameInfo != NULL)
1807 SamFreeMemory(AccountNameInfo);
1808
1809 if (OrigInfo != NULL)
1810 LsaFreeMemory(OrigInfo);
1811
1812 if (PolicyHandle != NULL)
1813 LsaClose(PolicyHandle);
1814
1815 if (UserHandle != NULL)
1816 SamCloseHandle(UserHandle);
1817
1818 if (DomainHandle != NULL)
1819 SamCloseHandle(DomainHandle);
1820
1821 if (ServerHandle != NULL)
1822 SamCloseHandle(ServerHandle);
1823
1824 DPRINT1("SYSSETUP: SetAdministratorPassword() done (Status %08lx)\n", Status);
1825
1826 return Status;
1827}
LONG NTSTATUS
Definition: precomp.h:26
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:616
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS WINAPI LsaOpenPolicy(IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
Definition: lsa.c:1183
NTSTATUS WINAPI LsaQueryInformationPolicy(IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
Definition: lsa.c:1473
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
Definition: lsa.c:701
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:194
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
ADMIN_INFO AdminInfo
Definition: install.c:39
Status
Definition: gdiplustypes.h:24
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define USER_READ_GENERAL
Definition: ntsam.h:126
#define USER_FORCE_PASSWORD_CHANGE
Definition: ntsam.h:133
#define DOMAIN_LOOKUP
Definition: ntsam.h:42
#define SAM_SERVER_LOOKUP_DOMAIN
Definition: ntsam.h:104
@ UserAccountNameInformation
Definition: ntsam.h:520
@ UserSetPasswordInformation
Definition: ntsam.h:528
#define SAM_SERVER_CONNECT
Definition: ntsam.h:99
@ PolicyAccountDomainInformation
Definition: ntsecapi.h:247
struct _LSA_OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES
#define POLICY_TRUST_ADMIN
Definition: ntsecapi.h:64
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
NTSTATUS NTAPI SamQueryInformationUser(IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PVOID *Buffer)
Definition: samlib.c:1731
NTSTATUS NTAPI SamOpenUser(IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT PSAM_HANDLE UserHandle)
Definition: samlib.c:1535
NTSTATUS NTAPI SamSetInformationUser(IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PVOID Buffer)
Definition: samlib.c:2000
NTSTATUS NTAPI SamFreeMemory(IN PVOID Buffer)
Definition: samlib.c:983
NTSTATUS NTAPI SamConnect(IN OUT PUNICODE_STRING ServerName OPTIONAL, OUT PSAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: samlib.c:519
NTSTATUS NTAPI SamCloseHandle(IN SAM_HANDLE SamHandle)
Definition: samlib.c:497
NTSTATUS NTAPI SamOpenDomain(IN SAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PSID DomainId, OUT PSAM_HANDLE DomainHandle)
Definition: samlib.c:1477
#define memset(x, y, z)
Definition: compat.h:39
#define STATUS_SUCCESS
Definition: shellext.h:65
LPWSTR Password
Definition: globals.h:25
LPWSTR Name
Definition: globals.h:23
LPWSTR Domain
Definition: globals.h:24
LSA_UNICODE_STRING DomainName
Definition: ntsecapi.h:566
UNICODE_STRING UserName
Definition: ntsam.h:623
UNICODE_STRING Password
Definition: ntsam.h:664
@ Password
Definition: telnetd.h:67
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define DOMAIN_USER_RID_ADMIN
Definition: setypes.h:631

Referenced by ComputerPageDlgProc().

◆ SetAutoAdminLogon()

VOID SetAutoAdminLogon ( VOID  )

Definition at line 1831 of file security.c.

1832{
1833 WCHAR szAutoAdminLogon[2];
1834 HKEY hKey = NULL;
1835 DWORD dwType;
1836 DWORD dwSize;
1837 LONG lError;
1838
1840 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1841 0,
1843 &hKey);
1844 if (lError != ERROR_SUCCESS)
1845 return;
1846
1847 dwSize = 2 * sizeof(WCHAR);
1848 lError = RegQueryValueExW(hKey,
1849 L"AutoAdminLogon",
1850 NULL,
1851 &dwType,
1852 (LPBYTE)szAutoAdminLogon,
1853 &dwSize);
1854 if (lError != ERROR_SUCCESS)
1855 goto done;
1856
1857 if (wcscmp(szAutoAdminLogon, L"1") == 0)
1858 {
1860 L"DefaultDomainName",
1861 0,
1862 REG_SZ,
1864 (wcslen(AdminInfo.Domain) + 1) * sizeof(WCHAR));
1865
1867 L"DefaultUserName",
1868 0,
1869 REG_SZ,
1871 (wcslen(AdminInfo.Name) + 1) * sizeof(WCHAR));
1872
1874 L"DefaultPassword",
1875 0,
1876 REG_SZ,
1878 (wcslen(AdminInfo.Password) + 1) * sizeof(WCHAR));
1879 }
1880
1881done:
1882 if (hKey != NULL)
1884}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
FxAutoRegKey hKey
#define REG_SZ
Definition: layer.c:22
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_READ
Definition: nt_native.h:1026
#define KEY_WRITE
Definition: nt_native.h:1034
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by InstallReactOS().

Variable Documentation

◆ AdminInfo

ADMIN_INFO AdminInfo
extern

Definition at line 39 of file install.c.

Referenced by InstallReactOS(), SetAdministratorPassword(), and SetAutoAdminLogon().

◆ hDllInstance

HINSTANCE hDllInstance
extern

Definition at line 17 of file browser.c.

◆ hSysSetupInf