mpr: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-11 08:29:30 +02:00
parent c1a01fd399
commit 1e117a5682
3 changed files with 27 additions and 29 deletions

View File

@ -2,6 +2,8 @@ MODULE = mpr.dll
IMPORTLIB = mpr
IMPORTS = user32 advapi32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
auth.c \
mpr_main.c \

View File

@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
@ -32,7 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
#include "wine/unicode.h"
#include "mprres.h"

View File

@ -33,7 +33,6 @@
#define WINE_MOUNTMGR_EXTENSIONS
#include "ddk/mountmgr.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "mprres.h"
#include "wnetpriv.h"
@ -136,7 +135,7 @@ static void _tryLoadProvider(PCWSTR provider)
HKEY hKey;
TRACE("%s\n", debugstr_w(provider));
snprintfW(serviceName, ARRAY_SIZE(serviceName), serviceFmt, servicePrefix, provider);
swprintf(serviceName, ARRAY_SIZE(serviceName), serviceFmt, servicePrefix, provider);
serviceName[ARRAY_SIZE(serviceName) - 1] = '\0';
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, serviceName, 0, KEY_READ, &hKey) ==
ERROR_SUCCESS)
@ -297,7 +296,7 @@ void wnetInit(HINSTANCE hInstDll)
* allocate space for */
for (ptr = providers, numToAllocate = 1; ptr; )
{
ptr = strchrW(ptr, ',');
ptr = wcschr(ptr, ',');
if (ptr) {
numToAllocate++;
ptr++;
@ -327,7 +326,7 @@ void wnetInit(HINSTANCE hInstDll)
for (ptr = providers; ptr; )
{
ptrPrev = ptr;
ptr = strchrW(ptr, ',');
ptr = wcschr(ptr, ',');
if (ptr)
*ptr++ = '\0';
_tryLoadProvider(ptrPrev);
@ -368,7 +367,7 @@ static DWORD _findProviderIndexW(LPCWSTR lpProvider)
for (i = 0; i < providerTable->numProviders &&
ret == BAD_PROVIDER_INDEX; i++)
if (!strcmpW(lpProvider, providerTable->table[i].name))
if (!lstrcmpW(lpProvider, providerTable->table[i].name))
ret = i;
}
return ret;
@ -393,10 +392,10 @@ static LPNETRESOURCEW _copyNetResourceForEnumW(LPNETRESOURCEW lpNet)
ret->lpLocalName = ret->lpComment = ret->lpProvider = NULL;
if (lpNet->lpRemoteName)
{
len = strlenW(lpNet->lpRemoteName) + 1;
len = lstrlenW(lpNet->lpRemoteName) + 1;
ret->lpRemoteName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (ret->lpRemoteName)
strcpyW(ret->lpRemoteName, lpNet->lpRemoteName);
lstrcpyW(ret->lpRemoteName, lpNet->lpRemoteName);
}
}
}
@ -806,7 +805,7 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
PWSTR RemoteName = lpNet->lpRemoteName;
if ((lpNet->dwUsage & RESOURCEUSAGE_CONTAINER) &&
RemoteName && !strcmpW(RemoteName, lpNet->lpProvider))
RemoteName && !lstrcmpW(RemoteName, lpNet->lpProvider))
lpNet->lpRemoteName = NULL;
ret = providerTable->table[index].openEnum(
@ -835,7 +834,7 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
}
else
{
if (lpNet->lpComment && !strcmpW(lpNet->lpComment,
if (lpNet->lpComment && !lstrcmpW(lpNet->lpComment,
providerTable->entireNetwork))
{
/* comment matches the "Entire Network", enumerate
@ -960,7 +959,7 @@ static DWORD _countProviderBytesW(PWNetProvider provider)
if (provider)
{
ret = sizeof(NETRESOURCEW);
ret += 2 * (strlenW(provider->name) + 1) * sizeof(WCHAR);
ret += 2 * (lstrlenW(provider->name) + 1) * sizeof(WCHAR);
}
else
ret = 0;
@ -1017,14 +1016,14 @@ static DWORD _enumerateProvidersW(PWNetEnumerator enumerator, LPDWORD lpcCount,
RESOURCEUSAGE_RESERVED;
resource->lpLocalName = NULL;
resource->lpRemoteName = strNext;
strcpyW(resource->lpRemoteName,
lstrcpyW(resource->lpRemoteName,
providerTable->table[i + enumerator->providerIndex].name);
strNext += strlenW(resource->lpRemoteName) + 1;
strNext += lstrlenW(resource->lpRemoteName) + 1;
resource->lpComment = NULL;
resource->lpProvider = strNext;
strcpyW(resource->lpProvider,
lstrcpyW(resource->lpProvider,
providerTable->table[i + enumerator->providerIndex].name);
strNext += strlenW(resource->lpProvider) + 1;
strNext += lstrlenW(resource->lpProvider) + 1;
}
enumerator->providerIndex += count;
*lpcCount = count;
@ -1211,7 +1210,7 @@ static DWORD _enumerateContextW(PWNetEnumerator enumerator, LPDWORD lpcCount,
if (!providerTable)
return WN_NO_NETWORK;
cchEntireNetworkLen = strlenW(providerTable->entireNetwork) + 1;
cchEntireNetworkLen = lstrlenW(providerTable->entireNetwork) + 1;
bytesNeeded = sizeof(NETRESOURCEW) + cchEntireNetworkLen * sizeof(WCHAR);
if (*lpBufferSize < bytesNeeded)
{
@ -1234,7 +1233,7 @@ static DWORD _enumerateContextW(PWNetEnumerator enumerator, LPDWORD lpcCount,
*/
lpNet->lpComment = (LPWSTR)((LPBYTE)lpBuffer + *lpBufferSize -
(cchEntireNetworkLen * sizeof(WCHAR)));
strcpyW(lpNet->lpComment, providerTable->entireNetwork);
lstrcpyW(lpNet->lpComment, providerTable->entireNetwork);
ret = WN_SUCCESS;
}
if (ret == WN_SUCCESS)
@ -1274,7 +1273,7 @@ static DWORD _copyStringToEnumW(const WCHAR *source, DWORD* left, void** end)
DWORD len;
WCHAR* local = *end;
len = strlenW(source) + 1;
len = lstrlenW(source) + 1;
len *= sizeof(WCHAR);
if (*left < len)
return WN_MORE_DATA;
@ -1949,9 +1948,9 @@ static DWORD use_connection_pre_set_accessnameW(struct use_connection_context *c
DWORD len;
if (local_name)
len = strlenW(local_name);
len = lstrlenW(local_name);
else
len = strlenW(ctxt->resource->lpRemoteName);
len = lstrlenW(ctxt->resource->lpRemoteName);
if (++len > *ctxt->buffer_size)
{
@ -1970,12 +1969,12 @@ static void use_connection_set_accessnameW(struct use_connection_context *ctxt,
WCHAR *accessname = ctxt->accessname;
if (local_name)
{
strcpyW(accessname, local_name);
lstrcpyW(accessname, local_name);
if (ctxt->result)
*ctxt->result = CONNECT_LOCALDRIVE;
}
else
strcpyW(accessname, ctxt->resource->lpRemoteName);
lstrcpyW(accessname, ctxt->resource->lpRemoteName);
}
static DWORD wnet_use_provider( struct use_connection_context *ctxt, NETRESOURCEW * netres, WNetProvider *provider, BOOLEAN redirect )
@ -2082,13 +2081,13 @@ static DWORD wnet_use_connection( struct use_connection_context *ctxt )
KEY_ALL_ACCESS, NULL, &network, NULL) == ERROR_SUCCESS)
{
DWORD dword_arg = RESOURCETYPE_DISK;
DWORD len = (strlenW(provider->name) + 1) * sizeof(WCHAR);
DWORD len = (lstrlenW(provider->name) + 1) * sizeof(WCHAR);
static const WCHAR empty[1] = {0};
RegSetValueExW(network, connectionType, 0, REG_DWORD, (const BYTE *)&dword_arg, sizeof(DWORD));
RegSetValueExW(network, providerName, 0, REG_SZ, (const BYTE *)provider->name, len);
RegSetValueExW(network, providerType, 0, REG_DWORD, (const BYTE *)&provider->dwNetType, sizeof(DWORD));
len = (strlenW(netres.lpRemoteName) + 1) * sizeof(WCHAR);
len = (lstrlenW(netres.lpRemoteName) + 1) * sizeof(WCHAR);
RegSetValueExW(network, remotePath, 0, REG_SZ, (const BYTE *)netres.lpRemoteName, len);
len = sizeof(empty);
RegSetValueExW(network, userName, 0, REG_SZ, (const BYTE *)empty, len);
@ -2296,7 +2295,7 @@ DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce
HKEY user_profile;
/* FIXME: Only remove it if that's a drive letter */
if (isalphaW(lpName[0]) && lpName[1] == ':' &&
if (iswalpha(lpName[0]) && lpName[1] == ':' &&
RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS)
{
WCHAR subkey[10] = {'N', 'e', 't', 'w', 'o', 'r', 'k', '\\', lpName[0], 0};
@ -3005,7 +3004,7 @@ DWORD WINAPI WNetGetProviderNameW( DWORD dwNetType,
;
if (i < providerTable->numProviders)
{
DWORD sizeNeeded = strlenW(providerTable->table[i].name) + 1;
DWORD sizeNeeded = lstrlenW(providerTable->table[i].name) + 1;
if (*lpBufferSize < sizeNeeded)
{
@ -3014,7 +3013,7 @@ DWORD WINAPI WNetGetProviderNameW( DWORD dwNetType,
}
else
{
strcpyW(lpProvider, providerTable->table[i].name);
lstrcpyW(lpProvider, providerTable->table[i].name);
ret = WN_SUCCESS;
/* FIXME: is *lpBufferSize set to the number of characters
* copied? */