secur32: Use the Unix call helpers.

This commit is contained in:
Alexandre Julliard 2022-11-25 10:16:06 +01:00
parent e9c065e590
commit f82dc3d7c4
3 changed files with 4 additions and 17 deletions

View file

@ -40,9 +40,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(secur32); WINE_DEFAULT_DEBUG_CHANNEL(secur32);
static unixlib_handle_t gnutls_handle; #define GNUTLS_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
#define GNUTLS_CALL( func, params ) __wine_unix_call( gnutls_handle, unix_ ## func, params )
#define SCHAN_INVALID_HANDLE ~0UL #define SCHAN_INVALID_HANDLE ~0UL
@ -1685,15 +1683,10 @@ void SECUR32_initSchannelSP(void)
}; };
SecureProvider *provider; SecureProvider *provider;
if (!gnutls_handle) if (__wine_init_unix_call() || GNUTLS_CALL( process_attach, NULL ))
{ {
if (NtQueryVirtualMemory( GetCurrentProcess(), hsecur32, MemoryWineUnixFuncs, ERR( "no schannel support, expect problems\n" );
&gnutls_handle, sizeof(gnutls_handle), NULL ) || return;
GNUTLS_CALL( process_attach, NULL ))
{
ERR( "no schannel support, expect problems\n" );
return;
}
} }
schan_handle_table = malloc(64 * sizeof(*schan_handle_table)); schan_handle_table = malloc(64 * sizeof(*schan_handle_table));
@ -1751,5 +1744,4 @@ void SECUR32_deinitSchannelSP(void)
} }
free(schan_handle_table); free(schan_handle_table);
GNUTLS_CALL( process_detach, NULL ); GNUTLS_CALL( process_detach, NULL );
gnutls_handle = 0;
} }

View file

@ -40,8 +40,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(secur32); WINE_DEFAULT_DEBUG_CHANNEL(secur32);
HINSTANCE hsecur32;
/** /**
* Type definitions * Type definitions
*/ */
@ -1183,7 +1181,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
switch (reason) switch (reason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
hsecur32 = hinstDLL;
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
SECUR32_initializeProviders(); SECUR32_initializeProviders();
break; break;

View file

@ -26,8 +26,6 @@
#include "schannel.h" #include "schannel.h"
#include "wine/list.h" #include "wine/list.h"
extern HINSTANCE hsecur32 DECLSPEC_HIDDEN;
typedef struct _SecureProvider typedef struct _SecureProvider
{ {
struct list entry; struct list entry;