ReactOS  0.4.15-dev-5499-g1341c38
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 
23 static HDC
25 {
26  HDC hdcMem;
27 
28  hdcMem = NT5_DrawBaseBackground(hdcDesktop);
29 
30  return hdcMem;
31 }
32 
33 static VOID
35 {
36  /* Draw the logoff icon */
37  NT5_CreateLogoffScreen(L"Saving your settings...", hdcMem);
38 }
39 
40 #if 0
41 static ULONG
43 {
44  UINT i, Length;
45  ULONG Value;
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 
65 static ULONG
66 GetULONG2(LPWSTR String1, LPWSTR String2, PINT i)
67 {
68  ULONG Value;
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 
87 static BOOL
89 {
90  return TRUE;
91 }
92 
93 static 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 */
128  DeleteDC(hdcMem);
129  }
130 
131  /* Release the desktop DC */
132  ReleaseDC(hDesktopWnd, hdcDesktop);
133  }
134 }
135 
136 int 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
#define IN
Definition: typedefs.h:39
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct _INFO * PINFO
#define TRUE
Definition: types.h:120
static HDC
Definition: imagelist.c:92
static VOID Run(VOID)
Definition: logonui.c:94
HINSTANCE hInstance
Definition: logonui.h:8
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define argv
Definition: mplay32.c:18
INT cx
Definition: logonui.h:9
int32_t INT
Definition: typedefs.h:58
#define SM_CXSCREEN
Definition: winuser.h:953
#define L(x)
Definition: ntvdm.h:50
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
static HDC DrawBaseBackground(HDC hdcDesktop)
Definition: logonui.c:24
unsigned int BOOL
Definition: ntddk_ex.h:94
INT cy
Definition: logonui.h:10
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:80
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
#define SM_CYSCREEN
Definition: winuser.h:954
int * PINT
Definition: windef.h:177
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WINAPI
Definition: msvc.h:6
int WINAPI GetSystemMetrics(_In_ int)
VOID NT5_CreateLogoffScreen(LPWSTR lpText, HDC hdcMem)
Definition: NT5design.c:125
#define DCX_CACHE
Definition: winuser.h:2104
static VOID DrawLogoffScreen(HDC hdcMem)
Definition: logonui.c:34
HINSTANCE hInst
Definition: dxdiag.c:13
Definition: precomp.h:83
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
PINFO g_pInfo
Definition: logonui.c:17
BOOL WINAPI DeleteDC(_In_ HDC)
HDC NT5_DrawBaseBackground(HDC hdcDesktop)
Definition: NT5design.c:136
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define INFO(fmt,...)
Definition: debug.h:13
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ const STRING * String2
Definition: rtlfuncs.h:2345
static BOOL ParseCmdline(int argc, WCHAR *argv[])
Definition: logonui.c:88
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static ULONG GetULONG(_In_z_ LPWSTR String)
Definition: tracert.cpp:157
#define HeapFree(x, y, z)
Definition: compat.h:735
#define SRCCOPY
Definition: wingdi.h:333
HDC hdcMem
Definition: welcome.c:104
static VOID NTAPI 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:49
int WINAPI wWinMain(IN HINSTANCE hInst, IN HINSTANCE hPrevInstance, IN LPWSTR lpszCmdLine, IN int nCmdShow)
Definition: logonui.c:137