ReactOS  0.4.14-dev-342-gdc047f9
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 
20 static
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 
63 static
64 void
67 {
69 
70  TRACE("DsSetupUnbind()\n");
71 
73  if (status)
74  {
75  TRACE("RpcBindingFree returned 0x%x\n", status);
76  }
77 }
78 
79 
80 VOID
81 WINAPI
84 {
85  TRACE("DsRoleFreeMemory(%p)\n", Buffer);
87 }
88 
89 
90 DWORD
91 WINAPI
93  LPCWSTR lpServer,
95  PBYTE* Buffer)
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)", status);
117  return status;
118  }
119 
121  {
123  InfoLevel,
125  }
127  {
129  }
130  RpcEndExcept;
131 
132  if (hBinding != NULL)
134 
135  return status;
136 }
137 
138 /* EOF */
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:877
#define RpcEndExcept
Definition: rpc.h:128
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
handle_t hBinding
Definition: ctx_c.c:54
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
enum _DSROLE_PRIMARY_DOMAIN_INFO_LEVEL DSROLE_PRIMARY_DOMAIN_INFO_LEVEL
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:511
VOID WINAPI DsRoleFreeMemory(_In_ PVOID Buffer)
Definition: dssetup.c:82
long RPC_STATUS
Definition: rpc.h:52
#define RpcTryExcept
Definition: rpc.h:126
#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
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
static void DsSetupUnbind(handle_t hBinding)
Definition: dssetup.c:65
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
DWORD WINAPI DsRoleGetPrimaryDomainInformation(LPCWSTR lpServer, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, PBYTE *Buffer)
Definition: dssetup.c:92
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
static RPC_STATUS DsSetupBind(LPWSTR lpServerName, handle_t *hBinding)
Definition: dssetup.c:22
static const WCHAR L[]
Definition: oid.c:1250
WINE_DEFAULT_DEBUG_CHANNEL(netapi32)
#define _In_
Definition: no_sal2.h:204
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static SERVICE_STATUS status
Definition: service.c:31
BYTE * PBYTE
Definition: pedump.c:66
#define HeapFree(x, y, z)
Definition: compat.h:402
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741
Definition: ps.c:97