1999-03-14 13:34:25 +01:00
|
|
|
/*
|
|
|
|
* TAPI32 Assisted Telephony
|
|
|
|
*
|
|
|
|
* Copyright 1999 Andreas Mohr
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
1999-03-14 13:34:25 +01:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2004-04-13 00:05:17 +02:00
|
|
|
#include <stdio.h>
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "winbase.h"
|
2004-04-13 00:05:17 +02:00
|
|
|
#include "winreg.h"
|
1999-03-14 13:34:25 +01:00
|
|
|
#include "tapi.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1999-03-14 13:34:25 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(tapi);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2000-03-24 21:46:04 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* tapiGetLocationInfo (TAPI32.@)
|
|
|
|
*/
|
2004-10-14 02:28:29 +02:00
|
|
|
DWORD WINAPI tapiGetLocationInfoA(LPSTR lpszCountryCode, LPSTR lpszCityCode)
|
1999-03-14 13:34:25 +01:00
|
|
|
{
|
2004-04-13 00:05:17 +02:00
|
|
|
HKEY hkey, hsubkey;
|
|
|
|
DWORD currid;
|
|
|
|
DWORD valsize;
|
|
|
|
DWORD type;
|
|
|
|
DWORD bufsize;
|
|
|
|
BYTE buf[100];
|
|
|
|
char szlockey[20];
|
|
|
|
if(!RegOpenKeyA(HKEY_LOCAL_MACHINE,
|
|
|
|
"Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Locations",
|
|
|
|
&hkey) != ERROR_SUCCESS) {
|
|
|
|
valsize = sizeof( DWORD);
|
|
|
|
if(!RegQueryValueExA(hkey, "CurrentID", 0, &type, (LPBYTE) &currid,
|
|
|
|
&valsize) && type == REG_DWORD) {
|
|
|
|
/* find a subkey called Location1, Location2... */
|
|
|
|
sprintf( szlockey, "Location%lu", currid);
|
|
|
|
if( !RegOpenKeyA( hkey, szlockey, &hsubkey)) {
|
|
|
|
if( lpszCityCode) {
|
|
|
|
bufsize=sizeof(buf);
|
|
|
|
if( !RegQueryValueExA( hsubkey, "AreaCode", 0, &type, buf,
|
|
|
|
&bufsize) && type == REG_SZ) {
|
2005-03-28 16:17:51 +02:00
|
|
|
lstrcpynA( lpszCityCode, (char *) buf, 8);
|
2004-04-13 00:05:17 +02:00
|
|
|
} else
|
|
|
|
lpszCityCode[0] = '\0';
|
|
|
|
}
|
|
|
|
if( lpszCountryCode) {
|
|
|
|
bufsize=sizeof(buf);
|
|
|
|
if( !RegQueryValueExA( hsubkey, "Country", 0, &type, buf,
|
|
|
|
&bufsize) && type == REG_DWORD)
|
|
|
|
snprintf( lpszCountryCode, 8, "%lu", *(LPDWORD) buf );
|
|
|
|
else
|
|
|
|
lpszCountryCode[0] = '\0';
|
|
|
|
}
|
|
|
|
TRACE("(%p \"%s\", %p \"%s\"): success.\n",
|
|
|
|
lpszCountryCode, debugstr_a(lpszCountryCode),
|
|
|
|
lpszCityCode, debugstr_a(lpszCityCode));
|
|
|
|
RegCloseKey( hkey);
|
|
|
|
RegCloseKey( hsubkey);
|
|
|
|
return 0; /* SUCCESS */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RegCloseKey( hkey);
|
|
|
|
}
|
|
|
|
WARN("(%p, %p): failed (no telephony registry entries?).\n",
|
|
|
|
lpszCountryCode, lpszCityCode);
|
|
|
|
return TAPIERR_REQUESTFAILED;
|
1999-03-14 13:34:25 +01:00
|
|
|
}
|
|
|
|
|
2000-03-24 21:46:04 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* tapiRequestMakeCall (TAPI32.@)
|
|
|
|
*/
|
2004-10-14 02:28:29 +02:00
|
|
|
DWORD WINAPI tapiRequestMakeCallA(LPCSTR lpszDestAddress, LPCSTR lpszAppName,
|
1999-03-14 13:34:25 +01:00
|
|
|
LPCSTR lpszCalledParty, LPCSTR lpszComment)
|
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
FIXME("(%s, %s, %s, %s): stub.\n", lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment);
|
1999-03-14 13:34:25 +01:00
|
|
|
return 0;
|
|
|
|
}
|