Add a simple API Test for netapi32.dll, only covering DsRoleGetPrimaryDomainInformation so far.
It succeeds in ReactOS, but outputs a heap error in the debug log. In real world applications, this later leads to a heap assertion failure.
svn path=/trunk/; revision=75208
add_subdirectory(localspl)
add_subdirectory(msgina)
add_subdirectory(msvcrt)
+add_subdirectory(netapi32)
add_subdirectory(netshell)
add_subdirectory(ntdll)
add_subdirectory(ole32)
--- /dev/null
+
+list(APPEND SOURCE
+ DsRoleGetPrimaryDomainInformation.c
+ testlist.c)
+
+add_executable(netapi32_apitest ${SOURCE})
+target_link_libraries(netapi32_apitest wine ${PSEH_LIB})
+set_module_type(netapi32_apitest win32cui)
+add_importlibs(netapi32_apitest netapi32 msvcrt kernel32 ntdll)
+add_rostests_file(TARGET netapi32_apitest)
--- /dev/null
+/*
+ * PROJECT: ReactOS netapi32.dll API Tests
+ * LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
+ * PURPOSE: Tests for DsRoleGetPrimaryDomainInformation
+ * COPYRIGHT: Copyright 2017 Colin Finck <colin@reactos.org>
+ */
+
+#include <apitest.h>
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <dsrole.h>
+
+START_TEST(DsRoleGetPrimaryDomainInformation)
+{
+ DWORD dwErrorCode;
+ PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pInfo = NULL;
+
+ // Get information about the domain membership of this computer.
+ dwErrorCode = DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE*)&pInfo);
+ ok(dwErrorCode == ERROR_SUCCESS, "DsRoleGetPrimaryDomainInformation returns %lu!\n", dwErrorCode);
+ ok(pInfo->MachineRole >= DsRole_RoleStandaloneWorkstation && pInfo->MachineRole <= DsRole_RolePrimaryDomainController, "pInfo->MachineRole is %lu!\n", pInfo->MachineRole);
+
+ if (pInfo)
+ DsRoleFreeMemory(pInfo);
+}
--- /dev/null
+/*
+ * PROJECT: ReactOS netapi32.dll API Tests
+ * LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
+ * PURPOSE: Test list
+ * COPYRIGHT: Copyright 2017 Colin Finck <colin@reactos.org>
+ */
+
+#define __ROS_LONG64__
+
+#define STANDALONE
+#include <apitest.h>
+
+extern void func_DsRoleGetPrimaryDomainInformation(void);
+
+const struct test winetest_testlist[] =
+{
+ { "DsRoleGetPrimaryDomainInformation", func_DsRoleGetPrimaryDomainInformation },
+
+ { 0, 0 }
+};