예제 #1
0
bool dhUserPrefs::QueryUser(void){

   find_adapters();


   if(!create_window()){

      return false;

   }

   MSG msg;

   while(GetMessage( &msg, NULL, 0, 0 )){
      if (!IsDialogMessage(m_window,&msg)) { //This makes TAB work as it should
         TranslateMessage(&msg); 
         DispatchMessage(&msg); 
      }
   }


   UnregisterClass(user_pref_wnd_class_name,GetModuleHandle(NULL));

   return m_exited_okay;

}
예제 #2
0
파일: adapter.c 프로젝트: crowm/minisatip
int init_all_hw()
{
	int i;
	char name[50];

	LOG("starting init_all_hw %d", init_complete);
	if (init_complete)
		return num_adapters;
	mutex_init(&a_mutex);
	mutex_lock(&a_mutex);
	find_adapters();
	num_adapters = 0;
	init_complete = 1;
	for (i = 0; i < MAX_ADAPTERS; i++)
		if (!a[i]
				|| ((!a[i]->enabled || a[i]->fe <= 0)
						&& ((a[i]->pa >= 0 && a[i]->fn >= 0) || a[i]->sip)))
		{
			if (!init_hw(i))
				num_adapters++;
		}
		else if (a[i]->enabled)
			num_adapters++;
	if (num_adapters == 0)
		init_complete = 0;
	LOG("done init_hw %d", init_complete);
	if (init_complete)
		getAdaptersCount();
	mutex_unlock(&a_mutex);
	return num_adapters;
}