mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:56:06 +00:00
[NET/USE]
In case an automatic drive letter assignment was asked (net use * REMOTE), print the mapping that was performed on success. ROSAPPS-303 svn path=/trunk/; revision=72098
This commit is contained in:
parent
7f771e6484
commit
cdc269d16b
1 changed files with 9 additions and 1 deletions
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
||||||
|
#define COUNT_OF(a) (sizeof(a) / sizeof(a[0]))
|
||||||
|
|
||||||
static
|
static
|
||||||
DWORD
|
DWORD
|
||||||
EnumerateConnections(LPCWSTR Local)
|
EnumerateConnections(LPCWSTR Local)
|
||||||
|
@ -130,6 +132,8 @@ cmdUse(
|
||||||
{
|
{
|
||||||
BOOL Persist = FALSE;
|
BOOL Persist = FALSE;
|
||||||
NETRESOURCE lpNet;
|
NETRESOURCE lpNet;
|
||||||
|
WCHAR Access[256];
|
||||||
|
DWORD OutFlags = 0, Size = COUNT_OF(Access);
|
||||||
|
|
||||||
Len = wcslen(argv[3]);
|
Len = wcslen(argv[3]);
|
||||||
if (Len < 4)
|
if (Len < 4)
|
||||||
|
@ -186,6 +190,10 @@ cmdUse(
|
||||||
lpNet.lpRemoteName = argv[3];
|
lpNet.lpRemoteName = argv[3];
|
||||||
lpNet.lpProvider = NULL;
|
lpNet.lpProvider = NULL;
|
||||||
|
|
||||||
return WNetAddConnection2(&lpNet, NULL, NULL, CONNECT_REDIRECT | (Persist ? CONNECT_UPDATE_PROFILE : 0));
|
Status = WNetUseConnection(NULL, &lpNet, NULL, NULL, CONNECT_REDIRECT | (Persist ? CONNECT_UPDATE_PROFILE : 0), Access, &Size, &OutFlags);
|
||||||
|
if (argv[2][0] == L'*' && Status == NO_ERROR && OutFlags == CONNECT_LOCALDRIVE)
|
||||||
|
printf("%S is now connected to %S\n", argv[3], Access);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue