ReactOS 0.4.15-dev-7931-gfd331f1
logonui.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Logon User Interface Host
4 * FILE: base/system/logonui/logonui.c
5 * PROGRAMMERS: Ged Murphy (gedmurphy@reactos.org)
6 */
7
8#include "logonui.h"
9
10/* DATA **********************************************************************/
11
12
13
14
15/* GLOBALS ******************************************************************/
16
18
19
20/* FUNCTIONS ****************************************************************/
21
22
23static HDC
25{
26 HDC hdcMem;
27
28 hdcMem = NT5_DrawBaseBackground(hdcDesktop);
29
30 return hdcMem;
31}
32
33static VOID
35{
36 /* Draw the logoff icon */
37 NT5_CreateLogoffScreen(L"Saving your settings...", hdcMem);
38}
39
40#if 0
41static ULONG
43{
44 UINT i, Length;
46 LPWSTR StopString;
47
48 i = 0;
49 /* Get the string length */
51
52 /* Check the string only consists of numbers */
53 while ((i < Length) && ((String[i] < L'0') || (String[i] > L'9'))) i++;
54 if ((i >= Length) || ((String[i] < L'0') || (String[i] > L'9')))
55 {
56 return (ULONG)-1;
57 }
58
59 /* Convert it */
60 Value = wcstoul(&String[i], &StopString, 10);
61
62 return Value;
63}
64
65static ULONG
66GetULONG2(LPWSTR String1, LPWSTR String2, PINT i)
67{
69
70 /* Check the first string value */
71 Value = GetULONG(String1);
72 if (Value == (ULONG)-1)
73 {
74 /* Check the second string value isn't a switch */
75 if (String2[0] != L'-')
76 {
77 /* Check the value */
79 *i += 1;
80 }
81 }
82
83 return Value;
84}
85#endif
86
87static BOOL
89{
90 return TRUE;
91}
92
93static VOID
95{
96 HWND hDesktopWnd;
97 HDC hdcDesktop, hdcMem;
98
99 /* Get the screen size */
102
103 hDesktopWnd = GetDesktopWindow();
104
105 /* Get the DC for the desktop */
106 hdcDesktop = GetDCEx(hDesktopWnd, NULL, DCX_CACHE);
107 if (hdcDesktop)
108 {
109 /* Initialize the base background onto a DC */
110 hdcMem = DrawBaseBackground(hdcDesktop);
111 if (hdcMem)
112 {
113 /* TEST : Draw logoff screen */
115
116 /* Blit the off-screen DC to the desktop */
117 BitBlt(hdcDesktop,
118 0,
119 0,
120 g_pInfo->cx,
121 g_pInfo->cy,
122 hdcMem,
123 0,
124 0,
125 SRCCOPY);
126
127 /* Delete the memory DC */
129 }
130
131 /* Release the desktop DC */
132 ReleaseDC(hDesktopWnd, hdcDesktop);
133 }
134}
135
136int WINAPI
138 IN HINSTANCE hPrevInstance,
139 IN LPWSTR lpszCmdLine,
140 IN int nCmdShow)
141{
142 LPWSTR *lpArgs;
143 INT NumArgs;
144
145 /* Allocate memory for the data */
148 sizeof(INFO));
149 if (!g_pInfo) return -1;
150
152
153 /* Get the command line args */
154 lpArgs = CommandLineToArgvW(lpszCmdLine, &NumArgs);
155 if (lpArgs)
156 {
157 /* Parse the command line */
158 if (ParseCmdline(NumArgs, lpArgs))
159 {
160 /* Start the main routine */
161 Run();
162 }
163 }
164
165 /* Free the data */
167 0,
168 g_pInfo);
169
170 return 0;
171}
172
173/* EOF */
static int argc
Definition: ServiceArgs.c:12
struct _INFO * PINFO
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
#define INFO
Definition: debug.h:89
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
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
_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)
static BOOL ParseCmdline(int argc, WCHAR *argv[])
Definition: logonui.c:88
static HDC DrawBaseBackground(HDC hdcDesktop)
Definition: logonui.c:24
PINFO g_pInfo
Definition: logonui.c:17
static VOID DrawLogoffScreen(HDC hdcMem)
Definition: logonui.c:34
int WINAPI wWinMain(IN HINSTANCE hInst, IN HINSTANCE hPrevInstance, IN LPWSTR lpszCmdLine, IN int nCmdShow)
Definition: logonui.c:137
HDC NT5_DrawBaseBackground(HDC hdcDesktop)
Definition: NT5design.c:136
VOID NT5_CreateLogoffScreen(LPWSTR lpText, HDC hdcMem)
Definition: NT5design.c:125
static HDC
Definition: imagelist.c:92
#define argv
Definition: mplay32.c:18
unsigned int UINT
Definition: ndis.h:50
_In_ const STRING * String2
Definition: rtlfuncs.h:2357
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:80
Definition: precomp.h:84
INT cx
Definition: logonui.h:9
HINSTANCE hInstance
Definition: logonui.h:8
INT cy
Definition: logonui.h:10
static ULONG GetULONG(_In_z_ LPWSTR String)
Definition: tracert.cpp:157
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
struct tagRun Run
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
HDC hdcMem
Definition: welcome.c:104
int * PINT
Definition: windef.h:177
#define WINAPI
Definition: msvc.h:6
#define SRCCOPY
Definition: wingdi.h:333
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define DCX_CACHE
Definition: winuser.h:2114
#define SM_CYSCREEN
Definition: winuser.h:960
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SM_CXSCREEN
Definition: winuser.h:959
int WINAPI GetSystemMetrics(_In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184