- IShellFolder_fnParseDisplayName(): return E_INVALIDARG instead of
[wine/multimedia.git] / dlls / capi2032 / cap20wxx.c
blob5972d9d98bc7e5a7cd59fdf7d26cb577df1c9749
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 #include <unistd.h>
30 #ifdef HAVE_LINUX_CAPI_H
31 # include <linux/capi.h>
32 #endif
33 #ifdef HAVE_CAPI20_H
34 # include <capi20.h>
35 #endif
36 #include "wine/debug.h"
37 #include "cap20wxx.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(capi);
41 /*===========================================================================*\
42 \*===========================================================================*/
44 DWORD APIENTRY wrapCAPI_REGISTER (DWORD MessageBufferSize, DWORD maxLogicalConnection, DWORD maxBDataBlocks, DWORD maxBDataLen, DWORD *pApplID) {
45 #ifdef HAVE_CAPI4LINUX
46 unsigned aid = 0;
47 DWORD fret = capi20_register (maxLogicalConnection, maxBDataBlocks, maxBDataLen, &aid);
48 *pApplID = aid;
49 TRACE ( "(%lx) -> %lx\n", *pApplID, fret);
50 return fret;
51 #else
52 FIXME ( "(), no CAPI4LINUX support compiled into WINE.\n" );
53 return 0x1009;
54 #endif
57 /*---------------------------------------------------------------------------*\
58 \*---------------------------------------------------------------------------*/
59 DWORD APIENTRY wrapCAPI_RELEASE (DWORD ApplID) {
60 #ifdef HAVE_CAPI4LINUX
61 DWORD fret = capi20_release (ApplID);
62 TRACE ("(%lx) -> %lx\n", ApplID, fret);
63 return fret;
64 #else
65 return 0x1109;
66 #endif
69 /*---------------------------------------------------------------------------*\
70 \*---------------------------------------------------------------------------*/
71 DWORD APIENTRY wrapCAPI_PUT_MESSAGE (DWORD ApplID, PVOID pCAPIMessage) {
72 #ifdef HAVE_CAPI4LINUX
73 DWORD fret = capi20_put_message (ApplID, pCAPIMessage);
74 TRACE ("(%lx) -> %lx\n", ApplID, fret);
75 return fret;
76 #else
77 return 0x1109;
78 #endif
81 /*---------------------------------------------------------------------------*\
82 \*---------------------------------------------------------------------------*/
83 DWORD APIENTRY wrapCAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage) {
84 #ifdef HAVE_CAPI4LINUX
85 DWORD fret = capi20_get_message (ApplID, (unsigned char **)ppCAPIMessage);
86 TRACE ("(%lx) -> %lx\n", ApplID, fret);
87 return fret;
88 #else
89 return 0x1109;
90 #endif
93 /*---------------------------------------------------------------------------*\
94 \*---------------------------------------------------------------------------*/
95 DWORD APIENTRY wrapCAPI_WAIT_FOR_SIGNAL (DWORD ApplID) {
96 #ifdef HAVE_CAPI4LINUX
97 TRACE ("(%lx)\n", ApplID);
98 return capi20_waitformessage (ApplID, NULL);
99 #else
100 return 0x1109;
101 #endif
104 /*---------------------------------------------------------------------------*\
105 \*---------------------------------------------------------------------------*/
106 DWORD APIENTRY wrapCAPI_GET_MANUFACTURER (char *SzBuffer) {
107 #ifdef HAVE_CAPI4LINUX
108 DWORD fret = (capi20_get_manufacturer (0, SzBuffer) != 0) ? 0 : 0x1108;
109 if (!strncmp (SzBuffer, "AVM", 3)) {
110 strcpy (SzBuffer, "AVM-GmbH");
112 TRACE ("(%s) -> %lx\n", SzBuffer, fret);
113 return fret;
114 #else
115 return 0x1109;
116 #endif
119 /*---------------------------------------------------------------------------*\
120 \*---------------------------------------------------------------------------*/
121 DWORD APIENTRY wrapCAPI_GET_VERSION (DWORD *pCAPIMajor, DWORD *pCAPIMinor, DWORD *pManufacturerMajor, DWORD *pManufacturerMinor) {
122 #ifdef HAVE_CAPI4LINUX
123 unsigned char version[4 * sizeof (unsigned)];
124 DWORD fret = (capi20_get_version (0, version) != 0) ? 0 : 0x1108;
125 *pCAPIMajor = *(unsigned *)(version + 0 * sizeof (unsigned));
126 *pCAPIMinor = *(unsigned *)(version + 1 * sizeof (unsigned));
127 *pManufacturerMajor = *(unsigned *)(version + 2 * sizeof (unsigned));
128 *pManufacturerMinor = *(unsigned *)(version + 3 * sizeof (unsigned));
129 TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor, *pCAPIMinor, *pManufacturerMajor,
130 *pManufacturerMinor, fret);
131 return fret;
132 #else
133 return 0x1109;
134 #endif
137 /*---------------------------------------------------------------------------*\
138 \*---------------------------------------------------------------------------*/
139 DWORD APIENTRY wrapCAPI_GET_SERIAL_NUMBER (char *SzBuffer) {
140 #ifdef HAVE_CAPI4LINUX
141 DWORD fret = (capi20_get_serial_number (0, SzBuffer) != 0) ? 0 : 0x1108;
142 TRACE ("(%s) -> %lx\n", SzBuffer, fret);
143 return fret;
144 #else
145 return 0x1109;
146 #endif
149 /*---------------------------------------------------------------------------*\
150 \*---------------------------------------------------------------------------*/
151 DWORD APIENTRY wrapCAPI_GET_PROFILE (PVOID SzBuffer, DWORD CtlrNr) {
152 #ifdef HAVE_CAPI4LINUX
153 DWORD fret = capi20_get_profile (CtlrNr, SzBuffer);
154 TRACE ("(%lx,%x) -> %lx\n", CtlrNr, *(unsigned short *)SzBuffer, fret);
155 return fret;
156 #else
157 return 0x1109;
158 #endif
161 /*---------------------------------------------------------------------------*\
162 \*---------------------------------------------------------------------------*/
163 DWORD APIENTRY wrapCAPI_INSTALLED (void) {
164 #ifdef HAVE_CAPI4LINUX
165 DWORD fret = capi20_isinstalled();
166 TRACE ("() -> %lx\n", fret);
167 return fret;
168 #else
169 return 0x1109;
170 #endif
173 /*---------------------------------------------------------------------------*\
174 \*---------------------------------------------------------------------------*/
175 DWORD APIENTRY wrapCAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen) {
176 FIXME ("(), not supported!\n");
177 return 0x1109;
180 /*---------------------------------------------------------------------------*\
181 \*---------------------------------------------------------------------------*/