mirror of
https://github.com/reactos/reactos.git
synced 2024-07-05 12:15:46 +00:00
[NETAPI32]
- Add netlogon RPC binding code. - Implement NetGetAnyDCName. This function calls its counterpart in the netlogon service. svn path=/trunk/; revision=75212
This commit is contained in:
parent
0706d8cb47
commit
4c3c7daba6
|
@ -9,6 +9,7 @@ add_rpc_files(client
|
|||
${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/atsvc.idl
|
||||
${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/browser.idl
|
||||
${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/dssetup.idl
|
||||
${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/netlogon.idl
|
||||
${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/srvsvc.idl
|
||||
${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/wkssvc.idl)
|
||||
|
||||
|
@ -37,6 +38,7 @@ list(APPEND SOURCE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/atsvc_c.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/browser_c.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dssetup_c.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/netlogon_c.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/srvsvc_c.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c)
|
||||
|
||||
|
|
|
@ -9,11 +9,68 @@
|
|||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "netapi32.h"
|
||||
#include <rpc.h>
|
||||
#include "netlogon_c.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
handle_t __RPC_USER
|
||||
LOGONSRV_HANDLE_bind(LOGONSRV_HANDLE pszSystemName)
|
||||
{
|
||||
handle_t hBinding = NULL;
|
||||
LPWSTR pszStringBinding;
|
||||
RPC_STATUS status;
|
||||
|
||||
TRACE("LOGONSRV_HANDLE_bind() called\n");
|
||||
|
||||
status = RpcStringBindingComposeW(NULL,
|
||||
L"ncacn_np",
|
||||
pszSystemName,
|
||||
L"\\pipe\\netlogon",
|
||||
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
|
||||
LOGONSRV_HANDLE_unbind(LOGONSRV_HANDLE pszSystemName,
|
||||
handle_t hBinding)
|
||||
{
|
||||
RPC_STATUS status;
|
||||
|
||||
TRACE("LOGONSRV_HANDLE_unbind() called\n");
|
||||
|
||||
status = RpcBindingFree(&hBinding);
|
||||
if (status)
|
||||
{
|
||||
TRACE("RpcBindingFree returned 0x%x\n", status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
NetEnumerateTrustedDomains(
|
||||
|
@ -30,14 +87,30 @@ NetEnumerateTrustedDomains(
|
|||
NET_API_STATUS
|
||||
WINAPI
|
||||
NetGetAnyDCName(
|
||||
_In_ LPCWSTR servername,
|
||||
_In_ LPCWSTR domainname,
|
||||
_Out_ LPBYTE *bufptr)
|
||||
_In_opt_ LPCWSTR ServerName,
|
||||
_In_opt_ LPCWSTR DomainName,
|
||||
_Out_ LPBYTE *BufPtr)
|
||||
{
|
||||
FIXME("NetGetAnyDCName(%s, %s, %p)\n",
|
||||
debugstr_w(servername), debugstr_w(domainname), bufptr);
|
||||
NET_API_STATUS status;
|
||||
|
||||
return ERROR_NO_LOGON_SERVERS;
|
||||
TRACE("NetGetAnyDCName(%s, %s, %p)\n",
|
||||
debugstr_w(ServerName), debugstr_w(DomainName), BufPtr);
|
||||
|
||||
*BufPtr = NULL;
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
status = NetrGetAnyDCName((PWSTR)ServerName,
|
||||
(PWSTR)DomainName,
|
||||
(PWSTR*)BufPtr);
|
||||
}
|
||||
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
status = I_RpcMapWin32Status(RpcExceptionCode());
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -978,10 +978,11 @@ cpp_quote("#endif")
|
|||
[
|
||||
uuid(12345678-1234-ABCD-EF00-01234567CFFB),
|
||||
version(1.0),
|
||||
pointer_default(unique),
|
||||
#ifdef __midl
|
||||
ms_union,
|
||||
#endif
|
||||
pointer_default(unique)
|
||||
endpoint("ncacn_np:[\\pipe\\netlogon]")
|
||||
#ifndef __midl
|
||||
,implicit_handle(handle_t hBinding)
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue