ReactOS  0.4.14-dev-98-gb0d4763
guisettings.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Console Server DLL
4  * FILE: win32ss/user/winsrv/consrv_new/frontends/gui/guisettings.c
5  * PURPOSE: GUI Terminal Front-End Settings Management
6  * PROGRAMMERS: Johannes Anderwald
7  * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8  */
9 
10 /* INCLUDES *******************************************************************/
11 
12 #include "consrv.h"
13 #include "include/conio.h"
14 #include "include/settings.h"
15 #include "guisettings.h"
16 
17 #define NDEBUG
18 #include <debug.h>
19 
20 
22 
23 /* FUNCTIONS ******************************************************************/
24 
25 BOOL
27  IN LPCWSTR ConsoleTitle,
29 {
30  /*****************************************************
31  * Adapted from ConSrvReadUserSettings in settings.c *
32  *****************************************************/
33 
34  BOOL RetVal = FALSE;
35  HKEY hKey;
36  DWORD dwNumSubKeys = 0;
37  DWORD dwIndex;
38  DWORD dwType;
39  WCHAR szValueName[MAX_PATH];
40  DWORD dwValueName;
41  WCHAR szValue[LF_FACESIZE] = L"\0";
42  DWORD Value;
43  DWORD dwValue;
44 
46  ConsoleTitle,
47  &hKey, KEY_READ,
48  FALSE))
49  {
50  DPRINT("ConSrvOpenUserSettings failed\n");
51  return FALSE;
52  }
53 
54  if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL,
55  &dwNumSubKeys, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
56  {
57  DPRINT("GuiConsoleReadUserSettings: RegQueryInfoKey failed\n");
58  RegCloseKey(hKey);
59  return FALSE;
60  }
61 
62  DPRINT("GuiConsoleReadUserSettings entered dwNumSubKeys %d\n", dwNumSubKeys);
63 
64  for (dwIndex = 0; dwIndex < dwNumSubKeys; dwIndex++)
65  {
66  dwValue = sizeof(Value);
67  dwValueName = MAX_PATH; // sizeof(szValueName)/sizeof(szValueName[0])
68 
69  if (RegEnumValueW(hKey, dwIndex, szValueName, &dwValueName, NULL, &dwType, (BYTE*)&Value, &dwValue) != ERROR_SUCCESS)
70  {
71  if (dwType == REG_SZ)
72  {
73  /*
74  * Retry in case of string value
75  */
76  dwValue = sizeof(szValue);
77  dwValueName = MAX_PATH; // sizeof(szValueName)/sizeof(szValueName[0])
78  if (RegEnumValueW(hKey, dwIndex, szValueName, &dwValueName, NULL, NULL, (BYTE*)szValue, &dwValue) != ERROR_SUCCESS)
79  break;
80  }
81  else
82  {
83  break;
84  }
85  }
86 
87  if (!wcscmp(szValueName, L"FaceName"))
88  {
89  SIZE_T Length = min(wcslen(szValue) + 1, LF_FACESIZE); // wcsnlen
90  wcsncpy(TermInfo->FaceName, szValue, LF_FACESIZE);
91  TermInfo->FaceName[Length] = L'\0';
92  RetVal = TRUE;
93  }
94  else if (!wcscmp(szValueName, L"FontFamily"))
95  {
96  TermInfo->FontFamily = Value;
97  RetVal = TRUE;
98  }
99  else if (!wcscmp(szValueName, L"FontSize"))
100  {
101  TermInfo->FontSize = Value;
102  RetVal = TRUE;
103  }
104  else if (!wcscmp(szValueName, L"FontWeight"))
105  {
106  TermInfo->FontWeight = Value;
107  RetVal = TRUE;
108  }
109  else if (!wcscmp(szValueName, L"FullScreen"))
110  {
111  TermInfo->FullScreen = Value;
112  RetVal = TRUE;
113  }
114  else if (!wcscmp(szValueName, L"WindowPosition"))
115  {
116  TermInfo->AutoPosition = FALSE;
117  TermInfo->WindowOrigin.x = LOWORD(Value);
118  TermInfo->WindowOrigin.y = HIWORD(Value);
119  RetVal = TRUE;
120  }
121  }
122 
123  RegCloseKey(hKey);
124  return RetVal;
125 }
126 
127 BOOL
129  IN LPCWSTR ConsoleTitle,
131 {
132  /******************************************************
133  * Adapted from ConSrvWriteUserSettings in settings.c *
134  ******************************************************/
135 
136  BOOL GlobalSettings = (ConsoleTitle[0] == L'\0');
137  HKEY hKey;
138  DWORD Storage = 0;
139 
140 #define SetConsoleSetting(SettingName, SettingType, SettingSize, Setting, DefaultValue) \
141 do { \
142  if (GlobalSettings || (!GlobalSettings && (*(Setting) != (DefaultValue)))) \
143  { \
144  RegSetValueExW(hKey, (SettingName), 0, (SettingType), (PBYTE)(Setting), (SettingSize)); \
145  } \
146  else \
147  { \
148  RegDeleteValue(hKey, (SettingName)); \
149  } \
150 } while (0)
151 
153  ConsoleTitle,
154  &hKey, KEY_WRITE,
155  TRUE))
156  {
157  return FALSE;
158  }
159 
160  SetConsoleSetting(L"FaceName", REG_SZ, (wcslen(TermInfo->FaceName) + 1) * sizeof(WCHAR), TermInfo->FaceName, L'\0'); // wcsnlen
161  SetConsoleSetting(L"FontFamily", REG_DWORD, sizeof(DWORD), &TermInfo->FontFamily, FF_DONTCARE);
162  SetConsoleSetting(L"FontSize", REG_DWORD, sizeof(DWORD), &TermInfo->FontSize, 0);
163  SetConsoleSetting(L"FontWeight", REG_DWORD, sizeof(DWORD), &TermInfo->FontWeight, FW_DONTCARE);
164 
165  Storage = TermInfo->FullScreen;
166  SetConsoleSetting(L"FullScreen", REG_DWORD, sizeof(DWORD), &Storage, FALSE);
167 
168  if (TermInfo->AutoPosition == FALSE)
169  {
170  Storage = MAKELONG(TermInfo->WindowOrigin.x, TermInfo->WindowOrigin.y);
171  RegSetValueExW(hKey, L"WindowPosition", 0, REG_DWORD, (PBYTE)&Storage, sizeof(DWORD));
172  }
173  else
174  {
175  RegDeleteValue(hKey, L"WindowPosition");
176  }
177 
178  RegCloseKey(hKey);
179  return TRUE;
180 }
181 
182 VOID
185 {
186  /*******************************************************
187  * Adapted from ConSrvGetDefaultSettings in settings.c *
188  *******************************************************/
189 
190  if (TermInfo == NULL) return;
191 
192  /*
193  * 1. Load the default values
194  */
195  // wcsncpy(TermInfo->FaceName, L"DejaVu Sans Mono", LF_FACESIZE);
196  // TermInfo->FontSize = MAKELONG(12, 8); // 0x0008000C; // font is 8x12
197  // TermInfo->FontSize = MAKELONG(16, 16); // font is 16x16
198  // TermInfo->FontWeight = FW_NORMAL;
199 
200  wcsncpy(TermInfo->FaceName, L"VGA", LF_FACESIZE); // HACK: !!
201  // TermInfo->FaceName[0] = L'\0';
202  TermInfo->FontFamily = FF_DONTCARE;
203  TermInfo->FontSize = 0;
204  TermInfo->FontWeight = FW_DONTCARE;
205  TermInfo->UseRasterFonts = TRUE;
206 
207  TermInfo->FullScreen = FALSE;
208  TermInfo->ShowWindow = SW_SHOWNORMAL;
209  TermInfo->AutoPosition = TRUE;
210  TermInfo->WindowOrigin.x = 0;
211  TermInfo->WindowOrigin.y = 0;
212 
213  /*
214  * 2. Overwrite them with the ones stored in HKCU\Console.
215  * If the HKCU\Console key doesn't exist, create it
216  * and store the default values inside.
217  */
218  if (!GuiConsoleReadUserSettings(TermInfo, L"", ProcessId))
219  {
221  }
222 }
223 
224 VOID
226  BOOL Defaults)
227 {
229  PCONSOLE Console = GuiData->Console;
230  PCONSOLE_SCREEN_BUFFER ActiveBuffer = Console->ActiveBuffer;
231  PCONSOLE_PROCESS_DATA ProcessData;
232  HANDLE hSection = NULL, hClientSection = NULL;
233  LARGE_INTEGER SectionSize;
234  ULONG ViewSize = 0;
235  SIZE_T Length = 0;
236  PCONSOLE_PROPS pSharedInfo = NULL;
237  PGUI_CONSOLE_INFO GuiInfo = NULL;
238 
239  DPRINT("GuiConsoleShowConsoleProperties entered\n");
240 
241  /*
242  * Create a memory section to share with the applet, and map it.
243  */
244  /* Holds data for console.dll + console info + terminal-specific info */
245  SectionSize.QuadPart = sizeof(CONSOLE_PROPS) + sizeof(GUI_CONSOLE_INFO);
248  NULL,
249  &SectionSize,
251  SEC_COMMIT,
252  NULL);
253  if (!NT_SUCCESS(Status))
254  {
255  DPRINT1("Error: Impossible to create a shared section ; Status = %lu\n", Status);
256  return;
257  }
258 
261  (PVOID*)&pSharedInfo,
262  0,
263  0,
264  NULL,
265  &ViewSize,
266  ViewUnmap,
267  0,
269  if (!NT_SUCCESS(Status))
270  {
271  DPRINT1("Error: Impossible to map the shared section ; Status = %lu\n", Status);
272  NtClose(hSection);
273  return;
274  }
275 
276 
277  /*
278  * Setup the shared console properties structure.
279  */
280 
281  /* Header */
282  pSharedInfo->hConsoleWindow = GuiData->hWindow;
283  pSharedInfo->ShowDefaultParams = Defaults;
284 
285  /*
286  * We fill-in the fields only if we display
287  * our properties, not the default ones.
288  */
289  if (!Defaults)
290  {
291  /* Console information */
292  pSharedInfo->ci.HistoryBufferSize = Console->HistoryBufferSize;
293  pSharedInfo->ci.NumberOfHistoryBuffers = Console->NumberOfHistoryBuffers;
294  pSharedInfo->ci.HistoryNoDup = Console->HistoryNoDup;
295  pSharedInfo->ci.QuickEdit = Console->QuickEdit;
296  pSharedInfo->ci.InsertMode = Console->InsertMode;
297  pSharedInfo->ci.InputBufferSize = 0;
298  pSharedInfo->ci.ScreenBufferSize = ActiveBuffer->ScreenBufferSize;
299  pSharedInfo->ci.ConsoleSize = ActiveBuffer->ViewSize;
300  pSharedInfo->ci.CursorBlinkOn;
301  pSharedInfo->ci.ForceCursorOff;
302  pSharedInfo->ci.CursorSize = ActiveBuffer->CursorInfo.dwSize;
303  if (GetType(ActiveBuffer) == TEXTMODE_BUFFER)
304  {
306 
307  pSharedInfo->ci.ScreenAttrib = Buffer->ScreenDefaultAttrib;
308  pSharedInfo->ci.PopupAttrib = Buffer->PopupDefaultAttrib;
309  }
310  else // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER)
311  {
312  // PGRAPHICS_SCREEN_BUFFER Buffer = (PGRAPHICS_SCREEN_BUFFER)ActiveBuffer;
313  DPRINT1("GuiConsoleShowConsoleProperties - Graphics buffer\n");
314 
315  // FIXME: Gather defaults from the registry ?
316  pSharedInfo->ci.ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
317  pSharedInfo->ci.PopupAttrib = DEFAULT_POPUP_ATTRIB ;
318  }
319  pSharedInfo->ci.CodePage;
320 
321  /* GUI Information */
322  pSharedInfo->TerminalInfo.Size = sizeof(GUI_CONSOLE_INFO);
323  GuiInfo = pSharedInfo->TerminalInfo.TermInfo = (PGUI_CONSOLE_INFO)(pSharedInfo + 1);
324  Length = min(wcslen(GuiData->GuiInfo.FaceName) + 1, LF_FACESIZE); // wcsnlen
325  wcsncpy(GuiInfo->FaceName, GuiData->GuiInfo.FaceName, LF_FACESIZE);
326  GuiInfo->FaceName[Length] = L'\0';
327  GuiInfo->FontFamily = GuiData->GuiInfo.FontFamily;
328  GuiInfo->FontSize = GuiData->GuiInfo.FontSize;
329  GuiInfo->FontWeight = GuiData->GuiInfo.FontWeight;
330  GuiInfo->UseRasterFonts = GuiData->GuiInfo.UseRasterFonts;
331  GuiInfo->FullScreen = GuiData->GuiInfo.FullScreen;
333  GuiInfo->AutoPosition = GuiData->GuiInfo.AutoPosition;
334  GuiInfo->WindowOrigin = GuiData->GuiInfo.WindowOrigin;
335  /* Offsetize */
336  pSharedInfo->TerminalInfo.TermInfo = (PVOID)((ULONG_PTR)GuiInfo - (ULONG_PTR)pSharedInfo);
337 
338  /* Palette */
339  memcpy(pSharedInfo->ci.Colors, Console->Colors, sizeof(Console->Colors));
340 
341  /* Title of the console, original one corresponding to the one set by the console leader */
342  Length = min(sizeof(pSharedInfo->ci.ConsoleTitle) / sizeof(pSharedInfo->ci.ConsoleTitle[0]) - 1,
343  Console->OriginalTitle.Length / sizeof(WCHAR));
344  wcsncpy(pSharedInfo->ci.ConsoleTitle, Console->OriginalTitle.Buffer, Length);
345  }
346  else
347  {
348  Length = 0;
349  // FIXME: Load the default parameters from the registry.
350  }
351 
352  /* Null-terminate the title */
353  pSharedInfo->ci.ConsoleTitle[Length] = L'\0';
354 
355 
356  /* Unmap the view */
357  NtUnmapViewOfSection(NtCurrentProcess(), pSharedInfo);
358 
359  /* Get the console leader process, our client */
360  ProcessData = CONTAINING_RECORD(Console->ProcessList.Blink,
362  ConsoleLink);
363 
364  /* Duplicate the section handle for the client */
366  hSection,
367  ProcessData->Process->ProcessHandle,
368  &hClientSection,
369  0, 0, DUPLICATE_SAME_ACCESS);
370  if (!NT_SUCCESS(Status))
371  {
372  DPRINT1("Error: Impossible to duplicate section handle for client ; Status = %lu\n", Status);
373  goto Quit;
374  }
375 
376  /* Start the properties dialog */
377  if (ProcessData->PropDispatcher)
378  {
379  _SEH2_TRY
380  {
381  HANDLE Thread = NULL;
382 
383  _SEH2_TRY
384  {
385  Thread = CreateRemoteThread(ProcessData->Process->ProcessHandle, NULL, 0,
386  ProcessData->PropDispatcher,
387  (PVOID)hClientSection, 0, NULL);
388  if (NULL == Thread)
389  {
390  DPRINT1("Failed thread creation (Error: 0x%x)\n", GetLastError());
391  }
392  else
393  {
394  DPRINT("ProcessData->PropDispatcher remote thread creation succeeded, ProcessId = %x, Process = 0x%p\n", ProcessData->Process->ClientId.UniqueProcess, ProcessData->Process);
396  }
397  }
399  {
401  }
402  _SEH2_END;
403  }
405  {
407  DPRINT1("GuiConsoleShowConsoleProperties - Caught an exception, Status = %08X\n", Status);
408  }
409  _SEH2_END;
410  }
411 
412 Quit:
413  /* We have finished, close the section handle */
414  NtClose(hSection);
415  return;
416 }
417 
418 NTSTATUS
420  HANDLE hClientSection,
422 {
424  PCONSOLE Console = GuiData->Console;
425  PCONSOLE_PROCESS_DATA ProcessData;
426  HANDLE hSection = NULL;
427  ULONG ViewSize = 0;
428  PCONSOLE_PROPS pConInfo = NULL;
430  PTERMINAL_INFO TermInfo = NULL;
431  PGUI_CONSOLE_INFO GuiInfo = NULL;
432 
433  /* Get the console leader process, our client */
434  ProcessData = CONTAINING_RECORD(Console->ProcessList.Blink,
436  ConsoleLink);
437 
438  /* Duplicate the section handle for ourselves */
440  hClientSection,
442  &hSection,
443  0, 0, DUPLICATE_SAME_ACCESS);
444  if (!NT_SUCCESS(Status))
445  {
446  DPRINT1("Error when mapping client handle, Status = %lu\n", Status);
447  return Status;
448  }
449 
450  /* Get a view of the shared section */
453  (PVOID*)&pConInfo,
454  0,
455  0,
456  NULL,
457  &ViewSize,
458  ViewUnmap,
459  0,
460  PAGE_READONLY);
461  if (!NT_SUCCESS(Status))
462  {
463  DPRINT1("Error when mapping view of file, Status = %lu\n", Status);
464  NtClose(hSection);
465  return Status;
466  }
467 
468  _SEH2_TRY
469  {
470  /* Check that the section is well-sized */
471  if ( (ViewSize < sizeof(CONSOLE_PROPS)) ||
472  (pConInfo->TerminalInfo.Size != sizeof(GUI_CONSOLE_INFO)) ||
473  (ViewSize < sizeof(CONSOLE_PROPS) + pConInfo->TerminalInfo.Size) )
474  {
475  DPRINT1("Error: section bad-sized: sizeof(Section) < sizeof(CONSOLE_PROPS) + sizeof(Terminal_specific_info)\n");
477  _SEH2_YIELD(goto Quit);
478  }
479 
480  // TODO: Check that GuiData->hWindow == pConInfo->hConsoleWindow
481 
482  /* Retrieve terminal informations */
483  ConInfo = &pConInfo->ci;
484  TermInfo = &pConInfo->TerminalInfo;
485  GuiInfo = TermInfo->TermInfo = (PVOID)((ULONG_PTR)pConInfo + (ULONG_PTR)TermInfo->TermInfo);
486 
487  /*
488  * If we don't set the default parameters,
489  * apply them, otherwise just save them.
490  */
491  if (pConInfo->ShowDefaultParams == FALSE)
492  {
493  /* Set the console informations */
495 
496  /* Set the terminal informations */
497 
498  // memcpy(&GuiData->GuiInfo, GuiInfo, sizeof(GUI_CONSOLE_INFO));
499 
500  /* Move the window to the user's values */
501  GuiData->GuiInfo.AutoPosition = GuiInfo->AutoPosition;
502  GuiData->GuiInfo.WindowOrigin = GuiInfo->WindowOrigin;
503  GuiConsoleMoveWindow(GuiData);
504 
505  InvalidateRect(GuiData->hWindow, NULL, TRUE);
506 
507  /*
508  * Apply full-screen mode.
509  */
510  GuiData->GuiInfo.FullScreen = GuiInfo->FullScreen;
511  // TODO: Apply it really
512  }
513 
514  /*
515  * Save settings if needed
516  */
517  // FIXME: Do it in the console properties applet ??
518  if (SaveSettings)
519  {
523  }
524 
526  }
528  {
530  DPRINT1("GuiApplyUserSettings - Caught an exception, Status = %08X\n", Status);
531  }
532  _SEH2_END;
533 
534 Quit:
535  /* Finally, close the section and return */
537  NtClose(hSection);
538  return Status;
539 }
540 
541 /* EOF */
VOID GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData, HANDLE hClientSection)
Definition: guisettings.c:258
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define DEFAULT_SCREEN_ATTRIB
Definition: settings.c:29
#define IN
Definition: typedefs.h:38
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
Definition: section.c:3782
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define LF_FACESIZE
Definition: dimm.idl:39
#define RegQueryInfoKey
Definition: winreg.h:521
#define ERROR_SUCCESS
Definition: deptool.c:10
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
Definition: section.c:3373
#define FF_DONTCARE
Definition: wingdi.h:447
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define KEY_READ
Definition: nt_native.h:1023
LONG NTSTATUS
Definition: precomp.h:26
#define HandleToUlong(h)
Definition: basetsd.h:79
BOOL ConSrvWriteUserSettings(IN PCONSOLE_INFO ConsoleInfo, IN DWORD ProcessId)
Definition: settings.c:321
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
PVOID TermInfo
Definition: settings.h:20
#define TEXTMODE_BUFFER
Definition: pccons.c:21
struct _GUI_CONSOLE_INFO GUI_CONSOLE_INFO
HANDLE UniqueProcess
Definition: compat.h:474
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
void SaveSettings(void)
Definition: settings.c:113
#define SECTION_ALL_ACCESS
Definition: nt_native.h:1293
#define DUPLICATE_SAME_ACCESS
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define SEC_COMMIT
Definition: mmtypes.h:99
COORD ScreenBufferSize
Definition: conio.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
Definition: section.c:3554
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
HANDLE ProcessHandle
Definition: csrsrv.h:46
VOID ConSrvApplyUserSettings(IN PCONSOLE Console, IN PCONSOLE_STATE_INFO ConsoleInfo)
Definition: settings.c:34
#define MAKELONG(a, b)
Definition: typedefs.h:248
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2853
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
CLIENT_ID ClientId
Definition: csrsrv.h:38
void * PVOID
Definition: retypes.h:9
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define SetConsoleSetting(SettingName, SettingType, SettingSize, Setting, DefaultValue)
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define RegDeleteValue
Definition: winreg.h:508
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define MAX_PATH
Definition: compat.h:26
VOID GuiConsoleShowConsoleProperties(PGUI_CONSOLE_DATA GuiData, BOOL Defaults)
Definition: guisettings.c:44
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _CONSOLE_PROPS CONSOLE_PROPS
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
PCSR_PROCESS Process
Definition: consrv.h:43
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
INT GetType(BOOL bLocal, LPOSVERSIONINFOEX osvi, LPSERVER_INFO_102 pBuf102)
Definition: gettype.c:129
static const WCHAR L[]
Definition: oid.c:1250
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define DEFAULT_POPUP_ATTRIB
Definition: settings.c:30
#define FW_DONTCARE
Definition: wingdi.h:367
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define STATUS_INVALID_VIEW_SIZE
Definition: ntstatus.h:254
_SEH2_END
Definition: create.c:4424
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData)
Definition: guiterm.c:61
struct _GUI_CONSOLE_INFO * PGUI_CONSOLE_INFO
BOOL ConSrvOpenUserSettings(DWORD ProcessId, LPCWSTR ConsoleTitle, PHKEY hSubKey, REGSAM samDesired, BOOL bCreate)
Definition: settings.c:123
_SEH2_FINALLY
Definition: create.c:4395
PCONSOLE_STATE_INFO ConInfo
Definition: console.c:23
#define min(a, b)
Definition: monoChain.cc:55
#define PAGE_READONLY
Definition: compat.h:127
WCHAR FaceName[LF_FACESIZE]
Definition: guisettings.h:18
WCHAR ConsoleTitle[ANYSIZE_ARRAY]
Definition: settings.h:58
LPTHREAD_START_ROUTINE PropDispatcher
Definition: consrv.h:74
CConsole Console
#define DPRINT1
Definition: precomp.h:8
GUI_CONSOLE_INFO GuiInfo
Definition: conwnd.h:96
BOOL GuiConsoleWriteUserSettings(IN OUT PGUI_CONSOLE_INFO TermInfo)
Definition: guisettings.c:31
NTSTATUS NTAPI NtDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)
Definition: obhandle.c:3407
#define OUT
Definition: typedefs.h:39
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:404
#define HIWORD(l)
Definition: typedefs.h:246
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
PCONSRV_CONSOLE Console
Definition: conwnd.h:90
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
CONSOLE_CURSOR_INFO CursorInfo
Definition: conio.h:102
#define REG_DWORD
Definition: sdbapi.c:596
BOOL GuiConsoleReadUserSettings(IN OUT PGUI_CONSOLE_INFO TermInfo)
Definition: guisettings.c:24
struct _TEXTMODE_SCREEN_BUFFER * PTEXTMODE_SCREEN_BUFFER
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
Definition: wingdi.h:3234
BYTE * PBYTE
Definition: pedump.c:66
#define LOWORD(l)
Definition: pedump.c:82
static IStorage Storage
Definition: ole2.c:3548
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTVDM_SETTINGS GlobalSettings
Definition: ntvdm.c:25
VOID GuiConsoleGetDefaultSettings(IN OUT PGUI_CONSOLE_INFO TermInfo)
Definition: guisettings.c:38
LONGLONG QuadPart
Definition: typedefs.h:112
#define PAGE_READWRITE
Definition: nt_native.h:1304
HANDLE WINAPI CreateRemoteThread(IN HANDLE hProcess, IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:158
#define REG_SZ
Definition: layer.c:22