ReactOS  0.4.15-dev-2991-g632fa1c
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
 

Typedefs

typedef struct _ADMIN_INFO ADMIN_INFO
 
typedef struct _ADMIN_INFOPADMIN_INFO
 

Functions

BOOL RegisterTypeLibraries (HINF hinf, LPCWSTR szSection)
 
BOOL InstallNetworkComponent (_In_ PWSTR pszComponentId)
 
VOID InstallSecurity (VOID)
 
NTSTATUS SetAdministratorPassword (LPCWSTR Password)
 
VOID SetAutoAdminLogon (VOID)
 
VOID InstallWizard (VOID)
 

Variables

HINSTANCE hDllInstance
 
HINF hSysSetupInf
 
ADMIN_INFO AdminInfo
 

Typedef Documentation

◆ ADMIN_INFO

◆ PADMIN_INFO

Function Documentation

◆ 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 
506 done:
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 TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ZeroMemory
Definition: winbase.h:1664
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL CreateInstanceKey(_In_ PCOMPONENT_INFO pComponentInfo, _Out_ PHKEY pInstanceKey)
Definition: netinstall.c:114
#define GetProcessHeap()
Definition: compat.h:595
static BOOL InstallInfSections(_In_ HWND hWnd, _In_ HKEY hKey, _In_ LPCWSTR InfFile, _In_ LPCWSTR InfSection)
Definition: netinstall.c:36
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define DPRINT
Definition: sndvol32.h:71
static BOOL ScanForInfFile(_In_ PWSTR pszComponentId, _In_ PCOMPONENT_INFO pComponentInfo)
Definition: netinstall.c:401
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by InstallLiveCD(), and InstallReactOS().

◆ InstallSecurity()

VOID InstallSecurity ( VOID  )

Definition at line 1569 of file security.c.

1570 {
1571  HINF hSecurityInf;
1572  PWSTR pszSecurityInf;
1573 
1574 // if (IsServer())
1575 // pszSecurityInf = L"defltsv.inf";
1576 // else
1577  pszSecurityInf = L"defltwk.inf";
1578 
1580 
1581  hSecurityInf = SetupOpenInfFileW(pszSecurityInf,
1582  NULL,
1584  NULL);
1585  if (hSecurityInf != INVALID_HANDLE_VALUE)
1586  {
1587  InstallPrivileges(hSecurityInf);
1588  ApplyRegistryValues(hSecurityInf);
1589 
1590  ApplyEventlogSettings(hSecurityInf, L"Application Log", L"Application");
1591  ApplyEventlogSettings(hSecurityInf, L"Security Log", L"Security");
1592  ApplyEventlogSettings(hSecurityInf, L"System Log", L"System");
1593 
1594  ApplyPasswordSettings(hSecurityInf, L"System Access");
1595  ApplyLockoutSettings(hSecurityInf, L"System Access");
1596  ApplyAccountSettings(hSecurityInf, L"System Access");
1597 
1598  ApplyAuditEvents(hSecurityInf);
1599 
1600  SetupCloseInfFile(hSecurityInf);
1601  }
1602 
1603  /* Hack */
1604  SetPrimaryDomain(L"WORKGROUP", NULL);
1605 }
static VOID ApplyAuditEvents(_In_ HINF hSecurityInf)
Definition: security.c:1430
static VOID InstallPrivileges(HINF hSecurityInf)
Definition: security.c:297
#define INF_STYLE_WIN4
Definition: infsupp.h:41
uint16_t * PWSTR
Definition: typedefs.h:56
static VOID InstallBuiltinAccounts(VOID)
Definition: security.c:237
static VOID ApplyPasswordSettings(_In_ HINF hSecurityInf, _In_ PWSTR pszSectionName)
Definition: security.c:784
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
static const WCHAR L[]
Definition: oid.c:1250
static VOID ApplyLockoutSettings(_In_ HINF hSecurityInf, _In_ PWSTR pszSectionName)
Definition: security.c:991
static VOID ApplyRegistryValues(HINF hSecurityInf)
Definition: security.c:441
#define NULL
Definition: types.h:112
static VOID ApplyAccountSettings(_In_ HINF hSecurityInf, _In_ PWSTR pszSectionName)
Definition: security.c:1331
static NTSTATUS SetPrimaryDomain(LPCWSTR DomainName, PSID DomainSid)
Definition: security.c:153
static VOID ApplyEventlogSettings(_In_ HINF hSecurityInf, _In_ PWSTR pszSectionName, _In_ PWSTR pszLogName)
Definition: security.c:640

