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.

110 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. hwdatgen.c
  5. Abstract:
  6. This module creates a tool that generates hwcomp.dat and is designed for us by
  7. the NT build lab. It simply calls the code in hwcomp.lib, the same code that
  8. the Win9x upgrade uses to determine incompatibilities.
  9. Author:
  10. Jim Schmidt (jimschm) 12-Oct-1996
  11. Revision History:
  12. <alias> <date> <comments>
  13. --*/
  14. #include <windows.h>
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include "miglib.h"
  18. VOID
  19. HelpAndExit (
  20. VOID
  21. )
  22. {
  23. printf ("Command line syntax:\n\n"
  24. "hwdatdmp [<hwcomp.dat path>] [/i]\n\n"
  25. "Optional Arguments:\n"
  26. " <hwcomp.dat path> - Specifies path to hwcomp.dat\n\n"
  27. " /i Shows PNP IDs only without the INF file\n"
  28. "\n");
  29. exit(255);
  30. }
  31. INT
  32. __cdecl
  33. main (
  34. INT argc,
  35. CHAR *argv[]
  36. )
  37. {
  38. PSTR InputPath = NULL;
  39. INT i;
  40. BOOL ShowInfs = TRUE;
  41. //
  42. // Parse command line
  43. //
  44. for (i = 1 ; i < argc ; i++) {
  45. if (argv[i][0] == '-' || argv[i][0] == '/') {
  46. switch (tolower (argv[i][1])) {
  47. case 'i':
  48. ShowInfs = FALSE;
  49. break;
  50. default:
  51. HelpAndExit();
  52. }
  53. } else {
  54. if (InputPath) {
  55. HelpAndExit();
  56. }
  57. InputPath = argv[i];
  58. }
  59. }
  60. if (!InputPath) {
  61. InputPath = "hwcomp.dat";
  62. }
  63. printf ("Input path: '%s'\n\n", InputPath);
  64. //
  65. // Init migutil.lib
  66. //
  67. InitializeMigLib();
  68. //
  69. // Dump hwcomp.dat
  70. //
  71. DumpHwCompDat (InputPath, ShowInfs);
  72. //
  73. // Cleanup
  74. //
  75. TerminateMigLib();
  76. return 0;
  77. }