Author: pschweitzer
Date: Tue Aug 2 11:46:31 2016
New Revision: 72091
URL:
http://svn.reactos.org/svn/reactos?rev=72091&view=rev
Log:
[MPR]
Properly set local name in case of redirection for *A function calls.
Alreaedy sent upstream.
CORE-11757
Modified:
trunk/reactos/dll/win32/mpr/wnet.c
Modified: trunk/reactos/dll/win32/mpr/wnet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/wnet.c?rev=7…
==============================================================================
--- trunk/reactos/dll/win32/mpr/wnet.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mpr/wnet.c [iso-8859-1] Tue Aug 2 11:46:31 2016
@@ -1757,11 +1757,11 @@
void *accessname;
DWORD *buffer_size;
DWORD *result;
- DWORD (*pre_set_accessname)(struct use_connection_context*, void *);
- void (*set_accessname)(struct use_connection_context*, void *);
+ DWORD (*pre_set_accessname)(struct use_connection_context*, WCHAR *);
+ void (*set_accessname)(struct use_connection_context*, WCHAR *);
};
-static DWORD use_connection_pre_set_accessnameW(struct use_connection_context *ctxt, void
*local_name)
+static DWORD use_connection_pre_set_accessnameW(struct use_connection_context *ctxt,
WCHAR *local_name)
{
if (ctxt->accessname && ctxt->buffer_size &&
*ctxt->buffer_size)
{
@@ -1784,7 +1784,7 @@
return ERROR_SUCCESS;
}
-static void use_connection_set_accessnameW(struct use_connection_context *ctxt, void
*local_name)
+static void use_connection_set_accessnameW(struct use_connection_context *ctxt, WCHAR
*local_name)
{
WCHAR *accessname = ctxt->accessname;
if (local_name)
@@ -1959,14 +1959,14 @@
return wnet_use_connection(&ctxt);
}
-static DWORD use_connection_pre_set_accessnameA(struct use_connection_context *ctxt, void
*local_name)
+static DWORD use_connection_pre_set_accessnameA(struct use_connection_context *ctxt,
WCHAR *local_name)
{
if (ctxt->accessname && ctxt->buffer_size &&
*ctxt->buffer_size)
{
DWORD len;
if (local_name)
- len = strlen(local_name);
+ len = WideCharToMultiByte(CP_ACP, 0, local_name, -1, NULL, 0, NULL, NULL) -
1;
else
len = strlen(ctxt->resourceA->lpRemoteName);
@@ -1982,12 +1982,12 @@
return ERROR_SUCCESS;
}
-static void use_connection_set_accessnameA(struct use_connection_context *ctxt, void
*local_name)
+static void use_connection_set_accessnameA(struct use_connection_context *ctxt, WCHAR
*local_name)
{
char *accessname = ctxt->accessname;
if (local_name)
{
- strcpy(accessname, local_name);
+ WideCharToMultiByte(CP_ACP, 0, local_name, -1, accessname, *ctxt->buffer_size,
NULL, NULL);
if (ctxt->result)
*ctxt->result = CONNECT_LOCALDRIVE;
}