WERROR registry_init_common(void) { WERROR werr; werr = regdb_init(); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("Failed to initialize the registry: %s\n", win_errstr(werr))); goto done; } werr = reghook_cache_init(); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("Failed to initialize the reghook cache: %s\n", win_errstr(werr))); goto done; } /* setup the necessary keys and values */ werr = init_registry_data(); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("Failed to initialize data in registry!\n")); } done: return werr; }
static int DoAddSourceCommand( int argc, char **argv, bool debugflag, char *exename ) { if ( argc < 3 ) { printf( "need more arguments:\n" ); printf( "-o addsource EventlogName SourceName /path/to/EventMessageFile.dll\n" ); return -1; } /* must open the registry before we access it */ if (!W_ERROR_IS_OK(regdb_init())) { printf( "Can't open the registry.\n" ); return -1; } if ( !eventlog_add_source( argv[0], argv[1], argv[2] ) ) return -2; return 0; }