ReactOS  0.4.15-dev-3457-gf6edd65
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)
 

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 35 of file mui.c.

36 {
37  ULONG lngIndex = 0;
38 
39  if (SelectedLanguageId == NULL)
40  {
41  /* Default to en-US */
42  return 0; // FIXME!!
43  // SelectedLanguageId = L"00000409";
44  }
45 
46  while (ResourceList[lngIndex].MuiPages != NULL)
47  {
48  if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
49  {
50  return lngIndex;
51  }
52 
53  lngIndex++;
54  }
55 
56  return 0;
57 }
_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 82 of file mui.c.

84 {
85  ULONG muiIndex = 0;
86  ULONG lngIndex;
87  const MUI_PAGE * Pages = NULL;
88 
89  lngIndex = max(FindLanguageIndex(), 0);
90  Pages = ResourceList[lngIndex].MuiPages;
91 
92  while (Pages[muiIndex].MuiEntry != NULL)
93  {
94  if (Pages[muiIndex].Number == PageNumber)
95  return Pages[muiIndex].MuiEntry;
96 
97  muiIndex++;
98  }
99 
100  return NULL;
101 }
#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:35
#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 105 of file mui.c.

106 {
107  ULONG lngIndex = max(FindLanguageIndex(), 0);
108  return ResourceList[lngIndex].MuiErrors;
109 }
#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:35
unsigned int ULONG
Definition: retypes.h:1

Referenced by MUIDisplayErrorV().

◆ FindMUIStringEntries()

static const MUI_STRING* FindMUIStringEntries ( VOID  )
static

Definition at line 113 of file mui.c.

114 {
115  ULONG lngIndex = max(FindLanguageIndex(), 0);
116  return ResourceList[lngIndex].MuiStrings;
117 }
#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:35
unsigned int ULONG
Definition: retypes.h:1

Referenced by MUIGetString().

◆ MUIClearPage()

VOID MUIClearPage ( IN ULONG  page)

Definition at line 121 of file mui.c.

