Author: ekohl Date: Tue Apr 14 21:47:06 2015 New Revision: 67197
URL: http://svn.reactos.org/svn/reactos?rev=67197&view=rev Log: [NETAPI32] - Add the client interface code of the server service. - Implement NetRemoteTOD. This will not fix CORE-5423 because the server side (NetrRemoteTOD) is not implemented yet.
Added: trunk/reactos/dll/win32/netapi32/srvsvc.c (with props) Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt trunk/reactos/dll/win32/netapi32/netapi32.spec
Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/CMakeLis... ============================================================================== --- trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] Tue Apr 14 21:47:06 2015 @@ -8,6 +8,7 @@ add_rpc_files(client ${REACTOS_SOURCE_DIR}/include/reactos/idl/atsvc.idl ${REACTOS_SOURCE_DIR}/include/reactos/idl/dssetup.idl + ${REACTOS_SOURCE_DIR}/include/reactos/idl/srvsvc.idl ${REACTOS_SOURCE_DIR}/include/reactos/idl/wkssvc.idl)
list(APPEND SOURCE @@ -26,12 +27,14 @@ netbios.c schedule.c share.c + srvsvc.c user.c wksta.c wksta_new.c netapi32.h ${CMAKE_CURRENT_BINARY_DIR}/atsvc_c.c ${CMAKE_CURRENT_BINARY_DIR}/dssetup_c.c + ${CMAKE_CURRENT_BINARY_DIR}/srvsvc_c.c ${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c)
add_library(netapi32 SHARED
Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi32... ============================================================================== --- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Tue Apr 14 21:47:06 2015 @@ -183,7 +183,7 @@ @ stdcall NetQueryDisplayInformation(wstr long long long long ptr ptr) @ stub NetRegisterDomainNameChangeNotification @ stub NetRemoteComputerSupports -@ stub NetRemoteTOD +@ stdcall NetRemoteTOD(wstr ptr) @ stub NetRemoveAlternateComputerName @ stub NetRenameMachineInDomain @ stub NetReplExportDirAdd
Added: trunk/reactos/dll/win32/netapi32/srvsvc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/srvsvc.c... ============================================================================== --- trunk/reactos/dll/win32/netapi32/srvsvc.c (added) +++ trunk/reactos/dll/win32/netapi32/srvsvc.c [iso-8859-1] Tue Apr 14 21:47:06 2015 @@ -0,0 +1,101 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: NetAPI DLL + * FILE: reactos/dll/win32/netapi32/schedule.c + * PURPOSE: Server service interface code + * + * PROGRAMMERS: Eric Kohl + */ + +/* INCLUDES ******************************************************************/ + +#include "netapi32.h" +#include "srvsvc_c.h" + +WINE_DEFAULT_DEBUG_CHANNEL(netapi32); + +/* FUNCTIONS *****************************************************************/ + +handle_t __RPC_USER +SRVSVC_HANDLE_bind(SRVSVC_HANDLE pszSystemName) +{ + handle_t hBinding = NULL; + LPWSTR pszStringBinding; + RPC_STATUS status; + + TRACE("SRVSVC_HANDLE_bind() called\n"); + + status = RpcStringBindingComposeW(NULL, + L"ncacn_np", + (RPC_WSTR)pszSystemName, + L"\pipe\srvsvc", + NULL, + &pszStringBinding); + if (status) + { + TRACE("RpcStringBindingCompose returned 0x%x\n", status); + return NULL; + } + + /* Set the binding handle that will be used to bind to the server. */ + status = RpcBindingFromStringBindingW(pszStringBinding, + &hBinding); + if (status) + { + TRACE("RpcBindingFromStringBinding returned 0x%x\n", status); + } + + status = RpcStringFreeW(&pszStringBinding); + if (status) + { +// TRACE("RpcStringFree returned 0x%x\n", status); + } + + return hBinding; +} + + +void __RPC_USER +SRVSVC_HANDLE_unbind(SRVSVC_HANDLE pszSystemName, + handle_t hBinding) +{ + RPC_STATUS status; + + TRACE("SRVSVC_HANDLE_unbind() called\n"); + + status = RpcBindingFree(&hBinding); + if (status) + { + TRACE("RpcBindingFree returned 0x%x\n", status); + } +} + + +NET_API_STATUS +WINAPI +NetRemoteTOD( + LPCWSTR UncServerName, + LPBYTE *BufferPtr) +{ + NET_API_STATUS status; + + TRACE("NetRemoteTOD(%s, %p)\n", debugstr_w(UncServerName), + BufferPtr); + + *BufferPtr = NULL; + + RpcTryExcept + { + status = NetrRemoteTOD((SRVSVC_HANDLE)UncServerName, + (LPTIME_OF_DAY_INFO *)BufferPtr); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + +/* EOF */
Propchange: trunk/reactos/dll/win32/netapi32/srvsvc.c ------------------------------------------------------------------------------ svn:eol-style = native