Referenced by InstallReactOS().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 2728 of file wizard.c.

2729 {
2730  PROPSHEETHEADER psh = {0};
2731  HPROPSHEETPAGE *phpage = NULL;
2732  PROPSHEETPAGE psp = {0};
2733  UINT nPages = 0;
2734  HWND hWnd;
2735  MSG msg;
2736  PSETUPDATA pSetupData = NULL;
2737  HMODULE hNetShell = NULL;
2739  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
2740 
2741  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2742 
2743  /* Allocate setup data */
2744  pSetupData = HeapAlloc(GetProcessHeap(),
2746  sizeof(SETUPDATA));
2747  if (pSetupData == NULL)
2748  {
2749  LogItem(NULL, L"SetupData allocation failed!");
2750  MessageBoxW(NULL,
2751  L"Setup failed to allocate global data!",
2752  L"ReactOS Setup",
2753  MB_ICONERROR | MB_OK);
2754  goto done;
2755  }
2756  pSetupData->ProductOption = PRODUCT_OPTION_DEFAULT;
2757 
2758  hNetShell = LoadLibraryW(L"netshell.dll");
2759  if (hNetShell != NULL)
2760  {
2761  DPRINT("Netshell.dll loaded!\n");
2762 
2763  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2764  "NetSetupRequestWizardPages");
2765  if (pfn != NULL)
2766  {
2767  pfn(&dwNetworkPageCount, NULL, NULL);
2768  dwPageCount += dwNetworkPageCount;
2769  }
2770  }
2771 
2772  DPRINT("PageCount: %lu\n", dwPageCount);
2773 
2774  phpage = HeapAlloc(GetProcessHeap(),
2776  dwPageCount * sizeof(HPROPSHEETPAGE));
2777  if (phpage == NULL)
2778  {
2779  LogItem(NULL, L"Page array allocation failed!");
2780  MessageBoxW(NULL,
2781  L"Setup failed to allocate page array!",
2782  L"ReactOS Setup",
2783  MB_ICONERROR | MB_OK);
2784  goto done;
2785  }
2786 
2787  /* Process the $winnt$.inf setup file */
2788  ProcessSetupInf(pSetupData);
2789 
2790  /* Create the Welcome page */
2791  psp.dwSize = sizeof(PROPSHEETPAGE);
2792  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2793  psp.hInstance = hDllInstance;
2794  psp.lParam = (LPARAM)pSetupData;
2795  psp.pfnDlgProc = WelcomeDlgProc;
2796  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2797  phpage[nPages++] = CreatePropertySheetPage(&psp);
2798 
2799  /* Create the Acknowledgements page */
2800  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2801  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2802  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2803  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2804  psp.pfnDlgProc = AckPageDlgProc;
2805  phpage[nPages++] = CreatePropertySheetPage(&psp);
2806 
2807  /* Create the Product page */
2808  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2809  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
2810  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
2811  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
2812  psp.pfnDlgProc = ProductPageDlgProc;
2813  phpage[nPages++] = CreatePropertySheetPage(&psp);
2814 
2815  /* Create the Locale page */
2816  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2817  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2818  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2819  psp.pfnDlgProc = LocalePageDlgProc;
2820  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2821  phpage[nPages++] = CreatePropertySheetPage(&psp);
2822 
2823  /* Create the Owner page */
2824  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2825  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2826  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2827  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2828  psp.pfnDlgProc = OwnerPageDlgProc;
2829  phpage[nPages++] = CreatePropertySheetPage(&psp);
2830 
2831  /* Create the Computer page */
2832  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2833  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2834  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2835  psp.pfnDlgProc = ComputerPageDlgProc;
2836  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2837  phpage[nPages++] = CreatePropertySheetPage(&psp);
2838 
2839  /* Create the DateTime page */
2840  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2841  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2842  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2843  psp.pfnDlgProc = DateTimePageDlgProc;
2844  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2845  phpage[nPages++] = CreatePropertySheetPage(&psp);
2846 
2847  /* Create the theme selection page */
2848  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2849  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2850  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2851  psp.pfnDlgProc = ThemePageDlgProc;
2852  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2853  phpage[nPages++] = CreatePropertySheetPage(&psp);
2854 
2857 
2858  if (pfn)
2859  {
2860  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2861  nPages += dwNetworkPageCount;
2862  }
2863 
2864  /* Create the Process page */
2865  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2866  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2867  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2868  psp.pfnDlgProc = ProcessPageDlgProc;
2869  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2870  phpage[nPages++] = CreatePropertySheetPage(&psp);
2871 
2872  /* Create the Finish page */
2873  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2874  psp.pfnDlgProc = FinishDlgProc;
2875  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2876  phpage[nPages++] = CreatePropertySheetPage(&psp);
2877 
2878  ASSERT(nPages == dwPageCount);
2879 
2880  /* Create the property sheet */
2881  psh.dwSize = sizeof(PROPSHEETHEADER);
2882  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2883  psh.hInstance = hDllInstance;
2884  psh.hwndParent = NULL;
2885  psh.nPages = nPages;
2886  psh.nStartPage = 0;
2887  psh.phpage = phpage;
2888  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
2889  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
2890 
2891  /* Create title font */
2892  pSetupData->hTitleFont = CreateTitleFont();
2893  pSetupData->hBoldFont = CreateBoldFont();
2894 
2895  /* Display the wizard */
2896  hWnd = (HWND)PropertySheet(&psh);
2898 
2899  while (GetMessage(&msg, NULL, 0, 0))
2900  {
2901  if (!IsDialogMessage(hWnd, &msg))
2902  {
2904  DispatchMessage(&msg);
2905  }
2906  }
2907 
2908  DeleteObject(pSetupData->hBoldFont);
2909  DeleteObject(pSetupData->hTitleFont);
2910 
2911  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2912  SetupCloseInfFile(pSetupData->hSetupInf);
2913 
2914 done:
2915  if (phpage != NULL)
2916  HeapFree(GetProcessHeap(), 0, phpage);
2917 
2918  if (hNetShell != NULL)
2919  FreeLibrary(hNetShell);
2920 
2921  if (pSetupData != NULL)
2922  HeapFree(GetProcessHeap(), 0, pSetupData);
2923 
2924  LogItem(L"END_SECTION", L"InstallWizard");
2925 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2076
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:104
#define IDD_PRODUCT
Definition: resource.h:95
#define IDS_PROCESSTITLE
Definition: resource.h:84
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:204
#define IDS_ACKSUBTITLE
Definition: resource.h:101
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:93
#define IDD_COMPUTERPAGE
Definition: resource.h:49
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1217
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:288
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:119
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2595
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:924
HANDLE HWND
Definition: compat.h:19
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1703
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:113
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSH_MODELESS
Definition: prsht.h:50
#define IsDialogMessage
Definition: winuser.h:5784
#define IDB_HEADER
Definition: resource.h:30
#define IDD_OWNERPAGE
Definition: resource.h:45
HINF hSetupInf
Definition: syssetup.h:56
#define IDD_PROCESSPAGE
Definition: resource.h:54
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:2725
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:118
#define IDS_COMPUTERTITLE
Definition: resource.h:106
#define IDS_DATETIMETITLE
Definition: resource.h:112
#define IDS_ACKTITLE
Definition: resource.h:100
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:159
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1584
#define LoadLibraryW(x)
Definition: compat.h:606
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:114
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:399
static HINSTANCE hDllInstance
Definition: clb.c:30
#define PSP_DEFAULT
Definition: prsht.h:22
#define IDD_ACKPAGE
Definition: resource.h:41
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:679
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ASSERT(a)
Definition: mode.c:44
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define MB_ICONERROR
Definition: winuser.h:781
#define IDD_FINISHPAGE
Definition: resource.h:34
static INT_PTR CALLBACK FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2211
#define IDS_PRODUCTTITLE
Definition: resource.h:158
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:543
HFONT hBoldFont
Definition: syssetup.h:37
#define IDS_OWNERTITLE
Definition: resource.h:103
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define GetMessage
Definition: winuser.h:5765
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:107
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:400
#define GetProcAddress(x, y)
Definition: compat.h:612
HFONT hTitleFont
Definition: reactos.h:117
#define DPRINT
Definition: sndvol32.h:71
#define IDS_LOCALESUBTITLE
Definition: resource.h:110
#define IDS_LOCALETITLE
Definition: resource.h:109
#define HeapFree(x, y, z)
Definition: compat.h:594
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IDD_THEMEPAGE
Definition: resource.h:75
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by InstallReactOS().

