From 89eb252fb84186051e9229ff135139d84a9c59a1 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 14 Jun 2017 11:31:54 +0000 Subject: [PATCH] [NETAPI32] Implement NetGetJoinableOUs and NetValidateName. These functions call their counterparts in the workstation service. svn path=/trunk/; revision=75033 --- reactos/dll/win32/netapi32/netapi32.spec | 4 +- reactos/dll/win32/netapi32/wksta_new.c | 82 ++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/netapi32/netapi32.spec b/reactos/dll/win32/netapi32/netapi32.spec index e491d029bf5..4cd127e6a7d 100644 --- a/reactos/dll/win32/netapi32/netapi32.spec +++ b/reactos/dll/win32/netapi32/netapi32.spec @@ -151,7 +151,7 @@ @ stdcall NetGetDCName(wstr wstr ptr) @ stub NetGetDisplayInformationIndex @ stdcall NetGetJoinInformation(wstr ptr ptr) -@ stub NetGetJoinableOUs +@ stdcall NetGetJoinableOUs(wstr wstr wstr wstr ptr ptr) @ stdcall NetGroupAdd(wstr long ptr ptr) @ stdcall NetGroupAddUser(wstr wstr wstr) @ stdcall NetGroupDel(wstr wstr) @@ -250,7 +250,7 @@ @ stdcall NetUserModalsSet(wstr long ptr ptr) @ stdcall NetUserSetGroups(wstr wstr long ptr long) @ stdcall NetUserSetInfo(wstr wstr long ptr ptr) -@ stub NetValidateName +@ stdcall NetValidateName(wstr wstr wstr wstr long) @ stub NetValidatePasswordPolicy @ stub NetValidatePasswordPolicyFree @ stdcall NetWkstaGetInfo(wstr long ptr) diff --git a/reactos/dll/win32/netapi32/wksta_new.c b/reactos/dll/win32/netapi32/wksta_new.c index 951a3857a9c..0841ef6ffe0 100644 --- a/reactos/dll/win32/netapi32/wksta_new.c +++ b/reactos/dll/win32/netapi32/wksta_new.c @@ -211,6 +211,48 @@ NetGetJoinInformation( #endif +NET_API_STATUS +WINAPI +NetGetJoinableOUs( + _In_ LPCWSTR lpServer, + _In_ LPCWSTR lpDomain, + _In_ LPCWSTR lpAccount, + _In_ LPCWSTR lpPassword, + _Out_ DWORD *OUCount, + _Out_ LPWSTR **OUs) +{ + PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword; + handle_t BindingHandle; + NET_API_STATUS status; + + TRACE("NetGetJoinableOUs(%s %s %s %s %p %p)\n", + debugstr_w(lpServer), debugstr_w(lpDomain), debugstr_w(lpAccount), + debugstr_w(lpPassword), OUCount, OUs); + + /* FIXME */ + BindingHandle = NULL; + EncryptedPassword = NULL; + + RpcTryExcept + { + status = NetrGetJoinableOUs2(BindingHandle, + (PWSTR)lpServer, + (PWSTR)lpDomain, + (PWSTR)lpAccount, + EncryptedPassword, + OUCount, + OUs); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + NET_API_STATUS WINAPI NetJoinDomain( @@ -552,6 +594,46 @@ NetUseEnum( } +NET_API_STATUS +WINAPI +NetValidateName( + _In_ LPCWSTR lpServer, + _In_ LPCWSTR lpName, + _In_ LPCWSTR lpAccount, + _In_ LPCWSTR lpPassword, + _In_ NETSETUP_NAME_TYPE NameType) +{ + PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword; + handle_t BindingHandle; + NET_API_STATUS status; + + TRACE("NetValidateName(%s %s %s %s %u)\n", + debugstr_w(lpServer), debugstr_w(lpName), debugstr_w(lpAccount), + debugstr_w(lpPassword), NameType); + + /* FIXME */ + BindingHandle = NULL; + EncryptedPassword = NULL; + + RpcTryExcept + { + status = NetrValidateName2(BindingHandle, + (PWSTR)lpServer, + (PWSTR)lpName, + (PWSTR)lpAccount, + EncryptedPassword, + NameType); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + NET_API_STATUS WINAPI NetUseGetInfo( -- 2.17.1