line.c 47.4 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
 *
 * 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
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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 "wingdi.h"
28
#include "winreg.h"
29
#include "winnls.h"
30
#include "winerror.h"
31
#include "objbase.h"
32
#include "tapi.h"
33
#include "wine/debug.h"
34

35
WINE_DEFAULT_DEBUG_CHANNEL(tapi);
36

37 38 39 40 41 42 43 44 45
/* 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";


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

315
    TRACE("(%08x, %08x, %p(%d)): stub.\n",
316 317
	  dwCountryID, dwAPIVersion, lpLineCountryList,
	  lpLineCountryList->dwTotalSize);
318

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


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

    if(dwAvailSize<dwOffset)
        return LINEERR_STRUCTURETOOSMALL;

    memset(lpLineCountryList, 0, dwAvailSize);

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

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

340 341 342 343 344 345 346 347 348 349 350 351 352 353
    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++)
354
    {
355 356
        DWORD len, size, size_int, size_long, size_name, size_same;
	HKEY hsubkey;
357

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

        if(dwCountryID && (atoi(subkey_name) != dwCountryID))
363 364
            continue;

365 366 367 368 369 370 371 372 373 374 375 376 377 378
	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;
379

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

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

        lpLineCountryList->dwNumCountries++;
394 395
        lpLineCountryList->dwCountryListSize += sizeof (LINECOUNTRYENTRY);
        lpLineCountryList->dwUsedSize += len + sizeof (LINECOUNTRYENTRY);
396

397 398
	if(dwCountryID)
	    i = 0;
399

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

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

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

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

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

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

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

	if(dwCountryID) break;
447 448 449 450
    }

    lpLineCountryList->dwNeededSize = dwOffset;

451
    TRACE("%d available %d required\n", dwAvailSize, dwOffset);
452

453 454 455
    HeapFree(GetProcessHeap(), 0, subkey_name);
    RegCloseKey(hkey);

456 457 458
    return 0;
}

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

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

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

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

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

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

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

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

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

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

549 550
/***********************************************************************
 *		lineGetTranslateCaps (TAPI32.@)
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
 *
 *      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.                |
 *      +-----------------------+
 */
