Exemplo n.º 1
0
KHMEXP void KHMAPI kmm_init(void)
{
    DWORD dummy;

    EnterCriticalSection(&cs_kmm);
    kmm_all_modules = NULL;
    kmm_listed_plugins = NULL;

    tls_kmm = TlsAlloc();

    hash_plugins = hash_new_hashtable(
        KMM_HASH_SIZE, 
        hash_string, 
        hash_string_comp, 
        NULL, 
        NULL);

    hash_modules = hash_new_hashtable(
        KMM_HASH_SIZE,
        hash_string,
        hash_string_comp,
        NULL,
        NULL);

    ht_registrar = CreateThread(
        NULL,
        0,
        kmmint_registrar,
        NULL,
        0,
        &dummy);

    _WAIT_FOR_START;

    khc_load_schema(NULL, schema_kmmconfig);

    LeaveCriticalSection(&cs_kmm);
}
Exemplo n.º 2
0
void kcdb_type_init(void)
{
    kcdb_type type;

    InitializeCriticalSection(&cs_type);
    kcdb_type_namemap = hash_new_hashtable(
        KCDB_TYPE_HASH_SIZE,
        hash_string,
        hash_string_comp,
        kcdb_type_add_ref,
        kcdb_type_del_ref);
    kcdb_type_tbl = PMALLOC(sizeof(kcdb_type_i *) * (KCDB_TYPE_MAX_ID + 1));
    ZeroMemory(kcdb_type_tbl, sizeof(kcdb_type_i *) * (KCDB_TYPE_MAX_ID + 1));
    kcdb_types = NULL;

    /* VOID */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_void_comp;
    type.dup = kcdb_type_void_dup;
    type.isValid = kcdb_type_void_isValid;
    type.toString = kcdb_type_void_toString;
    type.name = KCDB_TYPENAME_VOID;
    type.id = KCDB_TYPE_VOID;

    kcdb_type_register(&type, NULL);

    /* String */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_string_comp;
    type.dup = kcdb_type_string_dup;
    type.isValid = kcdb_type_string_isValid;
    type.toString = kcdb_type_string_toString;
    type.name = KCDB_TYPENAME_STRING;
    type.id = KCDB_TYPE_STRING;
    type.flags = KCDB_TYPE_FLAG_CB_AUTO;

    kcdb_type_register(&type, NULL);

    /* Date/Time */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_date_comp;
    type.dup = kcdb_type_date_dup;
    type.isValid = kcdb_type_date_isValid;
    type.toString = kcdb_type_date_toString;
    type.name = KCDB_TYPENAME_DATE;
    type.id = KCDB_TYPE_DATE;
    type.cb_max = sizeof(FILETIME);
    type.cb_min = sizeof(FILETIME);
    type.flags = KCDB_TYPE_FLAG_CB_FIXED;

    kcdb_type_register(&type, NULL);

    /* Interval */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_interval_comp;
    type.dup = kcdb_type_interval_dup;
    type.isValid = kcdb_type_interval_isValid;
    type.toString = kcdb_type_interval_toString;
    type.name = KCDB_TYPENAME_INTERVAL;
    type.id = KCDB_TYPE_INTERVAL;
    type.cb_max = sizeof(FILETIME);
    type.cb_min = sizeof(FILETIME);
    type.flags = KCDB_TYPE_FLAG_CB_FIXED;

    kcdb_type_register(&type, NULL);

    /* Int32 */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_int32_comp;
    type.dup = kcdb_type_int32_dup;
    type.isValid = kcdb_type_int32_isValid;
    type.toString = kcdb_type_int32_toString;
    type.name = KCDB_TYPENAME_INT32;
    type.id = KCDB_TYPE_INT32;
    type.cb_max = sizeof(khm_int32);
    type.cb_min = sizeof(khm_int32);
    type.flags = KCDB_TYPE_FLAG_CB_FIXED;

    kcdb_type_register(&type, NULL);

    /* Int64 */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_int64_comp;
    type.dup = kcdb_type_int64_dup;
    type.isValid = kcdb_type_int64_isValid;
    type.toString = kcdb_type_int64_toString;
    type.name = KCDB_TYPENAME_INT64;
    type.id = KCDB_TYPE_INT64;
    type.cb_max = sizeof(__int64);
    type.cb_min = sizeof(__int64);
    type.flags = KCDB_TYPE_FLAG_CB_FIXED;

    kcdb_type_register(&type, NULL);

    /* Data */

    ZeroMemory(&type, sizeof(type));
    type.comp = kcdb_type_data_comp;
    type.dup = kcdb_type_data_dup;
    type.isValid = kcdb_type_data_isValid;
    type.toString = kcdb_type_data_toString;
    type.name = KCDB_TYPENAME_DATA;
    type.id = KCDB_TYPE_DATA;

    kcdb_type_register(&type, NULL);
}
Exemplo n.º 3
0
KHMEXP void KHMAPI
khui_init_rescache(void) {
    h_bitmaps = hash_new_hashtable(127, hash_id, comp_id, NULL,
                                   del_ref_object);
}