ReactOS  0.4.15-dev-5496-g599ba9c
mui.c File Reference
#include "usetup.h"
#include "muilanguages.h"
#include <debug.h>
Include dependency graph for mui.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static ULONG FindLanguageIndex (VOID)
 
static const MUI_ENTRYFindMUIEntriesOfPage (IN ULONG PageNumber)
 
static const MUI_ERRORFindMUIErrorEntries (VOID)
 
static const MUI_STRINGFindMUIStringEntries (VOID)
 
VOID MUIClearPage (IN ULONG page)
 
VOID MUIDisplayPage (IN ULONG page)
 
VOID MUIDisplayErrorV (IN ULONG ErrorNum, OUT PINPUT_RECORD Ir, IN ULONG WaitEvent, IN va_list args)
 
VOID __cdecl MUIDisplayError (IN ULONG ErrorNum, OUT PINPUT_RECORD Ir, IN ULONG WaitEvent,...)
 
PCSTR MUIGetString (ULONG Number)
 
const MUI_ENTRYMUIGetEntry (IN ULONG Page, IN INT TextID)
 
VOID MUIClearText (IN ULONG Page, IN INT TextID)
 
VOID MUIClearStyledText (IN ULONG Page, IN INT TextID, IN INT Flags)
 
VOID MUISetText (IN ULONG Page, IN INT TextID)
 
VOID MUISetStyledText (IN ULONG Page, IN INT TextID, IN INT Flags)
 
VOID SetConsoleCodePage (VOID)
 

Variables

CHAR CharBullet = 0x07
 
CHAR CharBlock = 0xDB
 
CHAR CharHalfBlock = 0xDD
 
CHAR CharUpArrow = 0x18
 
CHAR CharDownArrow = 0x19
 
CHAR CharHorizontalLine = 0xC4
 
CHAR CharVerticalLine = 0xB3
 
CHAR CharUpperLeftCorner = 0xDA
 
CHAR CharUpperRightCorner = 0xBF
 
CHAR CharLowerLeftCorner = 0xC0
 
CHAR CharLowerRightCorner = 0xD9
 
CHAR CharVertLineAndRightHorizLine = 0xC3
 
CHAR CharLeftHorizLineAndVertLine = 0xB4
 
CHAR CharDoubleHorizontalLine = 0xCD
 
CHAR CharDoubleVerticalLine = 0xBA
 
CHAR CharDoubleUpperLeftCorner = 0xC9
 
CHAR CharDoubleUpperRightCorner = 0xBB
 
CHAR CharDoubleLowerLeftCorner = 0xC8
 
CHAR CharDoubleLowerRightCorner = 0xBC
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 30 of file mui.c.

Function Documentation

◆ FindLanguageIndex()

static ULONG FindLanguageIndex ( VOID  )
static

Definition at line 56 of file mui.c.

57 {
58  ULONG lngIndex = 0;
59 
60  if (SelectedLanguageId == NULL)
61  {
62  /* Default to en-US */
63  return 0; // FIXME!!
64  // SelectedLanguageId = L"00000409";
65  }
66 
67  while (ResourceList[lngIndex].MuiPages != NULL)
68  {
69  if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
70  {
71  return lngIndex;
72  }
73 
74  lngIndex++;
75  }
76 
77  return 0;
78 }
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
PCWSTR SelectedLanguageId
Definition: usetup.c:66
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by FindMUIEntriesOfPage(), FindMUIErrorEntries(), FindMUIStringEntries(), and MUIGetString().

◆ FindMUIEntriesOfPage()

static const MUI_ENTRY* FindMUIEntriesOfPage ( IN ULONG  PageNumber)
static

Definition at line 103 of file mui.c.

105 {
106  ULONG muiIndex = 0;
107  ULONG lngIndex;
108  const MUI_PAGE * Pages = NULL;
109 
110  lngIndex = max(FindLanguageIndex(), 0);
111  Pages = ResourceList[lngIndex].MuiPages;
112 
113  while (Pages[muiIndex].MuiEntry != NULL)
114  {
115  if (Pages[muiIndex].Number == PageNumber)
116  return Pages[muiIndex].MuiEntry;
117 
118  muiIndex++;
119  }
120 
121  return NULL;
122 }
#define max(a, b)
Definition: svc.c:63
Definition: mui.h:18
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
static ULONG FindLanguageIndex(VOID)
Definition: mui.c:56
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
MUI_ENTRY * MuiEntry
Definition: mui.h:21

