ReactOS 0.4.16-dev-205-g7b2bb7e
reg_test.h File Reference
#include <stdio.h>
#include <windows.h>
#include "wine/test.h"
Include dependency graph for reg_test.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define lok   ok_(file,line)
 
#define KEY_WINE   "Software\\Wine"
 
#define KEY_BASE   KEY_WINE "\\reg_test"
 
#define REG_EXIT_SUCCESS   0
 
#define REG_EXIT_FAILURE   1
 
#define TODO_REG_TYPE   (0x0001u)
 
#define TODO_REG_SIZE   (0x0002u)
 
#define TODO_REG_DATA   (0x0004u)
 
#define TODO_REG_COMPARE   (0x0008u)
 
#define run_reg_exe(c, r)   run_reg_exe_(__FILE__,__LINE__,c,r)
 
#define verify_reg(k, v, t, d, s, todo)   verify_reg_(__FILE__,__LINE__,k,v,t,d,s,todo)
 
#define verify_reg_nonexist(k, v)   verify_reg_nonexist_(__FILE__,__LINE__,k,v)
 
#define open_key(r, p, s, k)   open_key_(__FILE__,__LINE__,r,p,s,k)
 
#define close_key(k)   close_key_(__FILE__,__LINE__,k)
 
#define verify_key(r, p, s)   verify_key_(__FILE__,__LINE__,r,p,s)
 
#define verify_key_nonexist(r, p, s)   verify_key_nonexist_(__FILE__,__LINE__,r,p,s)
 
#define add_key(r, p, s, k)   add_key_(__FILE__,__LINE__,r,p,s,k)
 
#define delete_key(r, p, s)   delete_key_(__FILE__,__LINE__,r,p,s)
 
#define delete_tree(r, p, s)   delete_tree_(__FILE__,__LINE__,r,p,s)
 
#define add_value(k, n, t, d, s)   add_value_(__FILE__,__LINE__,k,n,t,d,s)
 
#define delete_value(k, n)   delete_value_(__FILE__,__LINE__,k,n)
 
#define compare_export(f, e, todo)   compare_export_(__FILE__,__LINE__,f,e,todo)
 
#define delete_file(f)   delete_file_(__FILE__,__LINE__,f)
 
#define test_import_str(c, r)   import_reg(__FILE__,__LINE__,c,FALSE,r)
 
#define test_import_wstr(c, r)   import_reg(__FILE__,__LINE__,c,TRUE,r)
 

Functions

BOOL run_reg_exe_ (const char *file, unsigned line, const char *cmd, DWORD *rc)
 
void verify_reg_ (const char *file, unsigned line, HKEY hkey, const char *value, DWORD exp_type, const void *exp_data, DWORD exp_size, DWORD todo)
 
void verify_reg_nonexist_ (const char *file, unsigned line, HKEY hkey, const char *value)
 
void open_key_ (const char *file, unsigned line, HKEY root, const char *path, REGSAM sam, HKEY *hkey)
 
void close_key_ (const char *file, unsigned line, HKEY hkey)
 
void verify_key_ (const char *file, unsigned line, HKEY root, const char *path, REGSAM sam)
 
void verify_key_nonexist_ (const char *file, unsigned line, HKEY root, const char *path, REGSAM sam)
 
void add_key_ (const char *file, unsigned line, const HKEY root, const char *path, REGSAM sam, HKEY *hkey)
 
void delete_key_ (const char *file, unsigned line, HKEY root, const char *path, REGSAM sam)
 
LONG delete_tree_ (const char *file, unsigned line, HKEY root, const char *path, REGSAM sam)
 
void add_value_ (const char *file, unsigned line, HKEY hkey, const char *name, DWORD type, const void *data, size_t size)
 
void delete_value_ (const char *file, unsigned line, HKEY hkey, const char *name)
 
BOOL compare_export_ (const char *file, unsigned line, const char *filename, const char *expected, DWORD todo)
 
