-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxvnkb_dll.h
54 lines (49 loc) · 2.3 KB
/
xvnkb_dll.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*----------------------------------------------------------------------------*/
/* xvnkb_dll.h */
/*----------------------------------------------------------------------------*/
/* copyright : (C) 2002 by Dao Hai Lam */
/* VISC Software & Security Consultant Company */
/* Hall 3, Quang Trung Software City */
/* Tan Chanh Hiep Ward, District 12, */
/* Ho Chi Minh city, VIETNAM */
/* website : http://www.visc-network.com */
/* email : lam@visc-network.com */
/* last modify : Sun, 4 Aug 2002 15:34:55 +0700 */
/*----------------------------------------------------------------------------*/
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/*----------------------------------------------------------------------------*/
#ifndef __XVNKB_DLL_H
#define __XVNKB_DLL_H
/*----------------------------------------------------------------------------*/
#include <dlfcn.h>
/*----------------------------------------------------------------------------*/
static inline void *get_func_entry(char *lib1, char *lib2, char *fn)
{
void *fptr = 0;
#ifdef RTLD_NEXT
fptr = dlsym(RTLD_NEXT, fn);
#else
void *dlh = NULL;
if( lib1 )
dlh = dlopen(lib1, RTLD_GLOBAL | RTLD_NOW);
if( !dlh && lib2 )
dlh = dlopen(lib2, RTLD_GLOBAL | RTLD_NOW);
if( !dlh )
DUMP("xvnkb: %s\n", dlerror());
else
fptr = dlsym(dlh, fn);
#endif
if( !fptr )
DUMP("xvnkb: dlsym: %s\n", dlerror());
else {
TRACE("xvnkb: %s is at %p\n", fn, fptr);
}
return fptr;
}
/*----------------------------------------------------------------------------*/
#endif