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.

93 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: I Q I N F O . C P P
  7. //
  8. // Contents: IQueryInfo implementation for CUPnPDeviceFolderQueryInfo
  9. //
  10. // Notes:
  11. //
  12. // Author: jeffspr 16 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "upsres.h"
  18. #include "shutil.h"
  19. HRESULT CUPnPDeviceFolderQueryInfo::CreateInstance(
  20. REFIID riid,
  21. void** ppv)
  22. {
  23. HRESULT hr = E_OUTOFMEMORY;
  24. CUPnPDeviceFolderQueryInfo * pObj = NULL;
  25. pObj = new CComObject <CUPnPDeviceFolderQueryInfo>;
  26. if (pObj)
  27. {
  28. // Do the standard CComCreator::CreateInstance stuff.
  29. //
  30. pObj->SetVoid (NULL);
  31. pObj->InternalFinalConstructAddRef ();
  32. hr = pObj->FinalConstruct ();
  33. pObj->InternalFinalConstructRelease ();
  34. if (SUCCEEDED(hr))
  35. {
  36. hr = pObj->QueryInterface (riid, ppv);
  37. }
  38. if (FAILED(hr))
  39. {
  40. delete pObj;
  41. }
  42. }
  43. return hr;
  44. }
  45. CUPnPDeviceFolderQueryInfo::CUPnPDeviceFolderQueryInfo()
  46. {
  47. m_pidl = NULL;
  48. }
  49. CUPnPDeviceFolderQueryInfo::~CUPnPDeviceFolderQueryInfo()
  50. {
  51. if (m_pidl)
  52. FreeIDL(m_pidl);
  53. }
  54. HRESULT CUPnPDeviceFolderQueryInfo::GetInfoTip(
  55. DWORD dwFlags,
  56. WCHAR **ppwszTip)
  57. {
  58. TraceTag(ttidShellFolderIface, "OBJ: CCFQI - IQueryInfo::GetInfoTip");
  59. HRESULT hr = NOERROR;
  60. PUPNPDEVICEFOLDPIDL pudfp = ConvertToUPnPDevicePIDL(m_pidl);
  61. if(pudfp)
  62. {
  63. hr = HrDupeShellString(WszLoadIds(IDS_UPNPDEV_INFOTIP), ppwszTip);
  64. }
  65. else
  66. {
  67. // no info tip
  68. hr = E_FAIL;
  69. }
  70. TraceHr(ttidError, FAL, hr, FALSE, "CUPnPDeviceFolderQueryInfo::GetInfoTip");
  71. return hr;
  72. }
  73. HRESULT CUPnPDeviceFolderQueryInfo::GetInfoFlags(
  74. DWORD *pdwFlags)
  75. {
  76. return E_NOTIMPL;
  77. }