[PATCH 4/4] netapi32: Build with msvcrt.

Zebediah Figura z.figura12 at gmail.com
Mon Apr 12 22:35:43 CDT 2021


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/netapi32/Makefile.in   |  2 +
 dlls/netapi32/nbcmdqueue.c  |  2 +-
 dlls/netapi32/nbnamecache.c |  3 --
 dlls/netapi32/nbt.c         | 60 ++++++++------------------
 dlls/netapi32/netapi32.c    | 85 +++++++++++++++----------------------
 dlls/netapi32/netbios.c     |  2 +-
 6 files changed, 56 insertions(+), 98 deletions(-)

diff --git a/dlls/netapi32/Makefile.in b/dlls/netapi32/Makefile.in
index 70c5f117381..702cda0c036 100644
--- a/dlls/netapi32/Makefile.in
+++ b/dlls/netapi32/Makefile.in
@@ -3,6 +3,8 @@ MODULE    = netapi32.dll
 IMPORTLIB = netapi32
 IMPORTS   = rpcrt4 iphlpapi ws2_32 advapi32 dnsapi
 
+EXTRADLLFLAGS = -mno-cygwin
+
 C_SRCS = \
 	nbcmdqueue.c \
 	nbnamecache.c \
diff --git a/dlls/netapi32/nbcmdqueue.c b/dlls/netapi32/nbcmdqueue.c
index 720826d8cc8..df15c616261 100644
--- a/dlls/netapi32/nbcmdqueue.c
+++ b/dlls/netapi32/nbcmdqueue.c
@@ -14,7 +14,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-#include "config.h"
+
 #include "wine/debug.h"
 #include "nbcmdqueue.h"
 
diff --git a/dlls/netapi32/nbnamecache.c b/dlls/netapi32/nbnamecache.c
index 5f9b0b515cc..0ec9a9d5158 100644
--- a/dlls/netapi32/nbnamecache.c
+++ b/dlls/netapi32/nbnamecache.c
@@ -19,9 +19,6 @@
  * rather more efficient than not having a name cache at all.
  */
 
-#include "config.h"
-#include "wine/port.h"
-
 #include "nbnamecache.h"
 
 typedef struct _NBNameCacheNode
diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c
index 9c2a731a94c..947bfc91b94 100644
--- a/dlls/netapi32/nbt.c
+++ b/dlls/netapi32/nbt.c
@@ -65,7 +65,6 @@
  * See also other FIXMEs in the code.
  */
 
-#include "config.h"
 #include <stdarg.h>
 
 #include "winsock2.h"
@@ -1412,28 +1411,6 @@ static UCHAR NetBTEnum(void)
     return ret;
 }
 
-static const WCHAR VxD_MSTCPW[] = { 'S','Y','S','T','E','M','\\','C','u','r',
- 'r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','S','e','r','v',
- 'i','c','e','s','\\','V','x','D','\\','M','S','T','C','P','\0' };
-static const WCHAR NetBT_ParametersW[] = { 'S','Y','S','T','E','M','\\','C','u',
- 'r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','S','e','r',
- 'v','i','c','e','s','\\','N','e','t','B','T','\\','P','a','r','a','m','e','t',
- 'e','r','s','\0' };
-static const WCHAR EnableDNSW[] = { 'E','n','a','b','l','e','D','N','S','\0' };
-static const WCHAR BcastNameQueryCountW[] = { 'B','c','a','s','t','N','a','m',
- 'e','Q','u','e','r','y','C','o','u','n','t','\0' };
-static const WCHAR BcastNameQueryTimeoutW[] = { 'B','c','a','s','t','N','a','m',
- 'e','Q','u','e','r','y','T','i','m','e','o','u','t','\0' };
-static const WCHAR NameSrvQueryCountW[] = { 'N','a','m','e','S','r','v',
- 'Q','u','e','r','y','C','o','u','n','t','\0' };
-static const WCHAR NameSrvQueryTimeoutW[] = { 'N','a','m','e','S','r','v',
- 'Q','u','e','r','y','T','i','m','e','o','u','t','\0' };
-static const WCHAR ScopeIDW[] = { 'S','c','o','p','e','I','D','\0' };
-static const WCHAR CacheTimeoutW[] = { 'C','a','c','h','e','T','i','m','e','o',
- 'u','t','\0' };
-static const WCHAR Config_NetworkW[] = { 'S','o','f','t','w','a','r','e','\\',
-                                         'W','i','n','e','\\','N','e','t','w','o','r','k','\0' };
-
 /* Initializes global variables and registers the NetBT transport */
 void NetBTInit(void)
 {
@@ -1457,40 +1434,37 @@ void NetBTInit(void)
     gCacheTimeout = CACHE_TIMEOUT;
 
     /* Try to open the Win9x NetBT configuration key */
-    ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, VxD_MSTCPW, 0, KEY_READ, &hKey);
+    ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP",
+                         0, KEY_READ, &hKey );
     /* If that fails, try the WinNT NetBT configuration key */
     if (ret != ERROR_SUCCESS)
