/*1* cap20wxx.c2*3* Copyright 2002-2003 AVM Computersysteme Vertriebs GmbH4*5* This library is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* This library is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with this library; if not, write to the Free Software17* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA18*19*/2021#define __NO_CAPIUTILS__2223#include <stdio.h>24#include <sys/types.h>2526#include "unixlib.h"27#include "wine/debug.h"2829WINE_DEFAULT_DEBUG_CHANNEL(capi);3031#define CAPI_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )323334BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, LPVOID reserved )35{36switch (reason)37{38case DLL_PROCESS_ATTACH:39DisableThreadLibraryCalls( instance );40return !__wine_init_unix_call();41}42return TRUE;43}4445/*===========================================================================* \46\*===========================================================================*/4748DWORD WINAPI CAPI_REGISTER (DWORD MessageBufferSize, DWORD maxLogicalConnection, DWORD maxBDataBlocks, DWORD maxBDataLen, DWORD *pApplID) {49struct register_params params = { MessageBufferSize, maxLogicalConnection,50maxBDataBlocks, maxBDataLen, pApplID };51DWORD fret;5253fret = CAPI_CALL( register, ¶ms );54TRACE ( "(%lx) -> %lx\n", *pApplID, fret);55return fret;56}5758/*---------------------------------------------------------------------------*\59\*---------------------------------------------------------------------------*/60DWORD WINAPI CAPI_RELEASE (DWORD ApplID) {61struct release_params params = { ApplID };62DWORD fret;6364fret = CAPI_CALL( release, ¶ms );65TRACE ("(%lx) -> %lx\n", ApplID, fret);66return fret;67}6869/*---------------------------------------------------------------------------*\70\*---------------------------------------------------------------------------*/71DWORD WINAPI CAPI_PUT_MESSAGE (DWORD ApplID, PVOID pCAPIMessage) {72struct put_message_params params = { ApplID, pCAPIMessage };73DWORD fret;7475fret = CAPI_CALL( put_message, ¶ms );76TRACE ("(%lx) -> %lx\n", ApplID, fret);77return fret;78}7980/*---------------------------------------------------------------------------*\81\*---------------------------------------------------------------------------*/82DWORD WINAPI CAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage) {83struct get_message_params params = { ApplID, ppCAPIMessage };84DWORD fret;8586fret = CAPI_CALL( get_message, ¶ms );87TRACE ("(%lx) -> %lx\n", ApplID, fret);88return fret;89}9091/*---------------------------------------------------------------------------*\92\*---------------------------------------------------------------------------*/93DWORD WINAPI CAPI_WAIT_FOR_SIGNAL (DWORD ApplID) {94struct waitformessage_params params = { ApplID };95TRACE ("(%lx)\n", ApplID);9697return CAPI_CALL( waitformessage, ¶ms );98}99100/*---------------------------------------------------------------------------*\101\*---------------------------------------------------------------------------*/102DWORD WINAPI CAPI_GET_MANUFACTURER (char *SzBuffer) {103struct get_manufacturer_params params = { SzBuffer };104DWORD fret;105106fret = CAPI_CALL( get_manufacturer, ¶ms );107if (!strncmp (SzBuffer, "AVM", 3)) {108strcpy (SzBuffer, "AVM-GmbH");109}110TRACE ("(%s) -> %lx\n", SzBuffer, fret);111return fret;112}113114/*---------------------------------------------------------------------------*\115\*---------------------------------------------------------------------------*/116DWORD WINAPI CAPI_GET_VERSION (DWORD *pCAPIMajor, DWORD *pCAPIMinor, DWORD *pManufacturerMajor, DWORD *pManufacturerMinor) {117struct get_version_params params = { pCAPIMajor, pCAPIMinor, pManufacturerMajor, pManufacturerMinor };118DWORD fret;119120fret = CAPI_CALL( get_version, ¶ms );121TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor, *pCAPIMinor, *pManufacturerMajor,122*pManufacturerMinor, fret);123return fret;124}125126/*---------------------------------------------------------------------------*\127\*---------------------------------------------------------------------------*/128DWORD WINAPI CAPI_GET_SERIAL_NUMBER (char *SzBuffer) {129struct get_serial_number_params params = { SzBuffer };130DWORD fret;131132fret = CAPI_CALL( get_serial_number, ¶ms );133TRACE ("(%s) -> %lx\n", SzBuffer, fret);134return fret;135}136137/*---------------------------------------------------------------------------*\138\*---------------------------------------------------------------------------*/139DWORD WINAPI CAPI_GET_PROFILE (PVOID SzBuffer, DWORD CtlrNr) {140struct get_profile_params params = { SzBuffer, CtlrNr };141DWORD fret;142143fret = CAPI_CALL( get_profile, ¶ms );144TRACE ("(%lx,%x) -> %lx\n", CtlrNr, *(unsigned short *)SzBuffer, fret);145return fret;146}147148/*---------------------------------------------------------------------------*\149\*---------------------------------------------------------------------------*/150DWORD WINAPI CAPI_INSTALLED (void) {151DWORD fret;152153fret = CAPI_CALL( isinstalled, NULL );154TRACE ("() -> %lx\n", fret);155return fret;156}157158/*---------------------------------------------------------------------------*\159\*---------------------------------------------------------------------------*/160DWORD WINAPI CAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen) {161FIXME ("(), not supported!\n");162return 0x1109;163}164165/*---------------------------------------------------------------------------*\166\*---------------------------------------------------------------------------*/167168169