Beispiel #1
0
void PrintJoinHeader(const JoinProcessOptions *options, LWException **exc)
{
    PSTR fqdn = NULL;
    PDOMAINJOININFO pDomainJoinInfo = NULL;
    PCSTR domain;

    if(options->joiningDomain)
    {
        LW_CLEANUP_CTERR(exc, DJGetFinalFqdn(options, &fqdn));
        fprintf(stdout,
                "Joining to AD Domain:   %s\n"
                "With Computer DNS Name: %s\n\n",
                options->domainName,
                fqdn);
    }
    else
    {
        if (options->domainName)
        {
            domain = options->domainName;
        }
        else
        {
            LW_TRY(exc, QueryInformation(&pDomainJoinInfo, &LW_EXC));
            domain = pDomainJoinInfo->pszDomainName;
        }
        if(domain == NULL)
            domain = "(unknown)";
        fprintf(stdout, "Leaving AD Domain:   %s\n", domain);
    }

cleanup:
    CT_SAFE_FREE_STRING(fqdn);
}
Beispiel #2
0
void CEchoPlugin::Init()
{

	int nLen = (int)QueryInformation(RMX_GET_CONFIG, 0, 0);

	if(nLen > 0){

		char *buffer = new char[nLen+1];
		if(QueryInformation(RMX_GET_CONFIG, nLen+1, (LPARAM)buffer) > 0){

			m_strIni = buffer;
			CIni ini;
			ini.SetIniFileName(m_strIni);
			m_bSysOut		= ini.GetValue("EchoPlugin", "SysOut", FALSE);
			m_bEnterLeave	= ini.GetValue("EchoPlugin", "ShowEnterLeave", FALSE);
		}
		delete buffer;
		buffer = 0;
	}

	OnReloadCfg();
}
Beispiel #3
0
	//--------------------------------------------------------------------------------
	CJob::sJobObjectCPURateControlInformation CJob::GetCPURateControlInfo( void )
	{
		_WINQ_FCONTEXT( "CJob::GetCPURateControlInfo" );
		sJobObjectCPURateControlInformation sResult;
		__QOR_PROTECT
		{
			unsigned long ulLenCheck = 0;
			QueryInformation( JobObjectCpuRateControlInformation, &sResult, sizeof( sJobObjectCPURateControlInformation ), &ulLenCheck );

			if( ulLenCheck != sizeof( sJobObjectCPURateControlInformation ) )
			{
				//TODO: Raise Error
			}
		}__QOR_ENDPROTECT
		return sResult;
	}
Beispiel #4
0
	//--------------------------------------------------------------------------------
	CJob::sJobObjectAssociateCompletionPort CJob::GetCompletionPortInfo( void )
	{
		_WINQ_FCONTEXT( "CJob::GetCompletionPortInfo" );
		sJobObjectAssociateCompletionPort sResult;
		__QOR_PROTECT
		{
			unsigned long ulLenCheck = 0;
			QueryInformation( JobObjectAssociateCompletionPortInformation, &sResult, sizeof( sJobObjectAssociateCompletionPort ), &ulLenCheck );

			if( ulLenCheck != sizeof( sJobObjectAssociateCompletionPort ) )
			{
				//TODO: Raise Error
			}
		}__QOR_ENDPROTECT
		return sResult;
	}
Beispiel #5
0
	//--------------------------------------------------------------------------------
	CJob::sJobObjectBasicUIRestrictions CJob::GetUILimits( void )
	{
		_WINQ_FCONTEXT( "CJob::GetUILimits" );
		sJobObjectBasicUIRestrictions sResult;
		sResult.UIRestrictionsClass = 0;
		__QOR_PROTECT
		{
			unsigned long ulLenCheck = 0;
			QueryInformation( JobObjectBasicUIRestrictions, &sResult, sizeof( sJobObjectBasicUIRestrictions ), &ulLenCheck );

			if( ulLenCheck != sizeof( sJobObjectBasicUIRestrictions ) )
			{
				//TODO: Raise Error
			}
		}__QOR_ENDPROTECT
		return sResult;
	}
