[NETAPI32]
[reactos.git] / reactos / dll / win32 / netapi32 / browser.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: NetAPI DLL
4 * FILE: dll/win32/netapi32/browser.c
5 * PURPOSE: Computer Browser service interface code
6 * PROGRAMMERS: Eric Kohl (eric.kohl@reactos.org)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include "netapi32.h"
12
13 #include <rpc.h>
14 #include <lmbrowsr.h>
15 #include "browser_c.h"
16
17
18 WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
19
20 /* FUNCTIONS *****************************************************************/
21
22 handle_t __RPC_USER
23 BROWSER_IDENTIFY_HANDLE_bind(BROWSER_IDENTIFY_HANDLE pszSystemName)
24 {
25 handle_t hBinding = NULL;
26 LPWSTR pszStringBinding;
27 RPC_STATUS status;
28
29 TRACE("BROWSER_IDENTIFY_HANDLE_bind() called\n");
30
31 status = RpcStringBindingComposeW(NULL,
32 L"ncacn_np",
33 pszSystemName,
34 L"\\pipe\\browser",
35 NULL,
36 &pszStringBinding);
37 if (status)
38 {
39 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
40 return NULL;
41 }
42
43 /* Set the binding handle that will be used to bind to the server. */
44 status = RpcBindingFromStringBindingW(pszStringBinding,
45 &hBinding);
46 if (status)
47 {
48 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
49 }
50
51 status = RpcStringFreeW(&pszStringBinding);
52 if (status)
53 {
54 // TRACE("RpcStringFree returned 0x%x\n", status);
55 }
56
57 return hBinding;
58 }
59
60
61 void __RPC_USER
62 BROWSER_IDENTIFY_HANDLE_unbind(BROWSER_IDENTIFY_HANDLE pszSystemName,
63 handle_t hBinding)
64 {
65 RPC_STATUS status;
66
67 TRACE("BROWSER_IDENTIFY_HANDLE_unbind() called\n");
68
69 status = RpcBindingFree(&hBinding);
70 if (status)
71 {
72 TRACE("RpcBindingFree returned 0x%x\n", status);
73 }
74 }
75
76
77 NET_API_STATUS
78 WINAPI
79 I_BrowserQueryEmulatedDomains(
80 _In_opt_ LPWSTR ServerName,
81 _Out_ PBROWSER_EMULATED_DOMAIN *EmulatedDomains,
82 _Out_ LPDWORD EntriesRead)
83 {
84 FIXME("I_BrowserQueryEmulatedDomains(%s %p %p)\n",
85 debugstr_w(ServerName), EmulatedDomains, EntriesRead);
86
87 return ERROR_NOT_SUPPORTED;
88 }
89
90
91 NET_API_STATUS
92 WINAPI
93 I_BrowserSetNetlogonState(
94 _In_ LPWSTR ServerName,
95 _In_ LPWSTR DomainName,
96 _In_ LPWSTR EmulatedServerName,
97 _In_ DWORD Role)
98 {
99 FIXME("I_BrowserSetNetlogonState(%s %s %s %lu)\n",
100 debugstr_w(ServerName), debugstr_w(ServerName),
101 debugstr_w(EmulatedServerName), Role);
102
103 return ERROR_NOT_SUPPORTED;
104 }
105
106
107 NET_API_STATUS
108 WINAPI
109 NetServerEnum(
110 _In_opt_ LMCSTR servername,
111 _In_ DWORD level,
112 _Out_ LPBYTE *bufptr,
113 _In_ DWORD prefmaxlen,
114 _Out_ LPDWORD entriesread,
115 _Out_ LPDWORD totalentries,
116 _In_ DWORD servertype,
117 _In_opt_ LMCSTR domain,
118 _Inout_opt_ LPDWORD resume_handle)
119 {
120 FIXME("NetServerEnum(%s %lu %p %lu %p %p %lu %s %p)\n",
121 debugstr_w(servername), level, bufptr, prefmaxlen, entriesread,
122 totalentries, servertype, debugstr_w(domain), resume_handle);
123
124 return ERROR_NO_BROWSER_SERVERS_FOUND;
125 }
126
127
128 NET_API_STATUS
129 WINAPI
130 NetServerEnumEx(
131 _In_opt_ LMCSTR ServerName,
132 _In_ DWORD Level,
133 _Out_ LPBYTE *Bufptr,
134 _In_ DWORD PrefMaxlen,
135 _Out_ LPDWORD EntriesRead,
136 _Out_ LPDWORD totalentries,
137 _In_ DWORD servertype,
138 _In_opt_ LMCSTR domain,
139 _In_opt_ LMCSTR FirstNameToReturn)
140 {
141 FIXME("NetServerEnumEx(%s %lu %p %lu %p %p %lu %s %s)\n",
142 debugstr_w(ServerName), Level, Bufptr, PrefMaxlen, EntriesRead, totalentries,
143 servertype, debugstr_w(domain), debugstr_w(FirstNameToReturn));
144
145 return ERROR_NO_BROWSER_SERVERS_FOUND;
146 }
147
148 /* EOF */