[TAPI32] Sync with Wine Staging 4.18. CORE-16441
[reactos.git] / dll / win32 / tapi32 / assisted.c
index 960081e..3ae4c7c 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winreg.h"
+#include "objbase.h"
+#include "tapi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(tapi);
 
 /***********************************************************************
  *      tapiGetLocationInfoW (TAPI32.@)
@@ -46,12 +56,12 @@ DWORD WINAPI tapiGetLocationInfoW(LPWSTR countrycode, LPWSTR citycode)
          '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) {
+    if(RegOpenKeyW(HKEY_LOCAL_MACHINE, locations_keyW, &hkey) == ERROR_SUCCESS) {
         valsize = sizeof( DWORD);
         if(!RegQueryValueExW(hkey, currentidW, 0, &type, (LPBYTE) &currid, &valsize) &&
            type == REG_DWORD) {
             /* find a subkey called Location1, Location2... */
-            sprintfW( szlockey, locationW, currid);
+            swprintf( szlockey, locationW, currid);
             if( !RegOpenKeyW( hkey, szlockey, &hsubkey)) {
                 if( citycode) {
                     bufsize=sizeof(buf);
@@ -65,7 +75,7 @@ DWORD WINAPI tapiGetLocationInfoW(LPWSTR countrycode, LPWSTR citycode)
                     bufsize=sizeof(buf);
                     if( !RegQueryValueExW( hsubkey, countryW, 0, &type, buf, &bufsize) &&
                         type == REG_DWORD)
-                        snprintfW( countrycode, 8, fmtW, *(LPDWORD) buf );
+                        swprintf( countrycode, fmtW, *(LPDWORD) buf );
                     else
                         countrycode[0] = '\0';
                 }