'Gets the typeinfo for the Default Dispatch for the passed typeinfo'

def GetDefaultSourceTypeInfo(self, typeinfo):

    attr = typeinfo.GetTypeAttr()
    cFuncs = attr[6]
    typeKind = attr[5]
    if (typeKind not in [pythoncom.TKIND_COCLASS, pythoncom.TKIND_INTERFACE]):
        RaiseAssert(winerror.E_UNEXPECTED, 'The    typeKind    of    the    object    is    unexpected')
    cImplType = attr[8]
    for i in xrange(cImplType):
        flags = typeinfo.GetImplTypeFlags(i)
        if ((flags & ((pythoncom.IMPLTYPEFLAG_FDEFAULT | pythoncom.IMPLTYPEFLAG_FSOURCE) | pythoncom.IMPLTYPEFLAG_FRESTRICTED)) == pythoncom.IMPLTYPEFLAG_FDEFAULT):
            href = typeinfo.GetRefTypeOfImplType(i)
            defTypeInfo = typeinfo.GetRefTypeInfo(href)
            attr = defTypeInfo.GetTypeAttr()
            typeKind = attr[5]
            typeFlags = attr[11]
            if ((typeKind == pythoncom.TKIND_INTERFACE) and (typeFlags & pythoncom.TYPEFLAG_FDUAL)):
                href = typeinfo.GetRefTypeOfImplType((-1))
                return defTypeInfo.GetRefTypeInfo(href)
            else:
                return defTypeInfo
