netapi32: Use standard dlopen() instead of the libwine wrappers.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-04-06 22:37:50 +02:00
parent 086c686e81
commit 1938ddc651
1 changed files with 5 additions and 8 deletions

View File

@ -57,7 +57,6 @@
#include "dsgetdc.h" #include "dsgetdc.h"
#include "davclnt.h" #include "davclnt.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/library.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "initguid.h" #include "initguid.h"
@ -134,19 +133,17 @@ static BOOL init_context(void)
static BOOL libnetapi_init(void) static BOOL libnetapi_init(void)
{ {
char buf[200];
if (libnetapi_handle) return TRUE; if (libnetapi_handle) return TRUE;
if (!(libnetapi_handle = wine_dlopen( SONAME_LIBNETAPI, RTLD_NOW, buf, sizeof(buf) ))) if (!(libnetapi_handle = dlopen( SONAME_LIBNETAPI, RTLD_NOW )))
{ {
WARN( "Failed to load libnetapi: %s\n", buf ); WARN( "Failed to load libnetapi: %s\n", dlerror() );
return FALSE; return FALSE;
} }
#define LOAD_FUNCPTR(f) \ #define LOAD_FUNCPTR(f) \
if (!(p##f = wine_dlsym( libnetapi_handle, #f, buf, sizeof(buf) ))) \ if (!(p##f = dlsym( libnetapi_handle, #f ))) \
{ \ { \
ERR( "Failed to load %s: %s\n", #f, buf ); \ ERR( "Failed to load %s: %s\n", #f, dlerror() ); \
goto error; \ goto error; \
} }
@ -167,7 +164,7 @@ static BOOL libnetapi_init(void)
if (init_context()) return TRUE; if (init_context()) return TRUE;
error: error:
wine_dlclose( libnetapi_handle, NULL, 0 ); dlclose( libnetapi_handle );
libnetapi_handle = NULL; libnetapi_handle = NULL;
return FALSE; return FALSE;
} }