Ejemplo n.º 1
0
MI_Boolean IsSameMiValue(
    _In_ MI_Value* value0,
    _In_ MI_Value* value1,
    _In_ MI_Type type)
{
    switch (type)
    {
        case MI_BOOLEAN:
            return value0->boolean == value1->boolean;

        case MI_UINT8:
            return value0->uint8 == value1->uint8;

        case MI_SINT8:
            return value0->sint8 == value1->sint8;

        case MI_UINT16:
            return value0->uint16 == value1->uint16;

        case MI_SINT16:
            return value0->sint16 == value1->sint16;

        case MI_UINT32:
            return value0->uint32 == value1->uint32;

        case MI_SINT32:
            return value0->sint32 == value1->sint32;

        case MI_UINT64:
            return value0->uint64 == value1->uint64;

        case MI_SINT64:
            return value0->sint64 == value1->sint64;

        case MI_REAL32:
            return value0->real32 == value1->real32;

        case MI_REAL64:
            return value0->real64 == value1->real64;

        case MI_CHAR16:
            return value0->char16 == value1->char16;

        case MI_DATETIME:
            return memcmp((const void *)&value0->datetime, (const void*)&value1->datetime, sizeof(value0->datetime)) == 0;

        case MI_STRING:
            return Tcscmp(value0->string, value1->string) == 0;

        default:
            return MI_FALSE;
    }

}
Ejemplo n.º 2
0
MI_Uint64 GetClassDeclId(_In_ const MI_ClassDecl* classDecl)
{
    int i = 0;

    for (i=0;DeclIdMap[i].name;++i)
        if (Tcscmp(classDecl->name, DeclIdMap[i].name) == 0)
            return DeclIdMap[i].id;

    //else if //
    if (classDecl->owningClass != (void*)-1)
        return (MI_Uint64)(ptrdiff_t)(void*)classDecl;
    else //if (classDecl->owningClass == -1)
        return 0;
}