예제 #1
0
mdToken             AsmMan::GetComTypeTokByName(
    __in_opt __nullterminated char* szComTypeName,
    __in_opt __nullterminated char* szComEnclosingTypeName)
{
    AsmManComType* tmp = GetComTypeByName(szComTypeName, szComEnclosingTypeName);
    return(tmp ? tmp->tkTok : mdExportedTypeNil);
}
예제 #2
0
void    AsmMan::StartComType(__in __nullterminated char* szName, DWORD dwAttr)
{
	if(GetComTypeByName(szName)) m_pCurComType = NULL;
	else
	{
        if((m_pCurComType = new AsmManComType))
		{
			memset(m_pCurComType,0,sizeof(AsmManComType));
			m_pCurComType->szName = szName;
			m_pCurComType->dwAttr = dwAttr;
            m_pCurComType->m_fNew = TRUE;
			((Assembler*)m_pAssembler)->m_tkCurrentCVOwner = 0;
            ((Assembler*)m_pAssembler)->m_CustomDescrListStack.PUSH(((Assembler*)m_pAssembler)->m_pCustomDescrList);
			((Assembler*)m_pAssembler)->m_pCustomDescrList = &(m_pCurComType->m_CustomDescrList);
		}
		else
			report->error("Failed to allocate AsmManComType structure\n");
	}
}
예제 #3
0
void    AsmMan::EndComType()
{
    if(m_pCurComType)
    {
        if(m_pAssembler)
        { 
            Class* pClass =((Assembler*)m_pAssembler)->m_pCurClass;
            if(pClass)
            {
                m_pCurComType->tkClass = pClass->m_cl;
                if(pClass->m_pEncloser)
                {
                    mdTypeDef tkEncloser = pClass->m_pEncloser->m_cl;
                    AsmManComType* pCT;
                    for(unsigned i=0; (pCT=m_ComTypeLst.PEEK(i)); i++)
                    {
                        if(pCT->tkClass == tkEncloser)
                        {
                            m_pCurComType->szComTypeName = pCT->szName;
                            break;
                        }
                    }
                }
            }
        }

        if (IsTdNested(m_pCurComType->dwAttr) && GetComTypeByName(m_pCurComType->szName, m_pCurComType->szComTypeName) != NULL)
        {
            report->error("Invalid TypeDefID of exported type\n");
            delete m_pCurComType;
        }
        else
        {
            m_ComTypeLst.PUSH(m_pCurComType);
        }

        m_pCurComType = NULL;
        ((Assembler*)m_pAssembler)->m_tkCurrentCVOwner = 0;
        ((Assembler*)m_pAssembler)->m_pCustomDescrList = ((Assembler*)m_pAssembler)->m_CustomDescrListStack.POP();
    }
}