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.

156 lines
3.4 KiB

  1. /*===================================================================
  2. Microsoft
  3. Microsoft Confidential.
  4. Copyright 1997 Microsoft Corporation. All Rights Reserved.
  5. Component: VPTOOL a WAMREG unit testing tool
  6. File: main.cpp
  7. Owner: leijin
  8. Note:
  9. ===================================================================*/
  10. #include <stdio.h>
  11. #include "module.h"
  12. #include "util.h"
  13. int _cdecl main (int argc, char **argv)
  14. {
  15. HRESULT hr = NOERROR;
  16. if (!ParseCommandLine(argc, argv))
  17. {
  18. return -1;
  19. }
  20. //
  21. // Do not do CoInitialize() in case of INSTALL or UNINSTALL
  22. //
  23. ModuleInitialize();
  24. switch(g_Command.eCmd)
  25. {
  26. #ifdef _WAMREG_LINK_DIRECT
  27. case eCommand_INSTALL:
  28. hr = CreateIISPackage();
  29. if (SUCCEEDED(hr))
  30. {
  31. printf("The default IIS Package has been installed on your machine.\n");
  32. }
  33. else
  34. {
  35. printf("Failed to create default IIS package, hr = %08x\n", hr);
  36. }
  37. break;
  38. case eCommand_UNINSTALL:
  39. hr = DeleteIISPackage();
  40. if (SUCCEEDED(hr))
  41. {
  42. printf("The default IIS Package has been Uninstalled from your machine.\n");
  43. }
  44. else
  45. {
  46. printf("Failed to uninstall default IIS package, hr = %08x\n", hr);
  47. }
  48. break;
  49. case eCommand_UPGRADE:
  50. hr = UpgradePackages(VS_K2Beta2, VS_K2Beta3);
  51. if (SUCCEEDED(hr))
  52. {
  53. printf("The packages has been upgraded on your machine.\n");
  54. }
  55. else
  56. {
  57. printf("Fail to upgrade the packages. hr = %08x\n",hr);
  58. }
  59. break;
  60. #endif
  61. case eCommand_CREATEINPROC:
  62. CreateInPool(g_Command.szMetabasePath, TRUE);
  63. break;
  64. case eCommand_CREATEINPOOL:
  65. CreateInPool(g_Command.szMetabasePath, FALSE);
  66. break;
  67. case eCommand_DELETE:
  68. Delete(g_Command.szMetabasePath);
  69. break;
  70. case eCommand_HELP:
  71. break;
  72. case eCommand_CREATEOUTPROC:
  73. CreateOutProc(g_Command.szMetabasePath);
  74. break;
  75. case eCommand_GETSTATUS:
  76. GetStatus(g_Command.szMetabasePath);
  77. break;
  78. case eCommand_UNLOAD:
  79. UnLoad(g_Command.szMetabasePath);
  80. break;
  81. case eCommand_DELETEREC:
  82. DeleteRecoverable(g_Command.szMetabasePath);
  83. break;
  84. case eCommand_RECOVER:
  85. Recover(g_Command.szMetabasePath);
  86. break;
  87. case eCommand_GETSIGNATURE:
  88. GetSignature();
  89. break;
  90. case eCommand_SERIALIZE:
  91. Serialize();
  92. break;
  93. case eCommand_2CREATE:
  94. CREATE2();
  95. break;
  96. case eCommand_2DELETE:
  97. DELETE2();
  98. break;
  99. case eCommand_2CREATEPOOL:
  100. CREATEPOOL2();
  101. break;
  102. case eCommand_2DELETEPOOL:
  103. DELETEPOOL2();
  104. break;
  105. case eCommand_2ENUMPOOL:
  106. ENUMPOOL2();
  107. break;
  108. case eCommand_2RECYCLEPOOL:
  109. RECYCLEPOOL();
  110. break;
  111. case eCommand_2GETMODE:
  112. GETMODE();
  113. break;
  114. case eCommand_2TestConn:
  115. TestConn();
  116. break;
  117. default:
  118. printf("This feature has not been implemented.\n");
  119. break;
  120. }
  121. ModuleUnInitialize();
  122. return 0;
  123. }