Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.3 KiB

  1. /*************************************************************************
  2. *
  3. * DISPLAY.C
  4. *
  5. * NetWare script routines for displaying information, ported from DOS
  6. *
  7. * Copyright (c) 1995 Microsoft Corporation
  8. *
  9. * $Log: N:\NT\PRIVATE\NW4\NWSCRIPT\VCS\DISPLAY.C $
  10. *
  11. * Rev 1.2 10 Apr 1996 14:22:06 terryt
  12. * Hotfix for 21181hq
  13. *
  14. * Rev 1.2 12 Mar 1996 19:53:04 terryt
  15. * Relative NDS names and merge
  16. *
  17. * Rev 1.1 22 Dec 1995 14:24:18 terryt
  18. * Add Microsoft headers
  19. *
  20. * Rev 1.0 15 Nov 1995 18:06:48 terryt
  21. * Initial revision.
  22. *
  23. * Rev 1.1 25 Aug 1995 16:22:32 terryt
  24. * Capture support
  25. *
  26. * Rev 1.0 15 May 1995 19:10:26 terryt
  27. * Initial revision.
  28. *
  29. *************************************************************************/
  30. /*
  31. File name: display.c
  32. Do not add any other functions to this file.
  33. Otherwise many exes size will increase.
  34. */
  35. #include "common.h"
  36. /*
  37. Display error report.
  38. */
  39. void DisplayError(int error ,char *functionName)
  40. {
  41. DisplayMessage(IDR_ERROR, error ,functionName);
  42. }
  43. void xstrupr(char *buffer)
  44. {
  45. for (; *buffer; buffer++)
  46. {
  47. if (IsDBCSLeadByte(*buffer))
  48. buffer++;
  49. else if (*buffer == 0xff80)
  50. *buffer = (char)0xff87;
  51. else if (*buffer == 0xff81)
  52. *buffer = (char)0xff9a;
  53. else if (*buffer == 0xff82)
  54. *buffer = (char)0xff90;
  55. else if (*buffer == 0xff84)
  56. *buffer = (char)0xff8e;
  57. else if (*buffer == 0xff88)
  58. *buffer = (char)0xff9f;
  59. else if (*buffer == 0xff91)
  60. *buffer = (char)0xff92;
  61. else if (*buffer == 0xff94)
  62. *buffer = (char)0xff99;
  63. else if (*buffer == 0xffa4)
  64. *buffer = (char)0xffa5;
  65. }
  66. _strupr (buffer);
  67. }
  68. /*
  69. Read password from the keyboard input.
  70. */
  71. void ReadPassword(char * Password)
  72. {
  73. int i = 0;
  74. char c;
  75. do
  76. { c=(char)_getch();
  77. if (c == '\b')
  78. {
  79. if (i > 0)
  80. i--;
  81. }
  82. else
  83. {
  84. Password[i]=c;
  85. i++;
  86. }
  87. }while((c!='\r') && i< MAX_PASSWORD_LEN );
  88. Password[i-1]='\0';
  89. xstrupr(Password);
  90. DisplayMessage(IDR_NEWLINE);
  91. }