Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
b4c3fcd1
Commit
b4c3fcd1
authored
Nov 13, 2011
by
André Hentschel
Committed by
Alexandre Julliard
Nov 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tapi32: Implement tapiGetLocationInfoW.
parent
2e5718ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
26 deletions
+62
-26
assisted.c
dlls/tapi32/assisted.c
+61
-26
tapi32.spec
dlls/tapi32/tapi32.spec
+1
-0
No files found.
dlls/tapi32/assisted.c
View file @
b4c3fcd1
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
* TAPI32 Assisted Telephony
* TAPI32 Assisted Telephony
*
*
* Copyright 1999 Andreas Mohr
* Copyright 1999 Andreas Mohr
* Copyright 2011 André Hentschel
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -29,50 +30,61 @@
...
@@ -29,50 +30,61 @@
#include "winreg.h"
#include "winreg.h"
#include "objbase.h"
#include "objbase.h"
#include "tapi.h"
#include "tapi.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
tapi
);
WINE_DEFAULT_DEBUG_CHANNEL
(
tapi
);
/***********************************************************************
/***********************************************************************
*
tapiGetLocationInfo
(TAPI32.@)
*
tapiGetLocationInfoW
(TAPI32.@)
*/
*/
DWORD
WINAPI
tapiGetLocationInfo
A
(
LPSTR
lpszCountryCode
,
LPSTR
lpszCityC
ode
)
DWORD
WINAPI
tapiGetLocationInfo
W
(
LPWSTR
countrycode
,
LPWSTR
cityc
ode
)
{
{
HKEY
hkey
,
hsubkey
;
HKEY
hkey
,
hsubkey
;
DWORD
currid
;
DWORD
currid
;
DWORD
valsize
;
DWORD
valsize
;
DWORD
type
;
DWORD
type
;
DWORD
bufsize
;
DWORD
bufsize
;
BYTE
buf
[
100
];
BYTE
buf
[
200
];
char
szlockey
[
20
];
WCHAR
szlockey
[
20
];
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Telephony
\\
Locations"
,
static
const
WCHAR
currentidW
[]
=
{
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'I'
,
'D'
,
0
};
&
hkey
)
!=
ERROR_SUCCESS
)
{
static
const
WCHAR
locationW
[]
=
{
'L'
,
'o'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'%'
,
'u'
,
0
};
static
const
WCHAR
areacodeW
[]
=
{
'A'
,
'r'
,
'e'
,
'a'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
countryW
[]
=
{
'C'
,
'o'
,
'u'
,
'n'
,
't'
,
'r'
,
'y'
,
0
};
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'u'
,
0
};
static
const
WCHAR
locations_keyW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'T'
,
'e'
,
'l'
,
'e'
,
'p'
,
'h'
,
'o'
,
'n'
,
'y'
,
'\\'
,
'L'
,
'o'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
's'
,
0
};
if
(
!
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
locations_keyW
,
&
hkey
)
!=
ERROR_SUCCESS
)
{
valsize
=
sizeof
(
DWORD
);
valsize
=
sizeof
(
DWORD
);
if
(
!
RegQueryValueEx
A
(
hkey
,
"CurrentID"
,
0
,
&
type
,
(
LPBYTE
)
&
currid
,
if
(
!
RegQueryValueEx
W
(
hkey
,
currentidW
,
0
,
&
type
,
(
LPBYTE
)
&
currid
,
&
valsize
)
&&
&
valsize
)
&&
type
==
REG_DWORD
)
{
type
==
REG_DWORD
)
{
/* find a subkey called Location1, Location2... */
/* find a subkey called Location1, Location2... */
sprintf
(
szlockey
,
"Location%u"
,
currid
);
sprintf
W
(
szlockey
,
locationW
,
currid
);
if
(
!
RegOpenKey
A
(
hkey
,
szlockey
,
&
hsubkey
))
{
if
(
!
RegOpenKey
W
(
hkey
,
szlockey
,
&
hsubkey
))
{
if
(
lpszCityC
ode
)
{
if
(
cityc
ode
)
{
bufsize
=
sizeof
(
buf
);
bufsize
=
sizeof
(
buf
);
if
(
!
RegQueryValueEx
A
(
hsubkey
,
"AreaCode"
,
0
,
&
type
,
buf
,
if
(
!
RegQueryValueEx
W
(
hsubkey
,
areacodeW
,
0
,
&
type
,
buf
,
&
bufsize
)
&&
&
bufsize
)
&&
type
==
REG_SZ
)
{
type
==
REG_SZ
)
{
lstrcpynA
(
lpszCityCode
,
(
char
*
)
buf
,
8
);
lstrcpynW
(
citycode
,
(
WCHAR
*
)
buf
,
8
);
}
else
}
else
lpszCityC
ode
[
0
]
=
'\0'
;
cityc
ode
[
0
]
=
'\0'
;
}
}
if
(
lpszCountryC
ode
)
{
if
(
countryc
ode
)
{
bufsize
=
sizeof
(
buf
);
bufsize
=
sizeof
(
buf
);
if
(
!
RegQueryValueEx
A
(
hsubkey
,
"Country"
,
0
,
&
type
,
buf
,
if
(
!
RegQueryValueEx
W
(
hsubkey
,
countryW
,
0
,
&
type
,
buf
,
&
bufsize
)
&&
&
bufsize
)
&&
type
==
REG_DWORD
)
type
==
REG_DWORD
)
snprintf
(
lpszCountryCode
,
8
,
"%u"
,
*
(
LPDWORD
)
buf
);
snprintf
W
(
countrycode
,
8
,
fmtW
,
*
(
LPDWORD
)
buf
);
else
else
lpszCountryC
ode
[
0
]
=
'\0'
;
countryc
ode
[
0
]
=
'\0'
;
}
}
TRACE
(
"(%p
\"
%s
\"
, %p
\"
%s
\"
): success.
\n
"
,
TRACE
(
"(%p
\"
%s
\"
, %p
\"
%s
\"
): success.
\n
"
,
countrycode
,
debugstr_w
(
countrycode
),
lpszCountryCode
,
debugstr_a
(
lpszCountryCode
),
citycode
,
debugstr_w
(
citycode
));
lpszCityCode
,
debugstr_a
(
lpszCityCode
));
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hsubkey
);
RegCloseKey
(
hsubkey
);
return
0
;
/* SUCCESS */
return
0
;
/* SUCCESS */
...
@@ -80,11 +92,34 @@ DWORD WINAPI tapiGetLocationInfoA(LPSTR lpszCountryCode, LPSTR lpszCityCode)
...
@@ -80,11 +92,34 @@ DWORD WINAPI tapiGetLocationInfoA(LPSTR lpszCountryCode, LPSTR lpszCityCode)
}
}
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
}
}
WARN
(
"(%p, %p): failed (no telephony registry entries?).
\n
"
,
WARN
(
"(%p, %p): failed (no telephony registry entries?).
\n
"
,
countrycode
,
citycode
);
lpszCountryCode
,
lpszCityCode
);
return
TAPIERR_REQUESTFAILED
;
return
TAPIERR_REQUESTFAILED
;
}
}
/***********************************************************************
* tapiGetLocationInfoA (TAPI32.@)
*/
DWORD
WINAPI
tapiGetLocationInfoA
(
LPSTR
countrycode
,
LPSTR
citycode
)
{
DWORD
ret
,
len
;
LPWSTR
country
,
city
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
countrycode
,
-
1
,
NULL
,
0
);
country
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
countrycode
,
-
1
,
country
,
len
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
citycode
,
-
1
,
NULL
,
0
);
city
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
citycode
,
-
1
,
city
,
len
);
ret
=
tapiGetLocationInfoW
(
country
,
city
);
HeapFree
(
GetProcessHeap
(),
0
,
city
);
HeapFree
(
GetProcessHeap
(),
0
,
country
);
return
ret
;
}
/***********************************************************************
/***********************************************************************
* tapiRequestMakeCall (TAPI32.@)
* tapiRequestMakeCall (TAPI32.@)
*/
*/
...
...
dlls/tapi32/tapi32.spec
View file @
b4c3fcd1
...
@@ -160,6 +160,7 @@
...
@@ -160,6 +160,7 @@
@ stdcall phoneShutdown(long)
@ stdcall phoneShutdown(long)
@ stdcall tapiGetLocationInfo(str str) tapiGetLocationInfoA
@ stdcall tapiGetLocationInfo(str str) tapiGetLocationInfoA
@ stdcall tapiGetLocationInfoA(str str)
@ stdcall tapiGetLocationInfoA(str str)
@ stdcall tapiGetLocationInfoW(wstr wstr)
@ stub tapiRequestDrop
@ stub tapiRequestDrop
@ stdcall tapiRequestMakeCall(str str str str) tapiRequestMakeCallA
@ stdcall tapiRequestMakeCall(str str str str) tapiRequestMakeCallA
@ stdcall tapiRequestMakeCallA(str str str str)
@ stdcall tapiRequestMakeCallA(str str str str)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment