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.
 
 
 
 
 
 

119 lines
2.5 KiB

#include "stdafx.h"
#include "objects.h"
#include "maindoc.h"
/***********************************************************
Function:
Arguments:
Return:
Purpose:
Author(s):
Revision:
Date:
***********************************************************/
COleDsSession::COleDsSession( )
{
}
/***********************************************************
Function:
Arguments:
Return:
Purpose:
Author(s):
Revision:
Date:
***********************************************************/
COleDsSession::COleDsSession( IUnknown *pIUnk): COleDsObject( pIUnk )
{
m_bHasChildren = FALSE;
}
/***********************************************************
Function:
Arguments:
Return:
Purpose:
Author(s):
Revision:
Date:
***********************************************************/
COleDsSession::~COleDsSession( )
{
}
/***********************************************************
Function:
Arguments:
Return:
Purpose:
Author(s):
Revision:
Date:
***********************************************************/
HRESULT COleDsSession::ReleaseIfNotTransient( void )
{
return S_OK;
}
/***********************************************************
Function:
Arguments:
Return:
Purpose:
Author(s):
Revision:
Date:
***********************************************************/
CString COleDsSession::GetDeleteName( )
{
HRESULT hResult, hResultX;
IADsSession* pISess = NULL;
CString strDeleteName;
BSTR bstrName;
hResult = m_pIUnk->QueryInterface( IID_IADs, (void**) &pISess );
ASSERT( SUCCEEDED( hResult ) );
hResultX = pISess->get_Name( &bstrName );
if( SUCCEEDED( hResultX ) )
{
strDeleteName = bstrName;
SysFreeString( bstrName );
return strDeleteName;
}
if( SUCCEEDED( hResult ) )
{
VARIANT var;
hResult = Get( pISess, _T("User"), &var );
ASSERT( SUCCEEDED( hResult ) );
if( SUCCEEDED( hResult ) )
{
strDeleteName = V_BSTR( &var );
VariantClear( &var );
}
hResult = Get( pISess, _T("Computer"), &var );
ASSERT( SUCCEEDED( hResult ) );
if( SUCCEEDED( hResult ) )
{
strDeleteName += _T('\\');
strDeleteName += V_BSTR( &var );
VariantClear( &var );
}
pISess->Release( );
}
return strDeleteName;
}