Author: ekohl Date: Mon Feb 23 22:55:43 2015 New Revision: 66436
URL: http://svn.reactos.org/svn/reactos?rev=66436&view=rev Log: [NETAPI32] CORE-9248 Comment out NetGetJoinInformation and NetWkstaGetInfo in wksta.c and reimplement them as RPC client functions to the workstation service in wksta_new.c.
Added: trunk/reactos/dll/win32/netapi32/wksta_new.c (with props) Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt trunk/reactos/dll/win32/netapi32/wksta.c
Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/CMakeLis... ============================================================================== --- trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] Mon Feb 23 22:55:43 2015 @@ -1,8 +1,11 @@
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +include_directories( + ${REACTOS_SOURCE_DIR}/include/reactos/idl + ${REACTOS_SOURCE_DIR}/include/reactos/wine) + add_definitions(-D__WINESRC__) - spec2def(netapi32.dll netapi32.spec ADD_IMPORTLIB) +add_rpc_files(client ${REACTOS_SOURCE_DIR}/include/reactos/idl/wkssvc.idl)
list(APPEND SOURCE access.c @@ -20,7 +23,9 @@ share.c user.c wksta.c - netapi32.h) + wksta_new.c + netapi32.h + ${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c)
add_library(netapi32 SHARED ${SOURCE} @@ -28,8 +33,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/netapi32.def)
set_module_type(netapi32 win32dll) -target_link_libraries(netapi32 wine) -add_importlibs(netapi32 iphlpapi ws2_32 advapi32 msvcrt kernel32 ntdll) +target_link_libraries(netapi32 wine ${PSEH_LIB}) +add_importlibs(netapi32 iphlpapi ws2_32 advapi32 rpcrt4 msvcrt kernel32 ntdll) add_delay_importlibs(netapi32 samlib secur32) add_pch(netapi32 netapi32.h SOURCE) add_cd_file(TARGET netapi32 DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/netapi32/wksta.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta.c?... ============================================================================== --- trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/wksta.c [iso-8859-1] Mon Feb 23 22:55:43 2015 @@ -464,6 +464,7 @@ return ERROR_INVALID_PARAMETER; }
+#if 0 NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level, LPBYTE* bufptr) { @@ -566,4 +567,4 @@
return NERR_Success; } - +#endif
Added: trunk/reactos/dll/win32/netapi32/wksta_new.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/wksta_ne... ============================================================================== --- trunk/reactos/dll/win32/netapi32/wksta_new.c (added) +++ trunk/reactos/dll/win32/netapi32/wksta_new.c [iso-8859-1] Mon Feb 23 22:55:43 2015 @@ -0,0 +1,197 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: NetAPI DLL + * FILE: reactos/dll/win32/netapi32/wksta_new.c + * PURPOSE: Workstation service interface code + * + * PROGRAMMERS: Eric Kohl + */ + +/* INCLUDES ******************************************************************/ + +#include "netapi32.h" +#include "wkssvc_c.h" + +WINE_DEFAULT_DEBUG_CHANNEL(netapi32); + +/* FUNCTIONS *****************************************************************/ + +void __RPC_FAR * __RPC_USER midl_user_allocate(SIZE_T len) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); +} + + +void __RPC_USER midl_user_free(void __RPC_FAR * ptr) +{ + HeapFree(GetProcessHeap(), 0, ptr); +} + + +handle_t __RPC_USER +WKSSVC_IDENTIFY_HANDLE_bind(WKSSVC_IDENTIFY_HANDLE pszSystemName) +{ + handle_t hBinding = NULL; + LPWSTR pszStringBinding; + RPC_STATUS status; + + TRACE("WKSSVC_IDENTIFY_HANDLE_bind() called\n"); + + status = RpcStringBindingComposeW(NULL, + L"ncacn_np", + pszSystemName, + L"\pipe\wkssvc", + 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 +WKSSVC_IDENTIFY_HANDLE_unbind(WKSSVC_IDENTIFY_HANDLE pszSystemName, + handle_t hBinding) +{ + RPC_STATUS status; + + TRACE("WKSSVC_IDENTIFY_HANDLE_unbind() called\n"); + + status = RpcBindingFree(&hBinding); + if (status) + { + TRACE("RpcBindingFree returned 0x%x\n", status); + } +} + + +handle_t __RPC_USER +WKSSVC_IMPERSONATE_HANDLE_bind(WKSSVC_IMPERSONATE_HANDLE pszSystemName) +{ + handle_t hBinding = NULL; + LPWSTR pszStringBinding; + RPC_STATUS status; + + TRACE("WKSSVC_IMPERSONATE_HANDLE_bind() called\n"); + + status = RpcStringBindingComposeW(NULL, + L"ncacn_np", + pszSystemName, + L"\pipe\wkssvc", + 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 +WKSSVC_IMPERSONATE_HANDLE_unbind(WKSSVC_IMPERSONATE_HANDLE pszSystemName, + handle_t hBinding) +{ + RPC_STATUS status; + + TRACE("WKSSVC_IMPERSONATE_HANDLE_unbind() called\n"); + + status = RpcBindingFree(&hBinding); + if (status) + { + TRACE("RpcBindingFree returned 0x%x\n", status); + } +} + + +NET_API_STATUS +NET_API_FUNCTION +NetGetJoinInformation( + LPCWSTR Server, + LPWSTR *Name, + PNETSETUP_JOIN_STATUS type) +{ + NET_API_STATUS status; + + FIXME("Stub %s %p %p\n", wine_dbgstr_w(Server), Name, type); + + if (Name == NULL || type == NULL) + return ERROR_INVALID_PARAMETER; + + RpcTryExcept + { + status = NetrGetJoinInformation((LPWSTR)Server, + Name, + type); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + +NET_API_STATUS +WINAPI +NetWkstaGetInfo( + LMSTR servername, + DWORD level, + LPBYTE *bufptr) +{ + NET_API_STATUS status; + + *bufptr = NULL; + + RpcTryExcept + { + status = NetrWkstaGetInfo(servername, + level, + (LPWKSTA_INFO)bufptr); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + +/* EOF */
Propchange: trunk/reactos/dll/win32/netapi32/wksta_new.c ------------------------------------------------------------------------------ svn:eol-style = native