Author: ekohl
Date: Mon Mar 23 21:47:50 2015
New Revision: 66865
URL:
http://svn.reactos.org/svn/reactos?rev=66865&view=rev
Log:
[NETAPI32]
Implement NetWkstaTransportAdd, NetWkstaTransportDel and NetWkstaTransportEnum.
Modified:
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/wksta.c
trunk/reactos/dll/win32/netapi32/wksta_new.c
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 23 21:47:50 2015
@@ -255,8 +255,8 @@
@ stub NetValidatePasswordPolicyFree
@ stdcall NetWkstaGetInfo(wstr long ptr)
@ stdcall NetWkstaSetInfo(wstr long ptr ptr)
-@ stub NetWkstaTransportAdd
-@ stub NetWkstaTransportDel
+@ stdcall NetWkstaTransportAdd(wstr long ptr ptr)
+@ stdcall NetWkstaTransportDel(wstr wstr long)
@ stdcall NetWkstaTransportEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetWkstaUserEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetWkstaUserGetInfo(wstr long ptr)
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] Mon Mar 23 21:47:50 2015
@@ -43,6 +43,7 @@
return ret && !strcmpiW( name, buf );
}
+#if 0
static void wprint_mac(WCHAR* buffer, int len, const MIB_IFROW *ifRow)
{
int i;
@@ -72,6 +73,7 @@
}
buffer[2*i]=0;
}
+#endif
/* Theoretically this could be too short, except that MS defines
* MAX_ADAPTER_NAME as 128, and MAX_INTERFACE_NAME_LEN as 256, and both
@@ -84,6 +86,7 @@
#define NBT_TRANSPORT_NAME_HEADER "\\Device\\NetBT_Tcpip_"
#define UNKNOWN_TRANSPORT_NAME_HEADER "\\Device\\UnknownTransport_"
+#if 0
static void wprint_name(WCHAR *buffer, int len, ULONG transport,
PMIB_IFROW ifRow)
{
@@ -109,6 +112,7 @@
*ptr1 = *ptr2;
*ptr1 = '\0';
}
+#endif
/***********************************************************************
* NetWkstaTransportEnum (NETAPI32.@)
@@ -125,6 +129,7 @@
/**********************************************************************/
+#if 0
static BOOL WkstaEnumAdaptersCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ULONG transport, const NetBIOSAdapterImpl *data, void *closure)
{
@@ -214,9 +219,11 @@
ret = FALSE;
return ret;
}
+#endif
/**********************************************************************/
+#if 0
NET_API_STATUS WINAPI
NetWkstaTransportEnum(LMSTR ServerName, DWORD level, PBYTE* pbuf,
DWORD prefmaxlen, LPDWORD read_entries,
@@ -271,6 +278,7 @@
}
return ret;
}
+#endif
/************************************************************
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 23 21:47:50 2015
@@ -404,8 +404,125 @@
NET_API_STATUS
WINAPI
+NetWkstaTransportAdd(
+ LPWSTR servername,
+ DWORD level,
+ LPBYTE buf,
+ LPDWORD parm_err)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetWkstaTransportAdd(%s, %d, %p, %p)\n", debugstr_w(servername),
+ level, buf, parm_err);
+
+ RpcTryExcept
+ {
+ status = NetrWkstaTransportAdd(servername,
+ level,
+ (LPWKSTA_TRANSPORT_INFO_0)buf,
+ parm_err);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetWkstaTransportDel(
+ LPWSTR servername,
+ LPWSTR transportname,
+ DWORD ucond)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetWkstaTransportDel(%s, %s, %d)\n", debugstr_w(servername),
+ debugstr_w(transportname), ucond);
+
+ RpcTryExcept
+ {
+ status = NetrWkstaTransportDel(servername,
+ transportname,
+ ucond);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetWkstaTransportEnum(
+ LPWSTR servername,
+ DWORD level,
+ LPBYTE *bufptr,
+ DWORD prefmaxlen,
+ LPDWORD entriesread,
+ LPDWORD totalentries,
+ LPDWORD resumehandle)
+{
+ WKSTA_TRANSPORT_ENUM_STRUCT TransportEnumInfo;
+ WKSTA_TRANSPORT_INFO_0_CONTAINER Container0;
+ NET_API_STATUS status;
+
+ TRACE("NetWkstaTransportEnum(%s, %d, %p, %d, %p, %p, %p)\n",
debugstr_w(servername),
+ level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
+
+ TransportEnumInfo.Level = level;
+ switch (level)
+ {
+ case 0:
+ TransportEnumInfo.WkstaTransportInfo.Level0 = &Container0;
+ Container0.EntriesRead = 0;
+ Container0.Buffer = NULL;
+ break;
+
+ default:
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ RpcTryExcept
+ {
+ status = NetrWkstaTransportEnum(servername,
+ &TransportEnumInfo,
+ prefmaxlen,
+ totalentries,
+ resumehandle);
+ if (status == NERR_Success || status == ERROR_MORE_DATA)
+ {
+ switch (level)
+ {
+ case 0:
+ *bufptr =
(LPBYTE)TransportEnumInfo.WkstaTransportInfo.Level0->Buffer;
+ *entriesread =
TransportEnumInfo.WkstaTransportInfo.Level0->EntriesRead;
+ break;
+ }
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
NetWkstaUserEnum(
- LMSTR servername,
+ LPWSTR servername,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,