110528.diff (1,811 bytes)
Index: network.cpp
===================================================================
--- network.cpp (revision 6300)
+++ network.cpp (working copy)
@@ -115,7 +115,7 @@
netResource.lpLocalName = (wchar_t *)NewDir;
netResource.lpRemoteName = (wchar_t *)strRemoteName.CPtr();
netResource.lpProvider = 0;
- DWORD res = WNetAddConnection2(&netResource, 0, strUserName, 0);
+ DWORD res = strUserName.IsEmpty() ? ERROR_SESSION_CREDENTIAL_CONFLICT : WNetAddConnection2(&netResource, 0, strUserName, 0);
if (res == ERROR_SESSION_CREDENTIAL_CONFLICT)
res = WNetAddConnection2(&netResource, 0, 0, 0);
Index: stddlg.cpp
===================================================================
--- stddlg.cpp (revision 6300)
+++ stddlg.cpp (working copy)
@@ -601,6 +601,7 @@
int WINAPI GetNameAndPassword(const wchar_t *Title, string &strUserName, string &strPassword,const wchar_t *HelpTopic,DWORD Flags)
{
static string strLastName, strLastPassword;
+ const wchar_t *HistoryName=L"NetworkUser";
int ExitCode;
/*
0 1 2 3 4 5 6 7
@@ -620,7 +621,7 @@
{
{DI_DOUBLEBOX, 3, 1,72, 8,0,nullptr,nullptr,0,NullToEmpty(Title)},
{DI_TEXT, 5, 2, 0, 2,0,nullptr,nullptr,0,MSG(MNetUserName)},
- {DI_EDIT, 5, 3,70, 3,0,nullptr,nullptr,DIF_FOCUS|DIF_USELASTHISTORY|DIF_HISTORY,(Flags&GNP_USELAST)?strLastName:strUserName},
+ {DI_EDIT, 5, 3,70, 3,0,HistoryName,nullptr,DIF_FOCUS|DIF_USELASTHISTORY|DIF_HISTORY,(Flags&GNP_USELAST)?strLastName:strUserName},
{DI_TEXT, 5, 4, 0, 4,0,nullptr,nullptr,0,MSG(MNetUserPassword)},
{DI_PSWEDIT, 5, 5,70, 5,0,nullptr,nullptr,0,(Flags&GNP_USELAST)?strLastPassword:strPassword},
{DI_TEXT, 3, 6, 0, 6,0,nullptr,nullptr,DIF_SEPARATOR,L""},