4 * Copyright 2007 Christian Eggers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #define WIN32_NO_STATUS
35 static IS8 (*pCT_init
)(IU16 ctn
, IU16 pn
);
36 static IS8 (*pCT_data
)(IU16 ctn
, IU8
*dad
, IU8
*sad
, IU16 lenc
, IU8
*command
, IU16
*lenr
, IU8
*response
);
37 static IS8 (*pCT_close
)(IU16 ctn
);
39 static void *ctapi_handle
;
41 static NTSTATUS
attach( void *args
)
43 const char *libname
= args
;
45 if (!(ctapi_handle
= dlopen( libname
, RTLD_NOW
))) return STATUS_DLL_NOT_FOUND
;
47 #define LOAD_FUNCPTR(f) if((p##f = dlsym(ctapi_handle, #f)) == NULL) return STATUS_ENTRYPOINT_NOT_FOUND
48 LOAD_FUNCPTR(CT_init
);
49 LOAD_FUNCPTR(CT_data
);
50 LOAD_FUNCPTR(CT_close
);
52 return STATUS_SUCCESS
;
55 static NTSTATUS
detach( void *args
)
57 dlclose( ctapi_handle
);
58 return STATUS_SUCCESS
;
61 static NTSTATUS
ct_init( void *args
)
63 const struct ct_init_params
*params
= args
;
65 return pCT_init(params
->ctn
, params
->pn
);
68 static NTSTATUS
ct_data( void *args
)
70 const struct ct_data_params
*params
= args
;
72 return pCT_data(params
->ctn
, params
->dad
, params
->sad
, params
->lenc
,
73 params
->command
, params
->lenr
, params
->response
);
76 static NTSTATUS
ct_close( void *args
)
78 const struct ct_close_params
*params
= args
;
80 return pCT_close(params
->ctn
);
83 const unixlib_entry_t __wine_unix_call_funcs
[] =
96 static NTSTATUS
wow64_ct_data( void *args
)
107 } const *params32
= args
;
109 struct ct_data_params params
=
112 ULongToPtr(params32
->dad
),
113 ULongToPtr(params32
->sad
),
115 ULongToPtr(params32
->command
),
116 ULongToPtr(params32
->lenr
),
117 ULongToPtr(params32
->response
)
120 return ct_data( ¶ms
);
123 const unixlib_entry_t __wine_unix_call_wow64_funcs
[] =