HRESULT CSecurityInformation::PropertySheetPageCallback(HWND hwnd, UINT uMsg,
			SI_PAGE_TYPE uPage)
{
	ARG_USED( uPage );
	ARG_USED( uMsg );
	ARG_USED( hwnd );
	return(S_OK);
}
HRESULT CSecurityInformation::MapGeneric(const GUID* pguidObjectType, 
		UCHAR* pAceFlags, ACCESS_MASK* pMask)
{
	ARG_USED( pMask );
	ARG_USED( pAceFlags );
	ARG_USED( pguidObjectType );
	return(S_OK);
}
HRESULT CSecurityInformation::GetAccessRights(const GUID* pguidObjectType,
		DWORD dwFlags, PSI_ACCESS* ppAccess, ULONG* pcAccesses, 
		ULONG* piDefaultAccess)
{
	ARG_USED( dwFlags );
	ARG_USED( pguidObjectType );
	// If the binary check box was set, we show only raw binary ACE information
	if (m_fBinary)
	{
		*ppAccess = m_siAccessBinaryRights;
	}
	else
	{
		// Otherwise locate the appropriate block of specific rights
		// See AccessData.H header file
		BOOL bFound = FALSE;
		for( int i=0; m_siAccessAllRights[i].m[0].pguid != NULL; i++ )
		{
			if( m_siAccessAllRights[i].m_objInternalType == m_Info.m_objInternalType )
			{
				*ppAccess = m_siAccessAllRights[i].m;
				bFound = TRUE;
				break;
			}
		}

		if( !bFound )
		{
			ASSERT( FALSE );
			*ppAccess = m_siAccessBinaryRights;
		}
		*piDefaultAccess = 0;
	}

	*pcAccesses = 0;
	while ((*ppAccess)[*pcAccesses].mask != 0)
		(*pcAccesses)++;
	return(S_OK);
}
Ejemplo n.º 4
0
void CTeleSerialHandler::Update()
{
    for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
    {
        Socket *p0 = (*it).second;
        ARG_USED(p0);

#ifdef TeleSerial_FUNC_STATUS_AGENT

        TcpSocket *p = dynamic_cast<CTeleSerialStatusAgent *>(p0);
        if (p)
        {
            List(p);
        }
#endif

    }
}
HRESULT CSecurityInformation::GetSecurity(
			SECURITY_INFORMATION RequestedInformation, 
			PSECURITY_DESCRIPTOR* ppSecurityDescriptor, BOOL fDefault)
{
	ARG_USED( fDefault );

	HRESULT hr = 1;
	PSECURITY_DESCRIPTOR pSD = NULL;

	// Get security information
	ULONG lErr;
	if (m_Info.m_szName[0] != 0) // Is it named
	{
		lErr = GetNamedSecurityInfo(m_Info.m_szName, 
					m_Type.m_objSecurType, RequestedInformation, NULL, NULL, 
					NULL, NULL, &pSD);
	}
	else // Is it a handle case
	{
		lErr = GetSecurityInfo(m_Info.m_hHandle, m_Type.m_objSecurType,
					RequestedInformation, NULL, NULL, NULL, NULL, &pSD);
	}

	// No matter what we still display security information
	if (lErr != ERROR_SUCCESS)
	{
		// Failure produces an empty SD
		MessageBox(NULL,
			TEXT("An error occurred retrieving security information for this object,\n")
			TEXT("possibly due to insufficient access rights.\n")
			TEXT("Empty security descriptor was created for editing."),
			TEXT("Security Notice"), MB_OK);
	}
	else
	{
		hr = S_OK;
		*ppSecurityDescriptor = pSD;
	}

	return(hr);
}