Fixed a race condition on RPC worker thread creation, and a typo.
[wine] / dlls / rasapi32 / rasapi.c
1 /*
2  * RASAPI32
3  *
4  * Copyright 1998,2001 Marcus Meissner
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "windef.h"
22 #include "ras.h"
23 #include "wine/debug.h"
24
25 WINE_DEFAULT_DEBUG_CHANNEL(ras);
26
27 /**************************************************************************
28  *                 RasEnumConnectionsA                  [RASAPI32.544]
29  */
30 DWORD WINAPI RasEnumConnectionsA( LPRASCONNA rca, LPDWORD lpcb, LPDWORD lpcConnections) {
31         /* Remote Access Service stuff is done by underlying OS anyway */
32         FIXME("(%p,%p,%p),stub!\n",rca,lpcb,lpcConnections);
33         FIXME("RAS support is not implemented! Configure program to use LAN connection/winsock instead!\n");
34         *lpcConnections = 0; /* no RAS connections available */
35
36         return 0;
37 }
38
39 /**************************************************************************
40  *                 RasEnumConnectionsW                  [RASAPI32.545]
41  */
42 DWORD WINAPI RasEnumConnectionsW( LPRASCONNW rcw, LPDWORD lpcb, LPDWORD lpcConnections) {
43         /* Remote Access Service stuff is done by underlying OS anyway */
44         FIXME("(%p,%p,%p),stub!\n",rcw,lpcb,lpcConnections);
45         FIXME("RAS support is not implemented! Configure program to use LAN connection/winsock instead!\n");
46         *lpcConnections = 0; /* no RAS connections available */
47
48         return 0;
49 }
50
51 /**************************************************************************
52  *                 RasEnumEntriesA                              [RASAPI32.546]
53  */
54 DWORD WINAPI RasEnumEntriesA( LPCSTR Reserved, LPCSTR lpszPhoneBook,
55         LPRASENTRYNAMEA lpRasEntryName,
56         LPDWORD lpcb, LPDWORD lpcEntries)
57 {
58         FIXME("(%p,%s,%p,%p,%p),stub!\n",Reserved,debugstr_a(lpszPhoneBook),
59             lpRasEntryName,lpcb,lpcEntries);
60         *lpcEntries = 0;
61         return 0;
62 }
63
64 /**************************************************************************
65  *                 RasGetEntryDialParamsA                       [RASAPI32.550]
66  */
67 DWORD WINAPI RasGetEntryDialParamsA(
68         LPCSTR lpszPhoneBook, LPRASDIALPARAMSA lpRasDialParams,
69         LPBOOL lpfPassword)
70 {
71         FIXME("(%s,%p,%p),stub!\n",debugstr_a(lpszPhoneBook),
72             lpRasDialParams,lpfPassword);
73         return 0;
74 }
75
76 /**************************************************************************
77  *                 RasHangUpA                   [RASAPI32.556]
78  */
79 DWORD WINAPI RasHangUpA( HRASCONN hrasconn)
80 {
81         FIXME("(%p),stub!\n",hrasconn);
82         return 0;
83 }
84
85 /**************************************************************************
86  *                 RasDeleteEntryA              [RASAPI32.7]
87  */
88 DWORD WINAPI RasDeleteEntryA(LPCSTR a, LPCSTR b)
89 {
90         FIXME("(%s,%s),stub!\n",debugstr_a(a),debugstr_a(b));
91         return 0;
92 }
93
94 /**************************************************************************
95  *                 RasDeleteEntryW              [RASAPI32.8]
96  */
97 DWORD WINAPI RasDeleteEntryW(LPCWSTR a, LPCWSTR b)
98 {
99         FIXME("(%s,%s),stub!\n",debugstr_w(a),debugstr_w(b));
100         return 0;
101 }
102
103 /**************************************************************************
104  *                 RasEnumAutodialAddressesA    [RASAPI32.14]
105  */
106 DWORD WINAPI RasEnumAutodialAddressesA(LPCSTR *a, LPDWORD b, LPDWORD c)
107 {
108         FIXME("(%p,%p,%p),stub!\n",a,b,c);
109         return 0;
110 }
111
112 /**************************************************************************
113  *                 RasEnumAutodialAddressesW    [RASAPI32.15]
114  */
115 DWORD WINAPI RasEnumAutodialAddressesW(LPCWSTR *a, LPDWORD b, LPDWORD c)
116 {
117         FIXME("(%p,%p,%p),stub!\n",a,b,c);
118         return 0;
119 }
120
121 typedef LPVOID LPRASAUTODIALENTRYA;
122 typedef LPVOID LPRASAUTODIALENTRYW;
123
124 /**************************************************************************
125  *                 RasEnumDevicesA              [RASAPI32.19]
126  *
127  * Just return a virtual modem too see what other APIs programs will
128  * call with it.
129  */
130 DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD lpcDevices)
131 {
132         FIXME("(%p,%p,%p),stub!\n",lpRasDevinfo,lpcb,lpcDevices);
133         if (*lpcb < sizeof(RASDEVINFOA)) {
134                 *lpcb = sizeof(RASDEVINFOA);
135                 return ERROR_BUFFER_TOO_SMALL;
136         }
137         /* honor dwSize ? */
138         strcpy(lpRasDevinfo->szDeviceType, RASDT_Modem);
139         strcpy(lpRasDevinfo->szDeviceName, "WINE virtmodem");
140         return 0;
141 }
142
143 /**************************************************************************
144  *                 RasEnumDevicesW              [RASAPI32.20]
145  */
146 DWORD WINAPI RasEnumDevicesW(LPRASDEVINFOW a, LPDWORD b, LPDWORD c)
147 {
148         FIXME("(%p,%p,%p),stub!\n",a,b,c);
149         return 0;
150 }
151
152 /**************************************************************************
153  *                 RasGetAutodialAddressA       [RASAPI32.24]
154  */
155 DWORD WINAPI RasGetAutodialAddressA(LPCSTR a, LPDWORD b, LPRASAUTODIALENTRYA c,
156                                         LPDWORD d, LPDWORD e)
157 {
158         FIXME("(%s,%p,%p,%p,%p),stub!\n",debugstr_a(a),b,c,d,e);
159         return 0;
160 }
161
162 /**************************************************************************
163  *                 RasGetAutodialAddressW       [RASAPI32.25]
164  */
165 DWORD WINAPI RasGetAutodialAddressW(LPCWSTR a, LPDWORD b, LPRASAUTODIALENTRYW c,
166                                         LPDWORD d, LPDWORD e)
167 {
168         FIXME("(%s,%p,%p,%p,%p),stub!\n",debugstr_w(a),b,c,d,e);
169         return 0;
170 }
171
172 /**************************************************************************
173  *                 RasGetAutodialEnableA        [RASAPI32.26]
174  */
175 DWORD WINAPI RasGetAutodialEnableA(DWORD a, LPBOOL b)
176 {
177         FIXME("(%lx,%p),stub!\n",a,b);
178         return 0;
179 }
180
181 /**************************************************************************
182  *                 RasGetAutodialEnableW        [RASAPI32.27]
183  */
184 DWORD WINAPI RasGetAutodialEnableW(DWORD a, LPBOOL b)
185 {
186         FIXME("(%lx,%p),stub!\n",a,b);
187         return 0;
188 }
189
190 /**************************************************************************
191  *                 RasGetAutodialParamA         [RASAPI32.28]
192  */
193 DWORD WINAPI RasGetAutodialParamA(DWORD dwKey, LPVOID lpvValue, LPDWORD lpdwcbValue)
194 {
195         FIXME("(%lx,%p,%p),stub!\n",dwKey,lpvValue,lpdwcbValue);
196         return 0;
197 }
198
199 /**************************************************************************
200  *                 RasGetAutodialParamW         [RASAPI32.29]
201  */
202 DWORD WINAPI RasGetAutodialParamW(DWORD dwKey, LPVOID lpvValue, LPDWORD lpdwcbValue)
203 {
204         FIXME("(%lx,%p,%p),stub!\n",dwKey,lpvValue,lpdwcbValue);
205         return 0;
206 }
207
208 /**************************************************************************
209  *                 RasSetAutodialAddressA       [RASAPI32.57]
210  */
211 DWORD WINAPI RasSetAutodialAddressA(LPCSTR a, DWORD b, LPRASAUTODIALENTRYA c,
212                                         DWORD d, DWORD e)
213 {
214         FIXME("(%s,%lx,%p,%lx,%lx),stub!\n",debugstr_a(a),b,c,d,e);
215         return 0;
216 }
217
218 /**************************************************************************
219  *                 RasSetAutodialAddressW       [RASAPI32.58]
220  */
221 DWORD WINAPI RasSetAutodialAddressW(LPCWSTR a, DWORD b, LPRASAUTODIALENTRYW c,
222                                         DWORD d, DWORD e)
223 {
224         FIXME("(%s,%lx,%p,%lx,%lx),stub!\n",debugstr_w(a),b,c,d,e);
225         return 0;
226 }
227
228 /**************************************************************************
229  *                 RasSetAutodialEnableA        [RASAPI32.59]
230  */
231 DWORD WINAPI RasSetAutodialEnableA(DWORD dwDialingLocation, BOOL fEnabled)
232 {
233         FIXME("(%lx,%x),stub!\n",dwDialingLocation,fEnabled);
234         return 0;
235 }
236
237 /**************************************************************************
238  *                 RasSetAutodialEnableW        [RASAPI32.60]
239  */
240 DWORD WINAPI RasSetAutodialEnableW(DWORD dwDialingLocation, BOOL fEnabled)
241 {
242         FIXME("(%lx,%x),stub!\n",dwDialingLocation,fEnabled);
243         return 0;
244 }
245
246 /**************************************************************************
247  *                 RasSetAutodialParamA [RASAPI32.61]
248  */
249 DWORD WINAPI RasSetAutodialParamA(DWORD a, LPVOID b, DWORD c)
250 {
251         FIXME("(%lx,%p,%lx),stub!\n",a,b,c);
252         return 0;
253 }
254
255 /**************************************************************************
256  *                 RasSetAutodialParamW [RASAPI32.62]
257  */
258 DWORD WINAPI RasSetAutodialParamW(DWORD a, LPVOID b, DWORD c)
259 {
260         FIXME("(%lx,%p,%lx),stub!\n",a,b,c);
261         return 0;
262 }
263
264 /**************************************************************************
265  *                 RasSetEntryPropertiesA       [RASAPI32.67]
266  */
267 DWORD WINAPI RasSetEntryPropertiesA(LPCSTR lpszPhonebook, LPCSTR lpszEntry,
268         LPRASENTRYA lpRasEntry, DWORD dwEntryInfoSize, LPBYTE lpbDeviceInfo,
269         DWORD dwDeviceInfoSize
270 ) {
271         FIXME("(%s,%s,%p,%ld,%p,%ld), stub!\n",
272                 debugstr_a(lpszPhonebook),debugstr_a(lpszEntry),
273                 lpRasEntry,dwEntryInfoSize,lpbDeviceInfo,dwDeviceInfoSize
274         );
275         FIXME("Rasentry:\n");
276         FIXME("\tdwfOptions %lx\n",lpRasEntry->dwfOptions);
277         FIXME("\tszLocalPhoneNumber %s\n",debugstr_a(lpRasEntry->szLocalPhoneNumber));
278         return 0;
279 }
280
281 /**************************************************************************
282  *                 RasSetEntryPropertiesW       [RASAPI32.68]
283  */
284 DWORD WINAPI RasSetEntryPropertiesW(LPCWSTR lpszPhonebook, LPCWSTR lpszEntry,
285         LPRASENTRYW lpRasEntry, DWORD dwEntryInfoSize, LPBYTE lpbDeviceInfo,
286         DWORD dwDeviceInfoSize
287 ) {
288         FIXME("(%s,%s,%p,%ld,%p,%ld), stub!\n",
289                 debugstr_w(lpszPhonebook),debugstr_w(lpszEntry),
290                 lpRasEntry,dwEntryInfoSize,lpbDeviceInfo,dwDeviceInfoSize
291         );
292         return 0;
293 }
294
295 /**************************************************************************
296  *                 RasValidateEntryNameA        [RASAPI32.72]
297  */
298 DWORD WINAPI RasValidateEntryNameA(LPCSTR lpszPhonebook, LPCSTR lpszEntry) {
299         FIXME("(%s,%s), stub!\n",debugstr_a(lpszPhonebook),debugstr_a(lpszEntry));
300         return 0;
301 }
302
303 /**************************************************************************
304  *                 RasValidateEntryNameW        [RASAPI32.73]
305  */
306 DWORD WINAPI RasValidateEntryNameW(LPCWSTR lpszPhonebook, LPCWSTR lpszEntry) {
307         FIXME("(%s,%s), stub!\n",debugstr_w(lpszPhonebook),debugstr_w(lpszEntry));
308         return 0;
309 }