Referenced by MUIClearPage(), MUIDisplayPage(), and MUIGetEntry().

◆ FindMUIErrorEntries()

static const MUI_ERROR* FindMUIErrorEntries ( VOID  )
static

Definition at line 126 of file mui.c.

127 {
128  ULONG lngIndex = max(FindLanguageIndex(), 0);
129  return ResourceList[lngIndex].MuiErrors;
130 }
#define max(a, b)
Definition: svc.c:63
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
static ULONG FindLanguageIndex(VOID)
Definition: mui.c:56
unsigned int ULONG
Definition: retypes.h:1

Referenced by MUIDisplayErrorV().

◆ FindMUIStringEntries()

static const MUI_STRING* FindMUIStringEntries ( VOID  )
static

Definition at line 134 of file mui.c.

135 {
136  ULONG lngIndex = max(FindLanguageIndex(), 0);
137  return ResourceList[lngIndex].MuiStrings;
138 }
#define max(a, b)
Definition: svc.c:63
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
static ULONG FindLanguageIndex(VOID)
Definition: mui.c:56
unsigned int ULONG
Definition: retypes.h:1

Referenced by MUIGetString().

◆ MUIClearPage()

VOID MUIClearPage ( IN ULONG  page)

Definition at line 142 of file mui.c.

