wined3d: Use wined3d_uint32_compare() in compare_sig().
[wine.git] / dlls / tapi32 / line.c
blob0df9746084b07c495b7e6143b0906dac5d9806a3
1 /*
2 * TAPI32 line services
4 * Copyright 1999 Andreas Mohr
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
21 #include <string.h>
22 #include <stdlib.h>
23 #include <stdarg.h>
24 #include <stdio.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winternl.h"
28 #include "wingdi.h"
29 #include "winreg.h"
30 #include "winnls.h"
31 #include "winerror.h"
32 #include "objbase.h"
33 #include "tapi.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(tapi);
38 /* registry keys */
39 static const char szCountrylistKey[] =
40 "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country List";
41 static const char szLocationsKey[] =
42 "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Locations";
43 static const char szCardsKey[] =
44 "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Cards";
47 /***********************************************************************
48 * lineAccept (TAPI32.@)
50 DWORD WINAPI lineAccept(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
52 FIXME("(%p, %s, %d): stub.\n", hCall, lpsUserUserInfo, dwSize);
53 return 1;
56 /***********************************************************************
57 * lineAddProviderA (TAPI32.@)
59 DWORD WINAPI lineAddProviderA(LPCSTR lpszProviderName, HWND hwndOwner, LPDWORD lpdwPermanentProviderID)
61 FIXME("(%s, %p, %p): stub.\n", lpszProviderName, hwndOwner, lpdwPermanentProviderID);
62 return LINEERR_OPERATIONFAILED;
65 /***********************************************************************
66 * lineAddProviderW (TAPI32.@)
68 DWORD WINAPI lineAddProviderW(LPCWSTR lpszProviderName, HWND hwndOwner, LPDWORD lpdwPermanentProviderID)
70 FIXME("(%s, %p, %p): stub.\n", wine_dbgstr_w(lpszProviderName), hwndOwner, lpdwPermanentProviderID);
71 return LINEERR_OPERATIONFAILED;
74 /***********************************************************************
75 * lineAddToConference (TAPI32.@)
77 DWORD WINAPI lineAddToConference(HCALL hConfCall, HCALL hConsultCall)
79 FIXME("(%p, %p): stub.\n", hConfCall, hConsultCall);
80 return 1;
83 /***********************************************************************
84 * lineAnswer (TAPI32.@)
86 DWORD WINAPI lineAnswer(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
88 FIXME("(%p, %s, %d): stub.\n", hCall, lpsUserUserInfo, dwSize);
89 return 1;
92 /***********************************************************************
93 * lineBlindTransfer (TAPI32.@)
95 DWORD WINAPI lineBlindTransferA(HCALL hCall, LPCSTR lpszDestAddress, DWORD dwCountryCode)
97 FIXME("(%p, %s, %08x): stub.\n", hCall, lpszDestAddress, dwCountryCode);
98 return 1;
101 /***********************************************************************
102 * lineClose (TAPI32.@)
104 DWORD WINAPI lineClose(HLINE hLine)
106 FIXME("(%p): stub.\n", hLine);
107 return 0;
110 /***********************************************************************
111 * lineCompleteCall (TAPI32.@)
113 DWORD WINAPI lineCompleteCall(HCALL hCall, LPDWORD lpdwCompletionID, DWORD dwCompletionMode, DWORD dwMessageID)
115 FIXME("(%p, %p, %08x, %08x): stub.\n", hCall, lpdwCompletionID, dwCompletionMode, dwMessageID);
116 return 1;
119 /***********************************************************************
120 * lineCompleteTransfer (TAPI32.@)
122 DWORD WINAPI lineCompleteTransfer(HCALL hCall, HCALL hConsultCall, LPHCALL lphConfCall, DWORD dwTransferMode)
124 FIXME("(%p, %p, %p, %08x): stub.\n", hCall, hConsultCall, lphConfCall, dwTransferMode);
125 return 1;
128 /***********************************************************************
129 * lineConfigDialog (TAPI32.@)
131 DWORD WINAPI lineConfigDialogA(DWORD dwDeviceID, HWND hwndOwner, LPCSTR lpszDeviceClass)
133 FIXME("(%08x, %p, %s): stub.\n", dwDeviceID, hwndOwner, lpszDeviceClass);
134 return 0;
137 /***********************************************************************
138 * lineConfigDialogW (TAPI32.@)
140 DWORD WINAPI lineConfigDialogW(DWORD dwDeviceID, HWND hwndOwner, LPCWSTR lpszDeviceClass)
142 FIXME("(%08x, %p, %s): stub.\n", dwDeviceID, hwndOwner, debugstr_w(lpszDeviceClass));
143 return 0;
146 /***********************************************************************
147 * lineConfigDialogEdit (TAPI32.@)
149 DWORD WINAPI lineConfigDialogEditA(DWORD dwDeviceID, HWND hwndOwner, LPCSTR lpszDeviceClass, LPVOID const lpDeviceConfigIn, DWORD dwSize, LPVARSTRING lpDeviceConfigOut)
151 FIXME("stub.\n");
152 return 0;
155 /***********************************************************************
156 * lineConfigProvider (TAPI32.@)
158 DWORD WINAPI lineConfigProvider(HWND hwndOwner, DWORD dwPermanentProviderID)
160 FIXME("(%p, %08x): stub.\n", hwndOwner, dwPermanentProviderID);
161 return 0;
164 /***********************************************************************
165 * lineDeallocateCall (TAPI32.@)
167 DWORD WINAPI lineDeallocateCall(HCALL hCall)
169 FIXME("(%p): stub.\n", hCall);
170 return 0;
173 /***********************************************************************
174 * lineDevSpecific (TAPI32.@)
176 DWORD WINAPI lineDevSpecific(HLINE hLine, DWORD dwAddressId, HCALL hCall, LPVOID lpParams, DWORD dwSize)
178 FIXME("(%p, %08x, %p, %p, %d): stub.\n", hLine, dwAddressId, hCall, lpParams, dwSize);
179 return 1;
182 /***********************************************************************
183 * lineDevSpecificFeature (TAPI32.@)
185 DWORD WINAPI lineDevSpecificFeature(HLINE hLine, DWORD dwFeature, LPVOID lpParams, DWORD dwSize)
187 FIXME("(%p, %08x, %p, %d): stub.\n", hLine, dwFeature, lpParams, dwSize);
188 return 1;
191 /***********************************************************************
192 * lineDial (TAPI32.@)
194 DWORD WINAPI lineDialA(HCALL hCall, LPCSTR lpszDestAddress, DWORD dwCountryCode)
196 FIXME("(%p, %s, %08x): stub.\n", hCall, lpszDestAddress, dwCountryCode);
197 return 1;
200 /***********************************************************************
201 * lineDialW (TAPI32.@)
203 DWORD WINAPI lineDialW(HCALL hCall, LPCWSTR lpszDestAddress, DWORD dwCountryCode)
205 FIXME("(%p, %s, %08x): stub.\n", hCall, debugstr_w(lpszDestAddress), dwCountryCode);
206 return 1;
209 /***********************************************************************
210 * lineDrop (TAPI32.@)
212 DWORD WINAPI lineDrop(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
214 FIXME("(%p, %s, %08x): stub.\n", hCall, lpsUserUserInfo, dwSize);
215 return 1;
218 /***********************************************************************
219 * lineForward (TAPI32.@)
221 DWORD WINAPI lineForwardA(HLINE hLine, DWORD bAllAddress, DWORD dwAddressID, LPLINEFORWARDLIST lpForwardList, DWORD dwNumRingsNoAnswer, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
223 FIXME("stub.\n");
224 return 1;
227 /***********************************************************************
228 * lineGatherDigits (TAPI32.@)
230 DWORD WINAPI lineGatherDigitsA(HCALL hCall, DWORD dwDigitModes, LPSTR lpsDigits, DWORD dwNumDigits, LPCSTR lpszTerminationDigits, DWORD dwFirstDigitTimeout, DWORD dwInterDigitTimeout)
232 FIXME("stub.\n");
233 return 0;
236 /***********************************************************************
237 * lineGenerateDigits (TAPI32.@)
239 DWORD WINAPI lineGenerateDigitsA(HCALL hCall, DWORD dwDigitModes, LPCSTR lpszDigits, DWORD dwDuration)
241 FIXME("(%p, %08x, %s, %d): stub.\n", hCall, dwDigitModes, lpszDigits, dwDuration);
242 return 0;
245 /***********************************************************************
246 * lineGenerateTone (TAPI32.@)
248 DWORD WINAPI lineGenerateTone(HCALL hCall, DWORD dwToneMode, DWORD dwDuration, DWORD dwNumTones, LPLINEGENERATETONE lpTones)
250 FIXME("(%p, %08x, %d, %d, %p): stub.\n", hCall, dwToneMode, dwDuration, dwNumTones, lpTones);
251 return 0;
254 /***********************************************************************
255 * lineGetAddressCaps (TAPI32.@)
257 DWORD WINAPI lineGetAddressCapsA(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAddressID, DWORD dwAPIVersion, DWORD dwExtVersion, LPLINEADDRESSCAPS lpAddressCaps)
259 FIXME("(%p, %08x, %08x, %08x, %08x, %p): stub.\n", hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps);
260 return 0;
263 /***********************************************************************
264 * lineGetAddressID (TAPI32.@)
266 DWORD WINAPI lineGetAddressIDA(HLINE hLine, LPDWORD lpdwAddressID, DWORD dwAddressMode, LPCSTR lpsAddress, DWORD dwSize)
268 FIXME("%p, %p, %08x, %s, %d): stub.\n", hLine, lpdwAddressID, dwAddressMode, lpsAddress, dwSize);
269 return 0;
272 /***********************************************************************
273 * lineGetAddressStatus (TAPI32.@)
275 DWORD WINAPI lineGetAddressStatusA(HLINE hLine, DWORD dwAddressID, LPLINEADDRESSSTATUS lpAddressStatus)
277 FIXME("(%p, %08x, %p): stub.\n", hLine, dwAddressID, lpAddressStatus);
278 return 0;
281 /***********************************************************************
282 * lineGetAppPriority (TAPI32.@)
284 DWORD WINAPI lineGetAppPriorityA(LPCSTR lpszAppFilename, DWORD dwMediaMode, LPLINEEXTENSIONID const lpExtensionID, DWORD dwRequestMode, LPVARSTRING lpExtensionName, LPDWORD lpdwPriority)
286 FIXME("(%s, %08x, %p, %08x, %p, %p): stub.\n", lpszAppFilename, dwMediaMode, lpExtensionID, dwRequestMode, lpExtensionName, lpdwPriority);
287 return 0;
290 /***********************************************************************
291 * lineGetCallInfo (TAPI32.@)
293 DWORD WINAPI lineGetCallInfoA(HCALL hCall, LPLINECALLINFO lpCallInfo)
295 FIXME("(%p, %p): stub.\n", hCall, lpCallInfo);
296 return 0;
299 /***********************************************************************
300 * lineGetCallStatus (TAPI32.@)
302 DWORD WINAPI lineGetCallStatus(HCALL hCall, LPLINECALLSTATUS lpCallStatus)
304 FIXME("(%p, %p): stub.\n", hCall, lpCallStatus);
305 return 0;
308 /***********************************************************************
309 * lineGetConfRelatedCalls (TAPI32.@)
311 DWORD WINAPI lineGetConfRelatedCalls(HCALL hCall, LPLINECALLLIST lpCallList)
313 FIXME("(%p, %p): stub.\n", hCall, lpCallList);
314 return 0;
317 /***********************************************************************
318 * lineGetCountryA (TAPI32.@)
320 DWORD WINAPI lineGetCountryA(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRYLIST lpLineCountryList)
322 DWORD dwAvailSize, dwOffset, i, num_countries, max_subkey_len;
323 LPLINECOUNTRYENTRY lpLCE;
324 HKEY hkey;
325 char *subkey_name;
327 if(!lpLineCountryList) {
328 TRACE("(%08x, %08x, %p): stub. Returning LINEERR_INVALPOINTER\n",
329 dwCountryID, dwAPIVersion, lpLineCountryList);
330 return LINEERR_INVALPOINTER;
333 TRACE("(%08x, %08x, %p(%d)): stub.\n",
334 dwCountryID, dwAPIVersion, lpLineCountryList,
335 lpLineCountryList->dwTotalSize);
337 if(RegOpenKeyA(HKEY_LOCAL_MACHINE, szCountrylistKey, &hkey)
338 != ERROR_SUCCESS)
339 return LINEERR_INIFILECORRUPT;
342 dwAvailSize = lpLineCountryList->dwTotalSize;
343 dwOffset = sizeof (LINECOUNTRYLIST);
345 if(dwAvailSize<dwOffset)
346 return LINEERR_STRUCTURETOOSMALL;
348 memset(lpLineCountryList, 0, dwAvailSize);
350 lpLineCountryList->dwTotalSize = dwAvailSize;
351 lpLineCountryList->dwUsedSize = dwOffset;
352 lpLineCountryList->dwNumCountries = 0;
353 lpLineCountryList->dwCountryListSize = 0;
354 lpLineCountryList->dwCountryListOffset = dwOffset;
356 lpLCE = (LPLINECOUNTRYENTRY)(&lpLineCountryList[1]);
358 if(RegQueryInfoKeyA(hkey, NULL, NULL, NULL, &num_countries, &max_subkey_len,
359 NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) {
360 RegCloseKey(hkey);
361 return LINEERR_STRUCTURETOOSMALL;
364 if(dwCountryID)
365 dwOffset = sizeof (LINECOUNTRYENTRY);
366 else
367 dwOffset += num_countries * sizeof (LINECOUNTRYENTRY);
369 max_subkey_len++;
370 subkey_name = HeapAlloc(GetProcessHeap(), 0, max_subkey_len);
371 for(i = 0; i < num_countries; i++)
373 DWORD len, size, size_int, size_long, size_name, size_same;
374 HKEY hsubkey;
376 if(RegEnumKeyA(hkey, i, subkey_name, max_subkey_len) !=
377 ERROR_SUCCESS)
378 continue;
380 if(dwCountryID && (atoi(subkey_name) != dwCountryID))
381 continue;
383 if(RegOpenKeyA(hkey, subkey_name, &hsubkey) != ERROR_SUCCESS)
384 continue;
386 RegQueryValueExA(hsubkey, "InternationalRule", NULL, NULL,
387 NULL, &size_int);
388 len = size_int;
390 RegQueryValueExA(hsubkey, "LongDistanceRule", NULL, NULL,
391 NULL, &size_long);
392 len += size_long;
394 RegQueryValueExA(hsubkey, "Name", NULL, NULL,
395 NULL, &size_name);
396 len += size_name;
398 RegQueryValueExA(hsubkey, "SameAreaRule", NULL, NULL,
399 NULL, &size_same);
400 len += size_same;
402 if(dwAvailSize < (dwOffset+len))
404 dwOffset += len;
405 RegCloseKey(hsubkey);
406 if(dwCountryID)
407 break;
408 continue;
411 lpLineCountryList->dwNumCountries++;
412 lpLineCountryList->dwCountryListSize += sizeof (LINECOUNTRYENTRY);
413 lpLineCountryList->dwUsedSize += len + sizeof (LINECOUNTRYENTRY);
415 if(dwCountryID)
416 i = 0;
418 lpLCE[i].dwCountryID = atoi(subkey_name);
419 size = sizeof(DWORD);
420 RegQueryValueExA(hsubkey, "CountryCode", NULL, NULL,
421 (BYTE*)&lpLCE[i].dwCountryCode, &size);
423 lpLCE[i].dwNextCountryID = 0;
425 if(i > 0)
426 lpLCE[i-1].dwNextCountryID = lpLCE[i].dwCountryID;
428 /* add country name */
429 lpLCE[i].dwCountryNameSize = size_name;
430 lpLCE[i].dwCountryNameOffset = dwOffset;
431 RegQueryValueExA(hsubkey, "Name", NULL, NULL,
432 ((LPBYTE)lpLineCountryList)+dwOffset,
433 &size_name);
434 dwOffset += size_name;
436 /* add Same Area Rule */
437 lpLCE[i].dwSameAreaRuleSize = size_same;
438 lpLCE[i].dwSameAreaRuleOffset = dwOffset;
439 RegQueryValueExA(hsubkey, "SameAreaRule", NULL, NULL,
440 ((LPBYTE)lpLineCountryList)+dwOffset,
441 &size_same);
442 dwOffset += size_same;
444 /* add Long Distance Rule */
445 lpLCE[i].dwLongDistanceRuleSize = size_long;
446 lpLCE[i].dwLongDistanceRuleOffset = dwOffset;
447 RegQueryValueExA(hsubkey, "LongDistanceRule", NULL, NULL,
448 ((LPBYTE)lpLineCountryList)+dwOffset,
449 &size_long);
450 dwOffset += size_long;
452 /* add Long Distance Rule */
453 lpLCE[i].dwInternationalRuleSize = size_int;
454 lpLCE[i].dwInternationalRuleOffset = dwOffset;
455 RegQueryValueExA(hsubkey, "InternationalRule", NULL, NULL,
456 ((LPBYTE)lpLineCountryList)+dwOffset,
457 &size_int);
458 dwOffset += size_int;
459 RegCloseKey(hsubkey);
461 TRACE("Added country %s at %p\n", (LPSTR)lpLineCountryList + lpLCE[i].dwCountryNameOffset,
462 &lpLCE[i]);
464 if(dwCountryID) break;
467 lpLineCountryList->dwNeededSize = dwOffset;
469 TRACE("%d available %d required\n", dwAvailSize, dwOffset);
471 HeapFree(GetProcessHeap(), 0, subkey_name);
472 RegCloseKey(hkey);
474 return 0;
477 /***********************************************************************
478 * lineGetCountryW (TAPI32.@)
480 DWORD WINAPI lineGetCountryW(DWORD id, DWORD version, LPLINECOUNTRYLIST list)
482 static const WCHAR country_listW[] =
483 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
484 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
485 'T','e','l','e','p','h','o','n','y','\\','C','o','u','n','t','r','y',' ','L','i','s','t',0};
486 static const WCHAR international_ruleW[] =
487 {'I','n','t','e','r','n','a','t','i','o','n','a','l','R','u','l','e',0};
488 static const WCHAR longdistance_ruleW[] =
489 {'L','o','n','g','D','i','s','t','a','n','c','e','R','u','l','e',0};
490 static const WCHAR samearea_ruleW[] =
491 {'S','a','m','e','A','r','e','a','R','u','l','e',0};
492 static const WCHAR nameW[] =
493 {'N','a','m','e',0};
494 static const WCHAR country_codeW[] =
495 {'C','o','u','n','t','r','y','C','o','d','e',0};
496 DWORD total_size, offset, i, num_countries, max_subkey_len;
497 LINECOUNTRYENTRY *entry;
498 WCHAR *subkey_name;
499 HKEY hkey;
501 if (!list) return LINEERR_INVALPOINTER;
502 TRACE("(%08x, %08x, %p(%d))\n", id, version, list, list->dwTotalSize);
504 if (RegOpenKeyW(HKEY_LOCAL_MACHINE, country_listW, &hkey) != ERROR_SUCCESS)
505 return LINEERR_INIFILECORRUPT;
507 total_size = list->dwTotalSize;
508 offset = sizeof(LINECOUNTRYLIST);
509 if (total_size < offset) return LINEERR_STRUCTURETOOSMALL;
511 memset(list, 0, total_size);
512 list->dwTotalSize = total_size;
513 list->dwUsedSize = offset;
514 list->dwNumCountries = 0;
515 list->dwCountryListSize = 0;
516 list->dwCountryListOffset = offset;
518 entry = (LINECOUNTRYENTRY *)(list + 1);
520 if (RegQueryInfoKeyW(hkey, NULL, NULL, NULL, &num_countries, &max_subkey_len,
521 NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
523 RegCloseKey(hkey);
524 return LINEERR_OPERATIONFAILED;
526 if (id) offset = sizeof(LINECOUNTRYENTRY);
527 else offset += num_countries * sizeof(LINECOUNTRYENTRY);
529 max_subkey_len++;
530 if (!(subkey_name = HeapAlloc(GetProcessHeap(), 0, max_subkey_len * sizeof(WCHAR))))
532 RegCloseKey(hkey);
533 return LINEERR_NOMEM;
535 for (i = 0; i < num_countries; i++)
537 DWORD len, size, size_int, size_long, size_name, size_same;
538 HKEY hsubkey;
540 if (RegEnumKeyW(hkey, i, subkey_name, max_subkey_len) != ERROR_SUCCESS) continue;
541 if (id && (wcstol(subkey_name, NULL, 10) != id)) continue;
542 if (RegOpenKeyW(hkey, subkey_name, &hsubkey) != ERROR_SUCCESS) continue;
544 RegQueryValueExW(hsubkey, international_ruleW, NULL, NULL, NULL, &size_int);
545 len = size_int;
547 RegQueryValueExW(hsubkey, longdistance_ruleW, NULL, NULL, NULL, &size_long);
548 len += size_long;
550 RegQueryValueExW(hsubkey, nameW, NULL, NULL, NULL, &size_name);
551 len += size_name;
553 RegQueryValueExW(hsubkey, samearea_ruleW, NULL, NULL, NULL, &size_same);
554 len += size_same;
556 if (total_size < offset + len)
558 offset += len;
559 RegCloseKey(hsubkey);
560 if (id) break;
561 continue;
563 list->dwNumCountries++;
564 list->dwCountryListSize += sizeof(LINECOUNTRYENTRY);
565 list->dwUsedSize += len + sizeof(LINECOUNTRYENTRY);
567 if (id) i = 0;
568 entry[i].dwCountryID = wcstol(subkey_name, NULL, 10);
569 size = sizeof(DWORD);
570 RegQueryValueExW(hsubkey, country_codeW, NULL, NULL, (BYTE *)&entry[i].dwCountryCode, &size);
571 entry[i].dwNextCountryID = 0;
573 if (i > 0) entry[i - 1].dwNextCountryID = entry[i].dwCountryID;
575 /* add country name */
576 entry[i].dwCountryNameSize = size_name;
577 entry[i].dwCountryNameOffset = offset;
578 RegQueryValueExW(hsubkey, nameW, NULL, NULL, (BYTE *)list + offset, &size_name);
579 offset += size_name;
581 /* add Same Area Rule */
582 entry[i].dwSameAreaRuleSize = size_same;
583 entry[i].dwSameAreaRuleOffset = offset;
584 RegQueryValueExW(hsubkey, samearea_ruleW, NULL, NULL, (BYTE *)list + offset, &size_same);
585 offset += size_same;
587 /* add Long Distance Rule */
588 entry[i].dwLongDistanceRuleSize = size_long;
589 entry[i].dwLongDistanceRuleOffset = offset;
590 RegQueryValueExW(hsubkey, longdistance_ruleW, NULL, NULL, (BYTE *)list + offset, &size_long);
591 offset += size_long;
593 /* add Long Distance Rule */
594 entry[i].dwInternationalRuleSize = size_int;
595 entry[i].dwInternationalRuleOffset = offset;
596 RegQueryValueExW(hsubkey, international_ruleW, NULL, NULL, (BYTE *)list + offset, &size_int);
597 offset += size_int;
598 RegCloseKey(hsubkey);
600 TRACE("added country %s at %p\n",
601 debugstr_w((const WCHAR *)((const char *)list + entry[i].dwCountryNameOffset)), &entry[i]);
602 if (id) break;
604 list->dwNeededSize = offset;
606 TRACE("%d available %d required\n", total_size, offset);
608 HeapFree(GetProcessHeap(), 0, subkey_name);
609 RegCloseKey(hkey);
610 return 0;
613 /***********************************************************************
614 * lineGetDevCapsW (TAPI32.@)
616 DWORD WINAPI lineGetDevCapsW(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion,
617 DWORD dwExtVersion, LPLINEDEVCAPS lpLineDevCaps)
619 static int warn_once;
621 if(!warn_once++)
622 FIXME("(%p, %08x, %08x, %08x, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion,
623 dwExtVersion, lpLineDevCaps);
624 return LINEERR_OPERATIONFAILED;
627 /***********************************************************************
628 * lineGetDevCapsA (TAPI32.@)
630 DWORD WINAPI lineGetDevCapsA(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion,
631 DWORD dwExtVersion, LPLINEDEVCAPS lpLineDevCaps)
633 static int warn_once;
635 if(!warn_once++)
636 FIXME("(%p, %08x, %08x, %08x, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion,
637 dwExtVersion, lpLineDevCaps);
638 return LINEERR_OPERATIONFAILED;
641 /***********************************************************************
642 * lineGetDevConfig (TAPI32.@)
644 DWORD WINAPI lineGetDevConfigA(DWORD dwDeviceID, LPVARSTRING lpDeviceConfig, LPCSTR lpszDeviceClass)
646 FIXME("(%08x, %p, %s): stub.\n", dwDeviceID, lpDeviceConfig, lpszDeviceClass);
647 return 0;
650 /***********************************************************************
651 * lineGetIDW (TAPI32.@)
653 DWORD WINAPI lineGetIDW(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD dwSelect,
654 LPVARSTRING lpDeviceID, LPCWSTR lpszDeviceClass)
656 FIXME("(%p, %08x, %p, %08x, %p, %s): stub.\n", hLine, dwAddressID, hCall,
657 dwSelect, lpDeviceID,
658 debugstr_w(lpszDeviceClass));
659 return LINEERR_OPERATIONFAILED;
662 /***********************************************************************
663 * lineGetIDA (TAPI32.@)
665 DWORD WINAPI lineGetIDA(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD dwSelect,
666 LPVARSTRING lpDeviceID, LPCSTR lpszDeviceClass)
668 FIXME("(%p, %08x, %p, %08x, %p, %s): stub.\n", hLine, dwAddressID, hCall,
669 dwSelect, lpDeviceID, lpszDeviceClass);
670 return LINEERR_OPERATIONFAILED;
673 /***********************************************************************
674 * lineGetIcon (TAPI32.@)
676 DWORD WINAPI lineGetIconA(DWORD dwDeviceID, LPCSTR lpszDeviceClass, HICON *lphIcon)
678 FIXME("(%08x, %s, %p): stub.\n", dwDeviceID, lpszDeviceClass, lphIcon);
679 return 0;
682 /***********************************************************************
683 * lineGetLineDevStatus (TAPI32.@)
685 DWORD WINAPI lineGetLineDevStatusA(HLINE hLine, LPLINEDEVSTATUS lpLineDevStatus)
687 FIXME("(%p, %p): stub.\n", hLine, lpLineDevStatus);
688 return 0;
691 /***********************************************************************
692 * lineGetMessage (TAPI32.@)
694 DWORD WINAPI lineGetMessage(HLINEAPP hLineApp, LPLINEMESSAGE lpMessage, DWORD dwTimeout)
696 FIXME("(%p, %p, %08x): stub.\n", hLineApp, lpMessage, dwTimeout);
697 return 0;
700 /***********************************************************************
701 * lineGetNewCalls (TAPI32.@)
703 DWORD WINAPI lineGetNewCalls(HLINE hLine, DWORD dwAddressID, DWORD dwSelect, LPLINECALLLIST lpCallList)
705 FIXME("(%p, %08x, %08x, %p): stub.\n", hLine, dwAddressID, dwSelect, lpCallList);
706 return 0;
709 /***********************************************************************
710 * lineGetNumRings (TAPI32.@)
712 DWORD WINAPI lineGetNumRings(HLINE hLine, DWORD dwAddressID, LPDWORD lpdwNumRings)
714 FIXME("(%p, %08x, %p): stub.\n", hLine, dwAddressID, lpdwNumRings);
715 return 0;
718 /***********************************************************************
719 * lineGetProviderListA (TAPI32.@)
721 DWORD WINAPI lineGetProviderListA(DWORD dwAPIVersion, LPLINEPROVIDERLIST lpProviderList)
723 FIXME("(%08x, %p): stub.\n", dwAPIVersion, lpProviderList);
724 return LINEERR_OPERATIONFAILED;
727 /***********************************************************************
728 * lineGetProviderListW (TAPI32.@)
730 DWORD WINAPI lineGetProviderListW(DWORD dwAPIVersion, LPLINEPROVIDERLIST lpProviderList)
732 FIXME("(%08x, %p): stub.\n", dwAPIVersion, lpProviderList);
733 return LINEERR_OPERATIONFAILED;
736 /***********************************************************************
737 * lineGetRequest (TAPI32.@)
739 DWORD WINAPI lineGetRequestA(HLINEAPP hLineApp, DWORD dwRequestMode, LPVOID lpRequestBuffer)
741 FIXME("%p, %08x, %p): stub.\n", hLineApp, dwRequestMode, lpRequestBuffer);
742 return 0;
745 /***********************************************************************
746 * lineGetStatusMessages (TAPI32.@)
748 DWORD WINAPI lineGetStatusMessages(HLINE hLine, LPDWORD lpdwLineStatus, LPDWORD lpdwAddressStates)
750 FIXME("(%p, %p, %p): stub.\n", hLine, lpdwLineStatus, lpdwAddressStates);
751 return 0;
754 /***********************************************************************
755 * lineGetTranslateCapsW (TAPI32.@)
757 DWORD WINAPI lineGetTranslateCapsW(HLINEAPP line_app, DWORD api_version, LINETRANSLATECAPS *caps)
759 FIXME("(%p, %08x, %p): stub.\n", line_app, api_version, caps);
760 return LINEERR_OPERATIONFAILED;
763 /***********************************************************************
764 * lineGetTranslateCaps (TAPI32.@)
766 * get address translate capabilities. Returns a LINETRANSLATECAPS
767 * structure:
769 * +-----------------------+
770 * |TotalSize |
771 * |NeededSize |
772 * |UsedSize |
773 * +-----------------------+
774 * |NumLocations |
775 * |LocationsListSize |
776 * |LocationsListOffset | -+
777 * |CurrentLocationID | |
778 * +-----------------------+ |
779 * |NumCards | |
780 * |CardListSize | |
781 * |CardListOffset | -|--+
782 * |CurrentPreferredCardID | | |
783 * +-----------------------+ | |
784 * | | <+ |
785 * |LINELOCATIONENTRY #1 | |
786 * | | |
787 * +-----------------------+ |
788 * ~ ~ |
789 * +-----------------------+ |
790 * | | |
791 * |LINELOCATIONENTRY | |
792 * | #NumLocations| |
793 * +-----------------------+ |
794 * | | <---+
795 * |LINECARDENTRY #1 |
796 * | |
797 * +-----------------------+
798 * ~ ~
799 * +-----------------------+
800 * | |
801 * |LINECARDENTRY #NumCards|
802 * | |
803 * +-----------------------+
804 * | room for strings named|
805 * | in the structures |
806 * | above. |
807 * +-----------------------+
809 DWORD WINAPI lineGetTranslateCapsA(HLINEAPP hLineApp, DWORD dwAPIVersion,
810 LPLINETRANSLATECAPS lpTranslateCaps)
812 HKEY hkLocations, hkCards, hkCardLocations, hsubkey;
813 int numlocations, numcards;
814 DWORD maxlockeylen,
815 maxcardkeylen;
816 char *loc_key_name = NULL;
817 char *card_key_name = NULL;
818 LPBYTE strptr;
819 int length;
820 int i;
821 DWORD lendword;
822 DWORD currentid;
823 LPLINELOCATIONENTRY pLocEntry;
824 LPLINECARDENTRY pCardEntry;
826 TRACE("(%p, %08x, %p (tot. size %d)\n", hLineApp, dwAPIVersion,
827 lpTranslateCaps, lpTranslateCaps->dwTotalSize );
828 if( lpTranslateCaps->dwTotalSize < sizeof(LINETRANSLATECAPS))
829 return LINEERR_STRUCTURETOOSMALL;
830 if( RegCreateKeyA(HKEY_LOCAL_MACHINE, szLocationsKey, &hkLocations)
831 != ERROR_SUCCESS ) {
832 ERR("unexpected registry error 1.\n");
833 return LINEERR_INIFILECORRUPT;
835 lendword = sizeof( DWORD);
836 if( RegQueryValueExA( hkLocations, "CurrentID", NULL, NULL,
837 (LPBYTE) &currentid, &lendword) != ERROR_SUCCESS )
838 currentid = -1; /* change this later */
839 if(RegQueryInfoKeyA(hkLocations, NULL, NULL, NULL, NULL, &maxlockeylen,
840 NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) {
841 RegCloseKey(hkLocations);
842 ERR("unexpected registry error 2.\n");
843 return LINEERR_INIFILECORRUPT;
845 maxlockeylen++;
846 if( maxlockeylen < 10)
847 maxlockeylen = 10; /* need this also if there is no key */
848 loc_key_name = HeapAlloc( GetProcessHeap(), 0, maxlockeylen);
849 /* first time through: calculate needed space */
850 length=0;
851 i=0;
852 numlocations=0;
853 while( RegEnumKeyA(hkLocations, i, loc_key_name, maxlockeylen)
854 == ERROR_SUCCESS){
855 DWORD size_val;
856 i++;
857 if( _strnicmp(loc_key_name, "location", 8) ||
858 (RegOpenKeyA(hkLocations, loc_key_name, &hsubkey)
859 != ERROR_SUCCESS))
860 continue;
861 numlocations++;
862 length += sizeof(LINELOCATIONENTRY);
863 RegQueryValueExA(hsubkey, "Name",NULL,NULL,NULL,&size_val);
864 length += size_val;
865 RegQueryValueExA(hsubkey, "AreaCode",NULL,NULL,NULL,&size_val);
866 length += size_val;
867 RegQueryValueExA(hsubkey, "OutsideAccess",NULL,NULL,NULL,&size_val);
868 length += size_val;
869 RegQueryValueExA(hsubkey, "LongDistanceAccess",NULL,NULL,NULL,&size_val);
870 length += size_val;
871 RegQueryValueExA(hsubkey, "DisableCallWaiting",NULL,NULL,NULL,&size_val);
872 length += size_val;
873 /* fixme: what about TollPrefixList???? */
874 RegCloseKey(hsubkey);
876 if(numlocations == 0) {
877 /* add one location */
878 if( RegCreateKeyA( hkLocations, "Location1", &hsubkey)
879 == ERROR_SUCCESS) {
880 DWORD dwval;
881 char buf[10];
882 numlocations = 1;
883 length += sizeof(LINELOCATIONENTRY) + 20 ;
884 RegSetValueExA( hsubkey, "AreaCode", 0, REG_SZ, (const BYTE *)"010", 4);
885 GetLocaleInfoA( LOCALE_SYSTEM_DEFAULT, LOCALE_ICOUNTRY, buf, 8);
886 dwval = atoi(buf);
887 RegSetValueExA( hsubkey, "Country", 0, REG_DWORD, (LPBYTE)&dwval,
888 sizeof(DWORD));
889 RegSetValueExA( hsubkey, "DisableCallWaiting", 0, REG_SZ, (const BYTE *)"", 1);
890 dwval = 1;
891 RegSetValueExA( hsubkey, "Flags", 0, REG_DWORD, (LPBYTE)&dwval,
892 sizeof(DWORD));
893 RegSetValueExA( hsubkey, "LongDistanceAccess", 0, REG_SZ, (const BYTE *)"", 1);
894 RegSetValueExA( hsubkey, "Name", 0, REG_SZ, (const BYTE *)"New Location", 13);
895 RegSetValueExA( hsubkey, "OutsideAccess", 0, REG_SZ, (const BYTE *)"", 1);
896 RegCloseKey(hsubkey);
897 dwval = 1;
898 RegSetValueExA( hkLocations, "CurrentID", 0, REG_DWORD,
899 (LPBYTE)&dwval, sizeof(DWORD));
900 dwval = 2;
901 RegSetValueExA( hkLocations, "NextID", 0, REG_DWORD, (LPBYTE)&dwval,
902 sizeof(DWORD));
905 /* do the card list */
906 numcards=0;
907 if( RegCreateKeyA(HKEY_CURRENT_USER, szCardsKey, &hkCards)
908 == ERROR_SUCCESS ) {
909 if(RegQueryInfoKeyA(hkCards, NULL, NULL, NULL, NULL, &maxcardkeylen,
910 NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
911 maxcardkeylen++;
912 if( maxcardkeylen < 6) maxcardkeylen = 6;
913 card_key_name = HeapAlloc(GetProcessHeap(), 0, maxcardkeylen);
914 i=0;
915 while( RegEnumKeyA(hkCards, i, card_key_name, maxcardkeylen) ==
916 ERROR_SUCCESS){
917 DWORD size_val;
918 i++;
919 if( _strnicmp(card_key_name, "card", 4) || ERROR_SUCCESS !=
920 (RegOpenKeyA(hkCards, card_key_name, &hsubkey) ))
921 continue;
922 numcards++;
923 length += sizeof(LINECARDENTRY);
924 RegQueryValueExA(hsubkey, "Name",NULL,NULL,NULL,&size_val);
925 length += size_val;
926 RegQueryValueExA(hsubkey, "LocalRule",NULL,NULL,NULL,&size_val);
927 length += size_val;
928 RegQueryValueExA(hsubkey, "LDRule",NULL,NULL,NULL,&size_val);
929 length += size_val;
930 RegQueryValueExA(hsubkey, "InternationalRule",NULL,NULL,NULL,
931 &size_val);
932 length += size_val;
933 RegCloseKey(hsubkey);
936 /* add one card (direct call) */
937 if (numcards == 0 &&
938 ERROR_SUCCESS == RegCreateKeyA( hkCards, "Card1", &hsubkey)) {
939 DWORD dwval;
940 numcards = 1;
941 length += sizeof(LINECARDENTRY) + 22 ;
942 RegSetValueExA( hsubkey, "Name", 0, REG_SZ, (const BYTE *)"None (Direct Call)", 19);
943 dwval = 1;
944 RegSetValueExA( hsubkey, "Flags", 0, REG_DWORD, (LPBYTE)&dwval,
945 sizeof(DWORD));
946 RegSetValueExA( hsubkey, "InternationalRule", 0, REG_SZ, (const BYTE *)"", 1);
947 RegSetValueExA( hsubkey, "LDRule", 0, REG_SZ, (const BYTE *)"", 1);
948 RegSetValueExA( hsubkey, "LocalRule", 0, REG_SZ, (const BYTE *)"", 1);
949 RegCloseKey(hsubkey);
950 dwval = 2;
951 RegSetValueExA( hkCards, "NextID", 0, REG_DWORD, (LPBYTE)&dwval,
952 sizeof(DWORD));
954 } else hkCards = 0; /* should really fail */
955 /* check if sufficient room is available */
956 lpTranslateCaps->dwNeededSize = sizeof(LINETRANSLATECAPS) + length;
957 if ( lpTranslateCaps->dwNeededSize > lpTranslateCaps->dwTotalSize ) {
958 RegCloseKey( hkLocations);
959 if( hkCards) RegCloseKey( hkCards);
960 HeapFree(GetProcessHeap(), 0, loc_key_name);
961 HeapFree(GetProcessHeap(), 0, card_key_name);
962 lpTranslateCaps->dwUsedSize = sizeof(LINETRANSLATECAPS);
963 TRACE("Insufficient space: total %d needed %d used %d\n",
964 lpTranslateCaps->dwTotalSize,
965 lpTranslateCaps->dwNeededSize,
966 lpTranslateCaps->dwUsedSize);
967 return 0;
969 /* fill in the LINETRANSLATECAPS structure */
970 lpTranslateCaps->dwUsedSize = lpTranslateCaps->dwNeededSize;
971 lpTranslateCaps->dwNumLocations = numlocations;
972 lpTranslateCaps->dwLocationListSize = sizeof(LINELOCATIONENTRY) *
973 lpTranslateCaps->dwNumLocations;
974 lpTranslateCaps->dwLocationListOffset = sizeof(LINETRANSLATECAPS);
975 lpTranslateCaps->dwCurrentLocationID = currentid;
976 lpTranslateCaps->dwNumCards = numcards;
977 lpTranslateCaps->dwCardListSize = sizeof(LINECARDENTRY) *
978 lpTranslateCaps->dwNumCards;
979 lpTranslateCaps->dwCardListOffset = lpTranslateCaps->dwLocationListOffset +
980 lpTranslateCaps->dwLocationListSize;
981 lpTranslateCaps->dwCurrentPreferredCardID = 0;
982 /* this is where the strings will be stored */
983 strptr = ((LPBYTE) lpTranslateCaps) +
984 lpTranslateCaps->dwCardListOffset + lpTranslateCaps->dwCardListSize;
985 pLocEntry = (LPLINELOCATIONENTRY) (lpTranslateCaps + 1);
986 /* key with Preferred CardIDs */
987 if( RegOpenKeyA(HKEY_CURRENT_USER, szLocationsKey, &hkCardLocations)
988 != ERROR_SUCCESS )
989 hkCardLocations = 0;
990 /* second time through all locations */
991 i=0;
992 while(RegEnumKeyA(hkLocations, i, loc_key_name, maxlockeylen)
993 == ERROR_SUCCESS){
994 DWORD size_val;
995 i++;
996 if( _strnicmp(loc_key_name, "location", 8) ||
997 (RegOpenKeyA(hkLocations, loc_key_name, &hsubkey)
998 != ERROR_SUCCESS))
999 continue;
1000 size_val=sizeof(DWORD);
1001 if( RegQueryValueExA(hsubkey, "ID",NULL, NULL,
1002 (LPBYTE) &(pLocEntry->dwPermanentLocationID), &size_val) !=
1003 ERROR_SUCCESS)
1004 pLocEntry->dwPermanentLocationID = atoi( loc_key_name + 8);
1005 size_val=2048;
1006 RegQueryValueExA(hsubkey, "Name",NULL,NULL, strptr, &size_val);
1007 pLocEntry->dwLocationNameSize = size_val;
1008 pLocEntry->dwLocationNameOffset = strptr - (LPBYTE) lpTranslateCaps;
1009 strptr += size_val;
1011 size_val=2048;
1012 RegQueryValueExA(hsubkey, "AreaCode",NULL,NULL, strptr, &size_val);
1013 pLocEntry->dwCityCodeSize = size_val;
1014 pLocEntry->dwCityCodeOffset = strptr - (LPBYTE) lpTranslateCaps;
1015 strptr += size_val;
1017 size_val=2048;
1018 RegQueryValueExA(hsubkey, "OutsideAccess",NULL,NULL, strptr, &size_val);
1019 pLocEntry->dwLocalAccessCodeSize = size_val;
1020 pLocEntry->dwLocalAccessCodeOffset = strptr - (LPBYTE) lpTranslateCaps;
1021 strptr += size_val;
1022 size_val=2048;
1023 RegQueryValueExA(hsubkey, "LongDistanceAccess",NULL,NULL, strptr,
1024 &size_val);
1025 pLocEntry->dwLongDistanceAccessCodeSize= size_val;
1026 pLocEntry->dwLongDistanceAccessCodeOffset= strptr -
1027 (LPBYTE) lpTranslateCaps;
1028 strptr += size_val;
1029 size_val=2048;
1030 RegQueryValueExA(hsubkey, "DisableCallWaiting",NULL,NULL, strptr,
1031 &size_val);
1032 pLocEntry->dwCancelCallWaitingSize= size_val;
1033 pLocEntry->dwCancelCallWaitingOffset= strptr - (LPBYTE) lpTranslateCaps;
1034 strptr += size_val;
1036 pLocEntry->dwTollPrefixListSize = 0; /* FIXME */
1037 pLocEntry->dwTollPrefixListOffset = 0; /* FIXME */
1039 size_val=sizeof(DWORD);
1040 RegQueryValueExA(hsubkey, "Country",NULL,NULL,
1041 (LPBYTE) &(pLocEntry->dwCountryCode), &size_val);
1042 pLocEntry->dwCountryID = pLocEntry->dwCountryCode; /* FIXME */
1043 RegQueryValueExA(hsubkey, "Flags",NULL,NULL,
1044 (LPBYTE) &(pLocEntry->dwOptions), &size_val);
1045 RegCloseKey(hsubkey);
1046 /* get preferred cardid */
1047 pLocEntry->dwPreferredCardID = 0;
1048 if ( hkCardLocations) {
1049 size_val=sizeof(DWORD);
1050 if(RegOpenKeyA(hkCardLocations, loc_key_name, &hsubkey) ==
1051 ERROR_SUCCESS) {
1052 RegQueryValueExA(hsubkey, "CallingCard",NULL,NULL,
1053 (LPBYTE) &(pLocEntry->dwPreferredCardID), &size_val);
1054 RegCloseKey(hsubkey);
1058 /* make sure there is a currentID */
1059 if(currentid == -1){
1060 currentid = pLocEntry->dwPermanentLocationID;
1061 lpTranslateCaps->dwCurrentLocationID = currentid;
1063 if(pLocEntry->dwPermanentLocationID == currentid )
1064 lpTranslateCaps->dwCurrentPreferredCardID =
1065 pLocEntry->dwPreferredCardID;
1066 TRACE("added: ID %d %s CountryCode %d CityCode %s CardID %d "
1067 "LocalAccess: %s LongDistanceAccess: %s CountryID %d "
1068 "Options %d CancelCallWait %s\n",
1069 pLocEntry->dwPermanentLocationID,
1070 debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwLocationNameOffset),
1071 pLocEntry->dwCountryCode,
1072 debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwCityCodeOffset),
1073 pLocEntry->dwPreferredCardID,
1074 debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwLocalAccessCodeOffset),
1075 debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwLongDistanceAccessCodeOffset),
1076 pLocEntry->dwCountryID,
1077 pLocEntry->dwOptions,
1078 debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwCancelCallWaitingOffset));
1079 pLocEntry++;
1081 pCardEntry= (LPLINECARDENTRY) pLocEntry;
1082 /* do the card list */
1083 if( hkCards) {
1084 i=0;
1085 while( RegEnumKeyA(hkCards, i, card_key_name, maxcardkeylen) ==
1086 ERROR_SUCCESS){
1087 DWORD size_val;
1088 i++;
1089 if( _strnicmp(card_key_name, "card", 4) ||
1090 (RegOpenKeyA(hkCards, card_key_name, &hsubkey) != ERROR_SUCCESS))
1091 continue;
1092 size_val=sizeof(DWORD);
1093 if( RegQueryValueExA(hsubkey, "ID",NULL, NULL,
1094 (LPBYTE) &(pCardEntry->dwPermanentCardID), &size_val) !=
1095 ERROR_SUCCESS)
1096 pCardEntry->dwPermanentCardID= atoi( card_key_name + 4);
1097 size_val=2048;
1098 RegQueryValueExA(hsubkey, "Name",NULL,NULL, strptr, &size_val);
1099 pCardEntry->dwCardNameSize = size_val;
1100 pCardEntry->dwCardNameOffset = strptr - (LPBYTE) lpTranslateCaps;
1101 strptr += size_val;
1102 pCardEntry->dwCardNumberDigits = 1; /* FIXME */
1103 size_val=2048;
1104 RegQueryValueExA(hsubkey, "LocalRule",NULL,NULL, strptr, &size_val);
1105 pCardEntry->dwSameAreaRuleSize= size_val;
1106 pCardEntry->dwSameAreaRuleOffset= strptr - (LPBYTE) lpTranslateCaps;
1107 strptr += size_val;
1108 size_val=2048;
1109 RegQueryValueExA(hsubkey, "LDRule",NULL,NULL, strptr, &size_val);
1110 pCardEntry->dwLongDistanceRuleSize = size_val;
1111 pCardEntry->dwLongDistanceRuleOffset = strptr - (LPBYTE) lpTranslateCaps;
1112 strptr += size_val;
1113 size_val=2048;
1114 RegQueryValueExA(hsubkey, "InternationalRule",NULL,NULL, strptr,
1115 &size_val);
1116 pCardEntry->dwInternationalRuleSize = size_val;
1117 pCardEntry->dwInternationalRuleOffset = strptr -
1118 (LPBYTE) lpTranslateCaps;
1119 strptr += size_val;
1120 size_val=sizeof(DWORD);
1121 RegQueryValueExA(hsubkey, "Flags",NULL, NULL,
1122 (LPBYTE) &(pCardEntry->dwOptions), &size_val);
1123 TRACE( "added card: ID %d name %s SameArea %s LongDistance %s International %s Options 0x%x\n",
1124 pCardEntry->dwPermanentCardID,
1125 debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwCardNameOffset),
1126 debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwSameAreaRuleOffset),
1127 debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwLongDistanceRuleOffset),
1128 debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwInternationalRuleOffset),
1129 pCardEntry->dwOptions);
1131 pCardEntry++;
1135 if(hkLocations) RegCloseKey(hkLocations);
1136 if(hkCards) RegCloseKey(hkCards);
1137 if(hkCardLocations) RegCloseKey(hkCardLocations);
1138 HeapFree(GetProcessHeap(), 0, loc_key_name);
1139 HeapFree(GetProcessHeap(), 0, card_key_name);
1140 TRACE(" returning success tot %d needed %d used %d\n",
1141 lpTranslateCaps->dwTotalSize,
1142 lpTranslateCaps->dwNeededSize,
1143 lpTranslateCaps->dwUsedSize );
1144 return 0; /* success */
1147 /***********************************************************************
1148 * lineHandoff (TAPI32.@)
1150 DWORD WINAPI lineHandoffA(HCALL hCall, LPCSTR lpszFileName, DWORD dwMediaMode)
1152 FIXME("(%p, %s, %08x): stub.\n", hCall, lpszFileName, dwMediaMode);
1153 return 0;
1156 /***********************************************************************
1157 * lineHold (TAPI32.@)
1159 DWORD WINAPI lineHold(HCALL hCall)
1161 FIXME("(%p): stub.\n", hCall);
1162 return 1;
1165 /***********************************************************************
1166 * lineInitialize (TAPI32.@)
1168 DWORD WINAPI lineInitialize(
1169 LPHLINEAPP lphLineApp,
1170 HINSTANCE hInstance,
1171 LINECALLBACK lpfnCallback,
1172 LPCSTR lpszAppName,
1173 LPDWORD lpdwNumDevs)
1175 FIXME("(%p, %p, %p, %s, %p): stub.\n", lphLineApp, hInstance,
1176 lpfnCallback, debugstr_a(lpszAppName), lpdwNumDevs);
1177 return 0;
1180 /***********************************************************************
1181 * lineInitializeExA (TAPI32.@)
1183 LONG WINAPI lineInitializeExA(LPHLINEAPP lphLineApp, HINSTANCE hInstance, LINECALLBACK lpfnCallback, LPCSTR lpszFriendlyAppName, LPDWORD lpdwNumDevs, LPDWORD lpdwAPIVersion, LPLINEINITIALIZEEXPARAMS lpLineInitializeExParams)
1185 FIXME("(%p, %p, %p, %s, %p, %p, %p): stub.\n", lphLineApp, hInstance,
1186 lpfnCallback, debugstr_a(lpszFriendlyAppName), lpdwNumDevs, lpdwAPIVersion, lpLineInitializeExParams);
1187 return 0;
1190 /***********************************************************************
1191 * lineInitializeExW (TAPI32.@)
1193 LONG WINAPI lineInitializeExW(LPHLINEAPP lphLineApp, HINSTANCE hInstance, LINECALLBACK lpfnCallback, LPCWSTR lpszFriendlyAppName, LPDWORD lpdwNumDevs, LPDWORD lpdwAPIVersion, LPLINEINITIALIZEEXPARAMS lpLineInitializeExParams)
1195 FIXME("(%p, %p, %p, %s, %p, %p, %p): stub.\n", lphLineApp, hInstance,
1196 lpfnCallback, debugstr_w(lpszFriendlyAppName), lpdwNumDevs, lpdwAPIVersion, lpLineInitializeExParams);
1197 return 0;
1200 /***********************************************************************
1201 * lineMakeCallW (TAPI32.@)
1203 DWORD WINAPI lineMakeCallW(HLINE hLine, LPHCALL lphCall, LPCWSTR lpszDestAddress,
1204 DWORD dwCountryCode, LPLINECALLPARAMS lpCallParams)
1206 FIXME("(%p, %p, %s, %08x, %p): stub.\n", hLine, lphCall, debugstr_w(lpszDestAddress),
1207 dwCountryCode, lpCallParams);
1208 return LINEERR_OPERATIONFAILED;
1211 /***********************************************************************
1212 * lineMakeCallA (TAPI32.@)
1214 DWORD WINAPI lineMakeCallA(HLINE hLine, LPHCALL lphCall, LPCSTR lpszDestAddress,
1215 DWORD dwCountryCode, LPLINECALLPARAMS lpCallParams)
1217 FIXME("(%p, %p, %s, %08x, %p): stub.\n", hLine, lphCall, lpszDestAddress,
1218 dwCountryCode, lpCallParams);
1219 return LINEERR_OPERATIONFAILED;
1222 /***********************************************************************
1223 * lineMonitorDigits (TAPI32.@)
1225 DWORD WINAPI lineMonitorDigits(HCALL hCall, DWORD dwDigitModes)
1227 FIXME("(%p, %08x): stub.\n", hCall, dwDigitModes);
1228 return 0;
1231 /***********************************************************************
1232 * lineMonitorMedia (TAPI32.@)
1234 DWORD WINAPI lineMonitorMedia(HCALL hCall, DWORD dwMediaModes)
1236 FIXME("(%p, %08x): stub.\n", hCall, dwMediaModes);
1237 return 0;
1240 /***********************************************************************
1241 * lineMonitorTones (TAPI32.@)
1243 DWORD WINAPI lineMonitorTones(HCALL hCall, LPLINEMONITORTONE lpToneList, DWORD dwNumEntries)
1245 FIXME("(%p, %p, %08x): stub.\n", hCall, lpToneList, dwNumEntries);
1246 return 0;
1249 /***********************************************************************
1250 * lineNegotiateAPIVersion (TAPI32.@)
1252 DWORD WINAPI lineNegotiateAPIVersion(
1253 HLINEAPP hLineApp,
1254 DWORD dwDeviceID,
1255 DWORD dwAPILowVersion,
1256 DWORD dwAPIHighVersion,
1257 LPDWORD lpdwAPIVersion,
1258 LPLINEEXTENSIONID lpExtensionID
1261 static int warn_once;
1263 if(!warn_once++)
1264 FIXME("(%p, %d, %d, %d, %p, %p): stub.\n", hLineApp, dwDeviceID,
1265 dwAPILowVersion, dwAPIHighVersion, lpdwAPIVersion, lpExtensionID);
1266 *lpdwAPIVersion = dwAPIHighVersion;
1267 return 0;
1270 /***********************************************************************
1271 * lineNegotiateExtVersion (TAPI32.@)
1273 DWORD WINAPI lineNegotiateExtVersion(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtLowVersion, DWORD dwExtHighVersion, LPDWORD lpdwExtVersion)
1275 FIXME("stub.\n");
1276 return 0;
1279 /***********************************************************************
1280 * lineOpenW (TAPI32.@)
1282 DWORD WINAPI lineOpenW(HLINEAPP hLineApp, DWORD dwDeviceID, LPHLINE lphLine, DWORD dwAPIVersion, DWORD dwExtVersion, DWORD dwCallbackInstance, DWORD dwPrivileges, DWORD dwMediaModes, LPLINECALLPARAMS lpCallParams)
1284 FIXME("stub.\n");
1285 return 0;
1288 /***********************************************************************
1289 * lineOpen (TAPI32.@)
1291 DWORD WINAPI lineOpenA(HLINEAPP hLineApp, DWORD dwDeviceID, LPHLINE lphLine, DWORD dwAPIVersion, DWORD dwExtVersion, DWORD dwCallbackInstance, DWORD dwPrivileges, DWORD dwMediaModes, LPLINECALLPARAMS lpCallParams)
1293 FIXME("stub.\n");
1294 return 0;
1297 /***********************************************************************
1298 * linePark (TAPI32.@)
1300 DWORD WINAPI lineParkA(HCALL hCall, DWORD dwParkMode, LPCSTR lpszDirAddress, LPVARSTRING lpNonDirAddress)
1302 FIXME("(%p, %08x, %s, %p): stub.\n", hCall, dwParkMode, lpszDirAddress, lpNonDirAddress);
1303 return 1;
1306 /***********************************************************************
1307 * linePickup (TAPI32.@)
1309 DWORD WINAPI linePickupA(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR lpszDestAddress, LPCSTR lpszGroupID)
1311 FIXME("(%p, %08x, %p, %s, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID);
1312 return 1;
1315 /***********************************************************************
1316 * linePrepareAddToConference (TAPI32.@)
1318 DWORD WINAPI linePrepareAddToConferenceA(HCALL hConfCall, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
1320 FIXME("(%p, %p, %p): stub.\n", hConfCall, lphConsultCall, lpCallParams);
1321 return 1;
1324 /***********************************************************************
1325 * lineRedirect (TAPI32.@)
1327 DWORD WINAPI lineRedirectA(
1328 HCALL hCall,
1329 LPCSTR lpszDestAddress,
1330 DWORD dwCountryCode) {
1332 FIXME(": stub.\n");
1333 return 1;
1336 /***********************************************************************
1337 * lineRegisterRequestRecipient (TAPI32.@)
1339 DWORD WINAPI lineRegisterRequestRecipient(HLINEAPP hLineApp, DWORD dwRegistrationInstance, DWORD dwRequestMode, DWORD dwEnable)
1341 FIXME("(%p, %08x, %08x, %08x): stub.\n", hLineApp, dwRegistrationInstance, dwRequestMode, dwEnable);
1342 return 1;
1345 /***********************************************************************
1346 * lineReleaseUserUserInfo (TAPI32.@)
1348 DWORD WINAPI lineReleaseUserUserInfo(HCALL hCall)
1350 FIXME("(%p): stub.\n", hCall);
1351 return 1;
1354 /***********************************************************************
1355 * lineRemoveFromConference (TAPI32.@)
1357 DWORD WINAPI lineRemoveFromConference(HCALL hCall)
1359 FIXME("(%p): stub.\n", hCall);
1360 return 1;
1363 /***********************************************************************
1364 * lineRemoveProvider (TAPI32.@)
1366 DWORD WINAPI lineRemoveProvider(DWORD dwPermanentProviderID, HWND hwndOwner)
1368 FIXME("(%08x, %p): stub.\n", dwPermanentProviderID, hwndOwner);
1369 return 1;
1372 /***********************************************************************
1373 * lineSecureCall (TAPI32.@)
1375 DWORD WINAPI lineSecureCall(HCALL hCall)
1377 FIXME("(%p): stub.\n", hCall);
1378 return 1;
1381 /***********************************************************************
1382 * lineSendUserUserInfo (TAPI32.@)
1384 DWORD WINAPI lineSendUserUserInfo(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
1386 FIXME("(%p, %s, %08x): stub.\n", hCall, lpsUserUserInfo, dwSize);
1387 return 1;
1390 /***********************************************************************
1391 * lineSetAppPriority (TAPI32.@)
1393 DWORD WINAPI lineSetAppPriorityA(LPCSTR lpszAppFilename, DWORD dwMediaMode, LPLINEEXTENSIONID const lpExtensionID, DWORD dwRequestMode, LPCSTR lpszExtensionName, DWORD dwPriority)
1395 FIXME("(%s, %08x, %p, %08x, %s, %08x): stub.\n", lpszAppFilename, dwMediaMode, lpExtensionID, dwRequestMode, lpszExtensionName, dwPriority);
1396 return 0;
1399 /***********************************************************************
1400 * lineSetAppSpecific (TAPI32.@)
1402 DWORD WINAPI lineSetAppSpecific(HCALL hCall, DWORD dwAppSpecific)
1404 FIXME("(%p, %08x): stub.\n", hCall, dwAppSpecific);
1405 return 0;
1408 /***********************************************************************
1409 * lineSetCallParams (TAPI32.@)
1411 DWORD WINAPI lineSetCallParams(HCALL hCall, DWORD dwBearerMode, DWORD dwMinRate, DWORD dwMaxRate, LPLINEDIALPARAMS lpDialParams)
1413 FIXME("(%p, %08x, %08x, %08x, %p): stub.\n", hCall, dwBearerMode, dwMinRate, dwMaxRate, lpDialParams);
1414 return 1;
1417 /***********************************************************************
1418 * lineSetCallPrivilege (TAPI32.@)
1420 DWORD WINAPI lineSetCallPrivilege(HCALL hCall, DWORD dwCallPrivilege)
1422 FIXME("(%p, %08x): stub.\n", hCall, dwCallPrivilege);
1423 return 0;
1426 /***********************************************************************
1427 * lineSetCurrentLocation (TAPI32.@)
1429 DWORD WINAPI lineSetCurrentLocation(HLINEAPP hLineApp, DWORD dwLocation)
1431 FIXME("(%p, %08x): stub.\n", hLineApp, dwLocation);
1432 return 0;
1435 /***********************************************************************
1436 * lineSetDevConfig (TAPI32.@)
1438 DWORD WINAPI lineSetDevConfigA(DWORD dwDeviceID, LPVOID lpDeviceConfig, DWORD dwSize, LPCSTR lpszDeviceClass)
1440 FIXME("(%08x, %p, %08x, %s): stub.\n", dwDeviceID, lpDeviceConfig, dwSize, lpszDeviceClass);
1441 return 0;
1444 /***********************************************************************
1445 * lineSetMediaControl (TAPI32.@)
1447 DWORD WINAPI lineSetMediaControl(
1448 HLINE hLine,
1449 DWORD dwAddressID,
1450 HCALL hCall,
1451 DWORD dwSelect,
1452 LPLINEMEDIACONTROLDIGIT const lpDigitList,
1453 DWORD dwDigitNumEntries,
1454 LPLINEMEDIACONTROLMEDIA const lpMediaList,
1455 DWORD dwMediaNumEntries,
1456 LPLINEMEDIACONTROLTONE const lpToneList,
1457 DWORD dwToneNumEntries,
1458 LPLINEMEDIACONTROLCALLSTATE const lpCallStateList,
1459 DWORD dwCallStateNumEntries)
1461 FIXME(": stub.\n");
1462 return 0;
1465 /***********************************************************************
1466 * lineSetMediaMode (TAPI32.@)
1468 DWORD WINAPI lineSetMediaMode(HCALL hCall, DWORD dwMediaModes)
1470 FIXME("(%p, %08x): stub.\n", hCall, dwMediaModes);
1471 return 0;
1474 /***********************************************************************
1475 * lineSetNumRings (TAPI32.@)
1477 DWORD WINAPI lineSetNumRings(HLINE hLine, DWORD dwAddressID, DWORD dwNumRings)
1479 FIXME("(%p, %08x, %08x): stub.\n", hLine, dwAddressID, dwNumRings);
1480 return 0;
1483 /***********************************************************************
1484 * lineSetStatusMessages (TAPI32.@)
1486 DWORD WINAPI lineSetStatusMessages(HLINE hLine, DWORD dwLineStates, DWORD dwAddressStates)
1488 FIXME("(%p, %08x, %08x): stub.\n", hLine, dwLineStates, dwAddressStates);
1489 return 0;
1492 /***********************************************************************
1493 * lineSetTerminal (TAPI32.@)
1495 DWORD WINAPI lineSetTerminal(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD dwSelect, DWORD dwTerminalModes, DWORD dwTerminalID, DWORD bEnable)
1497 FIXME("(%p, %08x, %p, %08x, %08x, %08x, %08x): stub.\n", hLine, dwAddressID, hCall, dwSelect, dwTerminalModes, dwTerminalID, bEnable);
1498 return 1;
1501 /***********************************************************************
1502 * lineSetTollList (TAPI32.@)
1504 DWORD WINAPI lineSetTollListA(HLINEAPP hLineApp, DWORD dwDeviceID, LPCSTR lpszAddressIn, DWORD dwTollListOption)
1506 FIXME("(%p, %08x, %s, %08x): stub.\n", hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption);
1507 return 0;
1510 /***********************************************************************
1511 * lineSetupConference (TAPI32.@)
1513 DWORD WINAPI lineSetupConferenceA(HCALL hCall, HLINE hLine, LPHCALL lphConfCall, LPHCALL lphConsultCall, DWORD dwNumParties, LPLINECALLPARAMS lpCallParams)
1515 FIXME("(%p, %p, %p, %p, %08x, %p): stub.\n", hCall, hLine, lphConfCall, lphConsultCall, dwNumParties, lpCallParams);
1516 return 1;
1519 /***********************************************************************
1520 * lineSetupTransfer (TAPI32.@)
1522 DWORD WINAPI lineSetupTransferA(HCALL hCall, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
1524 FIXME("(%p, %p, %p): stub.\n", hCall, lphConsultCall, lpCallParams);
1525 return 1;
1528 /***********************************************************************
1529 * lineShutdown (TAPI32.@)
1531 DWORD WINAPI lineShutdown(HLINEAPP hLineApp)
1533 FIXME("(%p): stub.\n", hLineApp);
1534 return 0;
1537 /***********************************************************************
1538 * lineSwapHold (TAPI32.@)
1540 DWORD WINAPI lineSwapHold(HCALL hActiveCall, HCALL hHeldCall)
1542 FIXME("(active: %p, held: %p): stub.\n", hActiveCall, hHeldCall);
1543 return 1;
1546 /***********************************************************************
1547 * lineTranslateAddress (TAPI32.@)
1549 DWORD WINAPI lineTranslateAddressA(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, LPCSTR lpszAddressIn, DWORD dwCard, DWORD dwTranslateOptions, LPLINETRANSLATEOUTPUT lpTranslateOutput)
1551 FIXME("(%p, %08x, %08x, %s, %08x, %08x, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, lpszAddressIn, dwCard, dwTranslateOptions, lpTranslateOutput);
1552 return 0;
1555 /***********************************************************************
1556 * lineTranslateAddressW (TAPI32.@)
1558 DWORD WINAPI lineTranslateAddressW(HLINEAPP hLineApp, DWORD dwDeviceID,
1559 DWORD dwAPIVersion, LPCWSTR lpszAddressIn, DWORD dwCard,
1560 DWORD dwTranslateOptions, LPLINETRANSLATEOUTPUT lpTranslateOutput)
1562 FIXME("(%p, %08x, %08x, %s, %08x, %08x, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion,
1563 debugstr_w(lpszAddressIn), dwCard, dwTranslateOptions, lpTranslateOutput);
1564 return 0;
1567 /***********************************************************************
1568 * lineTranslateDialog (TAPI32.@)
1570 DWORD WINAPI lineTranslateDialogA(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, HWND hwndOwner, LPCSTR lpszAddressIn)
1572 FIXME("(%p, %08x, %08x, %p, %s): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, hwndOwner, lpszAddressIn);
1573 return 0;
1576 /***********************************************************************
1577 * lineTranslateDialogW (TAPI32.@)
1579 DWORD WINAPI lineTranslateDialogW(HLINEAPP hLineApp, DWORD dwDeviceID,
1580 DWORD dwAPIVersion, HWND hwndOwner, LPCWSTR lpszAddressIn)
1582 FIXME("(%p, %08x, %08x, %p, %s): stub.\n", hLineApp, dwDeviceID,
1583 dwAPIVersion, hwndOwner, debugstr_w(lpszAddressIn));
1584 return 0;
1587 /***********************************************************************
1588 * lineUncompleteCall (TAPI32.@)
1590 DWORD WINAPI lineUncompleteCall(HLINE hLine, DWORD dwCompletionID)
1592 FIXME("(%p, %08x): stub.\n", hLine, dwCompletionID);
1593 return 1;
1596 /***********************************************************************
1597 * lineUnhold (TAPI32.@)
1599 DWORD WINAPI lineUnhold(HCALL hCall)
1601 FIXME("(%p): stub.\n", hCall);
1602 return 1;
1605 /***********************************************************************
1606 * lineUnpark (TAPI32.@)
1608 DWORD WINAPI lineUnparkA(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR lpszDestAddress)
1610 FIXME("(%p, %08x, %p, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress);
1611 return 1;