Beispiel #6
0
	//--------------------------------------------------------------------------------
	nsCodeQOR::CTLRef< CJob::sJobObjectLimitViolationInformation > CJob::GetLimitViolationInformation( void )
	{
		_WINQ_FCONTEXT( "CJob::GetLimitViolationInformation" );
		nsCodeQOR::CTLRef< CJob::sJobObjectLimitViolationInformation > refResult;
		__QOR_PROTECT
		{
			refResult = new sJobObjectLimitViolationInformation;
			unsigned long ulLenCheck = 0;
			QueryInformation( JobObjectLimitViolationInformation, refResult.operator nsWin32::CJob::sJobObjectLimitViolationInformation *(), sizeof( sJobObjectLimitViolationInformation ), &ulLenCheck );
			if( ulLenCheck != sizeof( sJobObjectLimitViolationInformation ) )
			{
				//TODO: Raise Error
				refResult.Detach();
			}
		}__QOR_ENDPROTECT
		return refResult;
	}
Beispiel #7
0
BOOLEAN GetEnableBoolean(EnableType dwEnable)
{
    PDOMAINJOININFO pDomainJoinInfo = NULL;
    if(dwEnable == ENABLE_TYPE_AUTO)
    {
        LW_TRY(NULL, QueryInformation(&pDomainJoinInfo, &LW_EXC));

        if(IsNullOrEmptyString(pDomainJoinInfo->pszDomainName))
            dwEnable = ENABLE_TYPE_DISABLE;
        else
            dwEnable = ENABLE_TYPE_ENABLE;

    }

cleanup:
    if(pDomainJoinInfo != NULL)
        FreeDomainJoinInfo(pDomainJoinInfo);

    return dwEnable == ENABLE_TYPE_ENABLE;
}
Beispiel #8
0
void CEchoPlugin::OnReloadCfg()
{

	m_crName	= (COLORREF)QueryInformation(RMX_CFG_COLOR_NAME, 0, 0);
	m_crMsg		= (COLORREF)QueryInformation(RMX_CFG_COLOR_MSG, 0, 0);
	m_crAct		= (COLORREF)QueryInformation(RMX_CFG_COLOR_ACTION, 0, 0);
	m_crBg		= (COLORREF)QueryInformation(RMX_CFG_COLOR_BG, 0, 0);
	m_crOp		= (COLORREF)QueryInformation(RMX_CFG_COLOR_OPMSG, 0, 0);
	m_crPart	= (COLORREF)QueryInformation(RMX_CFG_COLOR_PART, 0, 0);
	m_crJoin	= (COLORREF)QueryInformation(RMX_CFG_COLOR_ENTER, 0, 0);

	AdjustColor(m_crJoin);
	AdjustColor(m_crPart);
	AdjustColor(m_crName);
	AdjustColor(m_crMsg);
	AdjustColor(m_crAct);
	AdjustColor(m_crBg);
	AdjustColor(m_crOp);
}
Beispiel #9
0
void
DJQuery(
    char **computer, 
    char **domain,
    DJOptions* options,
    LWException** exc
    )
{
    PDOMAINJOININFO info = NULL;

    LW_TRY(exc, QueryInformation(&info, &LW_EXC));
    
    if (info->pszName)
    {
	LW_CLEANUP_CTERR(exc,
			 CTAllocateString(info->pszName, computer));
    }
    else
    {
	*computer = NULL;
    }

    if (info->pszDomainName)
    {
	LW_CLEANUP_CTERR(exc,
			 CTAllocateString(info->pszDomainName, domain));
    }
    else
    {
	*domain = NULL;
    }
    
cleanup:
    
    if (info)
    {
	FreeDomainJoinInfo(info);
    }
}
Beispiel #10
0
	//--------------------------------------------------------------------------------
	nsCodeQOR::CTLRef< nsCodeQOR::CTArray< Cmp_ulong_ptr > > CJob::GetBasicProcessIDList( void )
	{
		_WINQ_FCONTEXT( "CJob::GetBasicProcessIDList" );
		nsCodeQOR::CTLRef< nsCodeQOR::CTArray< Cmp_ulong_ptr > > refResult;
		__QOR_PROTECT
		{
			sJobObjectBasicProcessIDList ProcessListHeader;
			ProcessListHeader.NumberOfAssignedProcesses = 1;
			ProcessListHeader.NumberOfProcessIdsInList = 0;
			ProcessListHeader.ProcessIdList[ 0 ] = (Cmp_ulong_ptr)(-1);
			unsigned long ulProcessIDCount = 0;

			QueryInformation( JobObjectBasicProcessIdList, &ProcessListHeader, sizeof( ProcessListHeader ), &ulProcessIDCount );
			//This will fail and need to be caught by an Expected handler
			//Then try to find out or guess how many are really needed

			//TODO:

			refResult = new nsCodeQOR::CTArray< Cmp_ulong_ptr >( 256 );
			refResult->Validate( ulProcessIDCount );
		}__QOR_ENDPROTECT
		return refResult;
	}