ReactOS 0.4.16-dev-297-gc569aee
dssetup.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: NetAPI DLL
4 * FILE: reactos/dll/win32/netapi32/dssetup.c
5 * PURPOSE: Directory Service Setup interface code
6 * PROGRAMMERS: Eric Kohl
7 */
8
9/* INCLUDES ******************************************************************/
10
11#include "netapi32.h"
12
13#include <rpc.h>
14#include "dssetup_c.h"
15
17
18/* FUNCTIONS *****************************************************************/
19
20static
23 LPWSTR lpServerName,
25{
26 LPWSTR pszStringBinding;
28
29 TRACE("DsSetupBind() called\n");
30
31 *hBinding = NULL;
32
34 L"ncacn_np",
35 lpServerName,
36 L"\\pipe\\lsarpc",
37 NULL,
38 &pszStringBinding);
39 if (status)
40 {
41 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
42 return status;
43 }
44
45 /* Set the binding handle that will be used to bind to the server. */
46 status = RpcBindingFromStringBindingW(pszStringBinding,
47 hBinding);
48 if (status)
49 {
50 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
51 }
52
53 status = RpcStringFreeW(&pszStringBinding);
54 if (status)
55 {
56 TRACE("RpcStringFree returned 0x%x\n", status);
57 }
58
59 return status;
60}
61
62
63static
64void
67{
69
70 TRACE("DsSetupUnbind()\n");
71
73 if (status)
74 {
75 TRACE("RpcBindingFree returned 0x%x\n", status);
76 }
77}
78
79
80VOID
84{
85 TRACE("DsRoleFreeMemory(%p)\n", Buffer);
87}
88
89
93 LPCWSTR lpServer,
96{
99
100 TRACE("DsRoleGetPrimaryDomainInformation(%p, %d, %p)\n",
101 lpServer, InfoLevel, Buffer);
102
103 /* Check some input parameters */
104
105 if (!Buffer)
107
108 if ((InfoLevel < DsRolePrimaryDomainInfoBasic) || (InfoLevel > DsRoleOperationState))
110
111 *Buffer = NULL;
112
113 status = DsSetupBind((LPWSTR)lpServer, &hBinding);
114 if (status)
115 {
116 TRACE("DsSetupBind() failed (Status %lu\n)\n", status);
117 return status;
118 }
119
121 {
123 InfoLevel,
125 }
127 {
129 }
131
132 if (hBinding != NULL)
134
135 return status;
136}
137
138/* EOF */
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
Definition: bufpool.h:45
handle_t hBinding
Definition: ctx_c.c:54
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapFree(x, y, z)
Definition: compat.h:735
@ DsRolePrimaryDomainInfoBasic
Definition: dsrole.h:32
@ DsRoleOperationState
Definition: dsrole.h:34
enum _DSROLE_PRIMARY_DOMAIN_INFO_LEVEL DSROLE_PRIMARY_DOMAIN_INFO_LEVEL
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
DWORD WINAPI DsRolerGetPrimaryDomainInformation(handle_t hBinding, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, PDSROLER_PRIMARY_DOMAIN_INFORMATION *DomainInfo)
Definition: dssetup.c:138
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
static RPC_STATUS DsSetupBind(LPWSTR lpServerName, handle_t *hBinding)
Definition: dssetup.c:22
static void DsSetupUnbind(handle_t hBinding)
Definition: dssetup.c:65
VOID WINAPI DsRoleFreeMemory(_In_ PVOID Buffer)
Definition: dssetup.c:82
DWORD WINAPI DsRoleGetPrimaryDomainInformation(LPCWSTR lpServer, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, PBYTE *Buffer)
Definition: dssetup.c:92
#define _In_
Definition: no_sal2.h:158
#define L(x)
Definition: ntvdm.h:50
BYTE * PBYTE
Definition: pedump.c:66
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:740
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
long RPC_STATUS
Definition: rpc.h:52
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Definition: ps.c:97
#define WINAPI
Definition: msvc.h:6
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185