From 4d493bb613abf4fd4b4a5cc9c8ec2cf1c316de11 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 14 Jun 2017 13:06:41 +0000 Subject: [PATCH] [NETAPI32] Implement NetEnumerateComputerNames. This function calls its counterpart in the workstation service. svn path=/trunk/; revision=75037 --- reactos/dll/win32/netapi32/netapi32.spec | 2 +- reactos/dll/win32/netapi32/wksta_new.c | 38 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/netapi32/netapi32.spec b/reactos/dll/win32/netapi32/netapi32.spec index 4cd127e6a7d..e8c5038d9dc 100644 --- a/reactos/dll/win32/netapi32/netapi32.spec +++ b/reactos/dll/win32/netapi32/netapi32.spec @@ -139,7 +139,7 @@ @ stub NetDfsSetInfo @ stub NetDfsSetSecurity @ stub NetDfsSetStdContainerSecurity -@ stub NetEnumerateComputerNames +@ stdcall NetEnumerateComputerNames(wstr long long ptr ptr) @ stdcall NetEnumerateTrustedDomains(wstr ptr) @ stdcall NetErrorLogClear(wstr wstr ptr) @ stdcall NetErrorLogRead(wstr wstr ptr long ptr long long ptr long ptr ptr) diff --git a/reactos/dll/win32/netapi32/wksta_new.c b/reactos/dll/win32/netapi32/wksta_new.c index 0841ef6ffe0..bc876152354 100644 --- a/reactos/dll/win32/netapi32/wksta_new.c +++ b/reactos/dll/win32/netapi32/wksta_new.c @@ -178,6 +178,44 @@ NetAddAlternateComputerName( } +NET_API_STATUS +WINAPI +NetEnumerateComputerNames( + _In_opt_ LPCWSTR Server, + _In_ NET_COMPUTER_NAME_TYPE NameType, + _In_ ULONG Reserved, + _Out_ PDWORD EntryCount, + _Out_ LPWSTR **ComputerNames) +{ + PNET_COMPUTER_NAME_ARRAY ComputerNameArray = NULL; + NET_API_STATUS status; + + TRACE("NetEnumerateComputerNames(%s %lu %lu %p %p)\n", + debugstr_w(Server), NameType, Reserved, EntryCount, ComputerNames); + + RpcTryExcept + { + status = NetrEnumerateComputerNames((PWSTR)Server, + NameType, + Reserved, + &ComputerNameArray); + if (status == NERR_Success) + { + *EntryCount = ComputerNameArray->EntryCount; + /* FIXME */ + // *ComputerNames = + } + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + #if 0 NET_API_STATUS WINAPI