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.

127 lines
3.1 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. Choice.h
  5. Abstract:
  6. This module contains function definitions required by Choice.cpp
  7. Author:
  8. Wipro Technologies 22-June.-2001 (Created it)
  9. Revision History:
  10. --*/
  11. #ifndef _CHOICE_H
  12. #define _CHOICE_H
  13. #include "resource.h"
  14. // Defines
  15. #define MAX_NUM_RECS 2
  16. #define OPEN_BRACKET L"["
  17. #define CLOSED_BRACKET L"]?"
  18. #define COMMA L","
  19. #define SPACE L" "
  20. //#define OUTOUT_DEVICE_ERROR 1000 // this value should not be in resource.h
  21. #define MAX_COMMANDLINE_OPTION 7 // Maximum Command Line options
  22. #define EXIT__FAILURE 255
  23. #define NULL_U_STRING L"\0"
  24. #define NULL_U_CHAR L'\0'
  25. #define EXIT_SUCCESS 0
  26. #define FREQUENCY_IN_HERTZ 1500
  27. #define DURETION_IN_MILI_SEC 500
  28. #define MILI_SEC_TO_SEC_FACTOR 1000
  29. #define TIMEOUT_MIN 0
  30. #define TIMEOUT_MAX 9999
  31. #define DEFAULT_CHOICE GetResString(IDS_DEFAULT_CHOICE)
  32. // following are indxes used for command line parameter
  33. #define ID_HELP 0
  34. #define ID_CHOICE 1
  35. #define ID_PROMPT_CHOICE 2
  36. #define ID_CASE_SENSITIVE 3
  37. #define ID_DEFAULT_CHOICE 4
  38. #define ID_TIMEOUT_FACTOR 5
  39. #define ID_MESSAGE_STRING 6
  40. #define END_OF_LINE L"\n"
  41. /*#define RELEASE_MEMORY_EX( block ) \
  42. if ( NULL!=(block) ) \
  43. { \
  44. delete [] (block); \
  45. (block) = NULL; \
  46. } \
  47. 1
  48. #define DESTROY_ARRAY( array ) \
  49. if ( NULL != (array) ) \
  50. { \
  51. DestroyDynamicArray( &(array) ); \
  52. (array) = NULL;\
  53. } \
  54. 1*/
  55. BOOL
  56. ProcessCMDLine(
  57. IN DWORD argc,
  58. IN LPCWSTR argv[],
  59. OUT TCMDPARSER2 *pcmdParcerHead,
  60. OUT PBOOL pbUsage,
  61. OUT LPWSTR pszChoice,
  62. OUT PBOOL pbCaseSensitive,
  63. OUT PBOOL pbShowChoice,
  64. OUT PLONG plTimeOutFactor,
  65. OUT LPWSTR pszDefaultChoice,
  66. OUT LPWSTR pszMessage);
  67. void ShowUsage(void); // displays the help
  68. BOOL
  69. BuildPrompt(
  70. IN TCMDPARSER2 *pcmdParcer,
  71. IN BOOL bShowChoice,
  72. IN LPWSTR pszChoice,
  73. IN LPWSTR pszMessage,
  74. OUT LPWSTR pszPromptStr);
  75. DWORD
  76. UniStrChr(
  77. IN LPWSTR pszBuf,
  78. IN WCHAR szChar);
  79. DWORD
  80. GetChoice(
  81. IN LPCWSTR pszPromptStr,
  82. IN LONG lTimeOutFactor,
  83. IN BOOL bCaseSensitive,
  84. IN LPWSTR pszChoice,
  85. IN LPCWSTR pszDefaultChoice,
  86. OUT PBOOL pbErrorOnCarriageReturn);
  87. BOOL
  88. CheckforDuplicates( IN LPWSTR lpszChoice );
  89. /*void
  90. MakeErrorMsg(
  91. IN HRESULT hr,
  92. OUT LPWSTR pszErrorMsg);*/
  93. BOOL
  94. WINAPI HandlerRoutine( DWORD dwCtrlType ) ;
  95. // End of file
  96. #endif // _CHOICE_H