mshtml: Use popup menu from shdoclc.dll.
[wine/multimedia.git] / dlls / tapi32 / assisted.c
blob66ccf5e8c4b48e0918045ce0d76c3fc6f66b0ef6
1 /*
2 * TAPI32 Assisted Telephony
4 * Copyright 1999 Andreas Mohr
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winreg.h"
26 #include "tapi.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(tapi);
31 /***********************************************************************
32 * tapiGetLocationInfo (TAPI32.@)
34 DWORD WINAPI tapiGetLocationInfoA(LPSTR lpszCountryCode, LPSTR lpszCityCode)
36 HKEY hkey, hsubkey;
37 DWORD currid;
38 DWORD valsize;
39 DWORD type;
40 DWORD bufsize;
41 BYTE buf[100];
42 char szlockey[20];
43 if(!RegOpenKeyA(HKEY_LOCAL_MACHINE,
44 "Software\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Locations",
45 &hkey) != ERROR_SUCCESS) {
46 valsize = sizeof( DWORD);
47 if(!RegQueryValueExA(hkey, "CurrentID", 0, &type, (LPBYTE) &currid,
48 &valsize) && type == REG_DWORD) {
49 /* find a subkey called Location1, Location2... */
50 sprintf( szlockey, "Location%u", currid);
51 if( !RegOpenKeyA( hkey, szlockey, &hsubkey)) {
52 if( lpszCityCode) {
53 bufsize=sizeof(buf);
54 if( !RegQueryValueExA( hsubkey, "AreaCode", 0, &type, buf,
55 &bufsize) && type == REG_SZ) {
56 lstrcpynA( lpszCityCode, (char *) buf, 8);
57 } else
58 lpszCityCode[0] = '\0';
60 if( lpszCountryCode) {
61 bufsize=sizeof(buf);
62 if( !RegQueryValueExA( hsubkey, "Country", 0, &type, buf,
63 &bufsize) && type == REG_DWORD)
64 snprintf( lpszCountryCode, 8, "%u", *(LPDWORD) buf );
65 else
66 lpszCountryCode[0] = '\0';
68 TRACE("(%p \"%s\", %p \"%s\"): success.\n",
69 lpszCountryCode, debugstr_a(lpszCountryCode),
70 lpszCityCode, debugstr_a(lpszCityCode));
71 RegCloseKey( hkey);
72 RegCloseKey( hsubkey);
73 return 0; /* SUCCESS */
76 RegCloseKey( hkey);
78 WARN("(%p, %p): failed (no telephony registry entries?).\n",
79 lpszCountryCode, lpszCityCode);
80 return TAPIERR_REQUESTFAILED;
83 /***********************************************************************
84 * tapiRequestMakeCall (TAPI32.@)
86 DWORD WINAPI tapiRequestMakeCallA(LPCSTR lpszDestAddress, LPCSTR lpszAppName,
87 LPCSTR lpszCalledParty, LPCSTR lpszComment)
89 FIXME("(%s, %s, %s, %s): stub.\n", lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment);
90 return 0;