29#define CMP_MAGIC 0x01234567
54 WARN(
"RegQueryValueEx(%s) failed with error %lu\n",
debugstr_w(pszKey), rc);
59 WARN(
"Wrong registry data type (%u vs %u)\n", dwType,
REG_SZ);
71 WARN(
"RegQueryValueEx(%s) failed with error %lu\n",
debugstr_w(pszKey), rc);
101 WARN(
"RegOpenKeyEx() failed with error %lu\n", rc);
105 rc =
ReadRegSzKey(ControlKey,
L"SystemStartOptions", &SystemStartOptions);
108 WARN(
"ReadRegSzKey() failed with error %lu\n", rc);
113 CurrentOption = SystemStartOptions;
114 while (CurrentOption)
119 if (
_wcsicmp(CurrentOption,
L"CONSOLE") == 0)
121 TRACE(
"Found 'CONSOLE' boot option\n");
129 if (ControlKey !=
NULL)
132 TRACE(
"IsConsoleShell() returning %d\n",
ret);
147 TRACE(
"(%p, %p)\n", CommandLine, hRootKey);
149 rc =
RegOpenKeyExW(hRootKey,
L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
153 WARN(
"RegOpenKeyEx() failed with error %lu\n", rc);
159 ConsoleShell ?
L"ConsoleShell" :
L"Shell",
168 WARN(
"RegQueryValueEx() failed with error %lu\n", rc);
237 L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Option",
254 L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot",
272 TRACE(
"Alternate shell started (Safe Mode)\n");
278 WARN(
"Wrong type %lu (expected %u or %u)\n",
284 WARN(
"Alternate shell in Safe Mode required but not specified.\n");
299 TRACE(
"Started shell from HKEY_CURRENT_USER\n");
306 TRACE(
"Started shell from HKEY_LOCAL_MACHINE\n");
356 L"InactiveTitleText",
362 L"ButtonAlternateFace",
364 L"GradientActiveTitle",
365 L"GradientInactiveTitle",
400 WARN(
"RegOpenKeyEx() failed with error %lu\n", rc);
406 Size =
sizeof(szColor);
416 WARN(
"RegQueryValueEx(%s) failed with error %lu\n",
438 WARN(
"RegOpenKeyEx() failed with error %lu\n", rc);
442 Size =
sizeof(szWallpaper);
462 TRACE(
"No wallpaper set in registry (error %lu)\n", rc);
498 WARN(
"GetProcAddress() failed\n");
507 SIZE_T cchInstallerNameLen;
513 cchInstallerNameLen =
wcslen(lpInstallerName);
514 if (
ARRAYSIZE(Installer) < cchInstallerNameLen)
596 ERR(
"Failed to start the installer '%s', trying alternative.\n",
debugstr_w(Installer));
618 ERR(
"Failed to start the installer '%s'.\n",
debugstr_w(Installer));
639 &
tp.Privileges[0].Luid);
642 tp.PrivilegeCount = 1;
DWORD WINAPI UpdatePerUserSystemParameters(DWORD dw1, DWORD dw2)
#define RC_STRING_MAX_SIZE
#define IDS_INSTALLER_FAIL
#define RegCloseKey(hKey)
CONFIGRET WINAPI CMP_Report_LogOn(_In_ DWORD dwMagic, _In_ DWORD dwProcessId)
#define ERROR_NOT_ENOUGH_MEMORY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define GetProcAddress(x, y)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
static void cleanup(void)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
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)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
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
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
VOID RunLiveCD(PSTATE pState)
static char * NextOption(const char *const ostr)
#define ERROR_FILE_NOT_FOUND
#define PROCESSOR_ARCHITECTURE_IA64
#define PROCESSOR_ARCHITECTURE_ALPHA64
#define PROCESSOR_ARCHITECTURE_ALPHA
#define PROCESSOR_ARCHITECTURE_ARM
#define PROCESSOR_ARCHITECTURE_UNKNOWN
#define PROCESSOR_ARCHITECTURE_SHX
#define PROCESSOR_ARCHITECTURE_MIPS
#define PROCESSOR_ARCHITECTURE_PPC
#define PROCESSOR_ARCHITECTURE_AMD64
#define PROCESSOR_ARCHITECTURE_INTEL
#define FILE_ATTRIBUTE_DIRECTORY
#define REGSTR_PATH_DESKTOP
#define REGSTR_PATH_CURRENT_CONTROL_SET
#define REGSTR_PATH_COLORS
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
WORD wProcessorArchitecture
static BOOL StartInstaller(IN LPCTSTR lpInstallerName)
static BOOL GetShell(OUT WCHAR *CommandLine, IN HKEY hRootKey)
static BOOL StartProcess(IN LPCWSTR CommandLine)
static VOID SetUserSettings(VOID)
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
DWORD(WINAPI * PCMP_REPORT_LOGON)(DWORD, DWORD)
static VOID NotifyLogon(VOID)
const WCHAR g_RegColorNames[][32]
static VOID SetUserWallpaper(VOID)
static BOOL IsConsoleShell(VOID)
LONG ReadRegSzKey(IN HKEY hKey, IN LPCWSTR pszKey, OUT LPWSTR *pValue)
static VOID SetUserSysColors(VOID)
static BOOL StartShell(VOID)
int WINAPI wWinMain(IN HINSTANCE hInst, IN HINSTANCE hPrevInstance, IN LPWSTR lpszCmdLine, IN int nCmdShow)
static COLORREF StrToColorref(IN LPWSTR lpszCol)
#define INVALID_FILE_ATTRIBUTES
static int Shell(const char **args)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define NORMAL_PRIORITY_CLASS
DWORD WINAPI GetLastError(void)
#define STARTF_USESHOWWINDOW
DWORD WINAPI GetCurrentProcessId(void)
_In_ ULONG _In_ ULONG rgb
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define SPI_SETDESKWALLPAPER
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetSysColors(_In_ int cElements, _In_reads_(cElements) CONST INT *lpaElements, _In_reads_(cElements) CONST COLORREF *lpaRgbValues)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED