void outwnd_init(int display_under_freespace_window) { #ifndef NMONO if (!outwnd_inited) { outwnd_inited = TRUE; hOutputThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)outwnd_thread, (LPVOID)display_under_freespace_window, 0, &OutputThreadID); //SetThreadPriority(hOutputThread, THREAD_PRIORITY_TIME_CRITICAL); // set up the monochrome drivers if ( (mono_driver = CreateFile("\\\\.\\MONO", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == ((HANDLE)-1)) { outwnd_printf2("Cannot get handle to monochrome driver.\n"); mono_init(); } atexit(close_mono); } #endif #ifndef NDEBUG if ( Log_fp == NULL ) { Log_fp = fopen(Freespace_logfilename, "wb"); } #endif }
int main (int argc, char *argv[]) { MonoAssembly *assembly = NULL; const char *aname = NULL; const char *outfile = NULL; const char *rootfile = NULL; int i; gboolean all_meta = FALSE; mono_init (argv [0]); type_table = g_hash_table_new (NULL, NULL); method_table = g_hash_table_new (NULL, NULL); field_table = g_hash_table_new (NULL, NULL); image_table = g_hash_table_new (NULL, NULL); for (i = 1; i < argc; ++i) { all_meta = FALSE; aname = argv [i]; if (strcmp (aname, "-v") == 0) { verbose++; continue; } else if (strcmp (aname, "-e") == 0) { force_enums = 1; continue; } else if (strcmp (aname, "-h") == 0) { usage (0); } else if (strcmp (aname, "-o") == 0) { i++; if (i >= argc) usage (1); outfile = argv [i]; continue; } else if (strcmp (aname, "-F") == 0) { i++; if (i >= argc) usage (1); all_meta = TRUE; aname = argv [i]; } else if (strcmp (aname, "-a") == 0) { i++; if (i >= argc) usage (1); rootfile = argv [i]; continue; } assembly = mono_assembly_open (aname, NULL); if (!assembly) { g_print ("cannot open assembly %s\n", aname); exit (1); } process_assembly (assembly, all_meta); } if (!assembly) usage (1); if (rootfile) load_roots (rootfile); process_images (); dump_images (outfile); return 0; }