Author: ekohl
Date: Wed Sep 18 18:02:36 2013
New Revision: 60199
URL:
http://svn.reactos.org/svn/reactos?rev=60199&view=rev
Log:
[NETAPI32]
- NetLocalGroupAdd: Delete the newly created alias if setting alias information fails.
- NetUserGetGroups, NetUserGetInfo and NetUserGetLocalGroups: Return NERR_UserNotFound if
no matching user was found.
Modified:
trunk/reactos/dll/win32/netapi32/local_group.c
trunk/reactos/dll/win32/netapi32/user.c
Modified: trunk/reactos/dll/win32/netapi32/local_group.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/local_g…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/local_group.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/local_group.c [iso-8859-1] Wed Sep 18 18:02:36 2013
@@ -468,7 +468,12 @@
done:
if (AliasHandle != NULL)
- SamCloseHandle(AliasHandle);
+ {
+ if (ApiStatus != NERR_Success)
+ SamDeleteAlias(AliasHandle);
+ else
+ SamCloseHandle(AliasHandle);
+ }
if (DomainHandle != NULL)
SamCloseHandle(DomainHandle);
Modified: trunk/reactos/dll/win32/netapi32/user.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/user.c?…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] Wed Sep 18 18:02:36 2013
@@ -2692,7 +2692,10 @@
if (!NT_SUCCESS(Status))
{
ERR("SamLookupNamesInDomain failed (Status %08lx)\n", Status);
- ApiStatus = NetpNtStatusToApiStatus(Status);
+ if (Status == STATUS_NONE_MAPPED)
+ ApiStatus = NERR_UserNotFound;
+ else
+ ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
@@ -2846,7 +2849,10 @@
if (!NT_SUCCESS(Status))
{
ERR("SamOpenDomain failed (Status %08lx)\n", Status);
- ApiStatus = NetpNtStatusToApiStatus(Status);
+ if (Status == STATUS_NONE_MAPPED)
+ ApiStatus = NERR_UserNotFound;
+ else
+ ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}
@@ -3029,7 +3035,10 @@
if (!NT_SUCCESS(Status))
{
ERR("SamLookupNamesInDomain failed (Status %08lx)\n", Status);
- ApiStatus = NetpNtStatusToApiStatus(Status);
+ if (Status == STATUS_NONE_MAPPED)
+ ApiStatus = NERR_UserNotFound;
+ else
+ ApiStatus = NetpNtStatusToApiStatus(Status);
goto done;
}