Пример #1
0
bool CSrLvliRecord::DeleteItem (CSrLvloSubrecord* pItem)
{
	if (pItem == NULL) return false;
	bool Result = m_Subrecords.Delete(pItem);

	if (Result) 
	{
		if (GetListCount() > 0) 
			SetListCount(GetListCount() - 1);
		else
			UpdateListCount();
	}

	return true;
}
Пример #2
0
void AddDataMethod( id_type access_type, TypeInfo *typ, List *varlist ) {
/************************************************************************/

    unsigned            varcnt;
    VarInfo             *info;

    if( inSubPgm ) {
         return;
    }

    assert( varlist );
    assert( typ );

    SRU.curr.vars.varlist = varlist;
    copyTypeInfo( &(SRU.curr.vars.type), typ );
    SRU.curr.vars.access_id = access_type;
    SRU.curr.vars.typ_id = isTypeKnown( &SRU.curr.vars.type );
    if( !SRU.curr.vars.typ_id ) {
        SRU.curr.vars.fake = TRUE;
        // NYI -  put out a good error msg
        varcnt = GetListCount( SRU.curr.vars.varlist );
        for( ; varcnt > 0; varcnt-- ) {
            info = GetListItem( SRU.curr.vars.varlist, varcnt - 1 );
            Warning( UNKNOWN_DATA_TYPE, info->name, typ->name );
        }
    } else {
        SRU.curr.vars.fake = FALSE;
    }
    SRU.curr_typ = SRU_VARIABLE;
}
Пример #3
0
void CTagArrayEditor::WriteListToTagArray(ULONG ulListNum)
{
	if (!IsValidList(ulListNum)) return;

	// If we're not dirty, don't write
	if (!IsDirty(ulListNum)) return;

	HRESULT hRes = S_OK;
	ULONG ulListCount = GetListCount(ulListNum);
	EC_H(MAPIAllocateBuffer(
		CbNewSPropTagArray(ulListCount),
		(LPVOID*)&m_lpOutputTagArray));
	if (m_lpOutputTagArray)
	{
		m_lpOutputTagArray->cValues = ulListCount;

		ULONG iTagCount = 0;
		for (iTagCount = 0; iTagCount < m_lpOutputTagArray->cValues; iTagCount++)
		{
			SortListData* lpData = GetListRowData(ulListNum, iTagCount);
			if (lpData)
				m_lpOutputTagArray->aulPropTag[iTagCount] = lpData->data.Tag.ulPropTag;
		}

	}
} // CTagArrayEditor::WriteListToTagArray
Пример #4
0
CSrLvloSubrecord* CSrLvliRecord::AddItem (const srformid_t FormID, const dword Level, const dword Count)
{
	if (GetListCount() > SR_LVLO_MAXCOUNT) return NULL;

	CSrSubrecord* pSubrecord = AddNewSubrecord(SR_NAME_LVLO);
	CSrLvloSubrecord* pNewLvlo = SrCastClassNull(CSrLvloSubrecord, pSubrecord);
	if (pNewLvlo == NULL) return NULL;
	pNewLvlo->InitializeNew();

	pNewLvlo->GetListData().Count  = Count;
	pNewLvlo->GetListData().Level  = Level;
	pNewLvlo->GetListData().FormID = FormID;

	SetListCount(GetListCount() + 1);
	return pNewLvlo;
}
Пример #5
0
bool CMassiveGitTaskBase::ExecuteCommands(volatile BOOL& cancel)
{
	m_bUnused = false;

	int maxLength = 0;
	int firstCombine = 0;
	for (int i = 0; i < GetListCount(); ++i)
	{
		if (maxLength + GetListItem(i).GetLength() > MAX_COMMANDLINE_LENGTH || i == GetListCount() - 1 || cancel)
		{
			CString add;
			for (int j = firstCombine; j <= i; ++j)
			{
				add += L" \"";
				add += GetListItem(j);
				add += L'"';
			}

			CString cmd, out;
			cmd.Format(L"git.exe %s %s%s", (LPCTSTR)m_sParams, m_bIsPath ? L"--" : L"", (LPCTSTR)add);
			int exitCode = g_Git.Run(cmd, &out, CP_UTF8);
			if (exitCode && !m_bIgnoreErrors)
			{
				ReportError(out, exitCode);
				return false;
			}

			if (m_bIsPath)
			{
				for (int j = firstCombine; j <= i; ++j)
					ReportProgress(m_pathList[j], j);
			}

			maxLength = 0;
			firstCombine = i+1;

			if (cancel)
			{
				ReportUserCanceled();
				return false;
			}
		}
		else
			maxLength += 3 + GetListItem(i).GetLength();
	}
	return true;
}
bool CMassiveGitTaskBase::ExecuteCommands(volatile BOOL& cancel)
{
	m_bUnused = false;

	int maxLength = 0;
	int firstCombine = 0;
	for (int i = 0; i < GetListCount(); ++i)
	{
		if (maxLength + GetListItem(i).GetLength() > MAX_COMMANDLINE_LENGTH || i == GetListCount() - 1 || cancel)
		{
			CString add;
			for (int j = firstCombine; j <= i; ++j)
				add += _T(" \"") + GetListItem(j) + _T("\"");

			CString cmd, out;
			cmd.Format(_T("git.exe %s %s%s"), m_sParams, m_bIsPath ? _T("--") : _T(""), add);
			if (g_Git.Run(cmd, &out, CP_UTF8) && !m_bIgnoreErrors)
			{
				ReportError(out);
				return false;
			}

			if (m_bIsPath)
			{
				for (int j = firstCombine; j <= i; ++j)
					ReportProgress(m_pathList[j], j);
			}

			maxLength = 0;
			firstCombine = i+1;

			if (cancel)
			{
				ReportUserCanceled();
				return false;
			}
		}
		else
		{
			maxLength += 3 + GetListItem(i).GetLength();
		}
	}
	return true;
}
Пример #7
0
UINT ScanAndGetDriverCount()
{
	UINT cntDriver = 0;
	__try
	{
		THRPARAMS stThrParams = {0};
		if( STATUS_SUCCESS == ThreadWrapper( ScanAndGetDriverCountThread, &stThrParams ) )
		{
			cntDriver = GetListCount( DriverList );
		}
	}
	__except( EXCEPTION_EXECUTE_HANDLER )
	{
		cntDriver = 0;
		DbgPrint( "Exception caught in ScanAndGetDriverCount()" );
	}
	return cntDriver;
}
Пример #8
0
UINT SSDThooksCount()
{
	UINT cntHooks = 0;

	__try
	{
		THRPARAMS stThrParams = {0};
		if( STATUS_SUCCESS == ThreadWrapper(SSDTscanThread, &stThrParams) )
		{
			cntHooks = GetListCount(SsdtList);
		}
	}
	__except( EXCEPTION_EXECUTE_HANDLER )
	{
		cntHooks = 0;
		DbgPrint( "Exception caught in ScanAndGetSSDTHooksCount()" );
	}
	return cntHooks;
}