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.

103 lines
2.2 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 CConnectionFolderQueryInfo
  9. //
  10. // Notes:
  11. //
  12. // Author: jeffspr 16 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "foldinc.h" // Standard shell\folder includes
  18. #include <nsres.h>
  19. #include "shutil.h"
  20. HRESULT CConnectionFolderQueryInfo::CreateInstance(
  21. IN REFIID riid,
  22. OUT void** ppv)
  23. {
  24. TraceFileFunc(ttidShellFolderIface);
  25. HRESULT hr = E_OUTOFMEMORY;
  26. CConnectionFolderQueryInfo * pObj = NULL;
  27. pObj = new CComObject <CConnectionFolderQueryInfo>;
  28. if (pObj)
  29. {
  30. // Do the standard CComCreator::CreateInstance stuff.
  31. //
  32. pObj->SetVoid (NULL);
  33. pObj->InternalFinalConstructAddRef ();
  34. hr = pObj->FinalConstruct ();
  35. pObj->InternalFinalConstructRelease ();
  36. if (SUCCEEDED(hr))
  37. {
  38. hr = pObj->QueryInterface (riid, ppv);
  39. }
  40. if (FAILED(hr))
  41. {
  42. delete pObj;
  43. }
  44. }
  45. return hr;
  46. }
  47. CConnectionFolderQueryInfo::CConnectionFolderQueryInfo() throw()
  48. {
  49. m_pidl.Clear();
  50. }
  51. CConnectionFolderQueryInfo::~CConnectionFolderQueryInfo() throw()
  52. {
  53. }
  54. HRESULT CConnectionFolderQueryInfo::GetInfoTip(
  55. IN DWORD dwFlags,
  56. OUT WCHAR **ppwszTip)
  57. {
  58. TraceFileFunc(ttidShellFolderIface);
  59. HRESULT hr = NOERROR;
  60. if(m_pidl.empty())
  61. {
  62. hr = E_FAIL;
  63. }
  64. else
  65. {
  66. if (*m_pidl->PszGetDeviceNamePointer())
  67. {
  68. hr = HrDupeShellString(m_pidl->PszGetDeviceNamePointer(), ppwszTip);
  69. }
  70. else
  71. {
  72. hr = HrDupeShellString(m_pidl->PszGetNamePointer(), ppwszTip);
  73. }
  74. }
  75. TraceHr(ttidError, FAL, hr, FALSE, "CConnectionFolderQueryInfo::GetInfoTip");
  76. return hr;
  77. }
  78. HRESULT CConnectionFolderQueryInfo::GetInfoFlags(
  79. OUT DWORD *pdwFlags)
  80. {
  81. TraceFileFunc(ttidShellFolderIface);
  82. return E_NOTIMPL;
  83. }