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.

61 lines
1.7 KiB

  1. #include "stdafx.h"
  2. #include <stdio.h>
  3. #include <objbase.h>
  4. #include "wchar.h"
  5. #include "HelpServiceTypeLib.h"
  6. #include "HelpServiceTypeLib_i.c"
  7. #include "register.h"
  8. CComModule _Module;
  9. /**************************************************
  10. usage: saftest.exe -[A|D] config-file-name
  11. ****************************************************/
  12. int __cdecl wmain(int argc, WCHAR* argv[])
  13. {
  14. HRESULT hr;
  15. if (argc <2 || argv[1][1] == L'A' && argc < 3 || argv[1][1] != L'A' && argc < 2)
  16. {
  17. wprintf(L"\nUsage: -[A config-file-name|R [config-file-name]|C http-test-string]\n\n");
  18. return 0;
  19. }
  20. if (argv[1][1] == L'A')
  21. {
  22. wprintf(L"\n... Add support channel config file: %s...\n\n", argv[2]);
  23. hr = RegisterSupportChannel(
  24. L"VendorID:12345",
  25. L"Vendor Test Company",
  26. argv[2]);
  27. }
  28. else if (argv[1][1] == L'R')
  29. {
  30. wprintf(L"\n... Delete support config file: %s...\n\n", argv[2]);
  31. hr = RemoveSupportChannel(
  32. L"VendorID:12345",
  33. L"Vendor Test Company",
  34. argv[2]);
  35. }
  36. /*
  37. else if (argv[1][1] == L'C')
  38. {
  39. wprintf(L"\n... Check if %s is a legal support channel...\n\n", argv[2]);
  40. BOOL bRes = FALSE;
  41. GetSupportChannelMap();
  42. bRes = IsSupportChannel(argv[2]);
  43. wprintf(L"%s, it %s a support channel.\n\n",
  44. bRes ? L"Yes" : L"No",
  45. bRes ? L"is" : L"is not");
  46. CloseSupportChannelMap();
  47. }
  48. */
  49. if (FAILED(hr))
  50. printf("Test Failed\n");
  51. else
  52. printf("Test Succeed\n");
  53. return 0;
  54. }