4 * Copyright 2002-2003 AVM Computersysteme Vertriebs GmbH
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #define __NO_CAPIUTILS__
27 #include <sys/types.h>
33 #ifdef HAVE_LINUX_CAPI_H
34 # include <linux/capi.h>
39 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(capi
);
44 /*===========================================================================*\
45 \*===========================================================================*/
47 DWORD WINAPI
wrapCAPI_REGISTER (DWORD MessageBufferSize
, DWORD maxLogicalConnection
, DWORD maxBDataBlocks
, DWORD maxBDataLen
, DWORD
*pApplID
) {
48 #ifdef HAVE_CAPI4LINUX
50 DWORD fret
= capi20_register (maxLogicalConnection
, maxBDataBlocks
, maxBDataLen
, &aid
);
52 TRACE ( "(%lx) -> %lx\n", *pApplID
, fret
);
55 FIXME ( "(), no CAPI4LINUX support compiled into WINE.\n" );
60 /*---------------------------------------------------------------------------*\
61 \*---------------------------------------------------------------------------*/
62 DWORD WINAPI
wrapCAPI_RELEASE (DWORD ApplID
) {
63 #ifdef HAVE_CAPI4LINUX
64 DWORD fret
= capi20_release (ApplID
);
65 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
72 /*---------------------------------------------------------------------------*\
73 \*---------------------------------------------------------------------------*/
74 DWORD WINAPI
wrapCAPI_PUT_MESSAGE (DWORD ApplID
, PVOID pCAPIMessage
) {
75 #ifdef HAVE_CAPI4LINUX
76 DWORD fret
= capi20_put_message (ApplID
, pCAPIMessage
);
77 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
84 /*---------------------------------------------------------------------------*\
85 \*---------------------------------------------------------------------------*/
86 DWORD WINAPI
wrapCAPI_GET_MESSAGE (DWORD ApplID
, PVOID
*ppCAPIMessage
) {
87 #ifdef HAVE_CAPI4LINUX
88 DWORD fret
= capi20_get_message (ApplID
, (unsigned char **)ppCAPIMessage
);
89 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
96 /*---------------------------------------------------------------------------*\
97 \*---------------------------------------------------------------------------*/
98 DWORD WINAPI
wrapCAPI_WAIT_FOR_SIGNAL (DWORD ApplID
) {
99 #ifdef HAVE_CAPI4LINUX
100 TRACE ("(%lx)\n", ApplID
);
101 return capi20_waitformessage (ApplID
, NULL
);
107 /*---------------------------------------------------------------------------*\
108 \*---------------------------------------------------------------------------*/
109 DWORD WINAPI
wrapCAPI_GET_MANUFACTURER (char *SzBuffer
) {
110 #ifdef HAVE_CAPI4LINUX
111 DWORD fret
= (capi20_get_manufacturer (0, SzBuffer
) != 0) ? 0 : 0x1108;
112 if (!strncmp (SzBuffer
, "AVM", 3)) {
113 strcpy (SzBuffer
, "AVM-GmbH");
115 TRACE ("(%s) -> %lx\n", SzBuffer
, fret
);
122 /*---------------------------------------------------------------------------*\
123 \*---------------------------------------------------------------------------*/
124 DWORD WINAPI
wrapCAPI_GET_VERSION (DWORD
*pCAPIMajor
, DWORD
*pCAPIMinor
, DWORD
*pManufacturerMajor
, DWORD
*pManufacturerMinor
) {
125 #ifdef HAVE_CAPI4LINUX
126 unsigned char version
[4 * sizeof (unsigned)];
127 DWORD fret
= (capi20_get_version (0, version
) != 0) ? 0 : 0x1108;
128 *pCAPIMajor
= *(unsigned *)(version
+ 0 * sizeof (unsigned));
129 *pCAPIMinor
= *(unsigned *)(version
+ 1 * sizeof (unsigned));
130 *pManufacturerMajor
= *(unsigned *)(version
+ 2 * sizeof (unsigned));
131 *pManufacturerMinor
= *(unsigned *)(version
+ 3 * sizeof (unsigned));
132 TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor
, *pCAPIMinor
, *pManufacturerMajor
,
133 *pManufacturerMinor
, fret
);
140 /*---------------------------------------------------------------------------*\
141 \*---------------------------------------------------------------------------*/
142 DWORD WINAPI
wrapCAPI_GET_SERIAL_NUMBER (char *SzBuffer
) {
143 #ifdef HAVE_CAPI4LINUX
144 DWORD fret
= (capi20_get_serial_number (0, SzBuffer
) != 0) ? 0 : 0x1108;
145 TRACE ("(%s) -> %lx\n", SzBuffer
, fret
);
152 /*---------------------------------------------------------------------------*\
153 \*---------------------------------------------------------------------------*/
154 DWORD WINAPI
wrapCAPI_GET_PROFILE (PVOID SzBuffer
, DWORD CtlrNr
) {
155 #ifdef HAVE_CAPI4LINUX
156 DWORD fret
= capi20_get_profile (CtlrNr
, SzBuffer
);
157 TRACE ("(%lx,%x) -> %lx\n", CtlrNr
, *(unsigned short *)SzBuffer
, fret
);
164 /*---------------------------------------------------------------------------*\
165 \*---------------------------------------------------------------------------*/
166 DWORD WINAPI
wrapCAPI_INSTALLED (void) {
167 #ifdef HAVE_CAPI4LINUX
168 DWORD fret
= capi20_isinstalled();
169 TRACE ("() -> %lx\n", fret
);
176 /*---------------------------------------------------------------------------*\
177 \*---------------------------------------------------------------------------*/
178 DWORD WINAPI
wrapCAPI_MANUFACTURER (DWORD Class
, DWORD Function
, DWORD Ctlr
, PVOID pParams
, DWORD ParamsLen
) {
179 FIXME ("(), not supported!\n");
183 /*---------------------------------------------------------------------------*\
184 \*---------------------------------------------------------------------------*/