/* magic number for handle validation */
#define MAGIC 0xc001beef
-/* macro to validate COD manager handles */
-#define IS_VALID(h) ((h) != NULL && (h)->ul_magic == MAGIC)
-
/*
* ======== cod_manager ========
*/
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(lib != NULL);
- DBC_REQUIRE(IS_VALID(((struct cod_libraryobj *)lib)->cod_mgr));
+ DBC_REQUIRE(lib->cod_mgr);
hmgr = lib->cod_mgr;
hmgr->fxns.close_fxn(lib->dbll_lib);
void cod_delete(struct cod_manager *cod_mgr_obj)
{
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
if (cod_mgr_obj->base_lib) {
if (cod_mgr_obj->loaded)
int status = 0;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(plib != NULL);
*plib = (struct dbll_library_obj *)cod_mgr_obj->base_lib;
int status = 0;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(sz_name != NULL);
if (usize <= COD_MAXPATHLENGTH)
int cod_get_entry(struct cod_manager *cod_mgr_obj, u32 *entry_pt)
{
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(entry_pt != NULL);
*entry_pt = cod_mgr_obj->ul_entry;
int status = 0;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(loader != NULL);
*loader = (struct dbll_tar_obj *)cod_mgr_obj->target;
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(lib != NULL);
- DBC_REQUIRE(IS_VALID(lib->cod_mgr));
+ DBC_REQUIRE(lib->cod_mgr);
DBC_REQUIRE(str_sect != NULL);
DBC_REQUIRE(addr != NULL);
DBC_REQUIRE(len != NULL);
struct dbll_sym_val *dbll_sym;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(str_sym != NULL);
DBC_REQUIRE(pul_value != NULL);
u32 i;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(num_argc > 0);
DBC_REQUIRE(args != NULL);
DBC_REQUIRE(args[0] != NULL);
struct cod_libraryobj *lib = NULL;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(hmgr);
DBC_REQUIRE(sz_coff_path != NULL);
DBC_REQUIRE(flags == COD_NOLOAD || flags == COD_SYMB);
DBC_REQUIRE(lib_obj != NULL);
struct dbll_library_obj *lib;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(hmgr);
DBC_REQUIRE(sz_coff_path != NULL);
/* if we previously opened a base image, close it now */
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(lib != NULL);
- DBC_REQUIRE(IS_VALID(lib->cod_mgr));
+ DBC_REQUIRE(lib->cod_mgr);
DBC_REQUIRE(str_sect != NULL);
DBC_REQUIRE(str_content != NULL);