Commit 00fdd9fc authored by Alexandre Julliard's avatar Alexandre Julliard

AVM Computersysteme Vertriebs GmbH

Implemented a CAPI20 wrapper library for CAPI4Linux access. Marcus Meissner <marcus@jet.franken.de> Cleaned up, autoconfed.
parent 4dba172e
......@@ -624,6 +624,17 @@ AC_CHECK_HEADERS(libaudioio.h,
[AUDIOIOLIBS="-laudioio"
AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])])
dnl **** Check for capi4linux ****
AC_CHECK_HEADERS(capi20.h,[
AC_CHECK_HEADERS(linux/capi.h,[
AC_CHECK_LIB(capi20,capi20_register,[
AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers])
AC_SUBST(CAPI4LINUXLIBS,"-lcapi20")
])
])
])
dnl **** Check for broken glibc mmap64 ****
AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
......@@ -1414,6 +1425,7 @@ dlls/advapi32/tests/Makefile
dlls/avicap32/Makefile
dlls/avifil32/Makefile
dlls/cabinet/Makefile
dlls/capi2032/Makefile
dlls/cfgmgr32/Makefile
dlls/comcat/Makefile
dlls/comctl32/Makefile
......
......@@ -19,6 +19,7 @@ BASEDIRS = \
avicap32 \
avifil32 \
cabinet \
capi2032 \
cfgmgr32 \
comcat \
comctl32 \
......@@ -205,6 +206,7 @@ SYMLINKS = \
avicap32.dll$(DLLEXT) \
avifil32.dll$(DLLEXT) \
cabinet.dll$(DLLEXT) \
capi2032.dll$(DLLEXT) \
cfgmgr32.dll$(DLLEXT) \
comcat.dll$(DLLEXT) \
comctl32.dll$(DLLEXT) \
......@@ -334,6 +336,9 @@ avifil32.dll$(DLLEXT) avifile.dll$(DLLEXT): avifil32/avifil32.dll$(DLLEXT)
cabinet.dll$(DLLEXT): cabinet/cabinet.dll$(DLLEXT)
$(RM) $@ && $(LN_S) cabinet/cabinet.dll$(DLLEXT) $@
capi2032.dll$(DLLEXT): capi2032/capi2032.dll$(DLLEXT)
$(RM) $@ && $(LN_S) capi2032/capi2032.dll$(DLLEXT) $@
cfgmgr32.dll$(DLLEXT): cfgmgr32/cfgmgr32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) cfgmgr32/cfgmgr32.dll$(DLLEXT) $@
......@@ -699,6 +704,7 @@ IMPORT_LIBS = \
libavicap32 \
libavifil32 \
libcabinet \
libcapi2032 \
libcfgmgr32 \
libcomcat \
libcomctl32 \
......@@ -818,6 +824,11 @@ libcabinet.def: cabinet/cabinet.spec.def
libcabinet.a: cabinet/cabinet.spec.def
$(DLLTOOL) -k -l $@ -d cabinet/cabinet.spec.def
libcapi2032.def: capi2032/capi2032.spec.def
$(RM) $@ && $(LN_S) capi2032/capi2032.spec.def $@
libcapi2032.a: capi2032/capi2032.spec.def
$(DLLTOOL) -k -l $@ -d capi2032/capi2032.spec.def
libcfgmgr32.def: cfgmgr32/cfgmgr32.spec.def
$(RM) $@ && $(LN_S) cfgmgr32/cfgmgr32.spec.def $@
libcfgmgr32.a: cfgmgr32/cfgmgr32.spec.def
......@@ -1312,6 +1323,7 @@ advapi32/advapi32.spec.def: $(WINEBUILD)
avicap32/avicap32.spec.def: $(WINEBUILD)
avifil32/avifil32.spec.def: $(WINEBUILD)
cabinet/cabinet.spec.def: $(WINEBUILD)
capi2032/capi2032.spec.def: $(WINEBUILD)
cfgmgr32/cfgmgr32.spec.def: $(WINEBUILD)
comcat/comcat.spec.def: $(WINEBUILD)
comctl32/comctl32.spec.def: $(WINEBUILD)
......@@ -1421,6 +1433,7 @@ advapi32/advapi32.dll$(DLLEXT): advapi32
avicap32/avicap32.dll$(DLLEXT): avicap32
avifil32/avifil32.dll$(DLLEXT): avifil32
cabinet/cabinet.dll$(DLLEXT): cabinet
capi2032/capi2032.dll$(DLLEXT): capi2032
cfgmgr32/cfgmgr32.dll$(DLLEXT): cfgmgr32
comcat/comcat.dll$(DLLEXT): comcat
comctl32/comctl32.dll$(DLLEXT): comctl32
......
Makefile
capi2032.dll.dbg.c
capi2032.spec.c
capi2032.spec.def
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = capi2032.dll
IMPORTS = kernel32
EXTRALIBS = @CAPI4LINUXLIBS@
C_SRCS = cap20wxx.c
@MAKE_DLL_RULES@
### Dependencies:
/*
* cap20wxx.c
*
* Copyright 2002-2003 AVM Computersysteme Vertriebs GmbH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*---------------------------------------------------------------------------*\
* Modul : cap20wxx.cpp created at Thu 06-Jul-2000 14:54:47 by RStolz/DFriedel
*
* Id: cap20wxx.cpp 1.9 2002/12/04 09:43:07Z rstolz Exp
*
* Log: cap20wxx.cpp
* Revision 1.9 2002/12/04 09:43:07Z rstolz
* - RStolz: max. MessageBufferSize 65535; CCDI interface removed
* Revision 1.8 2002/08/27 11:44:31Z rstolz
* - RStolz: crt bugfix for CAPI2032
* Revision 1.7 2002/08/27 09:32:15Z rstolz
* - RStolz: new incarnation AVMCDDI.dll supports PNP notifications
* Revision 1.6 2001/10/24 12:01:50Z rstolz
* - RStolz: Bugfix - Release failed.
* Revision 1.5 2001/08/24 11:14:10Z rstolz
* - RStolz: Failure with error status interpretion in Release fixed
* Revision 1.4 2000/12/05 15:52:10Z rstolz
* -RStolz: CAppl-Objekt wurde nicht richtig geloescht
* Revision 1.3 2000/10/18 14:53:48Z rstolz
* - RStolz: PnP-Unterstuetzung
* Revision 1.2 2000/09/07 12:19:32Z DFriedel
* - Diego: Klammer fehlte
* Revision 1.1 2000/09/07 11:02:41Z DFriedel
* Initial revision
\*---------------------------------------------------------------------------*/
#define __NO_CAPIUTILS__
#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_LINUX_CAPI_H
# include <linux/capi.h>
#endif
#ifdef HAVE_CAPI20_H
# include <capi20.h>
#endif
#include "wine/debug.h"
#include "cap20wxx.h"
WINE_DEFAULT_DEBUG_CHANNEL(capi);
/*===========================================================================*\
\*===========================================================================*/
DWORD APIENTRY wrapCAPI_REGISTER (DWORD MessageBufferSize, DWORD maxLogicalConnection, DWORD maxBDataBlocks, DWORD maxBDataLen, DWORD *pApplID) {
#ifdef HAVE_CAPI4LINUX
unsigned aid = 0;
DWORD fret = capi20_register (maxLogicalConnection, maxBDataBlocks, maxBDataLen, &aid);
FIXME ( "(), no CAPI4LINUX support compiled into WINE.\n" );
*pApplID = aid;
TRACE ( "(%lx) -> %lx\n", *pApplID, fret);
return fret;
#else
return 0x1009;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_RELEASE (DWORD ApplID) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = capi20_release (ApplID);
TRACE ("(%lx) -> %lx\n", ApplID, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_PUT_MESSAGE (DWORD ApplID, PVOID pCAPIMessage) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = capi20_put_message (ApplID, pCAPIMessage);
TRACE ("(%lx) -> %lx\n", ApplID, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = capi20_get_message (ApplID, (unsigned char **)ppCAPIMessage);
TRACE ("(%lx) -> %lx\n", ApplID, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_WAIT_FOR_SIGNAL (DWORD ApplID) {
#ifdef HAVE_CAPI4LINUX
struct timeval tv;
TRACE ("(%lx)\n", ApplID);
tv.tv_sec = 5;
tv.tv_usec = 0;
return capi20_waitformessage (ApplID, &tv);
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_GET_MANUFACTURER (char *SzBuffer) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = (capi20_get_manufacturer (0, SzBuffer) != 0) ? 0 : 0x1108;
if (!strncmp (SzBuffer, "AVM", 3)) {
strcpy (SzBuffer, "AVM-GmbH");
}
TRACE ("(%s) -> %lx\n", SzBuffer, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_GET_VERSION (DWORD *pCAPIMajor, DWORD *pCAPIMinor, DWORD *pManufacturerMajor, DWORD *pManufacturerMinor) {
#ifdef HAVE_CAPI4LINUX
unsigned char version[4 * sizeof (unsigned)];
DWORD fret = (capi20_get_version (0, version) != 0) ? 0 : 0x1108;
*pCAPIMajor = *(unsigned *)(version + 0 * sizeof (unsigned));
*pCAPIMinor = *(unsigned *)(version + 1 * sizeof (unsigned));
*pManufacturerMajor = *(unsigned *)(version + 2 * sizeof (unsigned));
*pManufacturerMinor = *(unsigned *)(version + 3 * sizeof (unsigned));
TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor, *pCAPIMinor, *pManufacturerMajor,
*pManufacturerMinor, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_GET_SERIAL_NUMBER (char *SzBuffer) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = (capi20_get_serial_number (0, SzBuffer) != 0) ? 0 : 0x1108;
TRACE ("(%s) -> %lx\n", SzBuffer, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_GET_PROFILE (PVOID SzBuffer, DWORD CtlrNr) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = capi20_get_profile (CtlrNr, SzBuffer);
TRACE ("(%lx,%x) -> %lx\n", CtlrNr, *(unsigned short *)SzBuffer, fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_INSTALLED (void) {
#ifdef HAVE_CAPI4LINUX
DWORD fret = capi20_isinstalled();
TRACE ("() -> %lx\n", fret);
return fret;
#else
return 0x1109;
#endif
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen) {
FIXME ("(), not supported!\n");
return 0x1109;
}
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
/*
* cap20wxx.c
*
* Copyright 2002-2003 AVM Computersysteme Vertriebs GmbH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*---------------------------------------------------------------------------*\
* Modul : cap20wxx.h created at Thu 06-Jul-2000 19:58:17 by RStolz
*
* Id: cap20wxx.h 1.3 2002/12/04 09:43:22Z rstolz Exp
*
* Log: cap20wxx.h
* Revision 1.3 2002/12/04 09:43:22Z rstolz
* - RStolz: CCDI interface removed
* Revision 1.2 2002/08/27 09:32:15Z rstolz
* - RStolz: new incarnation AVMCDDI.dll supports PNP notifications
* Revision 1.1 2000/09/07 11:02:40Z DFriedel
* Initial revision
*
* CAPI 2.0-Schnittstelle fr Windows-Programme 32 und 64 Bit
\*---------------------------------------------------------------------------*/
#ifndef _cap20wxx_h
#define _cap20wxx_h
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
#include <windef.h>
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
DWORD APIENTRY wrapCAPI_REGISTER (DWORD MessageBufferSize, DWORD maxLogicalConnection, DWORD maxBDataBlocks, DWORD maxBDataLen, DWORD *pApplID);
DWORD APIENTRY wrapCAPI_RELEASE (DWORD ApplID);
DWORD APIENTRY wrapCAPI_PUT_MESSAGE (DWORD ApplID, PVOID pCAPIMessage);
DWORD APIENTRY wrapCAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage);
DWORD APIENTRY wrapCAPI_WAIT_FOR_SIGNAL (DWORD ApplID);
DWORD APIENTRY wrapCAPI_GET_MANUFACTURER (char *SzBuffer);
DWORD APIENTRY wrapCAPI_GET_VERSION (DWORD *pCAPIMajor, DWORD *pCAPIMinor, DWORD *pManufacturerMajor, DWORD *pManufacturerMinor);
DWORD APIENTRY wrapCAPI_GET_SERIAL_NUMBER (char *SzBuffer);
DWORD APIENTRY wrapCAPI_GET_PROFILE (PVOID SzBuffer, DWORD CtrlNr);
DWORD APIENTRY wrapCAPI_INSTALLED (void);
DWORD APIENTRY wrapCAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen);
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
#endif
1 stdcall CAPI_REGISTER (long long long long ptr) wrapCAPI_REGISTER
2 stdcall CAPI_RELEASE (long) wrapCAPI_RELEASE
3 stdcall CAPI_PUT_MESSAGE (long ptr) wrapCAPI_PUT_MESSAGE
4 stdcall CAPI_GET_MESSAGE (long ptr) wrapCAPI_GET_MESSAGE
5 stdcall CAPI_WAIT_FOR_SIGNAL (long) wrapCAPI_WAIT_FOR_SIGNAL
6 stdcall CAPI_GET_MANUFACTURER (str) wrapCAPI_GET_MANUFACTURER
7 stdcall CAPI_GET_VERSION (ptr ptr ptr ptr) wrapCAPI_GET_VERSION
8 stdcall CAPI_GET_SERIAL_NUMBER (str) wrapCAPI_GET_SERIAL_NUMBER
9 stdcall CAPI_GET_PROFILE (ptr long) wrapCAPI_GET_PROFILE
10 stdcall CAPI_INSTALLED () wrapCAPI_INSTALLED
99 stdcall CAPI_MANUFACTURER (long long long ptr long) wrapCAPI_MANUFACTURER
......@@ -38,6 +38,12 @@
/* Define to 1 if you have the <audio/soundlib.h> header file. */
#undef HAVE_AUDIO_SOUNDLIB_H
/* Define to 1 if you have the <capi20.h> header file. */
#undef HAVE_CAPI20_H
/* Define if you have capi4linux libs and headers */
#undef HAVE_CAPI4LINUX
/* Define to 1 if you have the `chsize' function. */
#undef HAVE_CHSIZE
......@@ -275,6 +281,9 @@
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
#undef HAVE_LINUX_22_JOYSTICK_API
/* Define to 1 if you have the <linux/capi.h> header file. */
#undef HAVE_LINUX_CAPI_H
/* Define to 1 if you have the <linux/cdrom.h> header file. */
#undef HAVE_LINUX_CDROM_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment