Commit bc283fcf authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

adsldp: Implement IADsADSystemInfo::get_ComputerName().

parent 8be0a557
MODULE = adsldp.dll
IMPORTS = oleaut32 secur32
C_SRCS = \
adsldp.c
......
......@@ -28,6 +28,8 @@
#include "objbase.h"
#include "rpcproxy.h"
#include "iads.h"
#define SECURITY_WIN32
#include "security.h"
#include "wine/debug.h"
......@@ -120,8 +122,27 @@ static HRESULT WINAPI sysinfo_get_UserName(IADsADSystemInfo *iface, BSTR *retval
static HRESULT WINAPI sysinfo_get_ComputerName(IADsADSystemInfo *iface, BSTR *retval)
{
FIXME("%p,%p: stub\n", iface, retval);
return E_NOTIMPL;
UINT size;
WCHAR *name;
TRACE("%p,%p\n", iface, retval);
size = 0;
GetComputerObjectNameW(NameFullyQualifiedDN, NULL, &size);
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
return HRESULT_FROM_WIN32(GetLastError());
name = SysAllocStringLen(NULL, size);
if (!name) return E_OUTOFMEMORY;
if (!GetComputerObjectNameW(NameFullyQualifiedDN, name, &size))
{
SysFreeString(name);
return HRESULT_FROM_WIN32(GetLastError());
}
*retval = name;
return S_OK;
}
static HRESULT WINAPI sysinfo_get_SiteName(IADsADSystemInfo *iface, BSTR *retval)
......
......@@ -79,7 +79,6 @@ static void test_ComputerName(void)
ok(hr == S_OK, "got %#x\n", hr);
hr = IADsADSystemInfo_get_ComputerName(sysinfo, &bstr);
todo_wine
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_CANT_ACCESS_DOMAIN_INFO), "got %#x\n", hr);
if (hr == S_OK)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment