NetUserEnum
suppandi
suppandi at gmail.com
Fri Jan 27 23:02:39 CST 2006
Hi,
I was trying to run notes7 and it was crashing because NetUserEnum() was not
implemented. So i tried writing a simple implementation. Could anybody have
a look at this, and tell me whats wrong. Now notes just crashes without any
doc. unfortunately i amn't a windows programmer to write a simple program
to make the call.
NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries,
LPDWORD resume_handle)
{
struct USER_INFO_20
{
LPWSTR usri20_name;
LPWSTR usri20_full_name;
LPWSTR usri20_comment;
DWORD usri20_flags;
DWORD usri20_user_id;
};
switch(level)
{
case 20:
{
struct USER_INFO_20 *data;
char user[]={'t','e','s','t'};
NetApiBufferAllocate(sizeof(struct USER_INFO_20),
(LPVOID *) bufptr);
data = (struct USER_INFO_20 *)malloc(sizeof(struct USER_INFO_20));
data->usri20_name = (LPWSTR)malloc(20);
memcpy((void*)data->usri20_name,user,4);
data->usri20_full_name = (LPWSTR)malloc(20);
memcpy((void*)data->usri20_full_name,user,4);
data->usri20_comment = (LPWSTR)malloc(20);
memcpy((void*)data->usri20_comment,user,4);
data->usri20_flags = UF_NORMAL_ACCOUNT;
data->usri20_user_id = 1000;
*entriesread = *totalentries = 1;
return 0;
}
break;
default:
FIXME("(%s,%ld, 0x%ld,%p,%ld,%p,%p,%p) stub!\n",
debugstr_w(servername), level,
filter, bufptr, prefmaxlen, entriesread, totalentries,
resume_handle);
return ERROR_ACCESS_DENIED;
break;
}
}
More information about the wine-devel
mailing list