◆ RegisterTypeLibraries()

BOOL RegisterTypeLibraries ( HINF  hinf,
LPCWSTR  szSection 
)

Definition at line 433 of file install.c.

434 {
435  INFCONTEXT InfContext;
436  BOOL res;
439  INT csidl;
440  LPWSTR p;
441  HMODULE hmod;
442  HRESULT hret;
443 
444  /* Begin iterating the entries in the inf section */
445  res = SetupFindFirstLine(hinf, szSection, NULL, &InfContext);
446  if (!res) return FALSE;
447 
448  do
449  {
450  /* Get the name of the current type library */
451  if (!SetupGetStringFieldW(&InfContext, 1, szName, ARRAYSIZE(szName), NULL))
452  {
453  FatalError("SetupGetStringFieldW failed\n");
454  continue;
455  }
456 
457  if (!SetupGetIntField(&InfContext, 2, &csidl))
458  csidl = CSIDL_SYSTEM;
459 
460  hret = SHGetFolderPathW(NULL, csidl, NULL, 0, szPath);
461  if (FAILED(hret))
462  {
463  FatalError("SHGetFolderPathW failed hret=0x%lx\n", hret);
464  continue;
465  }
466 
468  wcscpy(p, szName);
469 
471  if (hmod == NULL)
472  {
473  FatalError("LoadLibraryW failed\n");
474  continue;
475  }
476 
478 
479  } while (SetupFindNextLine(&InfContext, &InfContext));
480 
481  return TRUE;
482 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define SetupFindFirstLine
Definition: setupapi.h:2619
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PathAddBackslash
Definition: shlwapi.h:783
#define LoadLibraryW(x)
Definition: compat.h:606
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define MAX_PATH
Definition: compat.h:34
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
LPCWSTR szPath
Definition: env.c:37
#define NULL
Definition: types.h:112
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2447
static const WCHAR szName[]
Definition: msipriv.h:1194
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:146
GLuint res
Definition: glext.h:9613
#define CSIDL_SYSTEM
Definition: shlobj.h:2048
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static VOID FatalError(char *pszFmt,...)
Definition: install.c:53
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by InstallLiveCD(), and RegistrationProc().

◆ SetAdministratorPassword()

NTSTATUS SetAdministratorPassword ( LPCWSTR  Password)

Definition at line 1609 of file security.c.

1610 {
1611  PPOLICY_ACCOUNT_DOMAIN_INFO OrigInfo = NULL;
1612  PUSER_ACCOUNT_NAME_INFORMATION AccountNameInfo = NULL;
1613  USER_SET_PASSWORD_INFORMATION PasswordInfo;
1615  LSA_HANDLE PolicyHandle = NULL;
1616  SAM_HANDLE ServerHandle = NULL;
1617  SAM_HANDLE DomainHandle = NULL;
1618  SAM_HANDLE UserHandle = NULL;
1619  NTSTATUS Status;
1620 
1621  DPRINT("SYSSETUP: SetAdministratorPassword(%p)\n", Password);
1622 
1625 
1629  &PolicyHandle);
1630  if (Status != STATUS_SUCCESS)
1631  {
1632  DPRINT1("LsaOpenPolicy() failed (Status: 0x%08lx)\n", Status);
1633  return Status;
1634  }
1635 
1636  Status = LsaQueryInformationPolicy(PolicyHandle,
1638  (PVOID *)&OrigInfo);
1639  if (!NT_SUCCESS(Status))
1640  {
1641  DPRINT1("LsaQueryInformationPolicy() failed (Status: 0x%08lx)\n", Status);
1642  goto done;
1643  }
1644 
1646  &ServerHandle,
1648  NULL);
1649  if (!NT_SUCCESS(Status))
1650  {
1651  DPRINT1("SamConnect() failed (Status: 0x%08lx)\n", Status);
1652  goto done;
1653  }
1654 
1655  Status = SamOpenDomain(ServerHandle,
1656  DOMAIN_LOOKUP,
1657  OrigInfo->DomainSid,
1658  &DomainHandle);
1659  if (!NT_SUCCESS(Status))
1660  {
1661  DPRINT1("SamOpenDomain() failed (Status: 0x%08lx)\n", Status);
1662  goto done;
1663  }
1664 
1665  Status = SamOpenUser(DomainHandle,
1668  &UserHandle);
1669  if (!NT_SUCCESS(Status))
1670  {
1671  DPRINT1("SamOpenUser() failed (Status %08lx)\n", Status);
1672  goto done;
1673  }
1674 
1675  RtlInitUnicodeString(&PasswordInfo.Password, Password);
1676  PasswordInfo.PasswordExpired = FALSE;
1677 
1678  Status = SamSetInformationUser(UserHandle,
1680  &PasswordInfo);
1681  if (!NT_SUCCESS(Status))
1682  {
1683  DPRINT1("SamSetInformationUser() failed (Status %08lx)\n", Status);
1684  goto done;
1685  }
1686 
1687  Status = SamQueryInformationUser(UserHandle,
1689  (PVOID*)&AccountNameInfo);
1690  if (!NT_SUCCESS(Status))
1691  {
1692  DPRINT1("SamQueryInformationUser() failed (Status 0x%08lx)\n", Status);
1693  goto done;
1694  }
1695 
1696  AdminInfo.Name = RtlAllocateHeap(RtlGetProcessHeap(),
1698  AccountNameInfo->UserName.Length + sizeof(WCHAR));
1699  if (AdminInfo.Name != NULL)
1701  AccountNameInfo->UserName.Buffer,
1702  AccountNameInfo->UserName.Length);
1703 
1704  AdminInfo.Domain = RtlAllocateHeap(RtlGetProcessHeap(),
1706  OrigInfo->DomainName.Length + sizeof(WCHAR));
1707  if (AdminInfo.Domain != NULL)
1709  OrigInfo->DomainName.Buffer,
1710  OrigInfo->DomainName.Length);
1711 
1712  AdminInfo.Password = RtlAllocateHeap(RtlGetProcessHeap(),
1713  0,
1714  (wcslen(Password) + 1) * sizeof(WCHAR));
1715  if (AdminInfo.Password != NULL)
1717 
1718  DPRINT("Administrator Name: %S\n", AdminInfo.Name);
1719  DPRINT("Administrator Domain: %S\n", AdminInfo.Domain);
1720  DPRINT("Administrator Password: %S\n", AdminInfo.Password);
1721 
1722 done:
1723  if (AccountNameInfo != NULL)
1724  SamFreeMemory(AccountNameInfo);
1725 
1726  if (OrigInfo != NULL)
1727  LsaFreeMemory(OrigInfo);
1728 
1729  if (PolicyHandle != NULL)
1730  LsaClose(PolicyHandle);
1731 
1732  if (UserHandle != NULL)
1733  SamCloseHandle(UserHandle);
1734 
1735  if (DomainHandle != NULL)
1736  SamCloseHandle(DomainHandle);
1737 
1738  if (ServerHandle != NULL)
1739  SamCloseHandle(ServerHandle);
1740 
1741  DPRINT1("SYSSETUP: SetAdministratorPassword() done (Status %08lx)\n", Status);
1742 
1743  return Status;
1744 }
NTSTATUS NTAPI SamCloseHandle(IN SAM_HANDLE SamHandle)
Definition: samlib.c:497
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define SAM_SERVER_CONNECT
Definition: ntsam.h:99
NTSTATUS WINAPI LsaQueryInformationPolicy(IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
Definition: lsa.c:1471
#define POLICY_VIEW_LOCAL_INFORMATION
Definition: ntsecapi.h:61
ADMIN_INFO AdminInfo
Definition: install.c:38
NTSTATUS NTAPI SamOpenDomain(IN SAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PSID DomainId, OUT PSAM_HANDLE DomainHandle)
Definition: samlib.c:1477
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
Definition: lsa.c:192
LPWSTR Name
Definition: globals.h:23
UNICODE_STRING UserName
Definition: ntsam.h:623
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:1181
#define USER_READ_GENERAL
Definition: ntsam.h:126
#define FALSE
Definition: types.h:117
#define DOMAIN_USER_RID_ADMIN
Definition: setypes.h:603
#define USER_FORCE_PASSWORD_CHANGE
Definition: ntsam.h:133
UNICODE_STRING Password
Definition: ntsam.h:664
#define SAM_SERVER_LOOKUP_DOMAIN
Definition: ntsam.h:104
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
Definition: lsa.c:699
NTSTATUS NTAPI SamSetInformationUser(IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PVOID Buffer)
Definition: samlib.c:2000
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
Status
Definition: gdiplustypes.h:24
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define POLICY_TRUST_ADMIN
Definition: ntsecapi.h:64
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
NTSTATUS NTAPI SamFreeMemory(IN PVOID Buffer)
Definition: samlib.c:983
LPWSTR Password
Definition: globals.h:25
struct _LSA_OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LSA_UNICODE_STRING DomainName
Definition: ntsecapi.h:566
#define DPRINT1
Definition: precomp.h:8
LPWSTR Domain
Definition: globals.h:24
#define DOMAIN_LOOKUP
Definition: ntsam.h:42
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
NTSTATUS NTAPI SamQueryInformationUser(IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PVOID *Buffer)
Definition: samlib.c:1731
#define memset(x, y, z)
Definition: compat.h:39
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 SamOpenUser(IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT PSAM_HANDLE UserHandle)
Definition: samlib.c:1535

Referenced by ComputerPageDlgProc().

◆ SetAutoAdminLogon()

VOID SetAutoAdminLogon ( VOID  )

Definition at line 1748 of file security.c.

1749 {
1750  WCHAR szAutoAdminLogon[2];
1751  HKEY hKey = NULL;
1752  DWORD dwType;
1753  DWORD dwSize;
1754  LONG lError;
1755 
1757  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1758  0,
1759  KEY_READ | KEY_WRITE,
1760  &hKey);
1761  if (lError != ERROR_SUCCESS)
1762  return;
1763 
1764  dwSize = 2 * sizeof(WCHAR);
1765  lError = RegQueryValueExW(hKey,
1766  L"AutoAdminLogon",
1767  NULL,
1768  &dwType,
1769  (LPBYTE)szAutoAdminLogon,
1770  &dwSize);
1771  if (lError != ERROR_SUCCESS)
1772  goto done;
1773 
1774  if (wcscmp(szAutoAdminLogon, L"1") == 0)
1775  {
1777  L"DefaultDomainName",
1778  0,
1779  REG_SZ,
1781  (wcslen(AdminInfo.Domain) + 1) * sizeof(WCHAR));
1782 
1784  L"DefaultUserName",
1785  0,
1786  REG_SZ,
1788  (wcslen(AdminInfo.Name) + 1) * sizeof(WCHAR));
1789 
1791  L"DefaultPassword",
1792  0,
1793  REG_SZ,
1795  (wcslen(AdminInfo.Password) + 1) * sizeof(WCHAR));
1796  }
1797 
1798 done:
1799  if (hKey != NULL)
1800  RegCloseKey(hKey);
1801 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
ADMIN_INFO AdminInfo
Definition: install.c:38
LPWSTR Name
Definition: globals.h:23
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
long LONG
Definition: pedump.c:60
#define KEY_WRITE
Definition: nt_native.h:1031
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:4895
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR Password
Definition: globals.h:25
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LPWSTR Domain
Definition: globals.h:24
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by InstallReactOS().

Variable Documentation

◆ AdminInfo

ADMIN_INFO AdminInfo

Definition at line 38 of file install.c.

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

◆ hDllInstance

HINSTANCE hDllInstance

Definition at line 17 of file browser.c.

◆ hSysSetupInf