[NETAPI32]
authorEric Kohl <eric.kohl@reactos.org>
Wed, 14 Jun 2017 13:10:36 +0000 (13:10 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Wed, 14 Jun 2017 13:10:36 +0000 (13:10 +0000)
- Add the computer browser service client interface.
- Add binding code for the computer browser service client interface.

svn path=/trunk/; revision=75038

reactos/dll/win32/netapi32/CMakeLists.txt
reactos/dll/win32/netapi32/browser.c

index ce7bfff..f0a6957 100644 (file)
@@ -7,6 +7,7 @@ add_definitions(-D__WINESRC__)
 spec2def(netapi32.dll netapi32.spec ADD_IMPORTLIB)
 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/srvsvc.idl
     ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/wkssvc.idl)
@@ -34,6 +35,7 @@ list(APPEND SOURCE
     wksta_new.c
     netapi32.h
     ${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}/srvsvc_c.c
     ${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c)
index 17a93f6..b5ab289 100644 (file)
 #include "netapi32.h"
 
 #include <rpc.h>
+#include "browser_c.h"
 
 
 WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
 
 /* FUNCTIONS *****************************************************************/
 
+handle_t __RPC_USER
+BROWSER_IDENTIFY_HANDLE_bind(BROWSER_IDENTIFY_HANDLE pszSystemName)
+{
+    handle_t hBinding = NULL;
+    LPWSTR pszStringBinding;
+    RPC_STATUS status;
+
+    TRACE("BROWSER_IDENTIFY_HANDLE_bind() called\n");
+
+    status = RpcStringBindingComposeW(NULL,
+                                      L"ncacn_np",
+                                      pszSystemName,
+                                      L"\\pipe\\browser",
+                                      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
+BROWSER_IDENTIFY_HANDLE_unbind(BROWSER_IDENTIFY_HANDLE pszSystemName,
+                               handle_t hBinding)
+{
+    RPC_STATUS status;
+
+    TRACE("BROWSER_IDENTIFY_HANDLE_unbind() called\n");
+
+    status = RpcBindingFree(&hBinding);
+    if (status)
+    {
+        TRACE("RpcBindingFree returned 0x%x\n", status);
+    }
+}
+
+
 NET_API_STATUS
 WINAPI
 NetServerEnum(