BOOL is_elevated_process (void)
 
BOOL delete_file_ (const char *file, unsigned line, const char *fname)
 
BOOL import_reg (const char *file, unsigned line, const char *contents, BOOL unicode, DWORD *rc)
 

Variables

const charempty_key_test
 
const charsimple_data_test
 
const charcomplex_data_test
 
const charkey_order_test
 
const charvalue_order_test
 
const charempty_hex_test
 
const charempty_hex_test2
 
const charhex_types_test
 
const charslashes_test
 
const charembedded_null_test
 
const charescaped_null_test
 
const charregistry_view_test
 

Macro Definition Documentation

◆ add_key

#define add_key (   r,
  p,
  s,
  k 
)    add_key_(__FILE__,__LINE__,r,p,s,k)

Definition at line 61 of file reg_test.h.

◆ add_value

#define add_value (   k,
  n,
  t,
  d,
  s 
)    add_value_(__FILE__,__LINE__,k,n,t,d,s)

Definition at line 70 of file reg_test.h.

◆ close_key

#define close_key (   k)    close_key_(__FILE__,__LINE__,k)

Definition at line 52 of file reg_test.h.

◆ compare_export

#define compare_export (   f,
  e,
  todo 
)    compare_export_(__FILE__,__LINE__,f,e,todo)

Definition at line 78 of file reg_test.h.

◆ delete_file

#define delete_file (   f)    delete_file_(__FILE__,__LINE__,f)

Definition at line 97 of file reg_test.h.

◆ delete_key

#define delete_key (   r,
  p,
  s 
)    delete_key_(__FILE__,__LINE__,r,p,s)

Definition at line 64 of file reg_test.h.

◆ delete_tree

#define delete_tree (   r,
  p,
  s 
)    delete_tree_(__FILE__,__LINE__,r,p,s)

Definition at line 67 of file reg_test.h.

◆ delete_value

#define delete_value (   k,
  n 
)    delete_value_(__FILE__,__LINE__,k,n)

Definition at line 74 of file reg_test.h.

◆ KEY_BASE

#define KEY_BASE   KEY_WINE "\\reg_test"

Definition at line 29 of file reg_test.h.

◆ KEY_WINE

#define KEY_WINE   "Software\\Wine"

Definition at line 28 of file reg_test.h.

◆ lok

#define lok   ok_(file,line)

Definition at line 27 of file reg_test.h.

◆ open_key

#define open_key (   r,
  p,
  s,
  k 
)    open_key_(__FILE__,__LINE__,r,p,s,k)

Definition at line 49 of file reg_test.h.

◆ REG_EXIT_FAILURE

#define REG_EXIT_FAILURE   1

Definition at line 31 of file reg_test.h.

◆ REG_EXIT_SUCCESS

#define REG_EXIT_SUCCESS   0

Definition at line 30 of file reg_test.h.

◆ run_reg_exe

#define run_reg_exe (   c,
  r 
)    run_reg_exe_(__FILE__,__LINE__,c,r)

Definition at line 39 of file reg_test.h.

◆ test_import_str

#define test_import_str (   c,
  r 
)    import_reg(__FILE__,__LINE__,c,FALSE,r)

Definition at line 100 of file reg_test.h.

◆ test_import_wstr

#define test_import_wstr (   c,
  r 
)    import_reg(__FILE__,__LINE__,c,TRUE,r)

Definition at line 101 of file reg_test.h.

◆ TODO_REG_COMPARE

#define TODO_REG_COMPARE   (0x0008u)

Definition at line 36 of file reg_test.h.

◆ TODO_REG_DATA

#define TODO_REG_DATA   (0x0004u)

Definition at line 35 of file reg_test.h.

◆ TODO_REG_SIZE

#define TODO_REG_SIZE   (0x0002u)

Definition at line 34 of file reg_test.h.

◆ TODO_REG_TYPE

