Implement COM local servers using table marshaling to avoid doing the
[wine/multimedia.git] / dlls / capi2032 / cap20wxx.c
bloba7a3e28be1e2fd87c41ccfbc056e8dd58aea4b05
1 /*
2 * cap20wxx.c
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__
24 #include "config.h"
26 #include <stdio.h>
27 #include <sys/types.h>
28 #ifdef HAVE_UNISTD_H
29 # include <unistd.h>
30 #endif
32 #define __user
33 #ifdef HAVE_LINUX_CAPI_H
34 # include <linux/capi.h>
35 #endif
36 #ifdef HAVE_CAPI20_H
37 # include <capi20.h>
38 #endif
39 #include "wine/debug.h"
40 #include "cap20wxx.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
49 unsigned aid = 0;
50 DWORD fret = capi20_register (maxLogicalConnection, maxBDataBlocks, maxBDataLen, &aid);
51 *pApplID = aid;
52 TRACE ( "(%lx) -> %lx\n", *pApplID, fret);
53 return fret;
54 #else
55 FIXME ( "(), no CAPI4LINUX support compiled into WINE.\n" );
56 return 0x1009;
57 #endif
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);
66 return fret;
67 #else
68 return 0x1109;
69 #endif
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);
78 return fret;
79 #else
80 return 0x1109;
81 #endif
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);
90 return fret;
91 #else
92 return 0x1109;
93 #endif
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);
102 #else
103 return 0x1109;
104 #endif
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);
116 return fret;
117 #else
118 return 0x1109;
119 #endif
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);
134 return fret;
135 #else
136 return 0x1109;
137 #endif
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);
146 return fret;
147 #else
148 return 0x1109;
149 #endif
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);
158 return fret;
159 #else
160 return 0x1109;
161 #endif
164 /*---------------------------------------------------------------------------*\
165 \*---------------------------------------------------------------------------*/
166 DWORD WINAPI wrapCAPI_INSTALLED (void) {
167 #ifdef HAVE_CAPI4LINUX
168 DWORD fret = capi20_isinstalled();
169 TRACE ("() -> %lx\n", fret);
170 return fret;
171 #else
172 return 0x1109;
173 #endif
176 /*---------------------------------------------------------------------------*\
177 \*---------------------------------------------------------------------------*/
178 DWORD WINAPI wrapCAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen) {
179 FIXME ("(), not supported!\n");
180 return 0x1109;
183 /*---------------------------------------------------------------------------*\
184 \*---------------------------------------------------------------------------*/