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.

92 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: T I M E R T S T . C P P
  7. //
  8. // Contents:
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 30 Jun 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "stdio.h"
  18. #include "hostp.h"
  19. #include "hostp_i.c"
  20. EXTERN_C
  21. VOID
  22. __cdecl
  23. wmain (
  24. IN INT argc,
  25. IN PCWSTR argv[])
  26. {
  27. HRESULT hr;
  28. IUPnPEventingManagerDiag * puemd;
  29. CoInitialize(NULL);
  30. hr = CoCreateInstance(CLSID_UPnPEventingManagerDiag, NULL, CLSCTX_LOCAL_SERVER,
  31. IID_IUPnPEventingManagerDiag, (LPVOID *)&puemd);
  32. if (SUCCEEDED(hr))
  33. {
  34. DWORD ces;
  35. UDH_EVTSRC_INFO * rgesInfo;
  36. hr = puemd->GetEventSourceInfo(&ces, &rgesInfo);
  37. if (SUCCEEDED(hr))
  38. {
  39. printf("Got event source info...\n");
  40. DWORD ies;
  41. DWORD isub;
  42. UDH_SUBSCRIBER_INFO * psub;
  43. for (ies = 0; ies < ces; ies++)
  44. {
  45. printf("Event source ID: %S\n", rgesInfo[ies].szEsid);
  46. printf("-----------------------------------\n");
  47. for (isub = 0; isub < rgesInfo[ies].cSubs; isub++)
  48. {
  49. printf("Subscriber #%d:\n", isub);
  50. printf("SID: %S\n", rgesInfo[ies].rgSubs[isub].szSid);
  51. printf("URL: %S\n", rgesInfo[ies].rgSubs[isub].szDestUrl);
  52. printf("TO : %d\n", rgesInfo[ies].rgSubs[isub].csecTimeout);
  53. printf("SEQ: %d\n", rgesInfo[ies].rgSubs[isub].iSeq);
  54. printf("-----------------------------\n");
  55. CoTaskMemFree(rgesInfo[ies].rgSubs[isub].szSid);
  56. CoTaskMemFree(rgesInfo[ies].rgSubs[isub].szDestUrl);
  57. }
  58. printf("##################################################\n");
  59. CoTaskMemFree(rgesInfo[ies].rgSubs);
  60. CoTaskMemFree(rgesInfo[ies].szEsid);
  61. }
  62. CoTaskMemFree(rgesInfo);
  63. }
  64. else
  65. {
  66. printf("Failed to GetEventSourceInfo(): %08X\n", hr);
  67. }
  68. puemd->Release();
  69. }
  70. else
  71. {
  72. printf("Failed to CoCreateInstance() the diagnostic class: %08X\n", hr);
  73. }
  74. CoUninitialize();
  75. }