#define TODO_REG_TYPE   (0x0001u)

Definition at line 33 of file reg_test.h.

◆ verify_key

#define verify_key (   r,
  p,
  s 
)    verify_key_(__FILE__,__LINE__,r,p,s)

Definition at line 55 of file reg_test.h.

◆ verify_key_nonexist

#define verify_key_nonexist (   r,
  p,
  s 
)    verify_key_nonexist_(__FILE__,__LINE__,r,p,s)

Definition at line 58 of file reg_test.h.

◆ verify_reg

#define verify_reg (   k,
  v,
  t,
  d,
  s,
  todo 
)    verify_reg_(__FILE__,__LINE__,k,v,t,d,s,todo)

Definition at line 42 of file reg_test.h.

◆ verify_reg_nonexist

#define verify_reg_nonexist (   k,
  v 
)    verify_reg_nonexist_(__FILE__,__LINE__,k,v)

Definition at line 46 of file reg_test.h.

Function Documentation

◆ add_key_()

void add_key_ ( const char file,
unsigned  line,
const HKEY  root,
const char path,
REGSAM  sam,
HKEY hkey 
)

Definition at line 124 of file add.c.

125{
126 LONG err;
128
131 lok(err == ERROR_SUCCESS, "RegCreateKeyExA failed: got error %d\n", err);
132
133 if (hkey)
134 *hkey = new_key;
135 else
137}
static REGSAM sam
Definition: query.c:143
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1034
static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTKEY **ppCryptKey)
Definition: rsaenh.c:794
#define lok
Definition: registry.c:202
#define KEY_READ
Definition: nt_native.h:1023
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
long LONG
Definition: pedump.c:60
#define err(...)

◆ add_value_()

void add_value_ ( const char file,
unsigned  line,
HKEY  hkey,
const char name,
DWORD  type,
const void data,
size_t  size 
)

Definition at line 204 of file add.c.

206{
207 LONG err;
208
209 err = RegSetValueExA(hkey, name, 0, type, (const BYTE *)data, size);
210 lok(err == ERROR_SUCCESS, "RegSetValueExA failed: got error %d\n", err);
211}
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
Definition: name.c:39
unsigned char BYTE
Definition: xxhash.c:193

◆ close_key_()

void close_key_ ( const char file,
unsigned  line,
HKEY  hkey 
)

Definition at line 92 of file add.c.

93{
94 LONG err;
95
96 err = RegCloseKey(hkey);
97 lok(err == ERROR_SUCCESS, "RegCloseKey failed: got error %d\n", err);
98}

◆ compare_export_()

BOOL compare_export_ ( const char file,
unsigned  line,
const char filename,
const char expected,
DWORD  todo 
)

Definition at line 21 of file export.c.

