Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
bae5c76d
Commit
bae5c76d
authored
22 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Moved dlopen wrappers to loader.c.
parent
a9bedef3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
library/loader.c
+95
-0
95 additions, 0 deletions
library/loader.c
library/port.c
+0
-94
0 additions, 94 deletions
library/port.c
with
95 additions
and
94 deletions
library/loader.c
+
95
−
0
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
}
This diff is collapsed.
Click to expand it.
library/port.c
+
0
−
94
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment