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>
32 #ifdef HAVE_LINUX_CAPI_H
33 # include <linux/capi.h>
38 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(capi);
43 /*===========================================================================*\
44 \*===========================================================================*/
46 DWORD WINAPI wrapCAPI_REGISTER (DWORD MessageBufferSize, DWORD maxLogicalConnection, DWORD maxBDataBlocks, DWORD maxBDataLen, DWORD *pApplID) {
47 #ifdef HAVE_CAPI4LINUX
49 DWORD fret = capi20_register (maxLogicalConnection, maxBDataBlocks, maxBDataLen, &aid);
51 TRACE ( "(%lx) -> %lx\n", *pApplID, fret);
54 FIXME ( "(), no CAPI4LINUX support compiled into WINE.\n" );
59 /*---------------------------------------------------------------------------*\
60 \*---------------------------------------------------------------------------*/
61 DWORD WINAPI wrapCAPI_RELEASE (DWORD ApplID) {
62 #ifdef HAVE_CAPI4LINUX
63 DWORD fret = capi20_release (ApplID);
64 TRACE ("(%lx) -> %lx\n", ApplID, fret);
71 /*---------------------------------------------------------------------------*\
72 \*---------------------------------------------------------------------------*/
73 DWORD WINAPI wrapCAPI_PUT_MESSAGE (DWORD ApplID, PVOID pCAPIMessage) {
74 #ifdef HAVE_CAPI4LINUX
75 DWORD fret = capi20_put_message (ApplID, pCAPIMessage);
76 TRACE ("(%lx) -> %lx\n", ApplID, fret);
83 /*---------------------------------------------------------------------------*\
84 \*---------------------------------------------------------------------------*/
85 DWORD WINAPI wrapCAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage) {
86 #ifdef HAVE_CAPI4LINUX
87 DWORD fret = capi20_get_message (ApplID, (unsigned char **)ppCAPIMessage);
88 TRACE ("(%lx) -> %lx\n", ApplID, fret);
95 /*---------------------------------------------------------------------------*\
96 \*---------------------------------------------------------------------------*/
97 DWORD WINAPI wrapCAPI_WAIT_FOR_SIGNAL (DWORD ApplID) {
98 #ifdef HAVE_CAPI4LINUX
99 TRACE ("(%lx)\n", ApplID);
100 return capi20_waitformessage (ApplID, NULL);
106 /*---------------------------------------------------------------------------*\
107 \*---------------------------------------------------------------------------*/
108 DWORD WINAPI wrapCAPI_GET_MANUFACTURER (char *SzBuffer) {
109 #ifdef HAVE_CAPI4LINUX
110 DWORD fret = (capi20_get_manufacturer (0, SzBuffer) != 0) ? 0 : 0x1108;
111 if (!strncmp (SzBuffer, "AVM", 3)) {
112 strcpy (SzBuffer, "AVM-GmbH");
114 TRACE ("(%s) -> %lx\n", SzBuffer, fret);
121 /*---------------------------------------------------------------------------*\
122 \*---------------------------------------------------------------------------*/
123 DWORD WINAPI wrapCAPI_GET_VERSION (DWORD *pCAPIMajor, DWORD *pCAPIMinor, DWORD *pManufacturerMajor, DWORD *pManufacturerMinor) {
124 #ifdef HAVE_CAPI4LINUX
125 unsigned char version[4 * sizeof (unsigned)];
126 DWORD fret = (capi20_get_version (0, version) != 0) ? 0 : 0x1108;
127 *pCAPIMajor = *(unsigned *)(version + 0 * sizeof (unsigned));
128 *pCAPIMinor = *(unsigned *)(version + 1 * sizeof (unsigned));
129 *pManufacturerMajor = *(unsigned *)(version + 2 * sizeof (unsigned));
130 *pManufacturerMinor = *(unsigned *)(version + 3 * sizeof (unsigned));
131 TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor, *pCAPIMinor, *pManufacturerMajor,
132 *pManufacturerMinor, fret);
139 /*---------------------------------------------------------------------------*\
140 \*---------------------------------------------------------------------------*/
141 DWORD WINAPI wrapCAPI_GET_SERIAL_NUMBER (char *SzBuffer) {
142 #ifdef HAVE_CAPI4LINUX
143 DWORD fret = (capi20_get_serial_number (0, SzBuffer) != 0) ? 0 : 0x1108;
144 TRACE ("(%s) -> %lx\n", SzBuffer, fret);
151 /*---------------------------------------------------------------------------*\
152 \*---------------------------------------------------------------------------*/
153 DWORD WINAPI wrapCAPI_GET_PROFILE (PVOID SzBuffer, DWORD CtlrNr) {
154 #ifdef HAVE_CAPI4LINUX
155 DWORD fret = capi20_get_profile (CtlrNr, SzBuffer);
156 TRACE ("(%lx,%x) -> %lx\n", CtlrNr, *(unsigned short *)SzBuffer, fret);
163 /*---------------------------------------------------------------------------*\
164 \*---------------------------------------------------------------------------*/
165 DWORD WINAPI wrapCAPI_INSTALLED (void) {
166 #ifdef HAVE_CAPI4LINUX
167 DWORD fret = capi20_isinstalled();
168 TRACE ("() -> %lx\n", fret);
175 /*---------------------------------------------------------------------------*\
176 \*---------------------------------------------------------------------------*/
177 DWORD WINAPI wrapCAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen) {
178 FIXME ("(), not supported!\n");
182 /*---------------------------------------------------------------------------*\
183 \*---------------------------------------------------------------------------*/