23{
24 FILE *fp;
25 long file_size;
26 WCHAR *fbuf = NULL, *wstr = NULL;
27 size_t len;
28 BOOL ret = FALSE;
29
30 fp = fopen(filename, "rb");
31 if (!fp) return FALSE;
32
33 if (fseek(fp, 0, SEEK_END)) goto error;
34 file_size = ftell(fp);
35 if (file_size == -1) goto error;
36 rewind(fp);
37
38 fbuf = HeapAlloc(GetProcessHeap(), 0, file_size + sizeof(WCHAR));
39 if (!fbuf) goto error;
40
41 fread(fbuf, file_size, 1, fp);
42 fbuf[file_size/sizeof(WCHAR)] = 0;
43 fclose(fp);
44
46 wstr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
47 if (!wstr) goto exit;
49
51 lok(!lstrcmpW(fbuf, wstr), "export data does not match expected data\n");
52
54
55exit:
56 HeapFree(GetProcessHeap(), 0, fbuf);
57 HeapFree(GetProcessHeap(), 0, wstr);
58 return ret;
59
60error:
61 fclose(fp);
62 return FALSE;
63}
#define SEEK_END
Definition: cabinet.c:29
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define MultiByteToWideChar
Definition: compat.h:110
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLsizei len
Definition: glext.h:6722
_CRTIMP void __cdecl rewind(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
const char * filename
Definition: ioapi.h:137
#define error(str)
Definition: mkdosfs.c:1605
BOOL todo
Definition: filedlg.c:313
BOOL expected
Definition: store.c:2063
#define todo_wine_if(is_todo)
Definition: custom.c:86
BOOL delete_file_(const char *file, unsigned line, const char *fname)
Definition: import.c:44
#define TODO_REG_COMPARE
Definition: reg_test.h:36
static unsigned int file_size
Definition: regtests2xml.c:47
#define CP_UTF8
Definition: nls.h:20
#define exit(n)
Definition: config.h:202
Definition: fci.c:127
Definition: parser.c:49
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ delete_file_()

BOOL delete_file_ ( const char file,
unsigned  line,
const char fname 
)

Definition at line 44 of file import.c.

45{
46 BOOL ret;
47
48 ret = DeleteFileA(fname);
49 lok(ret, "DeleteFile failed: %u\n", GetLastError());
50
51 return ret;
52}
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by compare_export_().

◆ delete_key_()

void delete_key_ ( const char file,
unsigned  line,
HKEY  root,
const char path,
REGSAM  sam 
)

Definition at line 139 of file add.c.

140{
141 LONG err;
142
143 if (!path) return;
144
145 if (!sam)
146 {
148 lok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got error %d\n", err);
149 }
150 else
151 {
153 lok(err == ERROR_SUCCESS, "RegDeleteKeyExA failed: got error %d\n", err);
154 }
155}
LONG WINAPI RegDeleteKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
Definition: reg.c:1254
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224

◆ delete_tree_()

LONG delete_tree_ ( const char file,
unsigned  line,
HKEY  root,
const char path,
REGSAM  sam 
)

Definition at line 157 of file add.c.

158{
159 HKEY hkey;
160 LONG ret;
161 char *subkey_name = NULL;
162 DWORD max_subkey_len, subkey_len;
163 static const char empty[1];
164
165 ret = RegOpenKeyExA(root, path, 0, KEY_READ|sam, &hkey);
166 lok(!ret || ret == ERROR_FILE_NOT_FOUND, "RegOpenKeyExA failed, got error %d\n", ret);
167 if (ret) return ret;
168
169 ret = RegQueryInfoKeyA(hkey, NULL, NULL, NULL, NULL, &max_subkey_len,
170 NULL, NULL, NULL, NULL, NULL, NULL);
171 if (ret) goto cleanup;
172
173 max_subkey_len++;
174
175 subkey_name = HeapAlloc(GetProcessHeap(), 0, max_subkey_len);
176 if (!subkey_name)
177 {
179 goto cleanup;
180 }
181
182 for (;;)
183 {
184 subkey_len = max_subkey_len;
185 ret = RegEnumKeyExA(hkey, 0, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
186 if (ret == ERROR_NO_MORE_ITEMS) break;
187 if (ret) goto cleanup;
188 ret = delete_tree_(file, line, hkey, subkey_name, sam);
189 if (ret) goto cleanup;
190 }
191
192 if (!sam)
193 ret = RegDeleteKeyA(hkey, empty);
194 else
195 ret = RegDeleteKeyExA(hkey, empty, sam, 0);
196
197cleanup:
198 lok(!ret, "Failed to delete registry key, got error %d\n", ret);
199 HeapFree(GetProcessHeap(), 0, subkey_name);
200 RegCloseKey(hkey);
201 return ret;
202}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3583
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2419
static const WCHAR empty[]
Definition: main.c:47
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
static void cleanup(void)
Definition: main.c:1335
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LONG delete_tree_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam)
Definition: add.c:157

Referenced by delete_tree_().

◆ delete_value_()

void delete_value_ ( const char file,
unsigned  line,
HKEY  hkey,
const char name 
)

Definition at line 213 of file add.c.

214{
215 LONG err;
216
217 err = RegDeleteValueA(hkey, name);
218 lok(err == ERROR_SUCCESS, "RegDeleteValueA failed: got error %d\n", err);
219}
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2287

◆ import_reg()

BOOL import_reg ( const char file,
unsigned  line,
const char contents,
BOOL  unicode,
DWORD rc 
)

Definition at line 96 of file import.c.

97{
98 BOOL ret;
99
100 ret = write_reg_file("test.reg", contents, unicode);
101 if (!ret) return FALSE;
102
103 run_reg_exe("reg import test.reg", rc);
104
105 delete_file("test.reg");
106
107 return ret;
108}
static BOOL write_reg_file(const char *fname, const char *contents, BOOL unicode)
Definition: import.c:72
static const char * contents
Definition: parser.c:511
#define delete_file(f)
Definition: reg_test.h:97
#define run_reg_exe(c, r)
Definition: reg_test.h:39

◆ is_elevated_process()

BOOL is_elevated_process ( void  )

Definition at line 21 of file import.c.

22{
23 LONG err;
24 HKEY hkey;
25
27
29 return FALSE;
30
32 {
34 KEY_READ, NULL, &hkey, NULL))
35 return FALSE;
36
37 RegCloseKey(hkey);
39 }
40
41 return TRUE;
42}
#define TRUE
Definition: types.h:120
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define KEY_BASE
Definition: reg_test.h:29
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by START_TEST(), and test_import_win31().

