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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define __NO_CAPIUTILS__
25 #include <sys/types.h>
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(capi
);
32 #define CAPI_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
35 BOOL WINAPI
DllMain( HINSTANCE instance
, DWORD reason
, LPVOID reserved
)
39 case DLL_PROCESS_ATTACH
:
40 DisableThreadLibraryCalls( instance
);
41 return !__wine_init_unix_call();
46 /*===========================================================================* \
47 \*===========================================================================*/
49 DWORD WINAPI
CAPI_REGISTER (DWORD MessageBufferSize
, DWORD maxLogicalConnection
, DWORD maxBDataBlocks
, DWORD maxBDataLen
, DWORD
*pApplID
) {
50 struct register_params params
= { MessageBufferSize
, maxLogicalConnection
,
51 maxBDataBlocks
, maxBDataLen
, pApplID
};
54 fret
= CAPI_CALL( register, ¶ms
);
55 TRACE ( "(%lx) -> %lx\n", *pApplID
, fret
);
59 /*---------------------------------------------------------------------------*\
60 \*---------------------------------------------------------------------------*/
61 DWORD WINAPI
CAPI_RELEASE (DWORD ApplID
) {
62 struct release_params params
= { ApplID
};
65 fret
= CAPI_CALL( release
, ¶ms
);
66 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
70 /*---------------------------------------------------------------------------*\
71 \*---------------------------------------------------------------------------*/
72 DWORD WINAPI
CAPI_PUT_MESSAGE (DWORD ApplID
, PVOID pCAPIMessage
) {
73 struct put_message_params params
= { ApplID
, pCAPIMessage
};
76 fret
= CAPI_CALL( put_message
, ¶ms
);
77 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
81 /*---------------------------------------------------------------------------*\
82 \*---------------------------------------------------------------------------*/
83 DWORD WINAPI
CAPI_GET_MESSAGE (DWORD ApplID
, PVOID
*ppCAPIMessage
) {
84 struct get_message_params params
= { ApplID
, ppCAPIMessage
};
87 fret
= CAPI_CALL( get_message
, ¶ms
);
88 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
92 /*---------------------------------------------------------------------------*\
93 \*---------------------------------------------------------------------------*/
94 DWORD WINAPI
CAPI_WAIT_FOR_SIGNAL (DWORD ApplID
) {
95 struct waitformessage_params params
= { ApplID
};
96 TRACE ("(%lx)\n", ApplID
);
98 return CAPI_CALL( waitformessage
, ¶ms
);
101 /*---------------------------------------------------------------------------*\
102 \*---------------------------------------------------------------------------*/
103 DWORD WINAPI
CAPI_GET_MANUFACTURER (char *SzBuffer
) {
104 struct get_manufacturer_params params
= { SzBuffer
};
107 fret
= CAPI_CALL( get_manufacturer
, ¶ms
);
108 if (!strncmp (SzBuffer
, "AVM", 3)) {
109 strcpy (SzBuffer
, "AVM-GmbH");
111 TRACE ("(%s) -> %lx\n", SzBuffer
, fret
);
115 /*---------------------------------------------------------------------------*\
116 \*---------------------------------------------------------------------------*/
117 DWORD WINAPI
CAPI_GET_VERSION (DWORD
*pCAPIMajor
, DWORD
*pCAPIMinor
, DWORD
*pManufacturerMajor
, DWORD
*pManufacturerMinor
) {
118 struct get_version_params params
= { pCAPIMajor
, pCAPIMinor
, pManufacturerMajor
, pManufacturerMinor
};
121 fret
= CAPI_CALL( get_version
, ¶ms
);
122 TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor
, *pCAPIMinor
, *pManufacturerMajor
,
123 *pManufacturerMinor
, fret
);
127 /*---------------------------------------------------------------------------*\
128 \*---------------------------------------------------------------------------*/
129 DWORD WINAPI
CAPI_GET_SERIAL_NUMBER (char *SzBuffer
) {
130 struct get_serial_number_params params
= { SzBuffer
};
133 fret
= CAPI_CALL( get_serial_number
, ¶ms
);
134 TRACE ("(%s) -> %lx\n", SzBuffer
, fret
);
138 /*---------------------------------------------------------------------------*\
139 \*---------------------------------------------------------------------------*/
140 DWORD WINAPI
CAPI_GET_PROFILE (PVOID SzBuffer
, DWORD CtlrNr
) {
141 struct get_profile_params params
= { SzBuffer
, CtlrNr
};
144 fret
= CAPI_CALL( get_profile
, ¶ms
);
145 TRACE ("(%lx,%x) -> %lx\n", CtlrNr
, *(unsigned short *)SzBuffer
, fret
);
149 /*---------------------------------------------------------------------------*\
150 \*---------------------------------------------------------------------------*/
151 DWORD WINAPI
CAPI_INSTALLED (void) {
154 fret
= CAPI_CALL( isinstalled
, NULL
);
155 TRACE ("() -> %lx\n", fret
);
159 /*---------------------------------------------------------------------------*\
160 \*---------------------------------------------------------------------------*/
161 DWORD WINAPI
CAPI_MANUFACTURER (DWORD Class
, DWORD Function
, DWORD Ctlr
, PVOID pParams
, DWORD ParamsLen
) {
162 FIXME ("(), not supported!\n");
166 /*---------------------------------------------------------------------------*\
167 \*---------------------------------------------------------------------------*/