~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/tapi32/assisted.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * TAPI32 Assisted Telephony
  3  *
  4  * Copyright 1999  Andreas Mohr
  5  * Copyright 2011  André Hentschel
  6  *
  7  * This library is free software; you can redistribute it and/or
  8  * modify it under the terms of the GNU Lesser General Public
  9  * License as published by the Free Software Foundation; either
 10  * version 2.1 of the License, or (at your option) any later version.
 11  *
 12  * This library is distributed in the hope that it will be useful,
 13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15  * Lesser General Public License for more details.
 16  *
 17  * You should have received a copy of the GNU Lesser General Public
 18  * License along with this library; if not, write to the Free Software
 19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 20  */
 21 
 22 #include "config.h"
 23 #include "wine/port.h"
 24 
 25 #include <stdarg.h>
 26 #include <stdio.h>
 27 #include "windef.h"
 28 #include "winbase.h"
 29 #include "wingdi.h"
 30 #include "winreg.h"
 31 #include "objbase.h"
 32 #include "tapi.h"
 33 #include "wine/unicode.h"
 34 #include "wine/debug.h"
 35 
 36 WINE_DEFAULT_DEBUG_CHANNEL(tapi);
 37 
 38 /***********************************************************************
 39  *      tapiGetLocationInfoW (TAPI32.@)
 40  */
 41 DWORD WINAPI tapiGetLocationInfoW(LPWSTR countrycode, LPWSTR citycode)
 42 {
 43     HKEY hkey, hsubkey;
 44     DWORD currid;
 45     DWORD valsize;
 46     DWORD type;
 47     DWORD bufsize;
 48     BYTE buf[200];
 49     WCHAR szlockey[20];
 50 
 51     static const WCHAR currentidW[] = {'C','u','r','r','e','n','t','I','D',0};
 52     static const WCHAR locationW[]  = {'L','o','c','a','t','i','o','n','%','u',0};
 53     static const WCHAR areacodeW[]  = {'A','r','e','a','C','o','d','e',0};
 54     static const WCHAR countryW[]   = {'C','o','u','n','t','r','y',0};
 55     static const WCHAR fmtW[]       = {'%','u',0};
 56 
 57     static const WCHAR locations_keyW[] =
 58         {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
 59          'W','i','n','d','o','w','s','\\',
 60          'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
 61          'T','e','l','e','p','h','o','n','y','\\','L','o','c','a','t','i','o','n','s',0};
 62 
 63     if(!RegOpenKeyW(HKEY_LOCAL_MACHINE, locations_keyW, &hkey) != ERROR_SUCCESS) {
 64         valsize = sizeof( DWORD);
 65         if(!RegQueryValueExW(hkey, currentidW, 0, &type, (LPBYTE) &currid, &valsize) &&
 66            type == REG_DWORD) {
 67             /* find a subkey called Location1, Location2... */
 68             sprintfW( szlockey, locationW, currid);
 69             if( !RegOpenKeyW( hkey, szlockey, &hsubkey)) {
 70                 if( citycode) {
 71                     bufsize=sizeof(buf);
 72                     if( !RegQueryValueExW( hsubkey, areacodeW, 0, &type, buf, &bufsize) &&
 73                         type == REG_SZ) {
 74                         lstrcpynW( citycode, (WCHAR *) buf, 8);
 75                     } else 
 76                         citycode[0] = '\0';
 77                 }
 78                 if( countrycode) {
 79                     bufsize=sizeof(buf);
 80                     if( !RegQueryValueExW( hsubkey, countryW, 0, &type, buf, &bufsize) &&
 81                         type == REG_DWORD)
 82                         snprintfW( countrycode, 8, fmtW, *(LPDWORD) buf );
 83                     else
 84                         countrycode[0] = '\0';
 85                 }
 86                 TRACE("(%p \"%s\", %p \"%s\"): success.\n", countrycode, debugstr_w(countrycode),
 87                       citycode, debugstr_w(citycode));
 88                 RegCloseKey( hkey);
 89                 RegCloseKey( hsubkey);
 90                 return 0; /* SUCCESS */
 91             }
 92         }
 93         RegCloseKey( hkey);
 94     }
 95     WARN("(%p, %p): failed (no telephony registry entries?).\n", countrycode, citycode);
 96     return TAPIERR_REQUESTFAILED;
 97 }
 98 
 99 
100 /***********************************************************************
101  *      tapiGetLocationInfoA (TAPI32.@)
102  */
103 DWORD WINAPI tapiGetLocationInfoA(LPSTR countrycode, LPSTR citycode)
104 {
105     DWORD ret, len;
106     LPWSTR country, city;
107 
108     len = MultiByteToWideChar( CP_ACP, 0, countrycode, -1, NULL, 0 );
109     country = HeapAlloc( GetProcessHeap(), 0, len );
110     MultiByteToWideChar( CP_ACP, 0, countrycode, -1, country, len );
111 
112     len = MultiByteToWideChar( CP_ACP, 0, citycode, -1, NULL, 0 );
113     city = HeapAlloc( GetProcessHeap(), 0, len );
114     MultiByteToWideChar( CP_ACP, 0, citycode, -1, city, len );
115 
116     ret = tapiGetLocationInfoW(country, city);
117 
118     HeapFree( GetProcessHeap(), 0, city );
119     HeapFree( GetProcessHeap(), 0, country );
120     return ret;
121 }
122 
123 /***********************************************************************
124  *              tapiRequestMakeCall (TAPI32.@)
125  */
126 DWORD WINAPI tapiRequestMakeCallA(LPCSTR lpszDestAddress, LPCSTR lpszAppName,
127                                  LPCSTR lpszCalledParty, LPCSTR lpszComment)
128 {
129     FIXME("(%s, %s, %s, %s): stub.\n", lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment);
130     return 0;
131 }
132 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.