◆ open_key_()

void open_key_ ( const char file,
unsigned  line,
HKEY  root,
const char path,
REGSAM  sam,
HKEY hkey 
)

Definition at line 84 of file add.c.

85{
86 LONG err;
87
88 err = RegOpenKeyExA(root, path, 0, KEY_READ|sam, hkey);
89 lok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got error %d\n", err);
90}

◆ run_reg_exe_()

BOOL run_reg_exe_ ( const char file,
unsigned  line,
const char cmd,
DWORD rc 
)

Definition at line 21 of file add.c.

22{
23 STARTUPINFOA si = {sizeof(STARTUPINFOA)};
25 BOOL bret;
26 DWORD ret;
27 char cmdline[256];
28
33
35 if (!CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi))
36 return FALSE;
37
38 ret = WaitForSingleObject(pi.hProcess, 10000);
39 if (ret == WAIT_TIMEOUT)
40 TerminateProcess(pi.hProcess, 1);
41
42 bret = GetExitCodeProcess(pi.hProcess, rc);
43 lok(bret, "GetExitCodeProcess failed: %d\n", GetLastError());
44
45 CloseHandle(pi.hThread);
46 CloseHandle(pi.hProcess);
47 return bret;
48}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4747
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
static refpint_t pi[]
Definition: server.c:96
TCHAR * cmdline
Definition: stretchblt.cpp:32
HANDLE hStdOutput
Definition: winbase.h:871
HANDLE hStdError
Definition: winbase.h:872
DWORD dwFlags
Definition: winbase.h:866
HANDLE hStdInput
Definition: winbase.h:870
Definition: ftp_var.h:139
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
struct _STARTUPINFOA STARTUPINFOA
#define STARTF_USESTDHANDLES
Definition: winbase.h:524

◆ verify_key_()

void verify_key_ ( const char file,
unsigned  line,
HKEY  root,
const char path,
REGSAM  sam 
)

Definition at line 100 of file add.c.

101{
102 HKEY hkey;
103 LONG err;
104
105 err = RegOpenKeyExA(root, path, 0, KEY_READ|sam, &hkey);
106 lok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got error %d\n", err);
107
108 if (hkey)
109 RegCloseKey(hkey);
110}

◆ verify_key_nonexist_()

void verify_key_nonexist_ ( const char file,
unsigned  line,
HKEY  root,
const char path,
REGSAM  sam 
)