-        ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, NetBT_ParametersW, 0, KEY_READ,
-         &hKey);
+        ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters",
+                             0, KEY_READ, &hKey );
     if (ret == ERROR_SUCCESS)
     {
         DWORD dword, size;
 
         size = sizeof(dword);
-        if (RegQueryValueExW(hKey, EnableDNSW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS)
+        if (!RegQueryValueExW( hKey, L"EnableDNS", NULL, NULL, (BYTE *)&dword, &size ))
             gEnableDNS = dword;
         size = sizeof(dword);
-        if (RegQueryValueExW(hKey, BcastNameQueryCountW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERIES
-         && dword <= MAX_QUERIES)
+        if (!RegQueryValueExW( hKey, L"BcastNameQueryCount", NULL, NULL, (BYTE *)&dword, &size )
+                && dword >= MIN_QUERIES && dword <= MAX_QUERIES)
             gBCastQueries = dword;
         size = sizeof(dword);
-        if (RegQueryValueExW(hKey, BcastNameQueryTimeoutW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT)
+        if (!RegQueryValueExW( hKey, L"BcastNameQueryTimeout", NULL, NULL, (BYTE *)&dword, &size )
+                && dword >= MIN_QUERY_TIMEOUT)
             gBCastQueryTimeout = dword;
         size = sizeof(dword);
-        if (RegQueryValueExW(hKey, NameSrvQueryCountW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERIES
-         && dword <= MAX_QUERIES)
+        if (!RegQueryValueExW( hKey, L"NameSrvQueryCount", NULL, NULL, (BYTE *)&dword, &size )
+                    && dword >= MIN_QUERIES && dword <= MAX_QUERIES)
             gWINSQueries = dword;
         size = sizeof(dword);
-        if (RegQueryValueExW(hKey, NameSrvQueryTimeoutW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_QUERY_TIMEOUT)
+        if (!RegQueryValueExW( hKey, L"NameSrvQueryTimeout", NULL, NULL, (BYTE *)&dword, &size )
+                && dword >= MIN_QUERY_TIMEOUT)
             gWINSQueryTimeout = dword;
         size = sizeof(gScopeID) - 1;
-        if (RegQueryValueExW(hKey, ScopeIDW, NULL, NULL, (LPBYTE)gScopeID + 1, &size)
-         == ERROR_SUCCESS)
+        if (!RegQueryValueExW( hKey, L"ScopeID", NULL, NULL, (BYTE *)gScopeID + 1, &size ))
         {
             /* convert into L2-encoded version, suitable for use by
                NetBTNameEncode */
@@ -1509,8 +1483,8 @@ void NetBTInit(void)
                 }
             }
         }
-        if (RegQueryValueExW(hKey, CacheTimeoutW, NULL, NULL,
-         (LPBYTE)&dword, &size) == ERROR_SUCCESS && dword >= MIN_CACHE_TIMEOUT)
+        if (!RegQueryValueExW( hKey, L"CacheTimeout", NULL, NULL, (BYTE *)&dword, &size )
+                && dword >= MIN_CACHE_TIMEOUT)
             gCacheTimeout = dword;
         RegCloseKey(hKey);
     }
@@ -1519,7 +1493,7 @@ void NetBTInit(void)
      * same place.  Just do a global WINS configuration instead.
      */
     /* @@ Wine registry key: HKCU\Software\Wine\Network */
-    if (RegOpenKeyW(HKEY_CURRENT_USER, Config_NetworkW, &hKey) == ERROR_SUCCESS)
+    if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Network", &hKey ))
     {
         static const char *nsValueNames[] = { "WinsServer", "BackupWinsServer" };
         char nsString[16];
diff --git a/dlls/netapi32/netapi32.c b/dlls/netapi32/netapi32.c
index 44d23a602c7..7e27c20c891 100644
--- a/dlls/netapi32/netapi32.c
+++ b/dlls/netapi32/netapi32.c
@@ -21,15 +21,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
 #include <stdarg.h>
 
 #include "ntstatus.h"
 #define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
+#include "winternl.h"
 #include "winsock2.h"
 #include "ws2ipdef.h"
 #include "windns.h"
@@ -49,7 +47,6 @@
 #include "davclnt.h"
 #include "wine/debug.h"
 #include "wine/list.h"
-#include "wine/unicode.h"
 #include "initguid.h"
 
 #include "unixlib.h"
@@ -90,7 +87,7 @@ static BOOL NETAPI_IsLocalComputer( LMCSTR name )
 
     ret = GetComputerNameW( buf,  &size );
     if (ret && name[0] == '\\' && name[1] == '\\') name += 2;
-    return ret && !strcmpiW( name, buf );
+    return ret && !wcsicmp( name, buf );
 }
 
 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@@ -246,12 +243,6 @@ NET_API_STATUS WINAPI NetStatisticsGet(LMSTR server, LMSTR service,
                                        LPBYTE *bufptr)
 {
     int res;
-    static const WCHAR SERVICE_WORKSTATION[] = {
-                 'L', 'a', 'n', 'm', 'a', 'n',
-                 'W', 'o', 'r', 'k', 's', 't', 'a', 't', 'i', 'o', 'n', '\0'};
-    static const WCHAR SERVICE_SERVER[] = {
-                 'L', 'a', 'n', 'm', 'a', 'n',
-                 'S', 'e', 'r', 'v', 'e', 'r', '\0'};
     union
     {
         STAT_WORKSTATION_0 workst;
@@ -270,13 +261,13 @@ NET_API_STATUS WINAPI NetStatisticsGet(LMSTR server, LMSTR service,
     switch (level)
     {
         case 0:
-            if (!lstrcmpW(service, SERVICE_WORKSTATION))
+            if (!wcscmp( service, L"Lanman Workstation" ))
             {
                 /* Fill the struct STAT_WORKSTATION_0 properly */
                 memset(&stat->workst, 0, sizeof(stat->workst));
                 res = NERR_Success;
             }
-            else if (!lstrcmpW(service, SERVICE_SERVER))
+            else if (!wcscmp( service, L"Lanman Server" ))
             {
                 /* Fill the struct STAT_SERVER_0 properly */
                 memset(&stat->server, 0, sizeof(stat->server));
@@ -985,7 +976,7 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level,
         case 101:
         case 102:
         {
-            static const WCHAR lanroot[] = {'c',':','\\','l','a','n','m','a','n',0};  /* FIXME */
+            static const WCHAR lanroot[] = L"c:\\lanman";  /* FIXME */
             DWORD computerNameLen, domainNameLen, size;
             WCHAR computerName[MAX_COMPUTERNAME_LENGTH + 1];
             LSA_OBJECT_ATTRIBUTES ObjectAttributes;
@@ -1055,7 +1046,7 @@ NET_API_STATUS NET_API_FUNCTION NetGetJoinInformation(
     LPWSTR *Name,
     PNETSETUP_JOIN_STATUS type)
 {
-    static const WCHAR workgroupW[] = {'W','o','r','k','g','r','o','u','p',0};
+    static const WCHAR workgroupW[] = L"Workgroup";
 
     FIXME("Semi-stub %s %p %p\n", wine_dbgstr_w(Server), Name, type);
 
@@ -1371,7 +1362,6 @@ NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level,
 
     case 1:
       {
-        static const WCHAR homedirW[] = {'H','O','M','E',0};
         PUSER_INFO_1 ui;
         PUSER_INFO_0 ui0;
         /* sizes of the field buffers in WCHARS */
@@ -1389,7 +1379,7 @@ NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level,
             return status;
         }
         name_sz = lstrlenW(ui0->usri0_name) + 1;
-        home_dir_sz = GetEnvironmentVariableW(homedirW, NULL,0);
+        home_dir_sz = GetEnvironmentVariableW(L"HOME", NULL,0);
         /* set up buffer */
         NetApiBufferAllocate(sizeof(USER_INFO_1) +
                              (name_sz + password_sz + home_dir_sz +
@@ -1408,7 +1398,7 @@ NetUserGetInfo(LPCWSTR servername, LPCWSTR username, DWORD level,
         ui->usri1_password[0] = 0;
         ui->usri1_password_age = 0;
         ui->usri1_priv = 0;
-        GetEnvironmentVariableW(homedirW, ui->usri1_home_dir,home_dir_sz);
+        GetEnvironmentVariableW(L"HOME", ui->usri1_home_dir,home_dir_sz);
         ui->usri1_comment[0] = 0;
         ui->usri1_flags = 0;
         ui->usri1_script_path[0] = 0;
@@ -1459,7 +1449,7 @@ NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level,
                       DWORD flags, LPBYTE* bufptr, DWORD prefmaxlen,
                       LPDWORD entriesread, LPDWORD totalentries)
 {
-    static const WCHAR admins[] = {'A','d','m','i','n','i','s','t','r','a','t','o','r','s',0};
+    static const WCHAR admins[] = L"Administrators";
     NET_API_STATUS status;
     LPWSTR currentuser;
     LOCALGROUP_USERS_INFO_0* info;
@@ -1545,7 +1535,7 @@ NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
     {
         USER_INFO_0 *info;
 
-        size = sizeof(*info) + (strlenW(user) + 1) * sizeof(WCHAR);
+        size = sizeof(*info) + (wcslen(user) + 1) * sizeof(WCHAR);
 
         if (prefmaxlen < size)
             status = ERROR_MORE_DATA;
@@ -1556,7 +1546,7 @@ NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
             return status;
 
         info->usri0_name = (WCHAR *)((char *)info + sizeof(*info));
-        strcpyW(info->usri0_name, user);
+        wcscpy(info->usri0_name, user);
 
         *bufptr = (BYTE *)info;
         *entriesread = *totalentries = 1;
@@ -1570,7 +1560,7 @@ NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
         DWORD *rid;
         SID_NAME_USE use;
 
-        size = sizeof(*info) + (strlenW(user) + 1) * sizeof(WCHAR);
+        size = sizeof(*info) + (wcslen(user) + 1) * sizeof(WCHAR);
 
         if (prefmaxlen < size)
             status = ERROR_MORE_DATA;
@@ -1596,7 +1586,7 @@ NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
         rid = GetSidSubAuthority(sid, *count - 1);
 
         info->usri20_name      = (WCHAR *)((char *)info + sizeof(*info));
-        strcpyW(info->usri20_name, user);
+        wcscpy(info->usri20_name, user);
         info->usri20_full_name = NULL;
         info->usri20_comment   = NULL;
         info->usri20_flags     = UF_NORMAL_ACCOUNT;
@@ -1622,8 +1612,7 @@ NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
  */
 static void ACCESS_QueryAdminDisplayInformation(PNET_DISPLAY_USER *buf, PDWORD pdwSize)
 {
-    static const WCHAR sAdminUserName[] = {
-        'A','d','m','i','n','i','s','t','r','a','t','o','r',0};
+    static const WCHAR sAdminUserName[] = L"Administrator";
 
     /* sizes of the field buffers in WCHARS */
     int name_sz, comment_sz, full_name_sz;
@@ -1661,8 +1650,7 @@ static void ACCESS_QueryAdminDisplayInformation(PNET_DISPLAY_USER *buf, PDWORD p
  */
 static void ACCESS_QueryGuestDisplayInformation(PNET_DISPLAY_USER *buf, PDWORD pdwSize)
 {
-    static const WCHAR sGuestUserName[] = {
-        'G','u','e','s','t',0 };
+    static const WCHAR sGuestUserName[] = L"Guest";
 
     /* sizes of the field buffers in WCHARS */
     int name_sz, comment_sz, full_name_sz;
@@ -2105,13 +2093,12 @@ NET_API_STATUS WINAPI I_BrowserQueryEmulatedDomains(
 
 static DWORD get_dc_info(const WCHAR *domain, WCHAR *dc, WCHAR *ip)
 {
-    static const WCHAR pfx[] = {'_','l','d','a','p','.','_','t','c','p','.','d','c','.','_','m','s','d','c','s','.',0};
     WCHAR name[NS_MAXDNAME];
     DWORD ret, size;
     DNS_RECORDW *rec;
 
-    lstrcpyW(name, pfx);
-    lstrcatW(name, domain);
+    wcscpy( name, L"_ldap._tcp.dc._msdcs." );
+    wcscat( name, domain );
 
     ret = DnsQuery_W(name, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &rec, NULL);
     TRACE("DnsQuery_W(%s) => %d\n", wine_dbgstr_w(domain), ret);
@@ -2169,7 +2156,7 @@ DWORD WINAPI DsGetDcNameW(LPCWSTR computer, LPCWSTR domain, GUID *domain_guid,
                           LPCWSTR site, ULONG flags, PDOMAIN_CONTROLLER_INFOW *dc_info)
 {
     static const WCHAR pfxW[] = {'\\','\\'};
-    static const WCHAR default_site_nameW[] = {'D','e','f','a','u','l','t','-','F','i','r','s','t','-','S','i','t','e','-','N','a','m','e',0};
+    static const WCHAR default_site_nameW[] = L"Default-First-Site-Name";
     NTSTATUS status;
     POLICY_DNS_DOMAIN_INFO *dns_domain_info = NULL;
     DOMAIN_CONTROLLER_INFOW *info;
@@ -2217,12 +2204,12 @@ DWORD WINAPI DsGetDcNameW(LPCWSTR computer, LPCWSTR domain, GUID *domain_guid,
     info->DomainControllerName = (WCHAR *)(info + 1);
     memcpy(info->DomainControllerName, pfxW, sizeof(pfxW));
     lstrcpyW(info->DomainControllerName + 2, dc);
-    info->DomainControllerAddress = (WCHAR *)((char *)info->DomainControllerName + (strlenW(info->DomainControllerName) + 1) * sizeof(WCHAR));
+    info->DomainControllerAddress = (WCHAR *)((char *)info->DomainControllerName + (wcslen(info->DomainControllerName) + 1) * sizeof(WCHAR));
     memcpy(info->DomainControllerAddress, pfxW, sizeof(pfxW));
     lstrcpyW(info->DomainControllerAddress + 2, ip);
     info->DomainControllerAddressType = DS_INET_ADDRESS;
     info->DomainGuid = dns_domain_info ? dns_domain_info->DomainGuid : GUID_NULL /* FIXME */;
-    info->DomainName = (WCHAR *)((char *)info->DomainControllerAddress + (strlenW(info->DomainControllerAddress) + 1) * sizeof(WCHAR));
+    info->DomainName = (WCHAR *)((char *)info->DomainControllerAddress + (wcslen(info->DomainControllerAddress) + 1) * sizeof(WCHAR));
     lstrcpyW(info->DomainName, domain);
     info->DnsForestName = (WCHAR *)((char *)info->DomainName + (lstrlenW(info->DomainName) + 1) * sizeof(WCHAR));
     lstrcpyW(info->DnsForestName, domain);
@@ -2461,7 +2448,7 @@ NET_API_STATUS WINAPI NetLocalGroupGetInfo(
     DWORD level,
     LPBYTE* bufptr)
 {
-    static const WCHAR commentW[]={'N','o',' ','c','o','m','m','e','n','t',0};
+    static const WCHAR commentW[] = L"No comment";
     LOCALGROUP_INFO_1* info;
     DWORD size;
 
@@ -2571,10 +2558,8 @@ NET_API_STATUS WINAPI NetLocalGroupSetMembers(
  */
 DWORD WINAPI DavGetHTTPFromUNCPath(const WCHAR *unc_path, WCHAR *buf, DWORD *buflen)
 {
-    static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0};
-    static const WCHAR httpsW[] = {'h','t','t','p','s',':','/','/',0};
-    static const WCHAR sslW[] = {'S','S','L',0};
-    static const WCHAR fmtW[] = {':','%','u',0};
+    static const WCHAR httpW[] = L"http://";
+    static const WCHAR httpsW[] = L"https://";
     const WCHAR *p = unc_path, *q, *server, *path, *scheme = httpW;
     UINT i, len_server, len_path = 0, len_port = 0, len, port = 0;
     WCHAR *end, portbuf[12];
@@ -2590,17 +2575,17 @@ DWORD WINAPI DavGetHTTPFromUNCPath(const WCHAR *unc_path, WCHAR *buf, DWORD *buf
     {
         p = ++q;
         while (*p && (*p != '\\' && *p != '/' && *p != '@')) p++;
-        if (p - q == 3 && !strncmpiW( q, sslW, 3 ))
+        if (p - q == 3 && !wcsnicmp( q, L"SSL", 3 ))
         {
             scheme = httpsW;
             q = p;
         }
-        else if ((port = strtolW( q, &end, 10 ))) q = end;
+        else if ((port = wcstol( q, &end, 10 ))) q = end;
         else return ERROR_INVALID_PARAMETER;
     }
     if (*q == '@')
     {
-        if (!(port = strtolW( ++q, &end, 10 ))) return ERROR_INVALID_PARAMETER;
+        if (!(port = wcstol( ++q, &end, 10 ))) return ERROR_INVALID_PARAMETER;
         q = end;
     }
     if (*q == '\\' || *q  == '/') q++;
@@ -2609,16 +2594,16 @@ DWORD WINAPI DavGetHTTPFromUNCPath(const WCHAR *unc_path, WCHAR *buf, DWORD *buf
     if (len_path && (path[len_path - 1] == '\\' || path[len_path - 1] == '/'))
         len_path--; /* remove trailing slash */
 
-    sprintfW( portbuf, fmtW, port );
+    swprintf( portbuf, ARRAY_SIZE(portbuf), L":%u", port );
     if (scheme == httpsW)
     {
-        len = strlenW( httpsW );
-        if (port && port != 443) len_port = strlenW( portbuf );
+        len = wcslen( httpsW );
+        if (port && port != 443) len_port = wcslen( portbuf );
     }
     else
     {
-        len = strlenW( httpW );
-        if (port && port != 80) len_port = strlenW( portbuf );
+        len = wcslen( httpW );
+        if (port && port != 80) len_port = wcslen( portbuf );
     }
     len += len_server;
     len += len_port;
@@ -2631,8 +2616,8 @@ DWORD WINAPI DavGetHTTPFromUNCPath(const WCHAR *unc_path, WCHAR *buf, DWORD *buf
         return ERROR_INSUFFICIENT_BUFFER;
     }
 
-    memcpy( buf, scheme, strlenW(scheme) * sizeof(WCHAR) );
-    buf += strlenW( scheme );
+    memcpy( buf, scheme, wcslen(scheme) * sizeof(WCHAR) );
+    buf += wcslen( scheme );
     memcpy( buf, server, len_server * sizeof(WCHAR) );
     buf += len_server;
     if (len_port)
@@ -2673,8 +2658,8 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu
     TRACE("(%s %p %p)\n", debugstr_w(http_path), buf, buflen);
 
     while (*p && *p != ':') { p++; len++; };
-    if (len == ARRAY_SIZE(httpW) && !strncmpiW( http_path, httpW, len )) ssl = FALSE;
-    else if (len == ARRAY_SIZE(httpsW) && !strncmpiW( http_path, httpsW, len )) ssl = TRUE;
+    if (len == ARRAY_SIZE(httpW) && !wcsnicmp( http_path, httpW, len )) ssl = FALSE;
+    else if (len == ARRAY_SIZE(httpsW) && !wcsnicmp( http_path, httpsW, len )) ssl = TRUE;
     else return ERROR_INVALID_PARAMETER;
 
     if (p[0] != ':' || p[1] != '/' || p[2] != '/') return ERROR_INVALID_PARAMETER;
diff --git a/dlls/netapi32/netbios.c b/dlls/netapi32/netbios.c
index 0d2bb0e012d..83375f39f92 100644
--- a/dlls/netapi32/netbios.c
+++ b/dlls/netapi32/netbios.c
@@ -14,7 +14,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-#include "config.h"
+
 #include "wine/debug.h"
 #include "nbcmdqueue.h"
 #include "netbios.h"
-- 
2.30.2




More information about the wine-devel mailing list