mirror of
https://github.com/reactos/reactos.git
synced 2026-06-02 17:31:23 +08:00
Using `userenv!CreateEnvironmentBlock()` when starting the shell ensures that, even if it's started as LocalSystem, its environment inherits the "dynamical" environment variables created by SMSS at runtime (stored in `HKLM\SYSTEM\CurrentControlSet\Session Manager\Environment`). In ReactOS/Windows PE "MiniNT" mode, the Winlogon environment doesn't contain these values, and doesn't start the Setup with this augmented environment. (This is compatible with what Windows does, on WinPE or during a clean installation.) Winlogon creates an augmented environment only when a user logs in and starts its shell (standard boot), which isn't the case in "MiniNT" mode. It is thus the responsibility of the module that starts the shell instead to do it: in ReactOS' case, userinit.exe in LiveCD mode. As a result, we get access to the `COMPUTERNAME`, `NUMBER_OF_PROCESSORS`, `OS`, and `PROCESSOR_*` environment variables, amongst others.
13 lines
371 B
CMake
13 lines
371 B
CMake
|
|
list(APPEND SOURCE
|
|
livecd.c
|
|
userinit.c
|
|
userinit.h)
|
|
|
|
add_executable(userinit ${SOURCE} userinit.rc)
|
|
target_link_libraries(userinit wine)
|
|
set_module_type(userinit win32gui UNICODE)
|
|
add_importlibs(userinit advapi32 userenv gdi32 user32 msvcrt kernel32 ntdll)
|
|
add_pch(userinit userinit.h SOURCE)
|
|
add_cd_file(TARGET userinit DESTINATION reactos/system32 FOR all)
|