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.

75 lines
2.0 KiB

  1. #include <windows.h>
  2. #include <subsmgr.h>
  3. #include <stdio.h>
  4. #include <stdarg.h>
  5. void ErrorExit(char *fmt, ...)
  6. {
  7. va_list va;
  8. va_start(va, fmt);
  9. vprintf(fmt, va);
  10. exit(1);
  11. }
  12. int _cdecl main()
  13. {
  14. HINSTANCE hinst = LoadLibrary("webcheck.dll");
  15. if (hinst)
  16. {
  17. typedef (*PFCONVERTNOTFMGR)();
  18. PFCONVERTNOTFMGR ConvertNotfMgrSubscriptions;
  19. PFCONVERTNOTFMGR ConvertNotfMgrSchedules;
  20. ConvertNotfMgrSchedules = (PFCONVERTNOTFMGR)GetProcAddress(hinst, MAKEINTRESOURCE(11));
  21. if (ConvertNotfMgrSchedules)
  22. {
  23. HRESULT hr = ConvertNotfMgrSchedules();
  24. if (SUCCEEDED(hr))
  25. {
  26. printf("Schedule conversion succeeded - return code: 0x%08x\n", hr);
  27. ConvertNotfMgrSubscriptions = (PFCONVERTNOTFMGR)GetProcAddress(hinst, MAKEINTRESOURCE(10));
  28. if (ConvertNotfMgrSubscriptions)
  29. {
  30. HRESULT hr = ConvertNotfMgrSubscriptions();
  31. if (SUCCEEDED(hr))
  32. {
  33. printf("Subscription conversion succeeded - return code: 0x%08x\n", hr);
  34. }
  35. else
  36. {
  37. ErrorExit("Error converting subscriptions - error code: 0x%08x\n", hr);
  38. }
  39. }
  40. else
  41. {
  42. ErrorExit("Couldn't find procedure 'ConvertNotfMgrSubscriptions' ordinal #10 - error code: %d\n",
  43. GetLastError());
  44. }
  45. }
  46. else
  47. {
  48. ErrorExit("Error converting schedules - error code: 0x%08x\n", hr);
  49. }
  50. }
  51. else
  52. {
  53. ErrorExit("Couldn't find procedure 'ConvertNotfMgrSchedules' ordinal #11 - error code: %d\n",
  54. GetLastError());
  55. }
  56. }
  57. else
  58. {
  59. ErrorExit("Couldn't load webcheck - error code: %d\n", GetLastError());
  60. }
  61. return 0;
  62. }