mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[NET]
Net utility not enumerating local user accounts. Patch by Curtis Wilson. CORE-11023 #resolve #comment Thanks a lot! svn path=/trunk/; revision=71087
This commit is contained in:
parent
ec5cd6b41d
commit
79407a8027
|
@ -5,6 +5,7 @@
|
||||||
* PURPOSE:
|
* PURPOSE:
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Eric Kohl
|
* PROGRAMMERS: Eric Kohl
|
||||||
|
* Curtis Wilson
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
@ -45,6 +46,8 @@ EnumerateUsers(VOID)
|
||||||
|
|
||||||
NetApiBufferFree(pServer);
|
NetApiBufferFree(pServer);
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
Status = NetUserEnum(NULL,
|
Status = NetUserEnum(NULL,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
@ -53,7 +56,7 @@ EnumerateUsers(VOID)
|
||||||
&dwRead,
|
&dwRead,
|
||||||
&dwTotal,
|
&dwTotal,
|
||||||
&ResumeHandle);
|
&ResumeHandle);
|
||||||
if (Status != NERR_Success)
|
if ((Status != NERR_Success) && (Status != ERROR_MORE_DATA))
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
qsort(pBuffer,
|
qsort(pBuffer,
|
||||||
|
@ -61,15 +64,19 @@ EnumerateUsers(VOID)
|
||||||
sizeof(PUSER_INFO_0),
|
sizeof(PUSER_INFO_0),
|
||||||
CompareInfo);
|
CompareInfo);
|
||||||
|
|
||||||
// printf("dwRead: %lu dwTotal: %lu\n", dwRead, dwTotal);
|
|
||||||
for (i = 0; i < dwRead; i++)
|
for (i = 0; i < dwRead; i++)
|
||||||
{
|
{
|
||||||
// printf("%p\n", pBuffer[i].lgrpi0_name);
|
|
||||||
if (pBuffer[i].usri0_name)
|
if (pBuffer[i].usri0_name)
|
||||||
PrintToConsole(L"%s\n", pBuffer[i].usri0_name);
|
PrintToConsole(L"%s\n", pBuffer[i].usri0_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pBuffer != NULL)
|
||||||
|
{
|
||||||
NetApiBufferFree(pBuffer);
|
NetApiBufferFree(pBuffer);
|
||||||
|
pBuffer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (Status == ERROR_MORE_DATA);
|
||||||
|
|
||||||
return NERR_Success;
|
return NERR_Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue