[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.

svn path=/trunk/; revision=67197
This commit is contained in:
Eric Kohl 2015-04-14 21:47:06 +00:00
parent fdc0506420
commit 0749fc145c
3 changed files with 105 additions and 1 deletions

View file

@ -8,6 +8,7 @@ spec2def(netapi32.dll netapi32.spec ADD_IMPORTLIB)
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 @@ list(APPEND SOURCE
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

View file

@ -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

View file

@ -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 */