123 {
124  const MUI_ENTRY * entry;
125  ULONG index;
126 
128  if (!entry)
129  {
130  PopupError("Error: Failed to find translated page",
131  NULL,
132  NULL,
134  return;
135  }
136 
137  index = 0;
138  while (entry[index].Buffer != NULL)
139  {
141  entry[index].Y,
142  entry[index].Flags,
144  index++;
145  }
146 }
#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:82

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 378 of file mui.c.

382 {
383  const MUI_ENTRY * entry;
384  ULONG Index = 0;
385 
386  /* Get the MUI entry */
387  entry = MUIGetEntry(Page, TextID);
388 
389  if (!entry)
390  return;
391 
392  /* Ensure that the text string given by the text ID and page is not NULL */
393  while (entry[Index].Buffer != NULL)
394  {
395  /* If text ID is not correct, skip the entry */
396  if (entry[Index].TextID != TextID)
397  {
398  Index++;
399  continue;
400  }
401 
402  /* Now, begin removing the text by calling CONSOLE_ClearStyledText() */
404  entry[Index].X,
405  entry[Index].Y,
406  Flags,
408 
409  /* Increment the index and loop over next entires with the same ID */
410  Index++;
411  }
412 }
#define Y(I)
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: bufpool.h:45
PFN_NUMBER Page
Definition: section.c:4924
_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:276
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 323 of file mui.c.

326 {
327  const MUI_ENTRY * entry;
328  ULONG Index = 0;
329 
330  /* Get the MUI entry */
331  entry = MUIGetEntry(Page, TextID);
332 
333  if (!entry)
334  return;
335 
336  /* Ensure that the text string given by the text ID and page is not NULL */
337  while (entry[Index].Buffer != NULL)
338  {
339  /* If text ID is not correct, skip the entry */
340  if (entry[Index].TextID != TextID)
341  {
342  Index++;
343  continue;
344  }
345 
346  /* Remove the text by using CONSOLE_ClearTextXY() */
348  entry[Index].X,
349  entry[Index].Y,
351 
352  /* Increment the index and loop over next entires with the same ID */
353  Index++;
354  }
355 }
#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
Definition: bufpool.h:45
PFN_NUMBER Page
Definition: section.c:4924
_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:276

◆ MUIDisplayError()

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

Definition at line 216 of file mui.c.

221 {
222  va_list arg_ptr;
223 
224  va_start(arg_ptr, WaitEvent);
225  MUIDisplayErrorV(ErrorNum, Ir, WaitEvent, arg_ptr);
226  va_end(arg_ptr);
227 }
#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:178

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 178 of file mui.c.

183 {
184  const MUI_ERROR* entry;
185  CHAR Buffer[2048];
186 
187  if (ErrorNum >= ERROR_LAST_ERROR_CODE)
188  {
189  PopupError("Invalid error number provided",
190  "Press ENTER to continue",
191  Ir,
193  return;
194  }
195 
197  if (!entry)
198  {
199  PopupError("Error: Failed to find translated error message",
200  NULL,
201  NULL,
203  return;
204  }
205 
206  vsprintf(Buffer, entry[ErrorNum].ErrorText, args);
207 
209  entry[ErrorNum].ErrorStatus,
210  Ir,
211  WaitEvent);
212 }
#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:105
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 149 of file mui.c.

151 {
152  const MUI_ENTRY * entry;
153  ULONG index;
154 
156  if (!entry)
157  {
158  PopupError("Error: Failed to find translated page",
159  NULL,
160  NULL,
162  return;
163  }
164 
165  index = 0;
166  while (entry[index].Buffer != NULL)
167  {
169  entry[index].Y,
170  entry[index].Flags,
171  entry[index].Buffer);
172 
173  index++;
174  }
175 }
#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:82

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 276 of file mui.c.

279 {
280  const MUI_ENTRY * entry;
281  ULONG index;
282 
283  /* Retrieve the entries of a MUI page */
285  if (!entry)
286  {
287  DPRINT("MUIGetEntryData(): Failed to get the translated entry page!\n");
288  return NULL;
289  }
290 
291  /* Loop over the ID entries and check if it matches with one of them */
292  for (index = 0; entry[index].Buffer != NULL; index++)
293  {
294  if (entry[index].TextID == TextID)
295  {
296  /* They match so return the MUI entry */
297  return &entry[index];
298  }
299  }
300 
301  /* Page number or ID are incorrect so in this case bail out */
302  DPRINT("Couldn't get the MUI entry field from the page!\n");
303  return NULL;
304 }
PFN_NUMBER Page
Definition: section.c:4924
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:82
#define DPRINT
Definition: sndvol32.h:71

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

◆ MUIGetString()

PCSTR MUIGetString ( ULONG  Number)

Definition at line 230 of file mui.c.

232 {
233  ULONG i;
234  const MUI_STRING * entry;
235  CHAR szErr[128];
236 
238  if (entry)
239  {
240  for (i = 0; entry[i].Number != 0; i++)
241  {
242  if (entry[i].Number == Number)
243  {
244  return entry[i].String;
245  }
246  }
247  }
248 
249  sprintf(szErr, "Error: failed find string id %lu for language index %lu\n", Number, FindLanguageIndex());
250 
252  NULL,
253  NULL,
255 
256  return "<nostring>";
257 }
#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:113
#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:35
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 483 of file mui.c.

487 {
488  const MUI_ENTRY * entry;
489  ULONG Index = 0;
490 
491  /* Get the MUI entry */
492  entry = MUIGetEntry(Page, TextID);
493 
494  if (!entry)
495  return;
496 
497  /* Ensure that the text string given by the text ID and page is not NULL */
498  while (entry[Index].Buffer != NULL)
499  {
500  /* If text ID is not correct, skip the entry */
501  if (entry[Index].TextID != TextID)
502  {
503  Index++;
504  continue;
505  }
506 
507  /* Print the text to the console output by calling CONSOLE_SetStyledText() */
509 
510  /* Increment the index and loop over next entires with the same ID */
511  Index++;
512  }
513 }
#define Y(I)
Definition: bufpool.h:45
PFN_NUMBER Page
Definition: section.c:4924
_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:276

◆ 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 431 of file mui.c.

434 {
435  const MUI_ENTRY * entry;
436  ULONG Index = 0;
437 
438  /* Get the MUI entry */
439  entry = MUIGetEntry(Page, TextID);
440 
441  if (!entry)
442  return;
443 
444  /* Ensure that the text string given by the text ID and page is not NULL */
445  while (entry[Index].Buffer != NULL)
446  {
447  /* If text ID is not correct, skip the entry */
448  if (entry[Index].TextID != TextID)
449  {
450  Index++;
451  continue;
452  }
453 
454  /* Print the text to the console output by calling CONSOLE_SetTextXY() */
456 
457  /* Increment the index and loop over next entires with the same ID */
458  Index++;
459  }
460 }
VOID CONSOLE_SetTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:320
#define Y(I)
Definition: bufpool.h:45
PFN_NUMBER Page
Definition: section.c:4924
_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:276

◆ SetConsoleCodePage()

VOID SetConsoleCodePage ( VOID  )

Definition at line 516 of file mui.c.

517 {
518  UINT wCodePage;
519 
520 #if 0
521  ULONG lngIndex = 0;
522 
523  while (ResourceList[lngIndex].MuiPages != NULL)
524  {
525  if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
526  {
527  wCodePage = (UINT) wcstoul(ResourceList[lngIndex].OEMCPage, NULL, 10);
528  SetConsoleOutputCP(wCodePage);
529  return;
530  }
531 
532  lngIndex++;
533  }
534 #else
536  SetConsoleOutputCP(wCodePage);
537 #endif
538 }
BOOL WINAPI SetConsoleOutputCP(IN UINT wCodepage)
Definition: console.c:692
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_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
PCWSTR SelectedLanguageId
Definition: usetup.c:66
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().