mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 15:34:13 +00:00
[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. svn path=/trunk/; revision=66436
This commit is contained in:
parent
075ebb4c7b
commit
e71c25046e
|
@ -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__)
|
add_definitions(-D__WINESRC__)
|
||||||
|
|
||||||
spec2def(netapi32.dll netapi32.spec ADD_IMPORTLIB)
|
spec2def(netapi32.dll netapi32.spec ADD_IMPORTLIB)
|
||||||
|
add_rpc_files(client ${REACTOS_SOURCE_DIR}/include/reactos/idl/wkssvc.idl)
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
access.c
|
access.c
|
||||||
|
@ -20,7 +23,9 @@ list(APPEND SOURCE
|
||||||
share.c
|
share.c
|
||||||
user.c
|
user.c
|
||||||
wksta.c
|
wksta.c
|
||||||
netapi32.h)
|
wksta_new.c
|
||||||
|
netapi32.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c)
|
||||||
|
|
||||||
add_library(netapi32 SHARED
|
add_library(netapi32 SHARED
|
||||||
${SOURCE}
|
${SOURCE}
|
||||||
|
@ -28,8 +33,8 @@ add_library(netapi32 SHARED
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/netapi32.def)
|
${CMAKE_CURRENT_BINARY_DIR}/netapi32.def)
|
||||||
|
|
||||||
set_module_type(netapi32 win32dll)
|
set_module_type(netapi32 win32dll)
|
||||||
target_link_libraries(netapi32 wine)
|
target_link_libraries(netapi32 wine ${PSEH_LIB})
|
||||||
add_importlibs(netapi32 iphlpapi ws2_32 advapi32 msvcrt kernel32 ntdll)
|
add_importlibs(netapi32 iphlpapi ws2_32 advapi32 rpcrt4 msvcrt kernel32 ntdll)
|
||||||
add_delay_importlibs(netapi32 samlib secur32)
|
add_delay_importlibs(netapi32 samlib secur32)
|
||||||
add_pch(netapi32 netapi32.h SOURCE)
|
add_pch(netapi32 netapi32.h SOURCE)
|
||||||
add_cd_file(TARGET netapi32 DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET netapi32 DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -464,6 +464,7 @@ NET_API_STATUS WINAPI I_NetNameValidate(LPVOID p1, LPWSTR wkgrp, LPVOID p3,
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level,
|
NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level,
|
||||||
LPBYTE* bufptr)
|
LPBYTE* bufptr)
|
||||||
{
|
{
|
||||||
|
@ -566,4 +567,4 @@ NET_API_STATUS NET_API_FUNCTION NetGetJoinInformation(
|
||||||
|
|
||||||
return NERR_Success;
|
return NERR_Success;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
197
reactos/dll/win32/netapi32/wksta_new.c
Normal file
197
reactos/dll/win32/netapi32/wksta_new.c
Normal file
|
@ -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 */
|
Loading…
Reference in a new issue