Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/capi2032/cap20wxx.c
4388 views
1
/*
2
* cap20wxx.c
3
*
4
* Copyright 2002-2003 AVM Computersysteme Vertriebs GmbH
5
*
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.
10
*
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.
15
*
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
19
*
20
*/
21
22
#define __NO_CAPIUTILS__
23
24
#include <stdio.h>
25
#include <sys/types.h>
26
27
#include "unixlib.h"
28
#include "wine/debug.h"
29
30
WINE_DEFAULT_DEBUG_CHANNEL(capi);
31
32
#define CAPI_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
33
34
35
BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, LPVOID reserved )
36
{
37
switch (reason)
38
{
39
case DLL_PROCESS_ATTACH:
40
DisableThreadLibraryCalls( instance );
41
return !__wine_init_unix_call();
42
}
43
return TRUE;
44
}
45
46
/*===========================================================================* \
47
\*===========================================================================*/
48
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 };
52
DWORD fret;
53
54
fret = CAPI_CALL( register, &params );
55
TRACE ( "(%lx) -> %lx\n", *pApplID, fret);
56
return fret;
57
}
58
59
/*---------------------------------------------------------------------------*\
60
\*---------------------------------------------------------------------------*/
61
DWORD WINAPI CAPI_RELEASE (DWORD ApplID) {
62
struct release_params params = { ApplID };
63
DWORD fret;
64
65
fret = CAPI_CALL( release, &params );
66
TRACE ("(%lx) -> %lx\n", ApplID, fret);
67
return fret;
68
}
69
70
/*---------------------------------------------------------------------------*\
71
\*---------------------------------------------------------------------------*/
72
DWORD WINAPI CAPI_PUT_MESSAGE (DWORD ApplID, PVOID pCAPIMessage) {
73
struct put_message_params params = { ApplID, pCAPIMessage };
74
DWORD fret;
75
76
fret = CAPI_CALL( put_message, &params );
77
TRACE ("(%lx) -> %lx\n", ApplID, fret);
78
return fret;
79
}
80
81
/*---------------------------------------------------------------------------*\
82
\*---------------------------------------------------------------------------*/
83
DWORD WINAPI CAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage) {
84
struct get_message_params params = { ApplID, ppCAPIMessage };
85
DWORD fret;
86
87
fret = CAPI_CALL( get_message, &params );
88
TRACE ("(%lx) -> %lx\n", ApplID, fret);
89
return fret;
90
}
91
92
/*---------------------------------------------------------------------------*\
93
\*---------------------------------------------------------------------------*/
94
DWORD WINAPI CAPI_WAIT_FOR_SIGNAL (DWORD ApplID) {
95
struct waitformessage_params params = { ApplID };
96
TRACE ("(%lx)\n", ApplID);
97
98
return CAPI_CALL( waitformessage, &params );
99
}
100
101
/*---------------------------------------------------------------------------*\
102
\*---------------------------------------------------------------------------*/
103
DWORD WINAPI CAPI_GET_MANUFACTURER (char *SzBuffer) {
104
struct get_manufacturer_params params = { SzBuffer };
105
DWORD fret;
106
107
fret = CAPI_CALL( get_manufacturer, &params );
108
if (!strncmp (SzBuffer, "AVM", 3)) {
109
strcpy (SzBuffer, "AVM-GmbH");
110
}
111
TRACE ("(%s) -> %lx\n", SzBuffer, fret);
112
return fret;
113
}
114
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 };
119
DWORD fret;
120
121
fret = CAPI_CALL( get_version, &params );
122
TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor, *pCAPIMinor, *pManufacturerMajor,
123
*pManufacturerMinor, fret);
124
return fret;
125
}
126
127
/*---------------------------------------------------------------------------*\
128
\*---------------------------------------------------------------------------*/
129
DWORD WINAPI CAPI_GET_SERIAL_NUMBER (char *SzBuffer) {
130
struct get_serial_number_params params = { SzBuffer };
131
DWORD fret;
132
133
fret = CAPI_CALL( get_serial_number, &params );
134
TRACE ("(%s) -> %lx\n", SzBuffer, fret);
135
return fret;
136
}
137
138
/*---------------------------------------------------------------------------*\
139
\*---------------------------------------------------------------------------*/
140
DWORD WINAPI CAPI_GET_PROFILE (PVOID SzBuffer, DWORD CtlrNr) {
141
struct get_profile_params params = { SzBuffer, CtlrNr };
142
DWORD fret;
143
144
fret = CAPI_CALL( get_profile, &params );
145
TRACE ("(%lx,%x) -> %lx\n", CtlrNr, *(unsigned short *)SzBuffer, fret);
146
return fret;
147
}
148
149
/*---------------------------------------------------------------------------*\
150
\*---------------------------------------------------------------------------*/
151
DWORD WINAPI CAPI_INSTALLED (void) {
152
DWORD fret;
153
154
fret = CAPI_CALL( isinstalled, NULL );
155
TRACE ("() -> %lx\n", fret);
156
return fret;
157
}
158
159
/*---------------------------------------------------------------------------*\
160
\*---------------------------------------------------------------------------*/
161
DWORD WINAPI CAPI_MANUFACTURER (DWORD Class, DWORD Function, DWORD Ctlr, PVOID pParams, DWORD ParamsLen) {
162
FIXME ("(), not supported!\n");
163
return 0x1109;
164
}
165
166
/*---------------------------------------------------------------------------*\
167
\*---------------------------------------------------------------------------*/
168
169