144 {
145  const MUI_ENTRY * entry;
146  ULONG index;
147 
149  if (!entry)
150  {
151  PopupError("Error: Failed to find translated page",
152  NULL,
153  NULL,
155  return;
156  }
157 
158  index = 0;
159  while (entry[index].Buffer != NULL)
160  {
162  entry[index].Y,
163  entry[index].Flags,
165  index++;
166  }
167 }
#define POPUP_WAIT_NONE
Definition: usetup.h:123
#define Y(I)
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
VOID PopupError(PCCH Text, PCCH Status, PINPUT_RECORD Ir, ULONG WaitEvent)
Definition: usetup.c:256
Definition: module.h:566
Definition: bufpool.h:45
GLuint index
Definition: glext.h:6031
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define index(s, c)
Definition: various.h:29
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
VOID CONSOLE_ClearStyledText(IN SHORT x, IN SHORT y, IN INT Flags, IN SHORT Length)
Definition: consup.c:755
static const MUI_ENTRY * FindMUIEntriesOfPage(IN ULONG PageNumber)
Definition: mui.c:103

Referenced by LanguagePage().

◆ MUIClearStyledText()

VOID MUIClearStyledText ( IN ULONG  Page,
IN INT  TextID,
IN INT  Flags 
)

@MUIClearStyledText

Clears a portion of text from the console output, given the actual state style flag of the text.

Parameters
[in]PageThe MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
[in]TextIDThe text identification number (ID), as an integer. The parameter is used to identify its MUI properties like the coordinates, text style flag and its buffer content.
[in]FlagsThe text style flag, as an integer. The flag determines the style of the text, such as being highlighted, underlined, high padding and so on.
Returns
Nothing.

Definition at line 399 of file mui.c.

403 {
404  const MUI_ENTRY * entry;
405  ULONG Index = 0;
406 
407  /* Get the MUI entry */
408  entry = MUIGetEntry(Page, TextID);
409 
410  if (!entry)
411  return;
412 
413  /* Ensure that the text string given by the text ID and page is not NULL */
414  while (entry[Index].Buffer != NULL)
415  {
416  /* If text ID is not correct, skip the entry */
417  if (entry[Index].TextID != TextID)
418  {
419  Index++;
420  continue;
421  }
422 
423  /* Now, begin removing the text by calling CONSOLE_ClearStyledText() */
425  entry[Index].X,
426  entry[Index].Y,
427  Flags,
429 
430  /* Increment the index and loop over next entires with the same ID */
431  Index++;
432  }
433 }
#define Y(I)
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1295
Definition: bufpool.h:45
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ WDFCOLLECTION _In_ ULONG Index
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
const MUI_ENTRY * MUIGetEntry(IN ULONG Page, IN INT TextID)
Definition: mui.c:297
VOID CONSOLE_ClearStyledText(IN SHORT x, IN SHORT y, IN INT Flags, IN SHORT Length)
Definition: consup.c:755

Referenced by FormatPartitionPage().

◆ MUIClearText()

VOID MUIClearText ( IN ULONG  Page,
IN INT  TextID 
)

@MUIClearText

Clears a portion of text from the console output.

Parameters
[in]PageThe MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
[in]TextIDThe text identification number (ID), as an integer. The parameter is used to identify its MUI properties like the coordinates, text style flag and its buffer content.
Returns
Nothing.

Definition at line 344 of file mui.c.

347 {
348  const MUI_ENTRY * entry;
349  ULONG Index = 0;
350 
351  /* Get the MUI entry */
352  entry = MUIGetEntry(Page, TextID);
353 
354  if (!entry)
355  return;
356 
357  /* Ensure that the text string given by the text ID and page is not NULL */
358  while (entry[Index].Buffer != NULL)
359  {
360  /* If text ID is not correct, skip the entry */
361  if (entry[Index].TextID != TextID)
362  {
363  Index++;
364  continue;
365  }
366 
367  /* Remove the text by using CONSOLE_ClearTextXY() */
369  entry[Index].X,
370  entry[Index].Y,
372 
373  /* Increment the index and loop over next entires with the same ID */
374  Index++;
375  }
376 }
#define Y(I)
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
VOID CONSOLE_ClearTextXY(IN SHORT x, IN SHORT y, IN SHORT Length)
Definition: consup.c:339
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1295
Definition: bufpool.h:45
_In_ WDFCOLLECTION _In_ ULONG Index
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
const MUI_ENTRY * MUIGetEntry(IN ULONG Page, IN INT TextID)
Definition: mui.c:297

◆ MUIDisplayError()

VOID __cdecl MUIDisplayError ( IN ULONG  ErrorNum,
OUT PINPUT_RECORD  Ir,
IN ULONG  WaitEvent,
  ... 
)

Definition at line 237 of file mui.c.

242 {
243  va_list arg_ptr;
244 
245  va_start(arg_ptr, WaitEvent);
246  MUIDisplayErrorV(ErrorNum, Ir, WaitEvent, arg_ptr);
247  va_end(arg_ptr);
248 }
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
va_start(ap, x)
VOID MUIDisplayErrorV(IN ULONG ErrorNum, OUT PINPUT_RECORD Ir, IN ULONG WaitEvent, IN va_list args)
Definition: mui.c:199

Referenced by BootLoaderFloppyPage(), BootLoaderInstallationPage(), ConfirmQuit(), DeviceSettingsPage(), FormatPartitionPage(), InstallDirectoryPage(), RegistryPage(), SelectFileSystemPage(), SelectPartitionPage(), SetupStartPage(), and UpgradeRepairPage().

◆ MUIDisplayErrorV()

VOID MUIDisplayErrorV ( IN ULONG  ErrorNum,
OUT PINPUT_RECORD  Ir,
IN ULONG  WaitEvent,
IN va_list  args 
)

Definition at line 199 of file mui.c.

204 {
205  const MUI_ERROR* entry;
206  CHAR Buffer[2048];
207 
208  if (ErrorNum >= ERROR_LAST_ERROR_CODE)
209  {
210  PopupError("Invalid error number provided",
211  "Press ENTER to continue",
212  Ir,
214  return;
215  }
216 
218  if (!entry)
219  {
220  PopupError("Error: Failed to find translated error message",
221  NULL,
222  NULL,
224  return;
225  }
226 
227  vsprintf(Buffer, entry[ErrorNum].ErrorText, args);
228 
230  entry[ErrorNum].ErrorStatus,
231  Ir,
232  WaitEvent);
233 }
#define POPUP_WAIT_NONE
Definition: usetup.h:123
char CHAR
Definition: xmlstorage.h:175
VOID PopupError(PCCH Text, PCCH Status, PINPUT_RECORD Ir, ULONG WaitEvent)
Definition: usetup.c:256
Definition: match.c:390
Definition: bufpool.h:45
static const MUI_ERROR * FindMUIErrorEntries(VOID)
Definition: mui.c:126
uint32_t entry
Definition: isohybrid.c:63
#define POPUP_WAIT_ENTER
Definition: usetup.h:125
Definition: mui.h:12
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
#define NULL
Definition: types.h:112

Referenced by MUIDisplayError(), and USetupErrorRoutine().

◆ MUIDisplayPage()

VOID MUIDisplayPage ( IN ULONG  page)

Definition at line 170 of file mui.c.

172 {
173  const MUI_ENTRY * entry;
174  ULONG index;
175 
177  if (!entry)
178  {
179  PopupError("Error: Failed to find translated page",
180  NULL,
181  NULL,
183  return;
184  }
185 
186  index = 0;
187  while (entry[index].Buffer != NULL)
188  {
190  entry[index].Y,
191  entry[index].Flags,
192  entry[index].Buffer);
193 
194  index++;
195  }
196 }
#define POPUP_WAIT_NONE
Definition: usetup.h:123
#define Y(I)
VOID PopupError(PCCH Text, PCCH Status, PINPUT_RECORD Ir, ULONG WaitEvent)
Definition: usetup.c:256
Definition: module.h:566
Definition: bufpool.h:45
GLuint index
Definition: glext.h:6031
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
VOID CONSOLE_SetStyledText(IN SHORT x, IN SHORT y, IN INT Flags, IN LPCSTR Text)
Definition: consup.c:671
#define index(s, c)
Definition: various.h:29
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
static const MUI_ENTRY * FindMUIEntriesOfPage(IN ULONG PageNumber)
Definition: mui.c:103

Referenced by BootLoaderFloppyPage(), BootLoaderInstallationPage(), BootLoaderPage(), CheckFileSystemPage(), ComputerSettingsPage(), ConfirmDeleteSystemPartitionPage(), DeletePartitionPage(), DeviceSettingsPage(), DisplaySettingsPage(), FileCopyPage(), FlushPage(), FormatPartitionPage(), InstallDirectoryPage(), InstallIntroPage(), KeyboardSettingsPage(), LanguagePage(), LayoutSettingsPage(), LicensePage(), PrepareCopyPage(), QuitPage(), RegistryPage(), RepairIntroPage(), SelectFileSystemPage(), SelectPartitionPage(), SetupStartPage(), SuccessPage(), UpgradeRepairPage(), and WelcomePage().

◆ MUIGetEntry()

const MUI_ENTRY* MUIGetEntry ( IN ULONG  Page,
IN INT  TextID 
)

@MUIGetEntry

Retrieves a MUI entry of a page, given the page number and the text ID.

Parameters
[in]PageThe MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
[in]TextIDThe text identification number (ID), as a unsigned integer. The parameter is used to identify its MUI properties like the coordinates, text style flag and its buffer content.
Returns
Returns a constant MUI entry.

Definition at line 297 of file mui.c.

300 {
301  const MUI_ENTRY * entry;
302  ULONG index;
303 
304  /* Retrieve the entries of a MUI page */
306  if (!entry)
307  {
308  DPRINT("MUIGetEntryData(): Failed to get the translated entry page!\n");
309  return NULL;
310  }
311 
312  /* Loop over the ID entries and check if it matches with one of them */
313  for (index = 0; entry[index].Buffer != NULL; index++)
314  {
315  if (entry[index].TextID == TextID)
316  {
317  /* They match so return the MUI entry */
318  return &entry[index];
319  }
320  }
321 
322  /* Page number or ID are incorrect so in this case bail out */
323  DPRINT("Couldn't get the MUI entry field from the page!\n");
324  return NULL;
325 }
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1295
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
static const MUI_ENTRY * FindMUIEntriesOfPage(IN ULONG PageNumber)
Definition: mui.c:103
#define DPRINT
Definition: sndvol32.h:71

Referenced by MUIClearStyledText(), MUIClearText(), MUISetStyledText(), and MUISetText().

◆ MUIGetString()

PCSTR MUIGetString ( ULONG  Number)

Definition at line 251 of file mui.c.

253 {
254  ULONG i;
255  const MUI_STRING * entry;
256  CHAR szErr[128];
257 
259  if (entry)
260  {
261  for (i = 0; entry[i].Number != 0; i++)
262  {
263  if (entry[i].Number == Number)
264  {
265  return entry[i].String;
266  }
267  }
268  }
269 
270  sprintf(szErr, "Error: failed find string id %lu for language index %lu\n", Number, FindLanguageIndex());
271 
273  NULL,
274  NULL,
276 
277  return "<nostring>";
278 }
#define POPUP_WAIT_NONE
Definition: usetup.h:123
char CHAR
Definition: xmlstorage.h:175
VOID PopupError(PCCH Text, PCCH Status, PINPUT_RECORD Ir, ULONG WaitEvent)
Definition: usetup.c:256
static const MUI_STRING * FindMUIStringEntries(VOID)
Definition: mui.c:134
#define sprintf(buf, format,...)
Definition: sprintf.c:55
Definition: mui.h:24
uint32_t entry
Definition: isohybrid.c:63
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
static ULONG FindLanguageIndex(VOID)
Definition: mui.c:56
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
#define NULL
Definition: types.h:112
TCHAR szErr[256]
Definition: service.c:38
unsigned int ULONG
Definition: retypes.h:1

Referenced by BootLoaderPage(), CheckFileSystemPage(), CreateExtendedPartitionPage(), CreateLogicalPartitionPage(), CreatePrimaryPartitionPage(), DeletePartitionPage(), DiskDescription(), DoChkdsk(), DoFormat(), DrawFileSystemList(), FileCopyCallback(), FileCopyPage(), FormatPartitionPage(), GetPartitionTypeString(), PartitionDescription(), PrettifySize1(), PrettifySize2(), ProgressCountdown(), QuitPage(), RegistryPage(), RegistryStatus(), RunUSetup(), SelectFileSystemPage(), SelectPartitionPage(), and ShowPartitionSizeInputBox().

◆ MUISetStyledText()

VOID MUISetStyledText ( IN ULONG  Page,
IN INT  TextID,
IN INT  Flags 
)

@MUISetStyledText

Prints a text to the console output, with a style for it.

Parameters
[in]PageThe MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
[in]TextIDThe text identification number (ID), as an integer. The parameter is used to identify its MUI properties like the coordinates, text style flag and its buffer content.
[in]FlagsThe text style flag, as an integer. The flag determines the style of the text, such as being highlighted, underlined, high padding and so on.
Returns
Nothing.

Definition at line 504 of file mui.c.

508 {
509  const MUI_ENTRY * entry;
510  ULONG Index = 0;
511 
512  /* Get the MUI entry */
513  entry = MUIGetEntry(Page, TextID);
514 
515  if (!entry)
516  return;
517 
518  /* Ensure that the text string given by the text ID and page is not NULL */
519  while (entry[Index].Buffer != NULL)
520  {
521  /* If text ID is not correct, skip the entry */
522  if (entry[Index].TextID != TextID)
523  {
524  Index++;
525  continue;
526  }
527 
528  /* Print the text to the console output by calling CONSOLE_SetStyledText() */
530 
531  /* Increment the index and loop over next entires with the same ID */
532  Index++;
533  }
534 }
#define Y(I)
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1295
Definition: bufpool.h:45
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ WDFCOLLECTION _In_ ULONG Index
VOID CONSOLE_SetStyledText(IN SHORT x, IN SHORT y, IN INT Flags, IN LPCSTR Text)
Definition: consup.c:671
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
const MUI_ENTRY * MUIGetEntry(IN ULONG Page, IN INT TextID)
Definition: mui.c:297

◆ MUISetText()

VOID MUISetText ( IN ULONG  Page,
IN INT  TextID 
)

@MUISetText

Prints a text to the console output.

Parameters
[in]PageThe MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
[in]TextIDThe text identification number (ID), as an integer. The parameter is used to identify its MUI properties like the coordinates, text style flag and its buffer content.
Returns
Nothing.

Definition at line 452 of file mui.c.

455 {
456  const MUI_ENTRY * entry;
457  ULONG Index = 0;
458 
459  /* Get the MUI entry */
460  entry = MUIGetEntry(Page, TextID);
461 
462  if (!entry)
463  return;
464 
465  /* Ensure that the text string given by the text ID and page is not NULL */
466  while (entry[Index].Buffer != NULL)
467  {
468  /* If text ID is not correct, skip the entry */
469  if (entry[Index].TextID != TextID)
470  {
471  Index++;
472  continue;
473  }
474 
475  /* Print the text to the console output by calling CONSOLE_SetTextXY() */
477 
478  /* Increment the index and loop over next entires with the same ID */
479  Index++;
480  }
481 }
VOID CONSOLE_SetTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:320
#define Y(I)
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1295
Definition: bufpool.h:45
_In_ WDFCOLLECTION _In_ ULONG Index
uint32_t entry
Definition: isohybrid.c:63
Definition: mui.h:3
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
const MUI_ENTRY * MUIGetEntry(IN ULONG Page, IN INT TextID)
Definition: mui.c:297

◆ SetConsoleCodePage()

VOID SetConsoleCodePage ( VOID  )

Definition at line 537 of file mui.c.

538 {
539  UINT wCodePage;
540 
541 #if 0
542  ULONG lngIndex = 0;
543 
544  while (ResourceList[lngIndex].MuiPages != NULL)
545  {
546  if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
547  {
548  wCodePage = (UINT) wcstoul(ResourceList[lngIndex].OEMCPage, NULL, 10);
549  SetConsoleOutputCP(wCodePage);
550  return;
551  }
552 
553  lngIndex++;
554  }
555 #else
557  SetConsoleOutputCP(wCodePage);
558 #endif
559 
560  switch (wCodePage)
561  {
562  case 28606: /* Romanian */
563  case 932: /* Japanese */
564  /* Set special characters */
565  CharBullet = 0x07;
566  CharBlock = 0x01;
567  CharHalfBlock = 0x02;
568  CharUpArrow = 0x03;
569  CharDownArrow = 0x04;
570  CharHorizontalLine = 0x05;
571  CharVerticalLine = 0x06;
572  CharUpperLeftCorner = 0x08;
573  CharUpperRightCorner = 0x09;
574  CharLowerLeftCorner = 0x0B;
575  CharLowerRightCorner = 0x0C;
579  CharDoubleVerticalLine = 0x11;
584 
585  /* FIXME: Enter 640x400 video mode */
586  break;
587 
588  default: /* Other codepages */
589  /* Set special characters */
590  CharBullet = 0x07;
591  CharBlock = 0xDB;
592  CharHalfBlock = 0xDD;
593  CharUpArrow = 0x18;
594  CharDownArrow = 0x19;
595  CharHorizontalLine = 0xC4;
596  CharVerticalLine = 0xB3;
597  CharUpperLeftCorner = 0xDA;
598  CharUpperRightCorner = 0xBF;
599  CharLowerLeftCorner = 0xC0;
600  CharLowerRightCorner = 0xD9;
604  CharDoubleVerticalLine = 0xBA;
609 
610  /* FIXME: Enter 720x400 video mode */
611  break;
612  }
613 }
CHAR CharUpperRightCorner
Definition: mui.c:42
CHAR CharDoubleLowerRightCorner
Definition: mui.c:52
CHAR CharUpArrow
Definition: mui.c:37
BOOL WINAPI SetConsoleOutputCP(IN UINT wCodepage)
Definition: console.c:695
CHAR CharDownArrow
Definition: mui.c:38
CHAR CharHorizontalLine
Definition: mui.c:39
CHAR CharBlock
Definition: mui.c:35
CHAR CharBullet
Definition: mui.c:34
CHAR CharDoubleHorizontalLine
Definition: mui.c:47
CHAR CharVerticalLine
Definition: mui.c:40
CHAR CharLowerLeftCorner
Definition: mui.c:43
CHAR CharDoubleUpperRightCorner
Definition: mui.c:50
CHAR CharDoubleVerticalLine
Definition: mui.c:48
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
CHAR CharLowerRightCorner
Definition: mui.c:44
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
PCWSTR MUIGetOEMCodePage(IN PCWSTR LanguageId)
Definition: mui.c:96
CHAR CharVertLineAndRightHorizLine
Definition: mui.c:45
CHAR CharUpperLeftCorner
Definition: mui.c:41
CHAR CharDoubleLowerLeftCorner
Definition: mui.c:51
PCWSTR SelectedLanguageId
Definition: usetup.c:66
CHAR CharLeftHorizLineAndVertLine
Definition: mui.c:46
CHAR CharHalfBlock
Definition: mui.c:36
CHAR CharDoubleUpperLeftCorner
Definition: mui.c:49
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by LanguagePage(), and SetupStartPage().

Variable Documentation

◆ CharBlock

CHAR CharBlock = 0xDB

Definition at line 35 of file mui.c.

Referenced by ProgressSetStep(), and SetConsoleCodePage().

◆ CharBullet

CHAR CharBullet = 0x07

Definition at line 34 of file mui.c.

Referenced by SetConsoleCodePage().

◆ CharDoubleHorizontalLine

CHAR CharDoubleHorizontalLine = 0xCD

Definition at line 47 of file mui.c.

Referenced by CONSOLE_SetUnderlinedTextXY(), DrawThickBorder(), and SetConsoleCodePage().

◆ CharDoubleLowerLeftCorner

CHAR CharDoubleLowerLeftCorner = 0xC8

Definition at line 51 of file mui.c.

Referenced by DrawThickBorder(), and SetConsoleCodePage().

◆ CharDoubleLowerRightCorner

CHAR CharDoubleLowerRightCorner = 0xBC

Definition at line 52 of file mui.c.

Referenced by DrawThickBorder(), and SetConsoleCodePage().

◆ CharDoubleUpperLeftCorner

CHAR CharDoubleUpperLeftCorner = 0xC9

Definition at line 49 of file mui.c.

Referenced by DrawThickBorder(), and SetConsoleCodePage().

◆ CharDoubleUpperRightCorner

CHAR CharDoubleUpperRightCorner = 0xBB

Definition at line 50 of file mui.c.

Referenced by DrawThickBorder(), and SetConsoleCodePage().

◆ CharDoubleVerticalLine

CHAR CharDoubleVerticalLine = 0xBA

Definition at line 48 of file mui.c.

Referenced by DrawThickBorder(), and SetConsoleCodePage().

◆ CharDownArrow

CHAR CharDownArrow = 0x19

Definition at line 38 of file mui.c.

Referenced by DrawPartitionList(), DrawScrollBarGenericList(), and SetConsoleCodePage().

◆ CharHalfBlock

CHAR CharHalfBlock = 0xDD

Definition at line 36 of file mui.c.

Referenced by ProgressSetStep(), and SetConsoleCodePage().

◆ CharHorizontalLine

CHAR CharHorizontalLine = 0xC4

◆ CharLeftHorizLineAndVertLine

CHAR CharLeftHorizLineAndVertLine = 0xB4

Definition at line 46 of file mui.c.

Referenced by PopupError(), and SetConsoleCodePage().

◆ CharLowerLeftCorner

CHAR CharLowerLeftCorner = 0xC0

Definition at line 43 of file mui.c.

Referenced by DrawBorder(), DrawBox(), DrawListFrame(), DrawPartitionList(), and SetConsoleCodePage().

◆ CharLowerRightCorner

CHAR CharLowerRightCorner = 0xD9

Definition at line 44 of file mui.c.

Referenced by DrawBorder(), DrawBox(), DrawListFrame(), DrawPartitionList(), and SetConsoleCodePage().

◆ CharUpArrow

CHAR CharUpArrow = 0x18

Definition at line 37 of file mui.c.

Referenced by DrawPartitionList(), DrawScrollBarGenericList(), and SetConsoleCodePage().

◆ CharUpperLeftCorner

CHAR CharUpperLeftCorner = 0xDA

Definition at line 41 of file mui.c.

Referenced by DrawBorder(), DrawBox(), DrawListFrame(), DrawPartitionList(), and SetConsoleCodePage().

◆ CharUpperRightCorner

CHAR CharUpperRightCorner = 0xBF

Definition at line 42 of file mui.c.

Referenced by DrawBorder(), DrawBox(), DrawListFrame(), DrawPartitionList(), and SetConsoleCodePage().

◆ CharVerticalLine

CHAR CharVerticalLine = 0xB3

Definition at line 40 of file mui.c.

Referenced by DrawBorder(), DrawBox(), DrawListFrame(), DrawPartitionList(), and SetConsoleCodePage().

◆ CharVertLineAndRightHorizLine

CHAR CharVertLineAndRightHorizLine = 0xC3

Definition at line 45 of file mui.c.

Referenced by PopupError(), and SetConsoleCodePage().