Definition at line 112 of file add.c.

113{
114 HKEY hkey;
115 LONG err;
116
117 err = RegOpenKeyExA(root, path, 0, KEY_READ|sam, &hkey);
118 lok(err == ERROR_FILE_NOT_FOUND, "registry key '%s' shouldn't exist; got %d, expected 2\n", path, err);
119
120 if (hkey)
121 RegCloseKey(hkey);
122}

◆ verify_reg_()

void verify_reg_ ( const char file,
unsigned  line,
HKEY  hkey,
const char value,
DWORD  exp_type,
const void exp_data,
DWORD  exp_size,
DWORD  todo 
)

Definition at line 50 of file add.c.

52{
54 BYTE data[256];
55 LONG err;
56
57 size = sizeof(data);
58 memset(data, 0xdd, size);
60 lok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got error %d\n", err);
61 if (err != ERROR_SUCCESS)
62 return;
63
65 lok(type == exp_type, "got registry type %d, expected %d\n", type, exp_type);
67 lok(size == exp_size, "got data size %d, expected %d\n", size, exp_size);
68 if (exp_data)
69 {
71 lok(memcmp(data, exp_data, size) == 0, "registry data does not match\n");
72 }
73}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
#define TODO_REG_TYPE
Definition: reg_test.h:33
#define TODO_REG_DATA
Definition: reg_test.h:35
#define TODO_REG_SIZE
Definition: reg_test.h:34
#define memset(x, y, z)
Definition: compat.h:39
struct ChNotifyTest * exp_data
Definition: shlfolder.c:4868
Definition: pdh_main.c:94

◆ verify_reg_nonexist_()

void verify_reg_nonexist_ ( const char file,
unsigned  line,
HKEY  hkey,
const char value 
)

Definition at line 75 of file add.c.

76{
77 LONG err;
78
80 lok(err == ERROR_FILE_NOT_FOUND, "registry value '%s' shouldn't exist; got %d, expected 2\n",
81 (value && *value) ? value : "(Default)", err);
82}

Variable Documentation

◆ complex_data_test

const char* complex_data_test
extern

Definition at line 75 of file export.c.

Referenced by test_copy_complex_data(), and test_export().

◆ embedded_null_test

const char* embedded_null_test
extern

Definition at line 139 of file export.c.

Referenced by test_copy_embedded_null_values(), and test_export().

◆ empty_hex_test

const char* empty_hex_test
extern

Definition at line 113 of file export.c.

Referenced by test_copy_hex_data(), and test_export().

◆ empty_hex_test2

const char* empty_hex_test2
extern

Definition at line 125 of file export.c.

Referenced by test_copy_hex_data(), and test_export().

◆ empty_key_test

const char* empty_key_test
extern

Definition at line 65 of file export.c.

Referenced by test_copy_empty_key(), and test_export().

◆ escaped_null_test

const char* escaped_null_test
extern

Definition at line 158 of file export.c.

Referenced by test_copy_escaped_null_values(), and test_export().

◆ hex_types_test

const char* hex_types_test
extern

Definition at line 132 of file export.c.

Referenced by test_copy_hex_data(), and test_export().

◆ key_order_test

const char* key_order_test
extern

Definition at line 101 of file export.c.

Referenced by test_copy_key_order(), and test_export().

◆ registry_view_test

const char* registry_view_test
extern

Definition at line 168 of file export.c.

◆ simple_data_test

const char* simple_data_test
extern

Definition at line 69 of file export.c.

Referenced by test_copy_complex_data(), test_copy_simple_data(), and test_export().

◆ slashes_test

const char* slashes_test
extern

Definition at line 151 of file export.c.

Referenced by test_copy_slashes(), and test_export().

◆ value_order_test

const char* value_order_test
extern

Definition at line 107 of file export.c.

Referenced by test_copy_value_order(), and test_export().