line.c 46.7 KB
Newer Older
1 2 3 4
/*
 * TAPI32 line services
 *
 * Copyright 1999  Andreas Mohr
5 6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 20 21 22
 */

#include <string.h>
#include <stdlib.h>
23
#include <stdarg.h>
24
#include <stdio.h>
25
#include "windef.h"
26
#include "winbase.h"
27
#include "winreg.h"
28
#include "winnls.h"
29
#include "winerror.h"
30
#include "tapi.h"
31
#include "wine/debug.h"
32

33
WINE_DEFAULT_DEBUG_CHANNEL(tapi);
34

35 36 37 38 39 40 41 42 43
/* registry keys */
static const char szCountrylistKey[] =
    "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country List";
static const char szLocationsKey[] =
    "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Locations";
static const char szCardsKey[] =
    "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Cards";


44 45 46
/***********************************************************************
 *		lineAccept (TAPI32.@)
 */
47 48
DWORD WINAPI lineAccept(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
{
49
    FIXME("(%p, %s, %ld): stub.\n", hCall, lpsUserUserInfo, dwSize);
50 51 52
    return 1;
}

53 54 55
/***********************************************************************
 *		lineAddProvider (TAPI32.@)
 */
56 57
DWORD WINAPI lineAddProvider(LPCSTR lpszProviderName, HWND hwndOwner, LPDWORD lpdwPermanentProviderID)
{
58
    FIXME("(%s, %p, %p): stub.\n", lpszProviderName, hwndOwner, lpdwPermanentProviderID);
59
    return 1;
60
}
61

62 63 64
/***********************************************************************
 *		lineAddToConference (TAPI32.@)
 */
65 66
DWORD WINAPI lineAddToConference(HCALL hConfCall, HCALL hConsultCall)
{
67
    FIXME("(%p, %p): stub.\n", hConfCall, hConsultCall);
68 69 70
    return 1;
}

71 72 73
/***********************************************************************
 *		lineAnswer (TAPI32.@)
 */
74 75
DWORD WINAPI lineAnswer(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
{
76
    FIXME("(%p, %s, %ld): stub.\n", hCall, lpsUserUserInfo, dwSize);
77
    return 1;
78
}
79

80 81 82
/***********************************************************************
 *		lineBlindTransfer (TAPI32.@)
 */
83 84
DWORD WINAPI lineBlindTransfer(HCALL hCall, LPCSTR lpszDestAddress, DWORD dwCountryCode)
{
85
    FIXME("(%p, %s, %08lx): stub.\n", hCall, lpszDestAddress, dwCountryCode);
86
    return 1;
87
}
88

89 90 91
/***********************************************************************
 *		lineClose (TAPI32.@)
 */
92 93
DWORD WINAPI lineClose(HLINE hLine)
{
94
    FIXME("(%p): stub.\n", hLine);
95
    return 0;
96
}
97

98 99 100
/***********************************************************************
 *		lineCompleteCall (TAPI32.@)
 */
101 102
DWORD WINAPI lineCompleteCall(HCALL hCall, LPDWORD lpdwCompletionID, DWORD dwCompletionMode, DWORD dwMessageID)
{
103
    FIXME("(%p, %p, %08lx, %08lx): stub.\n", hCall, lpdwCompletionID, dwCompletionMode, dwMessageID);
104
    return 1;
105
}
106

107 108 109
/***********************************************************************
 *		lineCompleteTransfer (TAPI32.@)
 */
110 111
DWORD WINAPI lineCompleteTransfer(HCALL hCall, HCALL hConsultCall, LPHCALL lphConfCall, DWORD dwTransferMode)
{
112
    FIXME("(%p, %p, %p, %08lx): stub.\n", hCall, hConsultCall, lphConfCall, dwTransferMode);
113 114 115
    return 1;
}

116 117 118
/***********************************************************************
 *		lineConfigDialog (TAPI32.@)
 */
119 120
DWORD WINAPI lineConfigDialog(DWORD dwDeviceID, HWND hwndOwner, LPCSTR lpszDeviceClass)
{
121
    FIXME("(%08lx, %p, %s): stub.\n", dwDeviceID, hwndOwner, lpszDeviceClass);
122
    return 0;
123
}
124

125 126 127
/***********************************************************************
 *		lineConfigDialogEdit (TAPI32.@)
 */
128 129
DWORD WINAPI lineConfigDialogEdit(DWORD dwDeviceID, HWND hwndOwner, LPCSTR lpszDeviceClass, LPVOID const lpDeviceConfigIn, DWORD dwSize, LPVARSTRING lpDeviceConfigOut)
{
130
    FIXME("stub.\n");
131
    return 0;
132
}
133

134 135 136
/***********************************************************************
 *		lineConfigProvider (TAPI32.@)
 */
137 138
DWORD WINAPI lineConfigProvider(HWND hwndOwner, DWORD dwPermanentProviderID)
{
139
    FIXME("(%p, %08lx): stub.\n", hwndOwner, dwPermanentProviderID);
140 141 142
    return 0;
}

143 144 145
/***********************************************************************
 *		lineDeallocateCall (TAPI32.@)
 */
146 147
DWORD WINAPI lineDeallocateCall(HCALL hCall)
{
148
    FIXME("(%p): stub.\n", hCall);
149 150 151
    return 0;
}

152 153 154
/***********************************************************************
 *		lineDevSpecific (TAPI32.@)
 */
155 156
DWORD WINAPI lineDevSpecific(HLINE hLine, DWORD dwAddressId, HCALL hCall, LPVOID lpParams, DWORD dwSize)
{
157
    FIXME("(%p, %08lx, %p, %p, %ld): stub.\n", hLine, dwAddressId, hCall, lpParams, dwSize);
158
    return 1;
159
}
160

161 162 163
/***********************************************************************
 *		lineDevSpecificFeature (TAPI32.@)
 */
164 165
DWORD WINAPI lineDevSpecificFeature(HLINE hLine, DWORD dwFeature, LPVOID lpParams, DWORD dwSize)
{
166
    FIXME("(%p, %08lx, %p, %ld): stub.\n", hLine, dwFeature, lpParams, dwSize);
167 168 169
    return 1;
}

170 171 172
/***********************************************************************
 *		lineDial (TAPI32.@)
 */
173 174
DWORD WINAPI lineDial(HCALL hCall, LPCSTR lpszDestAddress, DWORD dwCountryCode)
{
175
    FIXME("(%p, %s, %08lx): stub.\n", hCall, lpszDestAddress, dwCountryCode);
176 177
    return 1;
}
178 179 180

/***********************************************************************
 *		lineDrop (TAPI32.@)
181
 */
182 183
DWORD WINAPI lineDrop(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
{
184
    FIXME("(%p, %s, %08lx): stub.\n", hCall, lpsUserUserInfo, dwSize);
185 186 187
    return 1;
}

188 189 190
/***********************************************************************
 *		lineForward (TAPI32.@)
 */
191 192
DWORD WINAPI lineForward(HLINE hLine, DWORD bAllAddress, DWORD dwAdressID, LPLINEFORWARDLIST lpForwardList, DWORD dwNumRingsNoAnswer, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
{
193
    FIXME("stub.\n");
194
    return 1;
195 196 197 198
}

/***********************************************************************
 *		lineGatherDigits (TAPI32.@)
199
 */
200 201
DWORD WINAPI lineGatherDigits(HCALL hCall, DWORD dwDigitModes, LPSTR lpsDigits, DWORD dwNumDigits, LPCSTR lpszTerminationDigits, DWORD dwFirstDigitTimeout, DWORD dwInterDigitTimeout)
{
202
    FIXME("stub.\n");
203 204 205
    return 0;
}

206 207 208
/***********************************************************************
 *		lineGenerateDigits (TAPI32.@)
 */
209 210
DWORD WINAPI lineGenerateDigits(HCALL hCall, DWORD dwDigitModes, LPCSTR lpszDigits, DWORD dwDuration)
{
211
    FIXME("(%p, %08lx, %s, %ld): stub.\n", hCall, dwDigitModes, lpszDigits, dwDuration);
212 213 214
    return 0;
}

215 216 217
/***********************************************************************
 *		lineGenerateTone (TAPI32.@)
 */
218 219
DWORD WINAPI lineGenerateTone(HCALL hCall, DWORD dwToneMode, DWORD dwDuration, DWORD dwNumTones, LPLINEGENERATETONE lpTones)
{
220
    FIXME("(%p, %08lx, %ld, %ld, %p): stub.\n", hCall, dwToneMode, dwDuration, dwNumTones, lpTones);
221
    return 0;
222
}
223

224 225 226
/***********************************************************************
 *		lineGetAddressCaps (TAPI32.@)
 */
227 228
DWORD WINAPI lineGetAddressCaps(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAddressID, DWORD dwAPIVersion, DWORD dwExtVersion, LPLINEADDRESSCAPS lpAddressCaps)
{
229
    FIXME("(%p, %08lx, %08lx, %08lx, %08lx, %p): stub.\n", hLineApp, dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion, lpAddressCaps);
230 231 232
    return 0;
}

233 234 235
/***********************************************************************
 *		lineGetAddressID (TAPI32.@)
 */
236 237
DWORD WINAPI lineGetAddressID(HLINE hLine, LPDWORD lpdwAddressID, DWORD dwAddressMode, LPCSTR lpsAddress, DWORD dwSize)
{
238
    FIXME("%p, %p, %08lx, %s, %ld): stub.\n", hLine, lpdwAddressID, dwAddressMode, lpsAddress, dwSize);
239 240 241
    return 0;
}

242 243 244
/***********************************************************************
 *		lineGetAddressStatus (TAPI32.@)
 */
245 246
DWORD WINAPI lineGetAddressStatus(HLINE hLine, DWORD dwAddressID, LPLINEADDRESSSTATUS lpAddressStatus)
{
247
    FIXME("(%p, %08lx, %p): stub.\n", hLine, dwAddressID, lpAddressStatus);
248
    return 0;
249
}
250

251 252 253
/***********************************************************************
 *		lineGetAppPriority (TAPI32.@)
 */
254 255
DWORD WINAPI lineGetAppPriority(LPCSTR lpszAppFilename, DWORD dwMediaMode, LPLINEEXTENSIONID const lpExtensionID, DWORD dwRequestMode, LPVARSTRING lpExtensionName, LPDWORD lpdwPriority)
{
256
    FIXME("(%s, %08lx, %p, %08lx, %p, %p): stub.\n", lpszAppFilename, dwMediaMode, lpExtensionID, dwRequestMode, lpExtensionName, lpdwPriority);
257
    return 0;
258
}
259

260 261 262
/***********************************************************************
 *		lineGetCallInfo (TAPI32.@)
 */
263 264
DWORD WINAPI lineGetCallInfo(HCALL hCall, LPLINECALLINFO lpCallInfo)
{
265
    FIXME("(%p, %p): stub.\n", hCall, lpCallInfo);
266 267 268
    return 0;
}

269 270 271
/***********************************************************************
 *		lineGetCallStatus (TAPI32.@)
 */
272 273
DWORD WINAPI lineGetCallStatus(HCALL hCall, LPLINECALLSTATUS lpCallStatus)
{
274
    FIXME("(%p, %p): stub.\n", hCall, lpCallStatus);
275 276 277
    return 0;
}

278 279 280
/***********************************************************************
 *		lineGetConfRelatedCalls (TAPI32.@)
 */
281 282
DWORD WINAPI lineGetConfRelatedCalls(HCALL hCall, LPLINECALLLIST lpCallList)
{
283
    FIXME("(%p, %p): stub.\n", hCall, lpCallList);
284
    return 0;
285
}
286

287 288 289 290 291
typedef struct tagTAPI_CountryInfo
{
    DWORD  dwCountryID;
    DWORD  dwCountryCode;
    LPSTR  lpCountryName;
292 293 294
    LPSTR  lpSameAreaRule;
    LPSTR  lpLongDistanceRule;
    LPSTR  lpInternationalRule;
295 296
} TAPI_CountryInfo;

297 298 299
/***********************************************************************
 *		lineGetCountry (TAPI32.@)
 */
300 301
DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRYLIST lpLineCountryList)
{
302
    DWORD dwAvailSize, dwOffset, i, num_countries, max_subkey_len;
303
    LPLINECOUNTRYENTRY lpLCE;
304 305
    HKEY hkey;
    char *subkey_name;
306

307 308 309 310 311 312
    if(!lpLineCountryList) {
	TRACE("(%08lx, %08lx, %p): stub. Returning LINEERR_INVALPOINTER\n",
	      dwCountryID, dwAPIVersion, lpLineCountryList);
        return LINEERR_INVALPOINTER;
    }

313
    TRACE("(%08lx, %08lx, %p(%ld)): stub.\n",
314 315
	  dwCountryID, dwAPIVersion, lpLineCountryList,
	  lpLineCountryList->dwTotalSize);
316

317 318
    if(RegOpenKeyA(HKEY_LOCAL_MACHINE, szCountrylistKey, &hkey)
            != ERROR_SUCCESS)
319 320 321
        return LINEERR_INIFILECORRUPT;


322 323 324 325 326 327 328 329
    dwAvailSize = lpLineCountryList->dwTotalSize;
    dwOffset = sizeof (LINECOUNTRYLIST);

    if(dwAvailSize<dwOffset)
        return LINEERR_STRUCTURETOOSMALL;

    memset(lpLineCountryList, 0, dwAvailSize);

330
    lpLineCountryList->dwTotalSize         = dwAvailSize;
331 332 333 334 335 336 337
    lpLineCountryList->dwUsedSize          = dwOffset;
    lpLineCountryList->dwNumCountries      = 0;
    lpLineCountryList->dwCountryListSize   = 0;
    lpLineCountryList->dwCountryListOffset = dwOffset;

    lpLCE = (LPLINECOUNTRYENTRY)(&lpLineCountryList[1]);

338 339 340 341 342 343 344 345 346 347 348 349 350 351
    if(RegQueryInfoKeyA(hkey, NULL, NULL, NULL, &num_countries, &max_subkey_len,
			NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) {
        RegCloseKey(hkey);
        return LINEERR_STRUCTURETOOSMALL;
    }

    if(dwCountryID)
        dwOffset = sizeof (LINECOUNTRYENTRY);
    else
        dwOffset += num_countries * sizeof (LINECOUNTRYENTRY);

    max_subkey_len++;
    subkey_name = HeapAlloc(GetProcessHeap(), 0, max_subkey_len);
    for(i = 0; i < num_countries; i++)
352
    {
353 354
        DWORD len, size, size_int, size_long, size_name, size_same;
	HKEY hsubkey;
355

356 357 358 359 360
	if(RegEnumKeyA(hkey, i, subkey_name, max_subkey_len) !=
	   ERROR_SUCCESS)
	    continue;

        if(dwCountryID && (atoi(subkey_name) != dwCountryID))
361 362
            continue;

363 364 365 366 367 368 369 370 371 372 373 374 375 376
	if(RegOpenKeyA(hkey, subkey_name, &hsubkey) != ERROR_SUCCESS)
	    continue;

	RegQueryValueExA(hsubkey, "InternationalRule", NULL, NULL,
			 NULL, &size_int);
        len  = size_int;

	RegQueryValueExA(hsubkey, "LongDistanceRule", NULL, NULL,
			 NULL, &size_long);
        len += size_long;

	RegQueryValueExA(hsubkey, "Name", NULL, NULL,
			 NULL, &size_name);
        len += size_name;
377

378 379 380 381 382
	RegQueryValueExA(hsubkey, "SameAreaRule", NULL, NULL,
			 NULL, &size_same);
        len += size_same;

        if(dwAvailSize < (dwOffset+len))
383
        {
384 385 386 387
            dwOffset += len;
	    RegCloseKey(hsubkey);
	    if(dwCountryID)
		break;
388 389 390 391
            continue;
        }

        lpLineCountryList->dwNumCountries++;
392 393
        lpLineCountryList->dwCountryListSize += sizeof (LINECOUNTRYENTRY);
        lpLineCountryList->dwUsedSize += len + sizeof (LINECOUNTRYENTRY);
394

395 396
	if(dwCountryID)
	    i = 0;
397

398 399 400 401
        lpLCE[i].dwCountryID = atoi(subkey_name);
	size = sizeof(DWORD);
	RegQueryValueExA(hsubkey, "CountryCode", NULL, NULL,
			 (BYTE*)&lpLCE[i].dwCountryCode, &size);
402

403 404 405 406
	lpLCE[i].dwNextCountryID = 0;
        
	if(i > 0)
            lpLCE[i-1].dwNextCountryID = lpLCE[i].dwCountryID;
407 408

        /* add country name */
409
        lpLCE[i].dwCountryNameSize = size_name;
410
        lpLCE[i].dwCountryNameOffset = dwOffset;
411 412 413 414
	RegQueryValueExA(hsubkey, "Name", NULL, NULL,
			 ((LPSTR)lpLineCountryList)+dwOffset,
			 &size_name);
        dwOffset += size_name;
415 416

        /* add Same Area Rule */
417
        lpLCE[i].dwSameAreaRuleSize = size_same;
418
        lpLCE[i].dwSameAreaRuleOffset = dwOffset;
419 420 421 422
	RegQueryValueExA(hsubkey, "SameAreaRule", NULL, NULL,
			 ((LPSTR)lpLineCountryList)+dwOffset,
			 &size_same);
        dwOffset += size_same;
423 424

        /* add Long Distance Rule */
425
        lpLCE[i].dwLongDistanceRuleSize = size_long;
426
        lpLCE[i].dwLongDistanceRuleOffset = dwOffset;
427 428 429 430
	RegQueryValueExA(hsubkey, "LongDistanceRule", NULL, NULL,
			 ((LPSTR)lpLineCountryList)+dwOffset,
			 &size_long);
        dwOffset += size_long;
431 432

        /* add Long Distance Rule */
433
        lpLCE[i].dwInternationalRuleSize = size_int;
434
        lpLCE[i].dwInternationalRuleOffset = dwOffset;
435 436 437 438 439 440 441 442 443 444
	RegQueryValueExA(hsubkey, "InternationalRule", NULL, NULL,
			 ((LPSTR)lpLineCountryList)+dwOffset,
			 &size_int);
        dwOffset += size_int;
	RegCloseKey(hsubkey);

        TRACE("Added country %s at %p\n", (LPSTR)lpLineCountryList + lpLCE[i].dwCountryNameOffset,
	      &lpLCE[i]);

	if(dwCountryID) break;
445 446 447 448 449 450
    }

    lpLineCountryList->dwNeededSize = dwOffset;

    TRACE("%ld available %ld required\n", dwAvailSize, dwOffset);

451 452 453
    HeapFree(GetProcessHeap(), 0, subkey_name);
    RegCloseKey(hkey);

454 455 456
    return 0;
}

457 458 459
/***********************************************************************
 *		lineGetDevCaps (TAPI32.@)
 */
460 461
DWORD WINAPI lineGetDevCaps(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtVersion, LPLINEDEVCAPS lpLineDevCaps)
{
462
    FIXME("(%p, %08lx, %08lx, %08lx, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpLineDevCaps);
463
    return 0;
464
}
465

466 467 468
/***********************************************************************
 *		lineGetDevConfig (TAPI32.@)
 */
469 470
DWORD WINAPI lineGetDevConfig(DWORD dwDeviceID, LPVARSTRING lpDeviceConfig, LPCSTR lpszDeviceClass)
{
471
    FIXME("(%08lx, %p, %s): stub.\n", dwDeviceID, lpDeviceConfig, lpszDeviceClass);
472 473 474
    return 0;
}

475 476 477
/***********************************************************************
 *		lineGetID (TAPI32.@)
 */
478 479
DWORD WINAPI lineGetID(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD dwSelect, LPVARSTRING lpDeviceID, LPCSTR lpszDeviceClass)
{
480
    FIXME("(%p, %08lx, %p, %08lx, %p, %s): stub.\n", hLine, dwAddressID, hCall, dwSelect, lpDeviceID, lpszDeviceClass);
481 482 483
    return 0;
}

484 485 486
/***********************************************************************
 *		lineGetIcon (TAPI32.@)
 */
487 488
DWORD WINAPI lineGetIcon(DWORD dwDeviceID, LPCSTR lpszDeviceClass, HICON *lphIcon)
{
489
    FIXME("(%08lx, %s, %p): stub.\n", dwDeviceID, lpszDeviceClass, lphIcon);
490
    return 0;
491
}
492

493 494 495
/***********************************************************************
 *		lineGetLineDevStatus (TAPI32.@)
 */
496 497
DWORD WINAPI lineGetLineDevStatus(HLINE hLine, LPLINEDEVSTATUS lpLineDevStatus)
{
498
    FIXME("(%p, %p): stub.\n", hLine, lpLineDevStatus);
499
    return 0;
500
}
501

502 503 504
/***********************************************************************
 *		lineGetNewCalls (TAPI32.@)
 */
505 506
DWORD WINAPI lineGetNewCalls(HLINE hLine, DWORD dwAddressID, DWORD dwSelect, LPLINECALLLIST lpCallList)
{
507
    FIXME("(%p, %08lx, %08lx, %p): stub.\n", hLine, dwAddressID, dwSelect, lpCallList);
508 509 510
    return 0;
}

511 512 513
/***********************************************************************
 *		lineGetNumRings (TAPI32.@)
 */
514 515
DWORD WINAPI lineGetNumRings(HLINE hLine, DWORD dwAddressID, LPDWORD lpdwNumRings)
{
516
    FIXME("(%p, %08lx, %p): stub.\n", hLine, dwAddressID, lpdwNumRings);
517 518 519
    return 0;
}

520 521 522
/***********************************************************************
 *		lineGetProviderList (TAPI32.@)
 */
523 524
DWORD WINAPI lineGetProviderList(DWORD dwAPIVersion, LPLINEPROVIDERLIST lpProviderList)
{
525
    FIXME("(%08lx, %p): stub.\n", dwAPIVersion, lpProviderList);
526
    return 0;
527
}
528

529 530 531
/***********************************************************************
 *		lineGetRequest (TAPI32.@)
 */
532 533
DWORD WINAPI lineGetRequest(HLINEAPP hLineApp, DWORD dwRequestMode, LPVOID lpRequestBuffer)
{
534
    FIXME("%p, %08lx, %p): stub.\n", hLineApp, dwRequestMode, lpRequestBuffer);
535
    return 0;
536
}
537

538 539 540
/***********************************************************************
 *		lineGetStatusMessages (TAPI32.@)
 */
541 542
DWORD WINAPI lineGetStatusMessages(HLINE hLine, LPDWORD lpdwLineStatus, LPDWORD lpdwAddressStates)
{
543
    FIXME("(%p, %p, %p): stub.\n", hLine, lpdwLineStatus, lpdwAddressStates);
544
    return 0;
545
}
546

547 548
/***********************************************************************
 *		lineGetTranslateCaps (TAPI32.@)
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928
 *
 *      get address translate capabilities. Returns a LINETRANSLATECAPS
 *      structure:
 *
 *      +-----------------------+
 *      |TotalSize              |
 *      |NeededSize             |
 *      |UsedSize               |
 *      +-----------------------+
 *      |NumLocations           |
 *      |LocationsListSize      |
 *      |LocationsListOffset    | -+
 *      |CurrentLocationID      |  |
 *      +-----------------------+  |
 *      |NumCards               |  |
 *      |CardListSize           |  |
 *      |CardListOffset         | -|--+
 *      |CurrentPreferredCardID |  |  |
 *      +-----------------------+  |  |
 *      |                       | <+  |
 *      |LINELOCATIONENTRY #1   |     |
 *      |                       |     |
 *      +-----------------------+     |
 *      ~                       ~     |
 *      +-----------------------+     |
 *      |                       |     |
 *      |LINELOCATIONENTRY      |     |
 *      |          #NumLocations|     |
 *      +-----------------------+     |
 *      |                       | <---+
 *      |LINECARDENTRY #1       |
 *      |                       |
 *      +-----------------------+
 *      ~                       ~
 *      +-----------------------+
 *      |                       |
 *      |LINECARDENTRY #NumCards|
 *      |                       |
 *      +-----------------------+
 *      | room for strings named|
 *      | in the structures     |
 *      | above.                |
 *      +-----------------------+
 */
DWORD WINAPI lineGetTranslateCaps(HLINEAPP hLineApp, DWORD dwAPIVersion,
        LPLINETRANSLATECAPS lpTranslateCaps)
{
    HKEY hkLocations, hkCards, hkCardLocations, hsubkey;
    int numlocations, numcards;
    DWORD maxlockeylen,
        maxcardkeylen;
    char *loc_key_name = NULL;
    char *card_key_name = NULL;
    LPBYTE strptr;
    int length;
    int i;
    DWORD lendword;
    DWORD currentid;
    LPLINELOCATIONENTRY pLocEntry;
    LPLINECARDENTRY pCardEntry;
    
    TRACE("(%p, %08lx, %p (tot. size %ld)\n", hLineApp, dwAPIVersion,
            lpTranslateCaps, lpTranslateCaps->dwTotalSize );
    if( lpTranslateCaps->dwTotalSize < sizeof(LINETRANSLATECAPS))
        return LINEERR_STRUCTURETOOSMALL;
    if( RegCreateKeyA(HKEY_LOCAL_MACHINE, szLocationsKey, &hkLocations)
            != ERROR_SUCCESS ) {
        ERR("unexpected registry error 1.\n");
        return LINEERR_INIFILECORRUPT;  
    }
    lendword = sizeof( DWORD);
    if( RegQueryValueExA( hkLocations, "CurrentID", NULL, NULL,
                (LPBYTE) &currentid, &lendword) != ERROR_SUCCESS )
        currentid = -1;  /* change this later */
    if(RegQueryInfoKeyA(hkLocations, NULL, NULL, NULL, NULL, &maxlockeylen,
			NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) {
        RegCloseKey(hkLocations);
        ERR("unexpected registry error 2.\n");
        return LINEERR_INIFILECORRUPT;
    }
    maxlockeylen++;
    if( maxlockeylen < 10)
        maxlockeylen = 10; /* need this also if there is no key */
    loc_key_name = HeapAlloc( GetProcessHeap(), 0, maxlockeylen);
    /* first time through: calculate needed space */
    length=0;
    i=0;
    numlocations=0;
    while( RegEnumKeyA(hkLocations, i, loc_key_name, maxlockeylen)
            == ERROR_SUCCESS){
        DWORD size_val;
        i++;
        if( strncasecmp(loc_key_name, "location", 8)  ||
                (RegOpenKeyA(hkLocations, loc_key_name, &hsubkey)
                 != ERROR_SUCCESS))
            continue;
        numlocations++;
        length += sizeof(LINELOCATIONENTRY);
        RegQueryValueExA(hsubkey, "Name",NULL,NULL,NULL,&size_val); 
        length += size_val;
        RegQueryValueExA(hsubkey, "AreaCode",NULL,NULL,NULL,&size_val); 
        length += size_val;
        RegQueryValueExA(hsubkey, "OutsideAccess",NULL,NULL,NULL,&size_val); 
        length += size_val;
        RegQueryValueExA(hsubkey, "LongDistanceAccess",NULL,NULL,NULL,&size_val); 
        length += size_val;
        RegQueryValueExA(hsubkey, "DisableCallWaiting",NULL,NULL,NULL,&size_val); 
        length += size_val;
        /* fixme: what about TollPrefixList???? */
        RegCloseKey(hsubkey);
    }
    if(numlocations == 0) {
        /* add one location */
        if( RegCreateKeyA( hkLocations, "Location1", &hsubkey)
                == ERROR_SUCCESS) {
            DWORD dwval;
            BYTE buf[10];
            numlocations = 1;
            length += sizeof(LINELOCATIONENTRY) + 20 ;
            RegSetValueExA( hsubkey, "AreaCode", 0, REG_SZ, "010", 4);
            GetLocaleInfoA( LOCALE_SYSTEM_DEFAULT, LOCALE_ICOUNTRY, buf, 8);
            dwval = atoi(buf);
            RegSetValueExA( hsubkey, "Country", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
            RegSetValueExA( hsubkey, "DisableCallWaiting", 0, REG_SZ, "", 1);
            dwval = 1;  
            RegSetValueExA( hsubkey, "Flags", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
            RegSetValueExA( hsubkey, "LongDistanceAccess", 0, REG_SZ, "", 1);
            RegSetValueExA( hsubkey, "Name", 0, REG_SZ, "New Location", 13);
            RegSetValueExA( hsubkey, "OutsideAccess", 0, REG_SZ, "", 1);
            RegCloseKey(hsubkey);
            dwval = 1;  
            RegSetValueExA( hkLocations, "CurrentID", 0, REG_DWORD,
                    (LPBYTE)&dwval, sizeof(DWORD));
            dwval = 2;  
            RegSetValueExA( hkLocations, "NextID", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
        }
    }
    /* do the card list */
    numcards=0;
    if( RegCreateKeyA(HKEY_CURRENT_USER, szCardsKey, &hkCards)
            == ERROR_SUCCESS ) {
        if(RegQueryInfoKeyA(hkCards, NULL, NULL, NULL, NULL, &maxcardkeylen,
                NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
            maxcardkeylen++;
            if( maxcardkeylen < 6) maxcardkeylen = 6;
            card_key_name = HeapAlloc(GetProcessHeap(), 0, maxcardkeylen);
            i=0;
            while( RegEnumKeyA(hkCards, i, card_key_name, maxcardkeylen) ==
                    ERROR_SUCCESS){
                DWORD size_val;
                i++;
                if( strncasecmp(card_key_name, "card", 4)  || ERROR_SUCCESS !=
                        (RegOpenKeyA(hkCards, card_key_name, &hsubkey) ))
                    continue;
                numcards++;
                length += sizeof(LINECARDENTRY);
                RegQueryValueExA(hsubkey, "Name",NULL,NULL,NULL,&size_val); 
                length += size_val;
                RegQueryValueExA(hsubkey, "LocalRule",NULL,NULL,NULL,&size_val); 
                length += size_val;
                RegQueryValueExA(hsubkey, "LDRule",NULL,NULL,NULL,&size_val); 
                length += size_val;
                RegQueryValueExA(hsubkey, "InternationalRule",NULL,NULL,NULL,
                        &size_val); 
                length += size_val;
                RegCloseKey(hsubkey);
            }
        }
        /* add one card (direct call) */
        if (numcards == 0 &&
                ERROR_SUCCESS == RegCreateKeyA( hkCards, "Card1", &hsubkey)) {
            DWORD dwval;
            numcards = 1;
            length += sizeof(LINECARDENTRY) + 22 ;
            RegSetValueExA( hsubkey, "Name", 0, REG_SZ, "None (Direct Call)", 19);
            dwval = 1;  
            RegSetValueExA( hsubkey, "Flags", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
            RegSetValueExA( hsubkey, "InternationalRule", 0, REG_SZ, "", 1);
            RegSetValueExA( hsubkey, "LDRule", 0, REG_SZ, "", 1);
            RegSetValueExA( hsubkey, "LocalRule", 0, REG_SZ, "", 1);
            RegCloseKey(hsubkey);
            dwval = 2;  
            RegSetValueExA( hkCards, "NextID", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
        }
    } else hkCards = 0;  /* should realy fail */
    /* check if sufficient room is available */
    lpTranslateCaps->dwNeededSize =  sizeof(LINETRANSLATECAPS) + length;
    if ( lpTranslateCaps->dwNeededSize > lpTranslateCaps->dwTotalSize ) {
        RegCloseKey( hkLocations);
        if( hkCards) RegCloseKey( hkCards);
        HeapFree(GetProcessHeap(), 0, loc_key_name);
        HeapFree(GetProcessHeap(), 0, card_key_name);
        lpTranslateCaps->dwUsedSize = sizeof(LINETRANSLATECAPS);
        TRACE("Insufficient space: total %ld needed %ld used %ld\n",
                lpTranslateCaps->dwTotalSize,
                lpTranslateCaps->dwNeededSize,
                lpTranslateCaps->dwUsedSize);
        return  0;
    }
    /* fill in the LINETRANSLATECAPS structure */
    lpTranslateCaps->dwUsedSize = lpTranslateCaps->dwNeededSize;
    lpTranslateCaps->dwNumLocations = numlocations;
    lpTranslateCaps->dwLocationListSize = sizeof(LINELOCATIONENTRY) *
            lpTranslateCaps->dwNumLocations;
    lpTranslateCaps->dwLocationListOffset = sizeof(LINETRANSLATECAPS);
    lpTranslateCaps->dwCurrentLocationID = currentid; 
    lpTranslateCaps->dwNumCards = numcards;
    lpTranslateCaps->dwCardListSize = sizeof(LINECARDENTRY) *
            lpTranslateCaps->dwNumCards;
    lpTranslateCaps->dwCardListOffset = lpTranslateCaps->dwLocationListOffset +
            lpTranslateCaps->dwLocationListSize;
    lpTranslateCaps->dwCurrentPreferredCardID = 0; 
    /* this is where the strings will be stored */
    strptr = ((LPBYTE) lpTranslateCaps) +
        lpTranslateCaps->dwCardListOffset + lpTranslateCaps->dwCardListSize;
    pLocEntry = (LPLINELOCATIONENTRY) (lpTranslateCaps + 1);
    /* key with Preferred CardID's */
    if( RegOpenKeyA(HKEY_CURRENT_USER, szLocationsKey, &hkCardLocations)
            != ERROR_SUCCESS ) 
        hkCardLocations = 0;
    /* second time through all locations */
    i=0;
    while(RegEnumKeyA(hkLocations, i, loc_key_name, maxlockeylen)
            == ERROR_SUCCESS){
        DWORD size_val;
        i++;
        if( strncasecmp(loc_key_name, "location", 8)  ||
                (RegOpenKeyA(hkLocations, loc_key_name, &hsubkey)
                 != ERROR_SUCCESS))
            continue;
        size_val=sizeof(DWORD);
        if( RegQueryValueExA(hsubkey, "ID",NULL, NULL,
                (LPBYTE) &(pLocEntry->dwPermanentLocationID), &size_val) !=
                ERROR_SUCCESS)
            pLocEntry->dwPermanentLocationID = atoi( loc_key_name + 8);
        size_val=2048;
        RegQueryValueExA(hsubkey, "Name",NULL,NULL, strptr, &size_val);
        pLocEntry->dwLocationNameSize = size_val;
        pLocEntry->dwLocationNameOffset = strptr - (LPBYTE) lpTranslateCaps;
        strptr += size_val;
 
        size_val=2048;
        RegQueryValueExA(hsubkey, "AreaCode",NULL,NULL, strptr, &size_val);
        pLocEntry->dwCityCodeSize = size_val;
        pLocEntry->dwCityCodeOffset = strptr - (LPBYTE) lpTranslateCaps;
        strptr += size_val;
        
        size_val=2048;
        RegQueryValueExA(hsubkey, "OutsideAccess",NULL,NULL, strptr, &size_val);
        pLocEntry->dwLocalAccessCodeSize = size_val;
        pLocEntry->dwLocalAccessCodeOffset = strptr - (LPBYTE) lpTranslateCaps;
        strptr += size_val;
        size_val=2048;
        RegQueryValueExA(hsubkey, "LongDistanceAccess",NULL,NULL, strptr,
                &size_val);
        pLocEntry->dwLongDistanceAccessCodeSize= size_val;
        pLocEntry->dwLongDistanceAccessCodeOffset= strptr -
            (LPBYTE) lpTranslateCaps;
        strptr += size_val;
        size_val=2048;
        RegQueryValueExA(hsubkey, "DisableCallWaiting",NULL,NULL, strptr,
                &size_val);
        pLocEntry->dwCancelCallWaitingSize= size_val;
        pLocEntry->dwCancelCallWaitingOffset= strptr - (LPBYTE) lpTranslateCaps;
        strptr += size_val;

        pLocEntry->dwTollPrefixListSize = 0;    /* FIXME */
        pLocEntry->dwTollPrefixListOffset = 0;    /* FIXME */

        size_val=sizeof(DWORD);
        RegQueryValueExA(hsubkey, "Country",NULL,NULL,
                (LPBYTE) &(pLocEntry->dwCountryCode), &size_val);
        pLocEntry->dwCountryID = pLocEntry->dwCountryCode; /* FIXME */
        RegQueryValueExA(hsubkey, "Flags",NULL,NULL,
                (LPBYTE) &(pLocEntry->dwOptions), &size_val);
        RegCloseKey(hsubkey);
        /* get preferred cardid */
        pLocEntry->dwPreferredCardID = 0;
        if ( hkCardLocations) {
            size_val=sizeof(DWORD);
            if(RegOpenKeyA(hkCardLocations, loc_key_name, &hsubkey) ==
                    ERROR_SUCCESS) {
                RegQueryValueExA(hsubkey, "CallingCard",NULL,NULL,
                        (LPBYTE) &(pLocEntry->dwPreferredCardID), &size_val);
                RegCloseKey(hsubkey);
            }
                
        }
        /* make sure there is a currentID */
        if(currentid == -1){
            currentid = pLocEntry->dwPermanentLocationID;
            lpTranslateCaps->dwCurrentLocationID = currentid; 
        }
        if(pLocEntry->dwPermanentLocationID == currentid )
            lpTranslateCaps->dwCurrentPreferredCardID =
                    pLocEntry->dwPreferredCardID;
        TRACE("added: ID %ld %s CountryCode %ld CityCode %s CardID %ld "
                "LocalAccess: %s LongDistanceAccess: %s CountryID %ld "
                "Options %ld CancelCallWait %s\n",
                pLocEntry->dwPermanentLocationID,
                debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwLocationNameOffset),
                pLocEntry->dwCountryCode,
                debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwCityCodeOffset),
                pLocEntry->dwPreferredCardID,
                debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwLocalAccessCodeOffset),
                debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwLongDistanceAccessCodeOffset),
                pLocEntry->dwCountryID,
                pLocEntry->dwOptions,
                debugstr_a( (char*)lpTranslateCaps + pLocEntry->dwCancelCallWaitingOffset));
        pLocEntry++;
    }
    pCardEntry= (LPLINECARDENTRY) pLocEntry;
    /* do the card list */
    if( hkCards) {
        i=0;
        while( RegEnumKeyA(hkCards, i, card_key_name, maxcardkeylen) ==
                ERROR_SUCCESS){
            DWORD size_val;
            i++;
            if( strncasecmp(card_key_name, "card", 4)  ||
                    (RegOpenKeyA(hkCards, card_key_name, &hsubkey) != ERROR_SUCCESS))
                continue;
            size_val=sizeof(DWORD);
            if( RegQueryValueExA(hsubkey, "ID",NULL, NULL,
                    (LPBYTE) &(pCardEntry->dwPermanentCardID), &size_val) !=
                    ERROR_SUCCESS)
                pCardEntry->dwPermanentCardID= atoi( card_key_name + 4);
            size_val=2048;
            RegQueryValueExA(hsubkey, "Name",NULL,NULL, strptr, &size_val);
            pCardEntry->dwCardNameSize = size_val;
            pCardEntry->dwCardNameOffset = strptr - (LPBYTE) lpTranslateCaps;
            strptr += size_val;
            pCardEntry->dwCardNumberDigits = 1; /* FIXME */
            size_val=2048;
            RegQueryValueExA(hsubkey, "LocalRule",NULL,NULL, strptr, &size_val);
            pCardEntry->dwSameAreaRuleSize= size_val;
            pCardEntry->dwSameAreaRuleOffset= strptr - (LPBYTE) lpTranslateCaps;
            strptr += size_val;
            size_val=2048;
            RegQueryValueExA(hsubkey, "LDRule",NULL,NULL, strptr, &size_val);
            pCardEntry->dwLongDistanceRuleSize = size_val;
            pCardEntry->dwLongDistanceRuleOffset = strptr - (LPBYTE) lpTranslateCaps;
            strptr += size_val;
            size_val=2048;
            RegQueryValueExA(hsubkey, "InternationalRule",NULL,NULL, strptr,
                    &size_val);
            pCardEntry->dwInternationalRuleSize = size_val;
            pCardEntry->dwInternationalRuleOffset = strptr -
                (LPBYTE) lpTranslateCaps;
            strptr += size_val;
            size_val=sizeof(DWORD);
            RegQueryValueExA(hsubkey, "Flags",NULL, NULL,
                    (LPBYTE) &(pCardEntry->dwOptions), &size_val); 
            TRACE( "added card: ID %ld name %s SameArea %s LongDistance %s International %s Options 0x%lx\n", 
                    pCardEntry->dwPermanentCardID,
                    debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwCardNameOffset),
                    debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwSameAreaRuleOffset),
                    debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwLongDistanceRuleOffset),
                    debugstr_a( (char*)lpTranslateCaps + pCardEntry->dwInternationalRuleOffset),
                    pCardEntry->dwOptions);

            pCardEntry++;
        }
    }

    if(hkLocations) RegCloseKey(hkLocations);
    if(hkCards) RegCloseKey(hkCards);
    if(hkCardLocations) RegCloseKey(hkCardLocations);
    HeapFree(GetProcessHeap(), 0, loc_key_name);
    HeapFree(GetProcessHeap(), 0, card_key_name);
    TRACE(" returning success tot %ld needed %ld used %ld \n",
            lpTranslateCaps->dwTotalSize,
            lpTranslateCaps->dwNeededSize,
            lpTranslateCaps->dwUsedSize );
    return 0; /* success */
929 930
}

931 932 933
/***********************************************************************
 *		lineHandoff (TAPI32.@)
 */
934 935
DWORD WINAPI lineHandoff(HCALL hCall, LPCSTR lpszFileName, DWORD dwMediaMode)
{
936
    FIXME("(%p, %s, %08lx): stub.\n", hCall, lpszFileName, dwMediaMode);
937
    return 0;
938
}
939

940 941 942
/***********************************************************************
 *		lineHold (TAPI32.@)
 */
943 944
DWORD WINAPI lineHold(HCALL hCall)
{
945
    FIXME("(%p): stub.\n", hCall);
946
    return 1;
947
}
948

949 950 951
/***********************************************************************
 *		lineInitialize (TAPI32.@)
 */
952 953 954 955 956 957 958
DWORD WINAPI lineInitialize(
  LPHLINEAPP lphLineApp,
  HINSTANCE hInstance,
  LINECALLBACK lpfnCallback,
  LPCSTR lpszAppName,
  LPDWORD lpdwNumDevs)
{
959
    FIXME("(%p, %p, %p, %s, %p): stub.\n", lphLineApp, hInstance,
960
	  lpfnCallback, debugstr_a(lpszAppName), lpdwNumDevs);
961 962 963
    return 0;
}

964 965 966
/***********************************************************************
 *		lineMakeCall (TAPI32.@)
 */
967 968
DWORD WINAPI lineMakeCall(HLINE hLine, LPHCALL lphCall, LPCSTR lpszDestAddress, DWORD dwCountryCode, LPLINECALLPARAMS lpCallParams)
{
969
    FIXME("(%p, %p, %s, %08lx, %p): stub.\n", hLine, lphCall, lpszDestAddress, dwCountryCode, lpCallParams);
970 971 972
    return 1;
}

973 974 975
/***********************************************************************
 *		lineMonitorDigits (TAPI32.@)
 */
976 977
DWORD WINAPI lineMonitorDigits(HCALL hCall, DWORD dwDigitModes)
{
978
    FIXME("(%p, %08lx): stub.\n", hCall, dwDigitModes);
979 980 981
    return 0;
}

982 983 984
/***********************************************************************
 *		lineMonitorMedia (TAPI32.@)
 */
985 986
DWORD WINAPI lineMonitorMedia(HCALL hCall, DWORD dwMediaModes)
{
987
    FIXME("(%p, %08lx): stub.\n", hCall, dwMediaModes);
988
    return 0;
989
}
990

991 992 993
/***********************************************************************
 *		lineMonitorTones (TAPI32.@)
 */
994 995
DWORD WINAPI lineMonitorTones(HCALL hCall, LPLINEMONITORTONE lpToneList, DWORD dwNumEntries)
{
996
    FIXME("(%p, %p, %08lx): stub.\n", hCall, lpToneList, dwNumEntries);
997
    return 0;
998
}
999

1000 1001 1002
/***********************************************************************
 *		lineNegotiateAPIVersion (TAPI32.@)
 */
1003 1004 1005 1006 1007 1008 1009 1010 1011
DWORD WINAPI lineNegotiateAPIVersion(
  HLINEAPP hLineApp,
  DWORD dwDeviceID,
  DWORD dwAPILowVersion,
  DWORD dwAPIHighVersion,
  LPDWORD lpdwAPIVersion,
  LPLINEEXTENSIONID lpExtensionID
)
{
1012
    FIXME("(%p, %ld, %ld, %ld, %p, %p): stub.\n", hLineApp, dwDeviceID,
1013
	  dwAPILowVersion, dwAPIHighVersion, lpdwAPIVersion, lpExtensionID);
1014 1015 1016 1017
    *lpdwAPIVersion = dwAPIHighVersion;
    return 0;
}

1018 1019 1020
/***********************************************************************
 *		lineNegotiateExtVersion (TAPI32.@)
 */
1021 1022
DWORD WINAPI lineNegotiateExtVersion(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtLowVersion, DWORD dwExtHighVersion, LPDWORD lpdwExtVersion)
{
1023
    FIXME("stub.\n");
1024 1025 1026
    return 0;
}

1027 1028 1029
/***********************************************************************
 *		lineOpen (TAPI32.@)
 */
1030 1031
DWORD WINAPI lineOpen(HLINEAPP hLineApp, DWORD dwDeviceID, LPHLINE lphLine, DWORD dwAPIVersion, DWORD dwExtVersion, DWORD dwCallbackInstance, DWORD dwPrivileges, DWORD dwMediaModes, LPLINECALLPARAMS lpCallParams)
{
1032
    FIXME("stub.\n");
1033 1034 1035
    return 0;
}

1036 1037 1038
/***********************************************************************
 *		linePark (TAPI32.@)
 */
1039 1040
DWORD WINAPI linePark(HCALL hCall, DWORD dwParkMode, LPCSTR lpszDirAddress, LPVARSTRING lpNonDirAddress)
{
1041
    FIXME("(%p, %08lx, %s, %p): stub.\n", hCall, dwParkMode, lpszDirAddress, lpNonDirAddress);
1042
    return 1;
1043
}
1044

1045 1046 1047
/***********************************************************************
 *		linePickup (TAPI32.@)
 */
1048 1049
DWORD WINAPI linePickup(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR lpszDestAddress, LPCSTR lpszGroupID)
{
1050
    FIXME("(%p, %08lx, %p, %s, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID);
1051
    return 1;
1052
}
1053

1054 1055 1056
/***********************************************************************
 *		linePrepareAddToConference (TAPI32.@)
 */
1057 1058
DWORD WINAPI linePrepareAddToConference(HCALL hConfCall, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
{
1059
    FIXME("(%p, %p, %p): stub.\n", hConfCall, lphConsultCall, lpCallParams);
1060
    return 1;
1061
}
1062

1063 1064
/***********************************************************************
 *		lineRedirect (TAPI32.@)
1065 1066 1067 1068 1069 1070
 */
DWORD WINAPI lineRedirect(
  HCALL hCall,
  LPCSTR lpszDestAddress,
  DWORD  dwCountryCode) {

1071
  FIXME(": stub.\n");
1072 1073 1074
  return 1;
}

1075 1076 1077
/***********************************************************************
 *		lineRegisterRequestRecipient (TAPI32.@)
 */
1078 1079
DWORD WINAPI lineRegisterRequestRecipient(HLINEAPP hLineApp, DWORD dwRegistrationInstance, DWORD dwRequestMode, DWORD dwEnable)
{
1080
    FIXME("(%p, %08lx, %08lx, %08lx): stub.\n", hLineApp, dwRegistrationInstance, dwRequestMode, dwEnable);
1081 1082 1083
    return 1;
}

1084 1085 1086
/***********************************************************************
 *		lineReleaseUserUserInfo (TAPI32.@)
 */
1087 1088
DWORD WINAPI lineReleaseUserUserInfo(HCALL hCall)
{
1089
    FIXME("(%p): stub.\n", hCall);
1090
    return 1;
1091
}
1092

1093 1094 1095
/***********************************************************************
 *		lineRemoveFromConference (TAPI32.@)
 */
1096 1097
DWORD WINAPI lineRemoveFromConference(HCALL hCall)
{
1098
    FIXME("(%p): stub.\n", hCall);
1099 1100 1101
    return 1;
}

1102 1103 1104
/***********************************************************************
 *		lineRemoveProvider (TAPI32.@)
 */
1105 1106
DWORD WINAPI lineRemoveProvider(DWORD dwPermanentProviderID, HWND hwndOwner)
{
1107
    FIXME("(%08lx, %p): stub.\n", dwPermanentProviderID, hwndOwner);
1108
    return 1;
1109
}
1110

1111 1112 1113
/***********************************************************************
 *		lineSecureCall (TAPI32.@)
 */
1114 1115
DWORD WINAPI lineSecureCall(HCALL hCall)
{
1116
    FIXME("(%p): stub.\n", hCall);
1117 1118 1119
    return 1;
}

1120 1121 1122
/***********************************************************************
 *		lineSendUserUserInfo (TAPI32.@)
 */
1123 1124
DWORD WINAPI lineSendUserUserInfo(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
{
1125
    FIXME("(%p, %s, %08lx): stub.\n", hCall, lpsUserUserInfo, dwSize);
1126 1127 1128
    return 1;
}

1129 1130 1131
/***********************************************************************
 *		lineSetAppPriority (TAPI32.@)
 */
1132 1133
DWORD WINAPI lineSetAppPriority(LPCSTR lpszAppFilename, DWORD dwMediaMode, LPLINEEXTENSIONID const lpExtensionID, DWORD dwRequestMode, LPCSTR lpszExtensionName, DWORD dwPriority)
{
1134
    FIXME("(%s, %08lx, %p, %08lx, %s, %08lx): stub.\n", lpszAppFilename, dwMediaMode, lpExtensionID, dwRequestMode, lpszExtensionName, dwPriority);
1135 1136 1137
    return 0;
}

1138 1139 1140
/***********************************************************************
 *		lineSetAppSpecific (TAPI32.@)
 */
1141 1142
DWORD WINAPI lineSetAppSpecific(HCALL hCall, DWORD dwAppSpecific)
{
1143
    FIXME("(%p, %08lx): stub.\n", hCall, dwAppSpecific);
1144 1145 1146
    return 0;
}

1147 1148 1149
/***********************************************************************
 *		lineSetCallParams (TAPI32.@)
 */
1150 1151
DWORD WINAPI lineSetCallParams(HCALL hCall, DWORD dwBearerMode, DWORD dwMinRate, DWORD dwMaxRate, LPLINEDIALPARAMS lpDialParams)
{
1152
    FIXME("(%p, %08lx, %08lx, %08lx, %p): stub.\n", hCall, dwBearerMode, dwMinRate, dwMaxRate, lpDialParams);
1153 1154 1155
    return 1;
}

1156 1157 1158
/***********************************************************************
 *		lineSetCallPrivilege (TAPI32.@)
 */
1159 1160
DWORD WINAPI lineSetCallPrivilege(HCALL hCall, DWORD dwCallPrivilege)
{
1161
    FIXME("(%p, %08lx): stub.\n", hCall, dwCallPrivilege);
1162
    return 0;
1163 1164
}

1165 1166 1167
/***********************************************************************
 *		lineSetCurrentLocation (TAPI32.@)
 */
1168 1169
DWORD WINAPI lineSetCurrentLocation(HLINEAPP hLineApp, DWORD dwLocation)
{
1170
    FIXME("(%p, %08lx): stub.\n", hLineApp, dwLocation);
1171 1172 1173
    return 0;
}

1174 1175 1176
/***********************************************************************
 *		lineSetDevConfig (TAPI32.@)
 */
1177 1178
DWORD WINAPI lineSetDevConfig(DWORD dwDeviceID, LPVOID lpDeviceConfig, DWORD dwSize, LPCSTR lpszDeviceClass)
{
1179
    FIXME("(%08lx, %p, %08lx, %s): stub.\n", dwDeviceID, lpDeviceConfig, dwSize, lpszDeviceClass);
1180 1181 1182
    return 0;
}

1183 1184 1185
/***********************************************************************
 *		lineSetMediaControl (TAPI32.@)
 */
1186 1187 1188 1189 1190 1191 1192 1193 1194
DWORD WINAPI lineSetMediaControl(
HLINE hLine,
DWORD dwAddressID,
HCALL hCall,
DWORD dwSelect,
LPLINEMEDIACONTROLDIGIT const lpDigitList,
DWORD dwDigitNumEntries,
LPLINEMEDIACONTROLMEDIA const lpMediaList,
DWORD dwMediaNumEntries,
1195
LPLINEMEDIACONTROLTONE const lpToneList,
1196 1197 1198 1199
DWORD dwToneNumEntries,
LPLINEMEDIACONTROLCALLSTATE const lpCallStateList,
DWORD dwCallStateNumEntries)
{
1200
    FIXME(": stub.\n");
1201 1202 1203
    return 0;
}

1204 1205 1206
/***********************************************************************
 *		lineSetMediaMode (TAPI32.@)
 */
1207 1208
DWORD WINAPI lineSetMediaMode(HCALL hCall, DWORD dwMediaModes)
{
1209
    FIXME("(%p, %08lx): stub.\n", hCall, dwMediaModes);
1210
    return 0;
1211
}
1212

1213 1214 1215
/***********************************************************************
 *		lineSetNumRings (TAPI32.@)
 */
1216 1217
DWORD WINAPI lineSetNumRings(HLINE hLine, DWORD dwAddressID, DWORD dwNumRings)
{
1218
    FIXME("(%p, %08lx, %08lx): stub.\n", hLine, dwAddressID, dwNumRings);
1219
    return 0;
1220 1221
}

1222 1223 1224
/***********************************************************************
 *		lineSetStatusMessages (TAPI32.@)
 */
1225 1226
DWORD WINAPI lineSetStatusMessages(HLINE hLine, DWORD dwLineStates, DWORD dwAddressStates)
{
1227
    FIXME("(%p, %08lx, %08lx): stub.\n", hLine, dwLineStates, dwAddressStates);
1228
    return 0;
1229 1230
}

1231 1232 1233
/***********************************************************************
 *		lineSetTerminal (TAPI32.@)
 */
1234 1235
DWORD WINAPI lineSetTerminal(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD dwSelect, DWORD dwTerminalModes, DWORD dwTerminalID, DWORD bEnable)
{
1236
    FIXME("(%p, %08lx, %p, %08lx, %08lx, %08lx, %08lx): stub.\n", hLine, dwAddressID, hCall, dwSelect, dwTerminalModes, dwTerminalID, bEnable);
1237
    return 1;
1238
}
1239

1240 1241 1242
/***********************************************************************
 *		lineSetTollList (TAPI32.@)
 */
1243 1244
DWORD WINAPI lineSetTollList(HLINEAPP hLineApp, DWORD dwDeviceID, LPCSTR lpszAddressIn, DWORD dwTollListOption)
{
1245
    FIXME("(%p, %08lx, %s, %08lx): stub.\n", hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption);
1246
    return 0;
1247 1248
}

1249 1250 1251
/***********************************************************************
 *		lineSetupConference (TAPI32.@)
 */
1252 1253
DWORD WINAPI lineSetupConference(HCALL hCall, HLINE hLine, LPHCALL lphConfCall, LPHCALL lphConsultCall, DWORD dwNumParties, LPLINECALLPARAMS lpCallParams)
{
1254
    FIXME("(%p, %p, %p, %p, %08lx, %p): stub.\n", hCall, hLine, lphConfCall, lphConsultCall, dwNumParties, lpCallParams);
1255 1256 1257
    return 1;
}

1258 1259 1260
/***********************************************************************
 *		lineSetupTransfer (TAPI32.@)
 */
1261 1262
DWORD WINAPI lineSetupTransfer(HCALL hCall, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
{
1263
    FIXME("(%p, %p, %p): stub.\n", hCall, lphConsultCall, lpCallParams);
1264
    return 1;
1265
}
1266

1267 1268 1269
/***********************************************************************
 *		lineShutdown (TAPI32.@)
 */
1270 1271
DWORD WINAPI lineShutdown(HLINEAPP hLineApp)
{
1272
    FIXME("(%p): stub.\n", hLineApp);
1273 1274 1275
    return 0;
}

1276 1277 1278
/***********************************************************************
 *		lineSwapHold (TAPI32.@)
 */
1279 1280
DWORD WINAPI lineSwapHold(HCALL hActiveCall, HCALL hHeldCall)
{
1281
    FIXME("(active: %p, held: %p): stub.\n", hActiveCall, hHeldCall);
1282 1283 1284
    return 1;
}

1285 1286 1287
/***********************************************************************
 *		lineTranslateAddress (TAPI32.@)
 */
1288 1289
DWORD WINAPI lineTranslateAddress(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, LPCSTR lpszAddressIn, DWORD dwCard, DWORD dwTranslateOptions, LPLINETRANSLATEOUTPUT lpTranslateOutput)
{
1290
    FIXME("(%p, %08lx, %08lx, %s, %08lx, %08lx, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, lpszAddressIn, dwCard, dwTranslateOptions, lpTranslateOutput);
1291 1292 1293
    return 0;
}

1294 1295 1296
/***********************************************************************
 *		lineTranslateDialog (TAPI32.@)
 */
1297 1298
DWORD WINAPI lineTranslateDialog(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, HWND hwndOwner, LPCSTR lpszAddressIn)
{
1299
    FIXME("(%p, %08lx, %08lx, %p, %s): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, hwndOwner, lpszAddressIn);
1300 1301 1302
    return 0;
}

1303 1304 1305
/***********************************************************************
 *		lineUncompleteCall (TAPI32.@)
 */
1306 1307
DWORD WINAPI lineUncompleteCall(HLINE hLine, DWORD dwCompletionID)
{
1308
    FIXME("(%p, %08lx): stub.\n", hLine, dwCompletionID);
1309 1310 1311
    return 1;
}

1312 1313 1314
/***********************************************************************
 *		lineUnhold (TAPI32.@)
 */
1315
DWORD WINAPI lineUnhold(HCALL hCall)
1316
{
1317
    FIXME("(%p): stub.\n", hCall);
1318 1319 1320
    return 1;
}

1321 1322 1323
/***********************************************************************
 *		lineUnpark (TAPI32.@)
 */
1324 1325
DWORD WINAPI lineUnpark(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR lpszDestAddress)
{
1326
    FIXME("(%p, %08lx, %p, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress);
1327
    return 1;
1328
}