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.

119 lines
2.6 KiB

  1. #include "stdafx.h"
  2. #include "objects.h"
  3. #include "maindoc.h"
  4. /***********************************************************
  5. Function:
  6. Arguments:
  7. Return:
  8. Purpose:
  9. Author(s):
  10. Revision:
  11. Date:
  12. ***********************************************************/
  13. COleDsSession::COleDsSession( )
  14. {
  15. }
  16. /***********************************************************
  17. Function:
  18. Arguments:
  19. Return:
  20. Purpose:
  21. Author(s):
  22. Revision:
  23. Date:
  24. ***********************************************************/
  25. COleDsSession::COleDsSession( IUnknown *pIUnk): COleDsObject( pIUnk )
  26. {
  27. m_bHasChildren = FALSE;
  28. }
  29. /***********************************************************
  30. Function:
  31. Arguments:
  32. Return:
  33. Purpose:
  34. Author(s):
  35. Revision:
  36. Date:
  37. ***********************************************************/
  38. COleDsSession::~COleDsSession( )
  39. {
  40. }
  41. /***********************************************************
  42. Function:
  43. Arguments:
  44. Return:
  45. Purpose:
  46. Author(s):
  47. Revision:
  48. Date:
  49. ***********************************************************/
  50. HRESULT COleDsSession::ReleaseIfNotTransient( void )
  51. {
  52. return S_OK;
  53. }
  54. /***********************************************************
  55. Function:
  56. Arguments:
  57. Return:
  58. Purpose:
  59. Author(s):
  60. Revision:
  61. Date:
  62. ***********************************************************/
  63. CString COleDsSession::GetDeleteName( )
  64. {
  65. HRESULT hResult, hResultX;
  66. IADsSession* pISess = NULL;
  67. CString strDeleteName;
  68. BSTR bstrName;
  69. hResult = m_pIUnk->QueryInterface( IID_IADs, (void**) &pISess );
  70. ASSERT( SUCCEEDED( hResult ) );
  71. hResultX = pISess->get_Name( &bstrName );
  72. if( SUCCEEDED( hResultX ) )
  73. {
  74. strDeleteName = bstrName;
  75. SysFreeString( bstrName );
  76. return strDeleteName;
  77. }
  78. if( SUCCEEDED( hResult ) )
  79. {
  80. VARIANT var;
  81. hResult = Get( pISess, _T("User"), &var );
  82. ASSERT( SUCCEEDED( hResult ) );
  83. if( SUCCEEDED( hResult ) )
  84. {
  85. strDeleteName = V_BSTR( &var );
  86. VariantClear( &var );
  87. }
  88. hResult = Get( pISess, _T("Computer"), &var );
  89. ASSERT( SUCCEEDED( hResult ) );
  90. if( SUCCEEDED( hResult ) )
  91. {
  92. strDeleteName += _T('\\');
  93. strDeleteName += V_BSTR( &var );
  94. VariantClear( &var );
  95. }
  96. pISess->Release( );
  97. }
  98. return strDeleteName;
  99. }