mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:46:13 +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
1 changed files with 30 additions and 23 deletions
|
@ -5,6 +5,7 @@
|
||||||
* PURPOSE:
|
* PURPOSE:
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Eric Kohl
|
* PROGRAMMERS: Eric Kohl
|
||||||
|
* Curtis Wilson
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
@ -45,31 +46,37 @@ EnumerateUsers(VOID)
|
||||||
|
|
||||||
NetApiBufferFree(pServer);
|
NetApiBufferFree(pServer);
|
||||||
|
|
||||||
Status = NetUserEnum(NULL,
|
do
|
||||||
0,
|
|
||||||
0,
|
|
||||||
(LPBYTE*)&pBuffer,
|
|
||||||
MAX_PREFERRED_LENGTH,
|
|
||||||
&dwRead,
|
|
||||||
&dwTotal,
|
|
||||||
&ResumeHandle);
|
|
||||||
if (Status != NERR_Success)
|
|
||||||
return Status;
|
|
||||||
|
|
||||||
qsort(pBuffer,
|
|
||||||
dwRead,
|
|
||||||
sizeof(PUSER_INFO_0),
|
|
||||||
CompareInfo);
|
|
||||||
|
|
||||||
// printf("dwRead: %lu dwTotal: %lu\n", dwRead, dwTotal);
|
|
||||||
for (i = 0; i < dwRead; i++)
|
|
||||||
{
|
{
|
||||||
// printf("%p\n", pBuffer[i].lgrpi0_name);
|
Status = NetUserEnum(NULL,
|
||||||
if (pBuffer[i].usri0_name)
|
0,
|
||||||
PrintToConsole(L"%s\n", pBuffer[i].usri0_name);
|
0,
|
||||||
}
|
(LPBYTE*)&pBuffer,
|
||||||
|
MAX_PREFERRED_LENGTH,
|
||||||
|
&dwRead,
|
||||||
|
&dwTotal,
|
||||||
|
&ResumeHandle);
|
||||||
|
if ((Status != NERR_Success) && (Status != ERROR_MORE_DATA))
|
||||||
|
return Status;
|
||||||
|
|
||||||
NetApiBufferFree(pBuffer);
|
qsort(pBuffer,
|
||||||
|
dwRead,
|
||||||
|
sizeof(PUSER_INFO_0),
|
||||||
|
CompareInfo);
|
||||||
|
|
||||||
|
for (i = 0; i < dwRead; i++)
|
||||||
|
{
|
||||||
|
if (pBuffer[i].usri0_name)
|
||||||
|
PrintToConsole(L"%s\n", pBuffer[i].usri0_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pBuffer != NULL)
|
||||||
|
{
|
||||||
|
NetApiBufferFree(pBuffer);
|
||||||
|
pBuffer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (Status == ERROR_MORE_DATA);
|
||||||
|
|
||||||
return NERR_Success;
|
return NERR_Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue