Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bae5c76d
Commit
bae5c76d
authored
Mar 20, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved dlopen wrappers to loader.c.
parent
a9bedef3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
94 deletions
+95
-94
loader.c
library/loader.c
+95
-0
port.c
library/port.c
+0
-94
No files found.
library/loader.c
View file @
bae5c76d
...
...
@@ -405,3 +405,98 @@ void *wine_dll_load_main_exe( const char *name, char *error, int errorsize, int
{
return
dlopen_dll
(
name
,
error
,
errorsize
,
test_only
);
}
/*
* These functions provide wrappers around dlopen() and associated
* functions. They work around a bug in glibc 2.1.x where calling
* a dl*() function after a previous dl*() function has failed
* without a dlerror() call between the two will cause a crash.
* They all take a pointer to a buffer that
* will receive the error description (from dlerror()). This
* parameter may be NULL if the error description is not required.
*/
/***********************************************************************
* wine_dlopen
*/
void
*
wine_dlopen
(
const
char
*
filename
,
int
flag
,
char
*
error
,
int
errorsize
)
{
#ifdef HAVE_DLOPEN
void
*
ret
;
const
char
*
s
;
dlerror
();
dlerror
();
ret
=
dlopen
(
filename
,
flag
);
s
=
dlerror
();
if
(
error
)
{
strncpy
(
error
,
s
?
s
:
""
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
dlerror
();
return
ret
;
#else
if
(
error
)
{
strncpy
(
error
,
"dlopen interface not detected by configure"
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
return
NULL
;
#endif
}
/***********************************************************************
* wine_dlsym
*/
void
*
wine_dlsym
(
void
*
handle
,
const
char
*
symbol
,
char
*
error
,
int
errorsize
)
{
#ifdef HAVE_DLOPEN
void
*
ret
;
const
char
*
s
;
dlerror
();
dlerror
();
ret
=
dlsym
(
handle
,
symbol
);
s
=
dlerror
();
if
(
error
)
{
strncpy
(
error
,
s
?
s
:
""
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
dlerror
();
return
ret
;
#else
if
(
error
)
{
strncpy
(
error
,
"dlopen interface not detected by configure"
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
return
NULL
;
#endif
}
/***********************************************************************
* wine_dlclose
*/
int
wine_dlclose
(
void
*
handle
,
char
*
error
,
int
errorsize
)
{
#ifdef HAVE_DLOPEN
int
ret
;
const
char
*
s
;
dlerror
();
dlerror
();
ret
=
dlclose
(
handle
);
s
=
dlerror
();
if
(
error
)
{
strncpy
(
error
,
s
?
s
:
""
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
dlerror
();
return
ret
;
#else
if
(
error
)
{
strncpy
(
error
,
"dlopen interface not detected by configure"
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
return
1
;
#endif
}
library/port.c
View file @
bae5c76d
...
...
@@ -248,100 +248,6 @@ void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
}
/*
* These functions provide wrappers around dlopen() and associated
* functions. They work around a bug in glibc 2.1.x where calling
* a dl*() function after a previous dl*() function has failed
* without a dlerror() call between the two will cause a crash.
* They all take a pointer to a buffer that
* will receive the error description (from dlerror()). This
* parameter may be NULL if the error description is not required.
*/
/***********************************************************************
* wine_dlopen
*/
void
*
wine_dlopen
(
const
char
*
filename
,
int
flag
,
char
*
error
,
int
errorsize
)
{
#ifdef HAVE_DLOPEN
void
*
ret
;
const
char
*
s
;
dlerror
();
dlerror
();
ret
=
dlopen
(
filename
,
flag
);
s
=
dlerror
();
if
(
error
)
{
strncpy
(
error
,
s
?
s
:
""
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
dlerror
();
return
ret
;
#else
if
(
error
)
{
strncpy
(
error
,
"dlopen interface not detected by configure"
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
return
NULL
;
#endif
}
/***********************************************************************
* wine_dlsym
*/
void
*
wine_dlsym
(
void
*
handle
,
const
char
*
symbol
,
char
*
error
,
int
errorsize
)
{
#ifdef HAVE_DLOPEN
void
*
ret
;
const
char
*
s
;
dlerror
();
dlerror
();
ret
=
dlsym
(
handle
,
symbol
);
s
=
dlerror
();
if
(
error
)
{
strncpy
(
error
,
s
?
s
:
""
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
dlerror
();
return
ret
;
#else
if
(
error
)
{
strncpy
(
error
,
"dlopen interface not detected by configure"
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
return
NULL
;
#endif
}
/***********************************************************************
* wine_dlclose
*/
int
wine_dlclose
(
void
*
handle
,
char
*
error
,
int
errorsize
)
{
#ifdef HAVE_DLOPEN
int
ret
;
const
char
*
s
;
dlerror
();
dlerror
();
ret
=
dlclose
(
handle
);
s
=
dlerror
();
if
(
error
)
{
strncpy
(
error
,
s
?
s
:
""
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
dlerror
();
return
ret
;
#else
if
(
error
)
{
strncpy
(
error
,
"dlopen interface not detected by configure"
,
errorsize
);
error
[
errorsize
-
1
]
=
'\0'
;
}
return
1
;
#endif
}
#ifndef HAVE_ECVT
/***********************************************************************
* ecvt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment