ReactOS 0.4.15-dev-7958-gcd0bb1a
ds.c File Reference
#include <stdarg.h>
#include <wine/test.h>
#include <windef.h>
#include <winbase.h>
#include <winerror.h>
#include <dsrole.h>
Include dependency graph for ds.c:

Go to the source code of this file.

Functions

static DWORD (WINAPI *pDsRoleGetPrimaryDomainInformation)(LPCWSTR
 
static PBYTE *static void (WINAPI *pDsRoleFreeMemory)(PVOID)
 
static void test_params (void)
 
static void test_get (void)
 
 START_TEST (ds)
 

Variables

static DSROLE_PRIMARY_DOMAIN_INFO_LEVEL
 

Function Documentation

◆ DWORD()

static DWORD ( WINAPI pDsRoleGetPrimaryDomainInformation)
static

◆ START_TEST()

START_TEST ( ds  )

Definition at line 77 of file ds.c.

78{
79 HMODULE hnetapi32 = LoadLibraryA("netapi32.dll");
80
81 pDsRoleGetPrimaryDomainInformation=(void*)GetProcAddress(hnetapi32,"DsRoleGetPrimaryDomainInformation");
82 if (pDsRoleGetPrimaryDomainInformation)
83 {
84 pDsRoleFreeMemory=(void*)GetProcAddress(hnetapi32,"DsRoleFreeMemory");
85
87 test_get();
88 }
89 else
90 win_skip("DsRoleGetPrimaryDomainInformation is not available\n");
91
92 FreeLibrary(hnetapi32);
93}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
static void test_get(void)
Definition: ds.c:53
static void test_params(void)
Definition: ds.c:32
#define win_skip
Definition: test.h:160

◆ test_get()

static void test_get ( void  )
static

Definition at line 53 of file ds.c.

54{
55 DWORD ret;
59
60 SetLastError(0xdeadbeef);
61 ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE *)&dpdi);
62 ok( ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got (%d)\n", ret);
63 pDsRoleFreeMemory(dpdi);
64
65 SetLastError(0xdeadbeef);
66 ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRoleUpgradeStatus, (PBYTE *)&dusi);
67 todo_wine { ok( ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got (%d)\n", ret); }
68 pDsRoleFreeMemory(dusi);
69
70 SetLastError(0xdeadbeef);
71 ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRoleOperationState, (PBYTE *)&dosi);
72 todo_wine { ok( ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got (%d)\n", ret); }
73 pDsRoleFreeMemory(dosi);
74}
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
@ DsRolePrimaryDomainInfoBasic
Definition: dsrole.h:32
@ DsRoleUpgradeStatus
Definition: dsrole.h:33
@ DsRoleOperationState
Definition: dsrole.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define todo_wine
Definition: custom.c:79
BYTE * PBYTE
Definition: pedump.c:66
int ret

Referenced by START_TEST().

◆ test_params()

static void test_params ( void  )
static

Definition at line 32 of file ds.c.

33{
34 DWORD ret;
36
37 SetLastError(0xdeadbeef);
38 ret = pDsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, NULL);
39 ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
40
41 SetLastError(0xdeadbeef);
42 ret = pDsRoleGetPrimaryDomainInformation(NULL, 0, NULL);
43 ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
44 SetLastError(0xdeadbeef);
45 ret = pDsRoleGetPrimaryDomainInformation(NULL, 4, NULL);
46 ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
47
48 SetLastError(0xdeadbeef);
49 ret = pDsRoleGetPrimaryDomainInformation(NULL, 4, (PBYTE *)&dpdi);
50 ok( ret == ERROR_INVALID_PARAMETER, "Expected error ERROR_INVALID_PARAMETER, got (%d)\n", ret);
51}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101

Referenced by START_TEST().

◆ void()

static PBYTE *static void ( WINAPI pDsRoleFreeMemory)
static

Variable Documentation

◆ DSROLE_PRIMARY_DOMAIN_INFO_LEVEL

Definition at line 29 of file ds.c.