Author: dchapyshev
Date: Sun Jan 11 09:59:49 2009
New Revision: 38701
URL:
http://svn.reactos.org/svn/reactos?rev=38701&view=rev
Log:
- Sync netapi32 with Wine head
Modified:
trunk/reactos/dll/win32/netapi32/access.c
trunk/reactos/dll/win32/netapi32/nbt.c
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/netbios.c
trunk/reactos/dll/win32/netapi32/share.c
trunk/reactos/dll/win32/netapi32/wksta.c
Modified: trunk/reactos/dll/win32/netapi32/access.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/access.…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/access.c [iso-8859-1] Sun Jan 11 09:59:49 2009
@@ -417,6 +417,10 @@
LPDWORD entriesread, LPDWORD totalentries)
{
NET_API_STATUS status;
+ const WCHAR admins[] =
{'A','d','m','i','n','i','s','t','r','a','t','o','r','s',0};
+ LPWSTR currentuser;
+ LOCALGROUP_USERS_INFO_0* info;
+ DWORD size;
FIXME("(%s, %s, %d, %08x, %p %d, %p, %p) stub!\n",
debugstr_w(servername), debugstr_w(username), level, flags, bufptr,
@@ -426,12 +430,37 @@
if (status != NERR_Success)
return status;
- if (!NETAPI_FindUser(username))
+ size = UNLEN + 1;
+ NetApiBufferAllocate(size, (LPVOID*)¤tuser);
+ GetUserNameW(currentuser, &size);
+
+ if (lstrcmpiW(username, currentuser) && NETAPI_FindUser(username))
+ {
+ NetApiBufferFree(currentuser);
return NERR_UserNotFound;
-
- if (bufptr) *bufptr = NULL;
- if (entriesread) *entriesread = 0;
- if (totalentries) *totalentries = 0;
+ }
+
+ NetApiBufferFree(currentuser);
+ *totalentries = 1;
+ size = sizeof(*info) + sizeof(admins);
+
+ if(prefmaxlen < size)
+ status = ERROR_MORE_DATA;
+ else
+ status = NetApiBufferAllocate(size, (LPVOID*)&info);
+
+ if(status != NERR_Success)
+ {
+ *bufptr = NULL;
+ *entriesread = 0;
+ return status;
+ }
+
+ info->lgrui0_name = (LPWSTR)((LPBYTE)info + sizeof(*info));
+ lstrcpyW(info->lgrui0_name, admins);
+
+ *bufptr = (LPBYTE)info;
+ *entriesread = 1;
return NERR_Success;
}
@@ -485,7 +514,7 @@
usr->usri1_comment[0] = 0;
usr->usri1_flags = UF_SCRIPT | UF_NORMAL_ACCOUNT | UF_DONT_EXPIRE_PASSWD;
usr->usri1_full_name[0] = 0;
- usr->usri1_user_id = 500;
+ usr->usri1_user_id = DOMAIN_USER_RID_ADMIN;
usr->usri1_next_index = 0;
}
@@ -525,7 +554,7 @@
usr->usri1_flags = UF_ACCOUNTDISABLE | UF_SCRIPT | UF_NORMAL_ACCOUNT |
UF_DONT_EXPIRE_PASSWD;
usr->usri1_full_name[0] = 0;
- usr->usri1_user_id = 500;
+ usr->usri1_user_id = DOMAIN_USER_RID_GUEST;
usr->usri1_next_index = 0;
}
@@ -689,6 +718,18 @@
return NERR_DCNotFound; /* say we can't find a domain controller */
}
+/************************************************************
+ * NetGroupEnum (NETAPI32.@)
+ *
+ */
+NET_API_STATUS WINAPI
+NetGroupEnum(LPCWSTR servername, DWORD level, LPBYTE *bufptr, DWORD prefmaxlen,
+ LPDWORD entriesread, LPDWORD totalentries, LPDWORD resume_handle)
+{
+ FIXME("(%s, %d, %p, %d, %p, %p, %p) stub!\n", debugstr_w(servername),
+ level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle);
+ return ERROR_ACCESS_DENIED;
+}
/******************************************************************************
* NetUserModalsGet (NETAPI32.@)
Modified: trunk/reactos/dll/win32/netapi32/nbt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/nbt.c?r…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/nbt.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/nbt.c [iso-8859-1] Sun Jan 11 09:59:49 2009
@@ -415,10 +415,7 @@
if (queryData->cacheEntry)
queryData->cacheEntry->numAddresses = 0;
else
- {
- ret = FALSE;
queryData->ret = NRC_OSRESNOTAV;
- }
}
if (rLen == 6 && queryData->cacheEntry &&
queryData->cacheEntry->numAddresses < answerCount)
@@ -850,8 +847,8 @@
astat->max_sess_pkt_size = 0xffff;
astat->xmit_success = adapter->xmit_success;
astat->recv_success = adapter->recv_success;
- }
- ret = NRC_GOODRET;
+ ret = NRC_GOODRET;
+ }
}
else
ret = NetBTAstatRemote(adapter, ncb);
@@ -1183,6 +1180,7 @@
* message header. */
NetBIOSHangupSession(ncb);
ret = NRC_SABORT;
+ goto error;
}
else if (buffer[0] != NBSS_MSG)
{
@@ -1190,6 +1188,7 @@
FIXME("Received unexpected session msg type %d\n", buffer[0]);
NetBIOSHangupSession(ncb);
ret = NRC_SABORT;
+ goto error;
}
else
{
@@ -1199,6 +1198,7 @@
FIXME("Received a message that's too long for my
taste\n");
NetBIOSHangupSession(ncb);
ret = NRC_SABORT;
+ goto error;
}
else
{
@@ -1226,6 +1226,7 @@
adapter->recv_success++;
}
}
+error:
TRACE("returning 0x%02x\n", ret);
return ret;
}
Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Sun Jan 11 09:59:49 2009
@@ -98,7 +98,7 @@
@ stub NetGroupAddUser
@ stub NetGroupDel
@ stub NetGroupDelUser
-@ stub NetGroupEnum
+@ stdcall NetGroupEnum(wstr long ptr long ptr ptr ptr)
@ stub NetGroupGetInfo
@ stub NetGroupGetUsers
@ stub NetGroupSetInfo
@@ -188,13 +188,13 @@
@ stub NetSessionDel
@ stdcall NetSessionEnum(wstr wstr wstr long ptr long ptr ptr ptr)
@ stub NetSessionGetInfo
-@ stub NetShareAdd
+@ stdcall NetShareAdd(wstr long ptr ptr)
@ stub NetShareCheck
@ stdcall NetShareDel(wstr wstr long)
@ stub NetShareDelSticky
@ stdcall NetShareEnum(wstr long ptr long ptr ptr ptr)
@ stub NetShareEnumSticky
-@ stub NetShareGetInfo
+@ stdcall NetShareGetInfo(wstr wstr long ptr)
@ stub NetShareSetInfo
@ stdcall NetStatisticsGet(wstr wstr long long ptr)
@ stdcall NetUseAdd(wstr long ptr ptr)
@@ -217,7 +217,7 @@
@ stub NetWkstaTransportAdd
@ stub NetWkstaTransportDel
@ stdcall NetWkstaTransportEnum (wstr long ptr long ptr ptr ptr)
-@ stub NetWkstaUserEnum
+@ stdcall NetWkstaUserEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetWkstaUserGetInfo(wstr long ptr)
@ stub NetWkstaUserSetInfo
@ stdcall NetapipBufferAllocate(long ptr) NetApiBufferAllocate
Modified: trunk/reactos/dll/win32/netapi32/netbios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netbios…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netbios.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netbios.c [iso-8859-1] Sun Jan 11 09:59:49 2009
@@ -637,7 +637,7 @@
EnterCriticalSection(&adapter->cs);
memset(session, 0, sizeof(NetBIOSSession));
LeaveCriticalSection(&adapter->cs);
- return NRC_GOODRET;
+ return ret;
}
static UCHAR nbHangup(NetBIOSAdapter *adapter, const NCB *ncb)
Modified: trunk/reactos/dll/win32/netapi32/share.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/share.c…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/share.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/share.c [iso-8859-1] Sun Jan 11 09:59:49 2009
@@ -92,3 +92,24 @@
FIXME("Stub (%s %s %d)\n", debugstr_w(servername), debugstr_w(netname),
reserved);
return NERR_Success;
}
+
+/************************************************************
+ * NetShareGetInfo (NETAPI32.@)
+ */
+NET_API_STATUS WINAPI NetShareGetInfo(LMSTR servername, LMSTR netname,
+ DWORD level, LPBYTE *bufptr)
+{
+ FIXME("Stub (%s %s %d %p)\n", debugstr_w(servername),
+ debugstr_w(netname),level, bufptr);
+ return NERR_NetNameNotFound;
+}
+
+/************************************************************
+ * NetShareAdd (NETAPI32.@)
+ */
+NET_API_STATUS WINAPI NetShareAdd(LMSTR servername,
+ DWORD level, LPBYTE buf, LPDWORD parm_err)
+{
+ FIXME("Stub (%s %d %p %p)\n", debugstr_w(servername), level, buf,
parm_err);
+ return ERROR_NOT_SUPPORTED;
+}
Modified: trunk/reactos/dll/win32/netapi32/wksta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta.c…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] Sun Jan 11 09:59:49 2009
@@ -98,7 +98,7 @@
else
buffer[2*i+1] = (WCHAR)((val & 0xf) + '0');
}
- buffer[2*i]=(WCHAR)0;
+ buffer[2*i]=0;
}
/* Theoretically this could be too short, except that MS defines
@@ -444,6 +444,19 @@
}
/************************************************************
+ * NetWkstaUserEnum (NETAPI32.@)
+ */
+NET_API_STATUS WINAPI
+NetWkstaUserEnum(LMSTR servername, DWORD level, LPBYTE* bufptr,
+ DWORD prefmaxlen, LPDWORD entriesread,
+ LPDWORD totalentries, LPDWORD resumehandle)
+{
+ FIXME("(%s, %d, %p, %d, %p, %p, %p): stub!\n", debugstr_w(servername),
+ level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
+ return ERROR_INVALID_PARAMETER;
+}
+
+/************************************************************
* NetpGetComputerName (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetpGetComputerName(LPWSTR *Buffer)