2005-11-29 11:00:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2005 Paul Vriens
|
|
|
|
*
|
|
|
|
* Conformance test of the ds functions.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-11-29 11:00:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include <wine/test.h>
|
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winerror.h>
|
|
|
|
#include <dsrole.h>
|
|
|
|
|
|
|
|
static DWORD (WINAPI *pDsRoleGetPrimaryDomainInformation)(LPCWSTR, DSROLE_PRIMARY_DOMAIN_INFO_LEVEL, PBYTE*);
|
|
|
|
static void (WINAPI *pDsRoleFreeMemory)(PVOID);
|
|
|
|
|
|
|
|
static void test_params(void)
|
|
|
|
{
|
|
|
|
DWORD ret;
|
|
|
|
PDSROLE_PRIMARY_DOMAIN_INFO_BASIC dpdi;
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, NULL);
|
2006-10-08 17:35:50 +00:00
|
|
|
ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
|
2005-11-29 11:00:19 +00:00
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, 0, NULL);
|
2006-10-08 17:35:50 +00:00
|
|
|
ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
|
2005-11-29 11:00:19 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, 4, NULL);
|
2006-10-08 17:35:50 +00:00
|
|
|
ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
|
2005-11-29 11:00:19 +00:00
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, 4, (PBYTE *)&dpdi);
|
2006-10-08 17:35:50 +00:00
|
|
|
ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
|
2005-11-29 11:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_get(void)
|
|
|
|
{
|
|
|
|
DWORD ret;
|
|
|
|
PDSROLE_PRIMARY_DOMAIN_INFO_BASIC dpdi;
|
|
|
|
PDSROLE_UPGRADE_STATUS_INFO dusi;
|
|
|
|
PDSROLE_OPERATION_STATE_INFO dosi;
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE *)&dpdi);
|
2006-10-08 17:35:50 +00:00
|
|
|
ok( ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got (%d)\n", ret);
|
2008-06-19 13:13:51 +00:00
|
|
|
pDsRoleFreeMemory(dpdi);
|
2005-11-29 11:00:19 +00:00
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRoleUpgradeStatus, (PBYTE *)&dusi);
|
2006-10-08 17:35:50 +00:00
|
|
|
todo_wine { ok( ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got (%d)\n", ret); }
|
2008-06-19 13:13:51 +00:00
|
|
|
pDsRoleFreeMemory(dusi);
|
2005-11-29 11:00:19 +00:00
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRoleOperationState, (PBYTE *)&dosi);
|
2006-10-08 17:35:50 +00:00
|
|
|
todo_wine { ok( ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got (%d)\n", ret); }
|
2008-06-19 13:13:51 +00:00
|
|
|
pDsRoleFreeMemory(dosi);
|
2005-11-29 11:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
START_TEST(ds)
|
|
|
|
{
|
2007-03-23 10:32:36 +00:00
|
|
|
HMODULE hnetapi32 = LoadLibrary("netapi32.dll");
|
2005-11-29 11:00:19 +00:00
|
|
|
|
|
|
|
pDsRoleGetPrimaryDomainInformation=(void*)GetProcAddress(hnetapi32,"DsRoleGetPrimaryDomainInformation");
|
2007-03-23 10:32:36 +00:00
|
|
|
if (pDsRoleGetPrimaryDomainInformation)
|
2005-11-29 11:00:19 +00:00
|
|
|
{
|
2007-03-23 10:32:36 +00:00
|
|
|
pDsRoleFreeMemory=(void*)GetProcAddress(hnetapi32,"DsRoleFreeMemory");
|
|
|
|
|
|
|
|
test_params();
|
|
|
|
test_get();
|
2005-11-29 11:00:19 +00:00
|
|
|
}
|
2007-03-23 10:32:36 +00:00
|
|
|
else
|
2009-02-23 09:42:43 +00:00
|
|
|
win_skip("DsRoleGetPrimaryDomainInformation is not available\n");
|
2005-11-29 11:00:19 +00:00
|
|
|
|
2007-03-23 10:32:36 +00:00
|
|
|
FreeLibrary(hnetapi32);
|
2005-11-29 11:00:19 +00:00
|
|
|
}
|