Source code of Windows XP (NT5)
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.

114 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. instutil.h
  5. Abstract:
  6. Header file for common definition for programs that manipulate the output of
  7. the INSTALER.EXE program (e.g. DISPINST.EXE, COMPINST.EXE, UNDOINST.EXE)
  8. Author:
  9. Steve Wood (stevewo) 14-Jan-1996
  10. Revision History:
  11. --*/
  12. #include <windows.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <tchar.h>
  16. WCHAR InstalerDirectory[ MAX_PATH ];
  17. PWSTR InstallationName;
  18. PWSTR ImlPath;
  19. BOOLEAN DebugOutput;
  20. //
  21. // Useful rounding macros that the rounding amount is always a
  22. // power of two.
  23. //
  24. #define ROUND_DOWN( Size, Amount ) ((DWORD)(Size) & ~((Amount) - 1))
  25. #define ROUND_UP( Size, Amount ) (((DWORD)(Size) + ((Amount) - 1)) & ~((Amount) - 1))
  26. void
  27. InitCommonCode(
  28. LPSTR ModuleName,
  29. LPSTR ModuleUsage1,
  30. LPSTR ModuleUsage2
  31. );
  32. void
  33. Usage(
  34. LPSTR Message,
  35. ULONG MessageParameter
  36. );
  37. void
  38. FatalError(
  39. LPSTR Message,
  40. ULONG MessageParameter1,
  41. ULONG MessageParameter2
  42. );
  43. void
  44. InputMessage(
  45. PWSTR FileName,
  46. ULONG LineNumber,
  47. BOOLEAN Error,
  48. LPSTR Message,
  49. ULONG MessageParameter1,
  50. ULONG MessageParameter2
  51. );
  52. PWSTR
  53. GetArgAsUnicode(
  54. LPSTR s
  55. );
  56. void
  57. CommonSwitchProcessing(
  58. PULONG argc,
  59. PCHAR **argv,
  60. CHAR c
  61. );
  62. BOOLEAN
  63. CommonArgProcessing(
  64. PULONG argc,
  65. PCHAR **argv
  66. );
  67. PWSTR
  68. FormatTempFileName(
  69. PWSTR Directory,
  70. PUSHORT TempFileUniqueId
  71. );
  72. PWSTR
  73. CreateBackupFileName(
  74. PUSHORT TempFileUniqueId
  75. );
  76. typedef struct _ENUM_TYPE_NAMES {
  77. ULONG Value;
  78. LPSTR Name;
  79. } ENUM_TYPE_NAMES, *PENUM_TYPE_NAMES;
  80. LPSTR
  81. FormatEnumType(
  82. ULONG BufferIndex,
  83. PENUM_TYPE_NAMES Table,
  84. ULONG Value,
  85. BOOLEAN FlagFormat
  86. );
  87. ENUM_TYPE_NAMES ValueDataTypeNames[];