ReactOS  0.4.14-dev-384-g5b37caa
settings.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/settings.c
5  * PURPOSE: Console 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/conio2.h"
15 #include "include/settings.h"
16 
17 #include <stdio.h> // for swprintf
18 
19 #define NDEBUG
20 #include <debug.h>
21 
22 
23 /* GLOBALS ********************************************************************/
24 
25 extern const COLORREF s_Colors[16];
26 
27 
28 /* FUNCTIONS ******************************************************************/
29 
30 static VOID
32  IN LPCWSTR ConsoleName,
33  IN UINT MaxStrLen)
34 {
35 #define PATH_SEPARATOR L'\\'
36 
37  UINT wLength;
38 
39  if ( DestString == NULL || ConsoleName == NULL ||
40  *ConsoleName == L'\0' || MaxStrLen == 0 )
41  {
42  return;
43  }
44 
45  wLength = GetWindowsDirectoryW(DestString, MaxStrLen);
46  if ((wLength > 0) && (_wcsnicmp(ConsoleName, DestString, wLength) == 0))
47  {
48  wcsncpy(DestString, L"%SystemRoot%", MaxStrLen);
49  // FIXME: Fix possible buffer overflows there !!!!!
50  wcsncat(DestString, ConsoleName + wLength, MaxStrLen);
51  }
52  else
53  {
54  wcsncpy(DestString, ConsoleName, MaxStrLen);
55  }
56 
57  /* Replace path separators (backslashes) by underscores */
58  while ((DestString = wcschr(DestString, PATH_SEPARATOR))) *DestString = L'_';
59 }
60 
61 static BOOL
63  PHKEY hResult,
64  REGSAM samDesired)
65 {
66  BOOL bRet = TRUE;
67  HANDLE hProcessToken = NULL;
69  BYTE Buffer[256];
70  DWORD Length = 0;
71  UNICODE_STRING SidName;
72  PTOKEN_USER TokUser;
73 
75  if (!hProcess)
76  {
77  DPRINT1("Error: OpenProcess failed(0x%x)\n", GetLastError());
78  return FALSE;
79  }
80 
81  if (!OpenProcessToken(hProcess, TOKEN_QUERY, &hProcessToken))
82  {
83  DPRINT1("Error: OpenProcessToken failed(0x%x)\n", GetLastError());
85  return FALSE;
86  }
87 
88  if (!GetTokenInformation(hProcessToken, TokenUser, (PVOID)Buffer, sizeof(Buffer), &Length))
89  {
90  DPRINT1("Error: GetTokenInformation failed(0x%x)\n",GetLastError());
91  CloseHandle(hProcessToken);
93  return FALSE;
94  }
95 
96  TokUser = ((PTOKEN_USER)Buffer)->User.Sid;
97  if (!NT_SUCCESS(RtlConvertSidToUnicodeString(&SidName, TokUser, TRUE)))
98  {
99  DPRINT1("Error: RtlConvertSidToUnicodeString failed(0x%x)\n", GetLastError());
100  CloseHandle(hProcessToken);
102  return FALSE;
103  }
104 
105  /*
106  * Might fail for LiveCD... Why ? Because only HKU\.DEFAULT exists.
107  */
108  bRet = (RegOpenKeyExW(HKEY_USERS,
109  SidName.Buffer,
110  0,
111  samDesired,
112  hResult) == ERROR_SUCCESS);
113 
114  RtlFreeUnicodeString(&SidName);
115 
116  CloseHandle(hProcessToken);
118 
119  return bRet;
120 }
121 
122 /*static*/ BOOL
124  LPCWSTR ConsoleTitle,
125  PHKEY hSubKey,
126  REGSAM samDesired,
127  BOOL bCreate)
128 {
129  BOOL bRet = TRUE;
130  WCHAR szBuffer[MAX_PATH] = L"Console\\";
131  WCHAR szBuffer2[MAX_PATH] = L"";
132  HKEY hKey;
133 
134  /*
135  * Console properties are stored under the HKCU\Console\* key.
136  *
137  * We use the original console title as the subkey name for storing
138  * console properties. We need to distinguish whether we were launched
139  * via the console application directly or via a shortcut.
140  *
141  * If the title of the console corresponds to a path (more precisely,
142  * if the title is of the form: C:\ReactOS<some_path><some_app.exe>),
143  * then use the corresponding unexpanded path and with the backslashes
144  * replaced by underscores, to make the registry happy,
145  * i.e. %SystemRoot%_<some_path>_<some_app.exe>
146  */
147 
148  /* Open the registry key where we saved the console properties */
149  if (!OpenUserRegistryPathPerProcessId(ProcessId, &hKey, samDesired))
150  {
151  DPRINT1("OpenUserRegistryPathPerProcessId failed\n");
152  return FALSE;
153  }
154 
155  /*
156  * Try to open properties via the console title:
157  * to make the registry happy, replace all the
158  * backslashes by underscores.
159  */
160  TranslateConsoleName(szBuffer2, ConsoleTitle, MAX_PATH);
161 
162  /* Create the registry path */
163  wcsncat(szBuffer, szBuffer2, MAX_PATH);
164 
165  /* Create or open the registry key */
166  if (bCreate)
167  {
168  /* Create the key */
169  bRet = (RegCreateKeyExW(hKey,
170  szBuffer,
171  0, NULL,
173  samDesired,
174  NULL,
175  hSubKey,
176  NULL) == ERROR_SUCCESS);
177  }
178  else
179  {
180  /* Open the key */
181  bRet = (RegOpenKeyExW(hKey,
182  szBuffer,
183  0,
184  samDesired,
185  hSubKey) == ERROR_SUCCESS);
186  }
187 
188  /* Close the parent key and return success or not */
189  RegCloseKey(hKey);
190  return bRet;
191 }
192 
193 BOOL
196 {
197  BOOL RetVal = FALSE;
198  HKEY hKey;
199  DWORD dwNumSubKeys = 0;
200  DWORD dwIndex;
201  DWORD dwColorIndex = 0;
202  DWORD dwType;
203  WCHAR szValueName[MAX_PATH];
204  DWORD dwValueName;
205  WCHAR szValue[LF_FACESIZE] = L"\0";
206  DWORD Value;
207  DWORD dwValue;
208 
210  ConsoleInfo->ConsoleTitle,
211  &hKey, KEY_READ,
212  FALSE))
213  {
214  DPRINT("ConSrvOpenUserSettings failed\n");
215  return FALSE;
216  }
217 
218  if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL,
219  &dwNumSubKeys, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
220  {
221  DPRINT("ConSrvReadUserSettings: RegQueryInfoKey failed\n");
222  RegCloseKey(hKey);
223  return FALSE;
224  }
225 
226  DPRINT("ConSrvReadUserSettings entered dwNumSubKeys %d\n", dwNumSubKeys);
227 
228  for (dwIndex = 0; dwIndex < dwNumSubKeys; dwIndex++)
229  {
230  dwValue = sizeof(Value);
231  dwValueName = MAX_PATH; // sizeof(szValueName)/sizeof(szValueName[0])
232 
233  if (RegEnumValueW(hKey, dwIndex, szValueName, &dwValueName, NULL, &dwType, (BYTE*)&Value, &dwValue) != ERROR_SUCCESS)
234  {
235  if (dwType == REG_SZ)
236  {
237  /*
238  * Retry in case of string value
239  */
240  dwValue = sizeof(szValue);
241  dwValueName = MAX_PATH; // sizeof(szValueName)/sizeof(szValueName[0])
242  if (RegEnumValueW(hKey, dwIndex, szValueName, &dwValueName, NULL, NULL, (BYTE*)szValue, &dwValue) != ERROR_SUCCESS)
243  break;
244  }
245  else
246  {
247  break;
248  }
249  }
250 
251  /* Maybe it is UI-specific ?? */
252  if (!wcsncmp(szValueName, L"ColorTable", wcslen(L"ColorTable")))
253  {
254  dwColorIndex = 0;
255  swscanf(szValueName, L"ColorTable%2d", &dwColorIndex);
256  if (dwColorIndex < sizeof(ConsoleInfo->Colors)/sizeof(ConsoleInfo->Colors[0]))
257  {
258  ConsoleInfo->Colors[dwColorIndex] = Value;
259  RetVal = TRUE;
260  }
261  }
262  else if (!wcscmp(szValueName, L"HistoryBufferSize"))
263  {
264  ConsoleInfo->HistoryBufferSize = Value;
265  RetVal = TRUE;
266  }
267  else if (!wcscmp(szValueName, L"NumberOfHistoryBuffers"))
268  {
269  ConsoleInfo->NumberOfHistoryBuffers = Value;
270  RetVal = TRUE;
271  }
272  else if (!wcscmp(szValueName, L"HistoryNoDup"))
273  {
274  ConsoleInfo->HistoryNoDup = (BOOLEAN)Value;
275  RetVal = TRUE;
276  }
277  else if (!wcscmp(szValueName, L"QuickEdit"))
278  {
279  ConsoleInfo->QuickEdit = (BOOLEAN)Value;
280  RetVal = TRUE;
281  }
282  else if (!wcscmp(szValueName, L"InsertMode"))
283  {
284  ConsoleInfo->InsertMode = (BOOLEAN)Value;
285  RetVal = TRUE;
286  }
287  else if (!wcscmp(szValueName, L"ScreenBufferSize"))
288  {
289  ConsoleInfo->ScreenBufferSize.X = LOWORD(Value);
290  ConsoleInfo->ScreenBufferSize.Y = HIWORD(Value);
291  RetVal = TRUE;
292  }
293  else if (!wcscmp(szValueName, L"WindowSize"))
294  {
295  ConsoleInfo->ConsoleSize.X = LOWORD(Value);
296  ConsoleInfo->ConsoleSize.Y = HIWORD(Value);
297  RetVal = TRUE;
298  }
299  else if (!wcscmp(szValueName, L"CursorSize"))
300  {
301  ConsoleInfo->CursorSize = min(max(Value, 0), 100);
302  RetVal = TRUE;
303  }
304  else if (!wcscmp(szValueName, L"ScreenColors"))
305  {
306  ConsoleInfo->ScreenAttrib = (USHORT)Value;
307  RetVal = TRUE;
308  }
309  else if (!wcscmp(szValueName, L"PopupColors"))
310  {
311  ConsoleInfo->PopupAttrib = (USHORT)Value;
312  RetVal = TRUE;
313  }
314  }
315 
316  RegCloseKey(hKey);
317  return RetVal;
318 }
319 
320 BOOL
323 {
324  BOOL GlobalSettings = (ConsoleInfo->ConsoleTitle[0] == L'\0');
325  HKEY hKey;
326  DWORD Storage = 0;
327 
328 #define SetConsoleSetting(SettingName, SettingType, SettingSize, Setting, DefaultValue) \
329 do { \
330  if (GlobalSettings || (!GlobalSettings && (*(Setting) != (DefaultValue)))) \
331  { \
332  RegSetValueExW(hKey, (SettingName), 0, (SettingType), (PBYTE)(Setting), (SettingSize)); \
333  } \
334  else \
335  { \
336  RegDeleteValue(hKey, (SettingName)); \
337  } \
338 } while (0)
339 
340  WCHAR szValueName[15];
341  UINT i;
342 
344  ConsoleInfo->ConsoleTitle,
345  &hKey, KEY_WRITE,
346  TRUE))
347  {
348  return FALSE;
349  }
350 
351  for (i = 0 ; i < sizeof(ConsoleInfo->Colors)/sizeof(ConsoleInfo->Colors[0]) ; ++i)
352  {
353  /*
354  * Write only the new value if we are saving the global settings
355  * or we are saving settings for a particular console, which differs
356  * from the default ones.
357  */
358  swprintf(szValueName, L"ColorTable%02u", i);
359  SetConsoleSetting(szValueName, REG_DWORD, sizeof(DWORD), &ConsoleInfo->Colors[i], s_Colors[i]);
360  }
361 
362  SetConsoleSetting(L"HistoryBufferSize", REG_DWORD, sizeof(DWORD), &ConsoleInfo->HistoryBufferSize, 50);
363  SetConsoleSetting(L"NumberOfHistoryBuffers", REG_DWORD, sizeof(DWORD), &ConsoleInfo->NumberOfHistoryBuffers, 4);
364 
365  Storage = ConsoleInfo->HistoryNoDup;
366  SetConsoleSetting(L"HistoryNoDup", REG_DWORD, sizeof(DWORD), &Storage, FALSE);
367 
368  Storage = ConsoleInfo->QuickEdit;
369  SetConsoleSetting(L"QuickEdit", REG_DWORD, sizeof(DWORD), &Storage, FALSE);
370 
371  Storage = ConsoleInfo->InsertMode;
372  SetConsoleSetting(L"InsertMode", REG_DWORD, sizeof(DWORD), &Storage, TRUE);
373 
374  Storage = MAKELONG(ConsoleInfo->ScreenBufferSize.X, ConsoleInfo->ScreenBufferSize.Y);
375  SetConsoleSetting(L"ScreenBufferSize", REG_DWORD, sizeof(DWORD), &Storage, MAKELONG(80, 300));
376 
377  Storage = MAKELONG(ConsoleInfo->ConsoleSize.X, ConsoleInfo->ConsoleSize.Y);
378  SetConsoleSetting(L"WindowSize", REG_DWORD, sizeof(DWORD), &Storage, MAKELONG(80, 25));
379 
380  SetConsoleSetting(L"CursorSize", REG_DWORD, sizeof(DWORD), &ConsoleInfo->CursorSize, CSR_DEFAULT_CURSOR_SIZE);
381 
382  Storage = ConsoleInfo->ScreenAttrib;
383  SetConsoleSetting(L"ScreenColors", REG_DWORD, sizeof(DWORD), &Storage, DEFAULT_SCREEN_ATTRIB);
384 
385  Storage = ConsoleInfo->PopupAttrib;
386  SetConsoleSetting(L"PopupColors", REG_DWORD, sizeof(DWORD), &Storage, DEFAULT_POPUP_ATTRIB);
387 
388  RegCloseKey(hKey);
389  return TRUE;
390 }
391 
392 VOID
395 {
396  if (ConsoleInfo == NULL) return;
397 
399 
400  /*
401  * 1. Load the default values
402  */
403 // #define DEFAULT_HISTORY_COMMANDS_NUMBER 50
404 // #define DEFAULT_HISTORY_BUFFERS_NUMBER 4
405  ConsoleInfo->HistoryBufferSize = 50;
406  ConsoleInfo->NumberOfHistoryBuffers = 4;
407  ConsoleInfo->HistoryNoDup = FALSE;
408 
409  ConsoleInfo->QuickEdit = FALSE;
410  ConsoleInfo->InsertMode = TRUE;
411  // ConsoleInfo->InputBufferSize;
412 
413  // Rule: ScreenBufferSize >= ConsoleSize
414  ConsoleInfo->ScreenBufferSize.X = 80;
415  ConsoleInfo->ScreenBufferSize.Y = 300;
416  ConsoleInfo->ConsoleSize.X = 80;
417  ConsoleInfo->ConsoleSize.Y = 25;
418 
419  ConsoleInfo->CursorBlinkOn;
420  ConsoleInfo->ForceCursorOff;
421  ConsoleInfo->CursorSize = CSR_DEFAULT_CURSOR_SIZE; // #define SMALL_SIZE 25
422 
423  ConsoleInfo->ScreenAttrib = DEFAULT_SCREEN_ATTRIB;
424  ConsoleInfo->PopupAttrib = DEFAULT_POPUP_ATTRIB;
425 
426  memcpy(ConsoleInfo->Colors, s_Colors, sizeof(s_Colors));
427 
428  // ConsoleInfo->CodePage;
429 
430  ConsoleInfo->ConsoleTitle[0] = L'\0';
431 
432  /*
433  * 2. Overwrite them with the ones stored in HKCU\Console.
434  * If the HKCU\Console key doesn't exist, create it
435  * and store the default values inside.
436  */
438  {
440  }
441 }
442 
443 VOID
446 {
447  PCONSOLE_SCREEN_BUFFER ActiveBuffer = Console->ActiveBuffer;
448 
449  /*
450  * Apply terminal-edition settings:
451  * - QuickEdit and Insert modes,
452  * - history settings.
453  */
454  Console->QuickEdit = ConsoleInfo->QuickEdit;
455  Console->InsertMode = ConsoleInfo->InsertMode;
456 
457  /*
458  * Apply foreground and background colors for both screen and popup
459  * and copy the new palette.
460  */
461  if (GetType(ActiveBuffer) == TEXTMODE_BUFFER)
462  {
464 
465  Buffer->ScreenDefaultAttrib = ConsoleInfo->ScreenAttrib;
466  Buffer->PopupDefaultAttrib = ConsoleInfo->PopupAttrib;
467  }
468  else // if (Console->ActiveBuffer->Header.Type == GRAPHICS_BUFFER)
469  {
470  }
471 
472  // FIXME: Possible buffer overflow if s_colors is bigger than pConInfo->Colors.
473  memcpy(Console->Colors, ConsoleInfo->Colors, sizeof(s_Colors));
474 
475  // TODO: Really update the screen attributes as FillConsoleOutputAttribute does.
476 
477  /* Apply cursor size */
478  ActiveBuffer->CursorInfo.bVisible = (ConsoleInfo->CursorSize != 0);
479  ActiveBuffer->CursorInfo.dwSize = min(max(ConsoleInfo->CursorSize, 0), 100);
480 
481  if (GetType(ActiveBuffer) == TEXTMODE_BUFFER)
482  {
484  COORD BufSize;
485 
486  /* Resize its active screen-buffer */
487  BufSize = ConsoleInfo->ScreenBufferSize;
488 
489  if (Console->FixedSize)
490  {
491  /*
492  * The console is in fixed-size mode, so we cannot resize anything
493  * at the moment. However, keep those settings somewhere so that
494  * we can try to set them up when we will be allowed to do so.
495  */
496  if (ConsoleInfo->ConsoleSize.X != Buffer->OldViewSize.X ||
497  ConsoleInfo->ConsoleSize.Y != Buffer->OldViewSize.Y)
498  {
499  Buffer->OldViewSize = ConsoleInfo->ConsoleSize;
500  }
501 
502  /* Buffer size is not allowed to be smaller than the view size */
503  if (BufSize.X >= Buffer->OldViewSize.X && BufSize.Y >= Buffer->OldViewSize.Y)
504  {
505  if (BufSize.X != Buffer->OldScreenBufferSize.X ||
506  BufSize.Y != Buffer->OldScreenBufferSize.Y)
507  {
508  /*
509  * The console is in fixed-size mode, so we cannot resize anything
510  * at the moment. However, keep those settings somewhere so that
511  * we can try to set them up when we will be allowed to do so.
512  */
513  Buffer->OldScreenBufferSize = BufSize;
514  }
515  }
516  }
517  else
518  {
519  BOOL SizeChanged = FALSE;
520 
521  /* Resize the console */
522  if (ConsoleInfo->ConsoleSize.X != Buffer->ViewSize.X ||
523  ConsoleInfo->ConsoleSize.Y != Buffer->ViewSize.Y)
524  {
525  Buffer->ViewSize = ConsoleInfo->ConsoleSize;
526  SizeChanged = TRUE;
527  }
528 
529  /* Resize the screen-buffer */
530  if (BufSize.X != Buffer->ScreenBufferSize.X ||
531  BufSize.Y != Buffer->ScreenBufferSize.Y)
532  {
534  SizeChanged = TRUE;
535  }
536 
537  if (SizeChanged) ConioResizeTerminal(Console);
538  }
539  }
540  else // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER)
541  {
543 
544  /*
545  * In any case we do NOT modify the size of the graphics screen-buffer.
546  * We just allow resizing the view only if the new size is smaller
547  * than the older one.
548  */
549 
550  if (Console->FixedSize)
551  {
552  /*
553  * The console is in fixed-size mode, so we cannot resize anything
554  * at the moment. However, keep those settings somewhere so that
555  * we can try to set them up when we will be allowed to do so.
556  */
557  if (ConsoleInfo->ConsoleSize.X <= Buffer->ViewSize.X ||
558  ConsoleInfo->ConsoleSize.Y <= Buffer->ViewSize.Y)
559  {
560  Buffer->OldViewSize = ConsoleInfo->ConsoleSize;
561  }
562  }
563  else
564  {
565  /* Resize the view if its size is bigger than the specified size */
566  if (ConsoleInfo->ConsoleSize.X <= Buffer->ViewSize.X ||
567  ConsoleInfo->ConsoleSize.Y <= Buffer->ViewSize.Y)
568  {
569  Buffer->ViewSize = ConsoleInfo->ConsoleSize;
570  // SizeChanged = TRUE;
571  }
572  }
573  }
574 }
575 
576 /* EOF */
#define HKEY_USERS
Definition: winreg.h:13
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define PATH_SEPARATOR
#define DEFAULT_SCREEN_ATTRIB
Definition: settings.c:29
#define IN
Definition: typedefs.h:38
#define max(a, b)
Definition: svc.c:63
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define LF_FACESIZE
Definition: dimm.idl:39
#define RegQueryInfoKey
Definition: winreg.h:521
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:158
static BOOL OpenUserRegistryPathPerProcessId(DWORD ProcessId, PHKEY hResult, REGSAM samDesired)
Definition: settings.c:62
#define KEY_READ
Definition: nt_native.h:1023
const COLORREF s_Colors[16]
Definition: conwnd.c:98
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
static VOID TranslateConsoleName(OUT LPWSTR DestString, IN LPCWSTR ConsoleName, IN UINT MaxStrLen)
Definition: settings.c:31
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
#define TEXTMODE_BUFFER
Definition: pccons.c:21
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
#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
#define BufSize
Definition: FsRtlTunnel.c:28
BOOL ConSrvReadUserSettings(IN OUT PCONSOLE_INFO ConsoleInfo, IN DWORD ProcessId)
Definition: settings.c:194
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
BOOLEAN bVisible
Definition: blue.h:41
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
#define TOKEN_QUERY
Definition: setypes.h:874
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
DWORD COLORREF
Definition: windef.h:285
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CSR_DEFAULT_CURSOR_SIZE
Definition: settings.c:26
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
NTSYSAPI NTSTATUS NTAPI RtlConvertSidToUnicodeString(OUT PUNICODE_STRING DestinationString, IN PVOID Sid, IN BOOLEAN AllocateDestinationString)
struct _GRAPHICS_SCREEN_BUFFER * PGRAPHICS_SCREEN_BUFFER
#define READ_CONTROL
Definition: nt_native.h:58
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
BOOL ConSrvOpenUserSettings(DWORD ProcessId, LPCWSTR ConsoleTitle, PHKEY hSubKey, REGSAM samDesired, BOOL bCreate)
Definition: settings.c:123
#define SetConsoleSetting(SettingName, SettingType, SettingSize, Setting, DefaultValue)
_CRTIMP wchar_t *__cdecl wcsncat(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
Definition: bl.h:1338
_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
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1227
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1435
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
NTSTATUS ConioResizeBuffer(PCONSOLE Console, PTEXTMODE_SCREEN_BUFFER ScreenBuffer, COORD Size)
Definition: text.c:257
unsigned short USHORT
Definition: pedump.c:61
static CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo
Definition: video.c:47
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
CConsole Console
#define DPRINT1
Definition: precomp.h:8
#define PROCESS_VM_READ
Definition: pstypes.h:153
#define BOOLEAN
Definition: pedump.c:73
#define OUT
Definition: typedefs.h:39
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
struct _TOKEN_USER * PTOKEN_USER
SID_AND_ATTRIBUTES User
Definition: setypes.h:956
BOOL ConSrvWriteUserSettings(IN PCONSOLE_INFO ConsoleInfo, IN DWORD ProcessId)
Definition: settings.c:321
WCHAR * LPWSTR
Definition: xmlstorage.h:184
CONSOLE_CURSOR_INFO CursorInfo
Definition: conio.h:102
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
struct _TEXTMODE_SCREEN_BUFFER * PTEXTMODE_SCREEN_BUFFER
VOID ConSrvApplyUserSettings(IN PCONSOLE Console, IN PCONSOLE_STATE_INFO ConsoleInfo)
Definition: settings.c:34
#define ConioResizeTerminal(Console)
Definition: conio2.h:22
#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 ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo, IN DWORD ProcessId)
Definition: settings.c:393
#define REG_SZ
Definition: layer.c:22