hi
i use NetUserEnum API to get all user in my computer
but when i want print any user it get with wprintf
it just print the first charackter of users
i also test it with microsoft visual c++ and MinGW, here it work fine
but in pellesc not
what is my mistake?
here is my code
#include <windows.h>
#include <stdio.h>
#include <wchar.h>
#include <lm.h>
#pragma comment(lib, "netapi32.lib")
int main()
{
LPUSER_INFO_0 lpUser = NULL;
NET_API_STATUS nStatus;
DWORD dwEntry = 0;
DWORD dwTotal = 0;
DWORD dwResume = 0;
do
{
nStatus = NetUserEnum(NULL,
0,
FILTER_NORMAL_ACCOUNT,
(LPBYTE *)&lpUser,
MAX_PREFERRED_LENGTH,
&dwEntry,
&dwTotal,
&dwResume);
if ( nStatus == NERR_Success || nStatus == ERROR_MORE_DATA )
wprintf(L"%s\n", lpUser->usri0_name);
if ( lpUser != NULL )
{
NetApiBufferFree(lpUser);
lpUser = NULL;
}
dwResume ++;
}while( dwEntry - 1);
return 0;
}
sorry for my bad english if i have any mistake
thanks