Ejemplo n.º 1
0
void setwfl_ (int *velocity, int *nominal, float *dt)
	{
    if (BwtHook != 0) {
	free_hook(&BwtHook) ; 
    }
    BwtHook = wa_new ( *velocity, *nominal, *dt ) ;
	}
Ejemplo n.º 2
0
void freefl_()
	{
    if (BwtHook != 0) 
		{
		free_hook(&BwtHook); 
		}
	}
Ejemplo n.º 3
0
void setbfl_ (float *fl, int *ol, float *fu, int *ou, float *dt ) 
	{
    if (BwtHook != 0) {
	free_hook(&BwtHook) ; 
    }
    BwtHook = bwt_new ( *fl, *ol, *fu, *ou, *dt ) ;
	}
Ejemplo n.º 4
0
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID unused1)
{
	if (reason == DLL_PROCESS_ATTACH) {
		wchar_t name[MAX_PATH];

		HANDLE cur_thread = OpenThread(THREAD_ALL_ACCESS, false,
				GetCurrentThreadId());

		/* this prevents the library from being automatically unloaded
		 * by the next FreeLibrary call */
		GetModuleFileNameW(hinst, name, MAX_PATH);
		LoadLibraryW(name);

		capture_thread = CreateThread(NULL, 0,
				(LPTHREAD_START_ROUTINE)main_capture_thread,
				(LPVOID)cur_thread, 0, 0);
		if (!capture_thread) {
			CloseHandle(cur_thread);
			return false;
		}

	} else if (reason == DLL_PROCESS_DETACH) {
		if (capture_thread) {
			stop_loop = true;
			WaitForSingleObject(capture_thread, 300);
			CloseHandle(capture_thread);
		}

		free_hook();
	}

	(void)unused1;
	return true;
}
Ejemplo n.º 5
0
void mpeg2_free(void * buf) {
  if (free_hook && free_hook (buf))
	  return;

  if (buf)
	  free(*(((void **)buf) - 1));
}
Ejemplo n.º 6
0
Archivo: hooks.c Proyecto: hankem/jed
static void release_hook (Hook_List_Type *l, Hook_Type *h)
{
   if (h->num_locks >= 1)
     h->num_locks--;

   if (h->is_valid == 0)
     free_hook (l, h);
}
Ejemplo n.º 7
0
static DWORD WINAPI main_capture_thread(HANDLE thread_handle)
{
	if (!init_hook(thread_handle)) {
		DbgOut("Failed to init hook\n");
		free_hook();
		return 0;
	}

	capture_loop();
	return 0;
}
Ejemplo n.º 8
0
Archivo: hooks.c Proyecto: hankem/jed
static void remove_hook_cmd (void)
{
   char *name;
   SLang_Name_Type *nt;
   Hook_Type *h;
   Hook_List_Type *l;

   if (-1 == pop_hooks_info (&name, &nt))
     return;

   if ((NULL == (l = find_hook_list (name)))
       || (NULL == (h = hook_already_exists (l, nt))))
     {
	SLang_free_slstring (name);
	return;
     }

   h->is_valid = 0;
   free_hook (l, h);
   SLang_free_slstring (name);
}
Ejemplo n.º 9
0
static void
parse_orbname( char *orbname, char *orb_address, int *orb_port )
{
	char	*split_orbname;
	Tbl	*orbname_parts;
	char	orbname_port[STRSZ];
	Hook	*hook = 0;
	static Pf *pfnames = 0;
	int	len = 0;
		
	if( STREQ( orbname, ":" ) ) {
		
		strcpy( orb_address, "127.0.0.1" );
		strcpy( orbname_port, "" );

	} else {
		
		split_orbname = strdup( orbname );
		orbname_parts = split( split_orbname, ':' );

		if( maxtbl( orbname_parts ) == 1 && orbname[0] == ':' ) {

			strcpy( orb_address, "127.0.0.1" );
			strcpy( orbname_port, poptbl( orbname_parts ) );

		} else if( maxtbl( orbname_parts ) == 1 ) {

			strcpy( orb_address, shifttbl( orbname_parts ) );
			strcpy( orbname_port, "" );

		} else if( maxtbl( orbname_parts ) == 2 ) {

			strcpy( orb_address, shifttbl( orbname_parts ) );
			strcpy( orbname_port, poptbl( orbname_parts ) );

		} else {

			elog_complain( 0, "pforbstat: unexpected error translating orb2orb argument <%s>\n",
				  orbname );
			strcpy( orb_address, "" );
			strcpy( orbname_port, "" );
		}

		free( split_orbname );
		freetbl( orbname_parts, 0 );
	}

	if( ( len = strlen( orbname_port ) ) > 0 ) {

		if( orbname_port[len-1] == '@' ) {
			
			orbname_port[len-1] = '\0';
		}
	}

	if( STREQ( orbname_port, "" ) ) {
		
		*orb_port = ORB_TCP_PORT;

	} else if( strmatches( orbname_port, "^[0-9]+$", &hook ) ) {
		
		*orb_port = atoi( orbname_port );

	} else {

		if( pfnames == 0 ) {

			pfread( "orbserver_names", &pfnames );
		}

		if( pfget_string( pfnames, orbname_port ) == 0 ) {

			elog_complain( 0, "pforbstat: couldn't translate orb port \":%s\"\n", orbname_port );

			*orb_port = 0;

		} else {
		
			*orb_port = pfget_int( pfnames, orbname_port );
		}
	}

	if( hook != (Hook *) NULL ) {

		free_hook( &hook );
	}

	return;
}