ReactOS 0.4.17-dev-683-g0dafdc5
userinit.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winreg.h>
#include <regstr.h>
#include <winnls.h>
#include <winuser.h>
#include <undocuser.h>
#include <strsafe.h>
#include <ndk/exfuncs.h>
#include <wine/debug.h>
#include "resource.h"
Include dependency graph for userinit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IMGINFO
 
struct  STATE
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 

Typedefs

typedef struct _IMGINFO IMGINFO
 
typedef struct _IMGINFOPIMGINFO
 
typedef struct STATEPSTATE
 

Enumerations

enum  PAGESTATE { LOCALEPAGE , STARTPAGE , DONE }
 
enum  RUN { SHELL , INSTALLER , REBOOT }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (userinit)
 
BOOL IsMiniNT (VOID)
 Check whether we are running in MiniNT mode (e.g. live medium).
 
VOID RunLiveCD (PSTATE State)
 

Variables

HINSTANCE hInstance
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 12 of file userinit.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 13 of file userinit.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 11 of file userinit.h.

Typedef Documentation

◆ IMGINFO

◆ PIMGINFO

◆ PSTATE

typedef struct STATE * PSTATE

Enumeration Type Documentation

◆ PAGESTATE

Enumerator
LOCALEPAGE 
STARTPAGE 
DONE 

Definition at line 33 of file userinit.h.

34{
37 DONE
38} PAGESTATE;
PAGESTATE
Definition: userinit.h:34
@ LOCALEPAGE
Definition: userinit.h:35
@ DONE
Definition: userinit.h:37
@ STARTPAGE
Definition: userinit.h:36

◆ RUN

Enumerator
SHELL 
INSTALLER 
REBOOT 

Definition at line 40 of file userinit.h.

41{
42 SHELL,
44 REBOOT
45} RUN;
RUN
Definition: userinit.h:41
@ REBOOT
Definition: userinit.h:44
@ INSTALLER
Definition: userinit.h:43
@ SHELL
Definition: userinit.h:42

Function Documentation

◆ IsMiniNT()

BOOL IsMiniNT ( VOID  )

Check whether we are running in MiniNT mode (e.g. live medium).

Definition at line 110 of file livecd.c.

111{
112 HKEY hKey;
113 LONG rc;
114
115 /* Check for the presence of the "MiniNT" registry key */
117 L"SYSTEM\\CurrentControlSet\\Control\\MiniNT",
118 0,
120 &hKey);
121 if (rc == ERROR_SUCCESS)
123
124 return (rc == ERROR_SUCCESS);
125}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define L(x)
Definition: resources.c:13
FxAutoRegKey hKey
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
long LONG
Definition: pedump.c:60
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ RunLiveCD()

VOID RunLiveCD ( PSTATE  State)

Definition at line 988 of file livecd.c.

990{
991 LIVECD_UNATTEND Unattend = {0};
992 WCHAR UnattendInf[MAX_PATH];
993
994 /* Try to locate the ReactOS Installer */
995 if (!ExpandInstallerPath(L"reactos.exe", Installer, _countof(Installer)))
997 if (*Installer)
998 TRACE("ReactOS Installer: '%S'\n", Installer);
999 else
1000 WARN("Could not find the ReactOS Installer\n");
1001
1002 /* If the ReactOS Installer was located, use its path for the
1003 * unattended file; otherwise, use the current ReactOS directory. */
1004 StringCchCopyW(UnattendInf, _countof(UnattendInf), Installer);
1005 if (*UnattendInf)
1006 {
1007 /* Find the last path separator and truncate the path there.
1008 * If there is none, NUL the path. */
1009 PWCHAR ptr = wcsrchr(UnattendInf, L'\\');
1010 if (!ptr)
1011 ptr = UnattendInf;
1012 *ptr = UNICODE_NULL;
1013 }
1014 if (!*UnattendInf)
1015 {
1016 /* No actual path was found, fall back to the ReactOS directory */
1017 GetWindowsDirectoryW(UnattendInf, _countof(UnattendInf));
1018 }
1019 StringCchCatW(UnattendInf, _countof(UnattendInf), L"\\unattend.inf");
1020 ParseUnattend(UnattendInf, &Unattend);
1021 pState->Unattend = &Unattend;
1022
1023 InitLogo(&pState->ImageInfo, NULL);
1024
1025 while (pState->NextPage != DONE)
1026 {
1027 switch (pState->NextPage)
1028 {
1029 case LOCALEPAGE:
1032 NULL,
1034 (LPARAM)pState);
1035 break;
1036
1037 case STARTPAGE:
1040 NULL,
1042 (LPARAM)pState);
1043 break;
1044
1045 default:
1046 break;
1047 }
1048 }
1049
1050 DeleteObject(pState->ImageInfo.hBitmap);
1051}
#define IDD_STARTPAGE
Definition: resource.h:27
#define WARN(fmt,...)
Definition: precomp.h:61
#define IDD_LOCALEPAGE
Definition: resource.h:13
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
#define wcsrchr
Definition: compat.h:16
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2271
pKey DeleteObject()
static INT_PTR CALLBACK LocaleDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: livecd.c:583
static BOOL ExpandInstallerPath(_In_ PCWSTR pInstallerName, _Out_writes_z_(PathSize) PWSTR pInstallerPath, _In_ SIZE_T PathSize)
Expands the path for the ReactOS Installer "reactos.exe". See also base/setup/welcome/welcome....
Definition: livecd.c:868
WCHAR Installer[MAX_PATH]
Definition: livecd.c:14
static VOID ParseUnattend(_In_ LPCWSTR UnattendInf, _Out_ LIVECD_UNATTEND *pUnattend)
Definition: livecd.c:814
static INT_PTR CALLBACK StartDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: livecd.c:719
static VOID InitLogo(PIMGINFO pImgInfo, HWND hwndDlg)
Definition: livecd.c:27
LONG_PTR LPARAM
Definition: minwindef.h:175
static PVOID ptr
Definition: dispmode.c:27
#define UNICODE_NULL
short WCHAR
Definition: pedump.c:58
#define DONE
Definition: rnr20lib.h:14
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
uint16_t * PWCHAR
Definition: typedefs.h:56
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by wWinMain().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( userinit  )

Variable Documentation

◆ hInstance

HINSTANCE hInstance
extern

Definition at line 19 of file charmap.c.