595
DWORD WINAPI lineGetTranslateCapsA(HLINEAPP hLineApp, DWORD dwAPIVersion,
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611
        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;
    
612
    TRACE("(%p, %08x, %p (tot. size %d)\n", hLineApp, dwAPIVersion,
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
            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;
667
            char buf[10];
668 669
            numlocations = 1;
            length += sizeof(LINELOCATIONENTRY) + 20 ;
670
            RegSetValueExA( hsubkey, "AreaCode", 0, REG_SZ, (const BYTE *)"010", 4);
671 672 673 674
            GetLocaleInfoA( LOCALE_SYSTEM_DEFAULT, LOCALE_ICOUNTRY, buf, 8);
            dwval = atoi(buf);
            RegSetValueExA( hsubkey, "Country", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
675
            RegSetValueExA( hsubkey, "DisableCallWaiting", 0, REG_SZ, (const BYTE *)"", 1);
676 677 678
            dwval = 1;  
            RegSetValueExA( hsubkey, "Flags", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
679 680 681
            RegSetValueExA( hsubkey, "LongDistanceAccess", 0, REG_SZ, (const BYTE *)"", 1);
            RegSetValueExA( hsubkey, "Name", 0, REG_SZ, (const BYTE *)"New Location", 13);
            RegSetValueExA( hsubkey, "OutsideAccess", 0, REG_SZ, (const BYTE *)"", 1);
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
            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 ;
728
            RegSetValueExA( hsubkey, "Name", 0, REG_SZ, (const BYTE *)"None (Direct Call)", 19);
729 730 731
            dwval = 1;  
            RegSetValueExA( hsubkey, "Flags", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
732 733 734
            RegSetValueExA( hsubkey, "InternationalRule", 0, REG_SZ, (const BYTE *)"", 1);
            RegSetValueExA( hsubkey, "LDRule", 0, REG_SZ, (const BYTE *)"", 1);
            RegSetValueExA( hsubkey, "LocalRule", 0, REG_SZ, (const BYTE *)"", 1);
735 736 737 738 739
            RegCloseKey(hsubkey);
            dwval = 2;  
            RegSetValueExA( hkCards, "NextID", 0, REG_DWORD, (LPBYTE)&dwval,
                    sizeof(DWORD));
        }
740
    } else hkCards = 0;  /* should really fail */
741 742 743 744 745 746 747 748
    /* 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);
749
        TRACE("Insufficient space: total %d needed %d used %d\n",
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
                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;
852 853 854
        TRACE("added: ID %d %s CountryCode %d CityCode %s CardID %d "
                "LocalAccess: %s LongDistanceAccess: %s CountryID %d "
                "Options %d CancelCallWait %s\n",
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
                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); 
909
            TRACE( "added card: ID %d name %s SameArea %s LongDistance %s International %s Options 0x%x\n", 
910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925
                    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);
926
    TRACE(" returning success tot %d needed %d used %d\n",
927 928 929 930
            lpTranslateCaps->dwTotalSize,
            lpTranslateCaps->dwNeededSize,
            lpTranslateCaps->dwUsedSize );
    return 0; /* success */
931 932
}

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

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

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

966 967 968 969 970 971 972 973 974 975
/***********************************************************************
 *              lineInitializeExA (TAPI32.@)
 */
LONG WINAPI lineInitializeExA(LPHLINEAPP lphLineApp, HINSTANCE hInstance, LINECALLBACK lpfnCallback, LPCSTR lpszFriendlyAppName, LPDWORD lpdwNumDevs, LPDWORD lpdwAPIVersion, LPLINEINITIALIZEEXPARAMS lpLineInitializeExParams)
{
    FIXME("(%p, %p, %p, %s, %p, %p, %p): stub.\n", lphLineApp, hInstance,
          lpfnCallback, debugstr_a(lpszFriendlyAppName), lpdwNumDevs, lpdwAPIVersion, lpLineInitializeExParams);
    return 0;
}

976 977 978
/***********************************************************************
 *		lineMakeCall (TAPI32.@)
 */
979
DWORD WINAPI lineMakeCallA(HLINE hLine, LPHCALL lphCall, LPCSTR lpszDestAddress, DWORD dwCountryCode, LPLINECALLPARAMS lpCallParams)
980
{
981
    FIXME("(%p, %p, %s, %08x, %p): stub.\n", hLine, lphCall, lpszDestAddress, dwCountryCode, lpCallParams);
982 983 984
    return 1;
}

985 986 987
/***********************************************************************
 *		lineMonitorDigits (TAPI32.@)
 */
988 989
DWORD WINAPI lineMonitorDigits(HCALL hCall, DWORD dwDigitModes)
{
990
    FIXME("(%p, %08x): stub.\n", hCall, dwDigitModes);
991 992 993
    return 0;
}

994 995 996
/***********************************************************************
 *		lineMonitorMedia (TAPI32.@)
 */
997 998
DWORD WINAPI lineMonitorMedia(HCALL hCall, DWORD dwMediaModes)
{
999
    FIXME("(%p, %08x): stub.\n", hCall, dwMediaModes);
1000
    return 0;
1001
}
1002

1003 1004 1005
/***********************************************************************
 *		lineMonitorTones (TAPI32.@)
 */
1006 1007
DWORD WINAPI lineMonitorTones(HCALL hCall, LPLINEMONITORTONE lpToneList, DWORD dwNumEntries)
{
1008
    FIXME("(%p, %p, %08x): stub.\n", hCall, lpToneList, dwNumEntries);
1009
    return 0;
1010
}
1011

1012 1013 1014
/***********************************************************************
 *		lineNegotiateAPIVersion (TAPI32.@)
 */
1015 1016 1017 1018 1019 1020 1021 1022 1023
DWORD WINAPI lineNegotiateAPIVersion(
  HLINEAPP hLineApp,
  DWORD dwDeviceID,
  DWORD dwAPILowVersion,
  DWORD dwAPIHighVersion,
  LPDWORD lpdwAPIVersion,
  LPLINEEXTENSIONID lpExtensionID
)
{
1024
    FIXME("(%p, %d, %d, %d, %p, %p): stub.\n", hLineApp, dwDeviceID,
1025
	  dwAPILowVersion, dwAPIHighVersion, lpdwAPIVersion, lpExtensionID);
1026 1027 1028 1029
    *lpdwAPIVersion = dwAPIHighVersion;
    return 0;
}

1030 1031 1032
/***********************************************************************
 *		lineNegotiateExtVersion (TAPI32.@)
 */
1033 1034
DWORD WINAPI lineNegotiateExtVersion(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtLowVersion, DWORD dwExtHighVersion, LPDWORD lpdwExtVersion)
{
1035
    FIXME("stub.\n");
1036 1037 1038
    return 0;
}

1039 1040 1041
/***********************************************************************
 *		lineOpen (TAPI32.@)
 */
1042
DWORD WINAPI lineOpenA(HLINEAPP hLineApp, DWORD dwDeviceID, LPHLINE lphLine, DWORD dwAPIVersion, DWORD dwExtVersion, DWORD dwCallbackInstance, DWORD dwPrivileges, DWORD dwMediaModes, LPLINECALLPARAMS lpCallParams)
1043
{
1044
    FIXME("stub.\n");
1045 1046 1047
    return 0;
}

1048 1049 1050
/***********************************************************************
 *		linePark (TAPI32.@)
 */
1051
DWORD WINAPI lineParkA(HCALL hCall, DWORD dwParkMode, LPCSTR lpszDirAddress, LPVARSTRING lpNonDirAddress)
1052
{
1053
    FIXME("(%p, %08x, %s, %p): stub.\n", hCall, dwParkMode, lpszDirAddress, lpNonDirAddress);
1054
    return 1;
1055
}
1056

1057 1058 1059
/***********************************************************************
 *		linePickup (TAPI32.@)
 */
1060
DWORD WINAPI linePickupA(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR lpszDestAddress, LPCSTR lpszGroupID)
1061
{
1062
    FIXME("(%p, %08x, %p, %s, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID);
1063
    return 1;
1064
}
1065

1066 1067 1068
/***********************************************************************
 *		linePrepareAddToConference (TAPI32.@)
 */
1069
DWORD WINAPI linePrepareAddToConferenceA(HCALL hConfCall, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
1070
{
1071
    FIXME("(%p, %p, %p): stub.\n", hConfCall, lphConsultCall, lpCallParams);
1072
    return 1;
1073
}
1074

1075 1076
/***********************************************************************
 *		lineRedirect (TAPI32.@)
1077
 */
1078
DWORD WINAPI lineRedirectA(
1079 1080 1081 1082
  HCALL hCall,
  LPCSTR lpszDestAddress,
  DWORD  dwCountryCode) {

1083
  FIXME(": stub.\n");
1084 1085 1086
  return 1;
}

1087 1088 1089
/***********************************************************************
 *		lineRegisterRequestRecipient (TAPI32.@)
 */
1090 1091
DWORD WINAPI lineRegisterRequestRecipient(HLINEAPP hLineApp, DWORD dwRegistrationInstance, DWORD dwRequestMode, DWORD dwEnable)
{
1092
    FIXME("(%p, %08x, %08x, %08x): stub.\n", hLineApp, dwRegistrationInstance, dwRequestMode, dwEnable);
1093 1094 1095
    return 1;
}

1096 1097 1098
/***********************************************************************
 *		lineReleaseUserUserInfo (TAPI32.@)
 */
1099 1100
DWORD WINAPI lineReleaseUserUserInfo(HCALL hCall)
{
1101
    FIXME("(%p): stub.\n", hCall);
1102
    return 1;
1103
}
1104

1105 1106 1107
/***********************************************************************
 *		lineRemoveFromConference (TAPI32.@)
 */
1108 1109
DWORD WINAPI lineRemoveFromConference(HCALL hCall)
{
1110
    FIXME("(%p): stub.\n", hCall);
1111 1112 1113
    return 1;
}

1114 1115 1116
/***********************************************************************
 *		lineRemoveProvider (TAPI32.@)
 */
1117 1118
DWORD WINAPI lineRemoveProvider(DWORD dwPermanentProviderID, HWND hwndOwner)
{
1119
    FIXME("(%08x, %p): stub.\n", dwPermanentProviderID, hwndOwner);
1120
    return 1;
1121
}
1122

1123 1124 1125
/***********************************************************************
 *		lineSecureCall (TAPI32.@)
 */
1126 1127
DWORD WINAPI lineSecureCall(HCALL hCall)
{
1128
    FIXME("(%p): stub.\n", hCall);
1129 1130 1131
    return 1;
}

1132 1133 1134
/***********************************************************************
 *		lineSendUserUserInfo (TAPI32.@)
 */
1135 1136
DWORD WINAPI lineSendUserUserInfo(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize)
{
1137
    FIXME("(%p, %s, %08x): stub.\n", hCall, lpsUserUserInfo, dwSize);
1138 1139 1140
    return 1;
}

1141 1142 1143
/***********************************************************************
 *		lineSetAppPriority (TAPI32.@)
 */
1144
DWORD WINAPI lineSetAppPriorityA(LPCSTR lpszAppFilename, DWORD dwMediaMode, LPLINEEXTENSIONID const lpExtensionID, DWORD dwRequestMode, LPCSTR lpszExtensionName, DWORD dwPriority)
1145
{
1146
    FIXME("(%s, %08x, %p, %08x, %s, %08x): stub.\n", lpszAppFilename, dwMediaMode, lpExtensionID, dwRequestMode, lpszExtensionName, dwPriority);
1147 1148 1149
    return 0;
}

1150 1151 1152
/***********************************************************************
 *		lineSetAppSpecific (TAPI32.@)
 */
1153 1154
DWORD WINAPI lineSetAppSpecific(HCALL hCall, DWORD dwAppSpecific)
{
1155
    FIXME("(%p, %08x): stub.\n", hCall, dwAppSpecific);
1156 1157 1158
    return 0;
}

1159 1160 1161
/***********************************************************************
 *		lineSetCallParams (TAPI32.@)
 */
1162 1163
DWORD WINAPI lineSetCallParams(HCALL hCall, DWORD dwBearerMode, DWORD dwMinRate, DWORD dwMaxRate, LPLINEDIALPARAMS lpDialParams)
{
1164
    FIXME("(%p, %08x, %08x, %08x, %p): stub.\n", hCall, dwBearerMode, dwMinRate, dwMaxRate, lpDialParams);
1165 1166 1167
    return 1;
}

1168 1169 1170
/***********************************************************************
 *		lineSetCallPrivilege (TAPI32.@)
 */
1171 1172
DWORD WINAPI lineSetCallPrivilege(HCALL hCall, DWORD dwCallPrivilege)
{
1173
    FIXME("(%p, %08x): stub.\n", hCall, dwCallPrivilege);
1174
    return 0;
1175 1176
}

1177 1178 1179
/***********************************************************************
 *		lineSetCurrentLocation (TAPI32.@)
 */
1180 1181
DWORD WINAPI lineSetCurrentLocation(HLINEAPP hLineApp, DWORD dwLocation)
{
1182
    FIXME("(%p, %08x): stub.\n", hLineApp, dwLocation);
1183 1184 1185
    return 0;
}

1186 1187 1188
/***********************************************************************
 *		lineSetDevConfig (TAPI32.@)
 */
1189
DWORD WINAPI lineSetDevConfigA(DWORD dwDeviceID, LPVOID lpDeviceConfig, DWORD dwSize, LPCSTR lpszDeviceClass)
1190
{
1191
    FIXME("(%08x, %p, %08x, %s): stub.\n", dwDeviceID, lpDeviceConfig, dwSize, lpszDeviceClass);
1192 1193 1194
    return 0;
}

1195 1196 1197
/***********************************************************************
 *		lineSetMediaControl (TAPI32.@)
 */
1198 1199 1200 1201 1202 1203 1204 1205 1206
DWORD WINAPI lineSetMediaControl(
HLINE hLine,
DWORD dwAddressID,
HCALL hCall,
DWORD dwSelect,
LPLINEMEDIACONTROLDIGIT const lpDigitList,
DWORD dwDigitNumEntries,
LPLINEMEDIACONTROLMEDIA const lpMediaList,
DWORD dwMediaNumEntries,
1207
LPLINEMEDIACONTROLTONE const lpToneList,
1208 1209 1210 1211
DWORD dwToneNumEntries,
LPLINEMEDIACONTROLCALLSTATE const lpCallStateList,
DWORD dwCallStateNumEntries)
{
1212
    FIXME(": stub.\n");
1213 1214 1215
    return 0;
}

1216 1217 1218
/***********************************************************************
 *		lineSetMediaMode (TAPI32.@)
 */
1219 1220
DWORD WINAPI lineSetMediaMode(HCALL hCall, DWORD dwMediaModes)
{
1221
    FIXME("(%p, %08x): stub.\n", hCall, dwMediaModes);
1222
    return 0;
1223
}
1224

1225 1226 1227
/***********************************************************************
 *		lineSetNumRings (TAPI32.@)
 */
1228 1229
DWORD WINAPI lineSetNumRings(HLINE hLine, DWORD dwAddressID, DWORD dwNumRings)
{
1230
    FIXME("(%p, %08x, %08x): stub.\n", hLine, dwAddressID, dwNumRings);
1231
    return 0;
1232 1233
}

1234 1235 1236
/***********************************************************************
 *		lineSetStatusMessages (TAPI32.@)
 */
1237 1238
DWORD WINAPI lineSetStatusMessages(HLINE hLine, DWORD dwLineStates, DWORD dwAddressStates)
{
1239
    FIXME("(%p, %08x, %08x): stub.\n", hLine, dwLineStates, dwAddressStates);
1240
    return 0;
1241 1242
}

1243 1244 1245
/***********************************************************************
 *		lineSetTerminal (TAPI32.@)
 */
1246 1247
DWORD WINAPI lineSetTerminal(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD dwSelect, DWORD dwTerminalModes, DWORD dwTerminalID, DWORD bEnable)
{
1248
    FIXME("(%p, %08x, %p, %08x, %08x, %08x, %08x): stub.\n", hLine, dwAddressID, hCall, dwSelect, dwTerminalModes, dwTerminalID, bEnable);
1249
    return 1;
1250
}
1251

1252 1253 1254
/***********************************************************************
 *		lineSetTollList (TAPI32.@)
 */
1255
DWORD WINAPI lineSetTollListA(HLINEAPP hLineApp, DWORD dwDeviceID, LPCSTR lpszAddressIn, DWORD dwTollListOption)
1256
{
1257
    FIXME("(%p, %08x, %s, %08x): stub.\n", hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption);
1258
    return 0;
1259 1260
}

1261 1262 1263
/***********************************************************************
 *		lineSetupConference (TAPI32.@)
 */
1264
DWORD WINAPI lineSetupConferenceA(HCALL hCall, HLINE hLine, LPHCALL lphConfCall, LPHCALL lphConsultCall, DWORD dwNumParties, LPLINECALLPARAMS lpCallParams)
1265
{
1266
    FIXME("(%p, %p, %p, %p, %08x, %p): stub.\n", hCall, hLine, lphConfCall, lphConsultCall, dwNumParties, lpCallParams);
1267 1268 1269
    return 1;
}

1270 1271 1272
/***********************************************************************
 *		lineSetupTransfer (TAPI32.@)
 */
1273
DWORD WINAPI lineSetupTransferA(HCALL hCall, LPHCALL lphConsultCall, LPLINECALLPARAMS lpCallParams)
1274
{
1275
    FIXME("(%p, %p, %p): stub.\n", hCall, lphConsultCall, lpCallParams);
1276
    return 1;
1277
}
1278

1279 1280 1281
/***********************************************************************
 *		lineShutdown (TAPI32.@)
 */
1282 1283
DWORD WINAPI lineShutdown(HLINEAPP hLineApp)
{
1284
    FIXME("(%p): stub.\n", hLineApp);
1285 1286 1287
    return 0;
}

1288 1289 1290
/***********************************************************************
 *		lineSwapHold (TAPI32.@)
 */
1291 1292
DWORD WINAPI lineSwapHold(HCALL hActiveCall, HCALL hHeldCall)
{
1293
    FIXME("(active: %p, held: %p): stub.\n", hActiveCall, hHeldCall);
1294 1295 1296
    return 1;
}

1297 1298 1299
/***********************************************************************
 *		lineTranslateAddress (TAPI32.@)
 */
1300
DWORD WINAPI lineTranslateAddressA(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, LPCSTR lpszAddressIn, DWORD dwCard, DWORD dwTranslateOptions, LPLINETRANSLATEOUTPUT lpTranslateOutput)
1301
{
1302
    FIXME("(%p, %08x, %08x, %s, %08x, %08x, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, lpszAddressIn, dwCard, dwTranslateOptions, lpTranslateOutput);
1303 1304 1305
    return 0;
}

1306 1307 1308
/***********************************************************************
 *		lineTranslateDialog (TAPI32.@)
 */
1309
DWORD WINAPI lineTranslateDialogA(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, HWND hwndOwner, LPCSTR lpszAddressIn)
1310
{
1311
    FIXME("(%p, %08x, %08x, %p, %s): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, hwndOwner, lpszAddressIn);
1312 1313 1314
    return 0;
}

1315 1316 1317
/***********************************************************************
 *		lineUncompleteCall (TAPI32.@)
 */
1318 1319
DWORD WINAPI lineUncompleteCall(HLINE hLine, DWORD dwCompletionID)
{
1320
    FIXME("(%p, %08x): stub.\n", hLine, dwCompletionID);
1321 1322 1323
    return 1;
}

1324 1325 1326
/***********************************************************************
 *		lineUnhold (TAPI32.@)
 */
1327
DWORD WINAPI lineUnhold(HCALL hCall)
1328
{
1329
    FIXME("(%p): stub.\n", hCall);
1330 1331 1332
    return 1;
}

1333 1334 1335
/***********************************************************************
 *		lineUnpark (TAPI32.@)
 */
1336
DWORD WINAPI lineUnparkA(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR lpszDestAddress)
1337
{
1338
    FIXME("(%p, %08x, %p, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress);
1339
    return 1;
1340
}