ctapi32: Implement Wow64 entry points in the Unix library.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-11-08 20:53:51 +01:00
parent 9f69a0ddaa
commit fc67bbf27f
3 changed files with 49 additions and 14 deletions

View File

@ -38,7 +38,6 @@ static unixlib_handle_t ctapi_handle;
static BOOL load_functions(void) {
struct attach_params params;
char soname[MAX_PATH] = FALLBACK_LIBCTAPI;
LONG result;
HKEY key_handle;
@ -61,8 +60,7 @@ static BOOL load_functions(void) {
}
TRACE("Loading library '%s'\n", soname);
params.libname = soname;
if (!CTAPI_CALL( attach, &params )) return TRUE;
if (!CTAPI_CALL( attach, soname )) return TRUE;
MESSAGE("Wine cannot find any usable hardware library, ctapi32.dll not working.\n");
MESSAGE("Please create the key \"HKEY_CURRENT_USER\\Software\\Wine\\ctapi32\" in your registry\n");

View File

@ -40,9 +40,9 @@ static void *ctapi_handle;
static NTSTATUS attach( void *args )
{
struct attach_params *params = args;
const char *libname = args;
if (!(ctapi_handle = dlopen( params->libname, RTLD_NOW ))) return STATUS_DLL_NOT_FOUND;
if (!(ctapi_handle = dlopen( libname, RTLD_NOW ))) return STATUS_DLL_NOT_FOUND;
#define LOAD_FUNCPTR(f) if((p##f = dlsym(ctapi_handle, #f)) == NULL) return STATUS_ENTRYPOINT_NOT_FOUND
LOAD_FUNCPTR(CT_init);
@ -60,14 +60,14 @@ static NTSTATUS detach( void *args )
static NTSTATUS ct_init( void *args )
{
struct ct_init_params *params = args;
const struct ct_init_params *params = args;
return pCT_init(params->ctn, params->pn);
}
static NTSTATUS ct_data( void *args )
{
struct ct_data_params *params = args;
const struct ct_data_params *params = args;
return pCT_data(params->ctn, params->dad, params->sad, params->lenc,
params->command, params->lenr, params->response);
@ -75,12 +75,12 @@ static NTSTATUS ct_data( void *args )
static NTSTATUS ct_close( void *args )
{
struct ct_close_params *params = args;
const struct ct_close_params *params = args;
return pCT_close(params->ctn);
}
unixlib_entry_t __wine_unix_call_funcs[] =
const unixlib_entry_t __wine_unix_call_funcs[] =
{
attach,
detach,
@ -88,3 +88,45 @@ unixlib_entry_t __wine_unix_call_funcs[] =
ct_data,
ct_close,
};
#ifdef _WIN64
typedef ULONG PTR32;
static NTSTATUS wow64_ct_data( void *args )
{
struct
{
IU16 ctn;
PTR32 dad;
PTR32 sad;
IU16 lenc;
PTR32 command;
PTR32 lenr;
PTR32 response;
} const *params32 = args;
struct ct_data_params params =
{
params32->ctn,
ULongToPtr(params32->dad),
ULongToPtr(params32->sad),
params32->lenc,
ULongToPtr(params32->command),
ULongToPtr(params32->lenr),
ULongToPtr(params32->response)
};
return ct_data( &params );
}
const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{
attach,
detach,
ct_init,
wow64_ct_data,
ct_close,
};
#endif /* _WIN64 */

View File

@ -31,11 +31,6 @@ typedef unsigned short IU16;
typedef signed char IS8;
typedef signed short IS16;
struct attach_params
{
const char *libname;
};
struct ct_init_params
{
IU16 ctn;