Author: ekohl
Date: Mon Mar 16 20:03:54 2015
New Revision: 66743
URL:
http://svn.reactos.org/svn/reactos?rev=66743&view=rev
Log:
[NETAPI32]
Implement NetUseAdd, NetUseDel, NetUseEnum and NetUseGetInfo.
Modified:
trunk/reactos/dll/win32/netapi32/access.c
trunk/reactos/dll/win32/netapi32/netapi32.c
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/wksta_new.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] Mon Mar 16 20:03:54 2015
@@ -260,10 +260,3 @@
debugstr_w(domainname), bufptr);
return NERR_DCNotFound; /* say we can't find a domain controller */
}
-
-
-NET_API_STATUS WINAPI NetUseAdd(LMSTR servername, DWORD level, LPBYTE bufptr, LPDWORD
parm_err)
-{
- FIXME("%s %d %p %p stub\n", debugstr_w(servername), level, bufptr,
parm_err);
- return NERR_Success;
-}
Modified: trunk/reactos/dll/win32/netapi32/netapi32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.c [iso-8859-1] Mon Mar 16 20:03:54 2015
@@ -202,14 +202,6 @@
return ApiStatus;
}
-NET_API_STATUS WINAPI NetUseEnum(LMSTR server, DWORD level, LPBYTE* bufptr, DWORD
prefmaxsize,
- LPDWORD entriesread, LPDWORD totalentries, LPDWORD
resumehandle)
-{
- FIXME("stub (%p, %d, %p, %d, %p, %p, %p)\n", server, level, bufptr,
prefmaxsize,
- entriesread, totalentries, resumehandle);
- return ERROR_NOT_SUPPORTED;
-}
-
NET_API_STATUS WINAPI NetScheduleJobAdd(LPCWSTR server, LPBYTE bufptr, LPDWORD jobid)
{
FIXME("stub (%s, %p, %p)\n", debugstr_w(server), bufptr, jobid);
@@ -231,9 +223,3 @@
return NERR_Success;
}
-NET_API_STATUS WINAPI NetUseGetInfo(LMSTR server, LMSTR name, DWORD level, LPBYTE
*bufptr)
-{
- FIXME("stub (%p, %p, %d, %p)\n", server, name, level, bufptr);
- return ERROR_NOT_SUPPORTED;
-
-}
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] Mon Mar 16 20:03:54 2015
@@ -236,7 +236,7 @@
@ stub NetUnjoinDomain
@ stub NetUnregisterDomainNameChangeNotification
@ stdcall NetUseAdd(wstr long ptr ptr)
-@ stub NetUseDel
+@ stdcall NetUseDel(wstr wstr long)
@ stdcall NetUseEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetUseGetInfo(ptr ptr long ptr)
@ stdcall NetUserAdd(wstr long ptr ptr)
Modified: trunk/reactos/dll/win32/netapi32/wksta_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta_n…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/wksta_new.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/wksta_new.c [iso-8859-1] Mon Mar 16 20:03:54 2015
@@ -147,7 +147,7 @@
{
NET_API_STATUS status;
- TRACE("NetGetJoinInformation(%s %p %p)\n", wine_dbgstr_w(Server),
+ TRACE("NetGetJoinInformation(%s %p %p)\n", debugstr_w(Server),
Name, type);
if (Name == NULL || type == NULL)
@@ -158,6 +158,179 @@
status = NetrGetJoinInformation((LPWSTR)Server,
Name,
type);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetUseAdd(
+ LMSTR UncServerName,
+ DWORD Level,
+ LPBYTE Buf,
+ LPDWORD ParmError)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetUseAdd(%s %d %p %p)\n", debugstr_w(UncServerName),
+ Level, Buf, ParmError);
+
+ RpcTryExcept
+ {
+ status = NetrUseAdd(UncServerName,
+ Level,
+ (LPUSE_INFO)Buf,
+ ParmError);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetUseDel(
+ LMSTR UncServerName,
+ LMSTR UseName,
+ DWORD ForceCond)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetUseDel(%s %s %d)\n", debugstr_w(UncServerName),
+ debugstr_w(UseName), ForceCond);
+
+ RpcTryExcept
+ {
+ status = NetrUseDel(UncServerName,
+ UseName,
+ ForceCond);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetUseEnum(
+ LMSTR UncServerName,
+ DWORD Level,
+ LPBYTE *BufPtr,
+ DWORD PreferedMaximumSize,
+ LPDWORD EntriesRead,
+ LPDWORD TotalEntries,
+ LPDWORD ResumeHandle)
+{
+ USE_ENUM_STRUCT UseEnumInfo;
+ USE_INFO_0_CONTAINER Container0;
+ USE_INFO_1_CONTAINER Container1;
+ USE_INFO_2_CONTAINER Container2;
+ NET_API_STATUS status;
+
+ TRACE("NetUseEnum(%s, %d, %p, %d, %p, %p, %p)\n",
debugstr_w(UncServerName),
+ Level, BufPtr, PreferedMaximumSize, EntriesRead, TotalEntries, ResumeHandle);
+
+ UseEnumInfo.Level = Level;
+ switch (Level)
+ {
+ case 0:
+ UseEnumInfo.UseInfo.Level0 = &Container0;
+ Container0.EntriesRead = 0;
+ Container0.Buffer = NULL;
+ break;
+
+ case 1:
+ UseEnumInfo.UseInfo.Level1 = &Container1;
+ Container1.EntriesRead = 0;
+ Container1.Buffer = NULL;
+ break;
+
+ case 2:
+ UseEnumInfo.UseInfo.Level2 = &Container2;
+ Container2.EntriesRead = 0;
+ Container2.Buffer = NULL;
+ break;
+
+ default:
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ RpcTryExcept
+ {
+ status = NetrUseEnum(UncServerName,
+ &UseEnumInfo,
+ PreferedMaximumSize,
+ TotalEntries,
+ ResumeHandle);
+ if (status == NERR_Success || status == ERROR_MORE_DATA)
+ {
+ switch (Level)
+ {
+ case 0:
+ *BufPtr = (LPBYTE)UseEnumInfo.UseInfo.Level0->Buffer;
+ *EntriesRead = UseEnumInfo.UseInfo.Level0->EntriesRead;
+ break;
+
+ case 1:
+ *BufPtr = (LPBYTE)UseEnumInfo.UseInfo.Level1->Buffer;
+ *EntriesRead = UseEnumInfo.UseInfo.Level1->EntriesRead;
+ break;
+
+ case 2:
+ *BufPtr = (LPBYTE)UseEnumInfo.UseInfo.Level2->Buffer;
+ *EntriesRead = UseEnumInfo.UseInfo.Level2->EntriesRead;
+ break;
+ }
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetUseGetInfo(
+ LMSTR UncServerName,
+ LMSTR UseName,
+ DWORD Level,
+ LPBYTE *BufPtr)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetUseGetInfo(%s, %s, %d, %p)\n", debugstr_w(UncServerName),
+ debugstr_w(UseName), Level, BufPtr);
+
+ *BufPtr = NULL;
+
+ RpcTryExcept
+ {
+ status = NetrUseGetInfo(UncServerName,
+ UseName,
+ Level,
+ (LPUSE_INFO)BufPtr);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
@@ -241,8 +414,8 @@
LPDWORD resumehandle)
{
WKSTA_USER_ENUM_STRUCT UserEnumInfo;
- WKSTA_USER_INFO_0_CONTAINER Level0;
- WKSTA_USER_INFO_1_CONTAINER Level1;
+ WKSTA_USER_INFO_0_CONTAINER Container0;
+ WKSTA_USER_INFO_1_CONTAINER Container1;
NET_API_STATUS status;
TRACE("NetWkstaUserEnum(%s, %d, %p, %d, %p, %p, %p)\n",
debugstr_w(servername),
@@ -252,15 +425,15 @@
switch (level)
{
case 0:
- UserEnumInfo.WkstaUserInfo.Level0 = &Level0;
- UserEnumInfo.WkstaUserInfo.Level0->EntriesRead = 0;
- UserEnumInfo.WkstaUserInfo.Level0->Buffer = NULL;
+ UserEnumInfo.WkstaUserInfo.Level0 = &Container0;
+ Container0.EntriesRead = 0;
+ Container0.Buffer = NULL;
break;
case 1:
- UserEnumInfo.WkstaUserInfo.Level1 = &Level1;
- UserEnumInfo.WkstaUserInfo.Level1->EntriesRead = 0;
- UserEnumInfo.WkstaUserInfo.Level1->Buffer = NULL;
+ UserEnumInfo.WkstaUserInfo.Level1 = &Container1;
+ Container1.EntriesRead = 0;
+ Container1.Buffer = NULL;
break;
default: