ReactOS 0.4.15-dev-5664-g3bf4ef6
export.c File Reference
#include "reg_test.h"
Include dependency graph for export.c:

Go to the source code of this file.

Functions

BOOL compare_export_ (const char *file, unsigned line, const char *filename, const char *expected, DWORD todo)
 
static void test_command_syntax (void)
 
static void test_export (void)
 
 START_TEST (export)
 

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 charembedded_null_test
 
const charslashes_test
 
const charescaped_null_test
 
const charregistry_view_test
 

Function Documentation

◆ 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:27
#define NULL
Definition: types.h:112
#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
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
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define error(str)
Definition: mkdosfs.c:1605
#define lok
Definition: registry.c:202
BOOL todo
Definition: filedlg.c:313
BOOL expected
Definition: store.c:2063
#define todo_wine_if(is_todo)
Definition: custom.c:76
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

◆ START_TEST()

START_TEST ( export  )

Definition at line 595 of file export.c.

596{
597 DWORD r;
598
599 if (!run_reg_exe("reg.exe /?", &r)) {
600 win_skip("reg.exe not available, skipping 'export' tests\n");
601 return;
602 }
603
605 test_export();
606
607 /* Check if reg.exe is running with elevated privileges */
608 if (!is_elevated_process())
609 {
610 win_skip("reg.exe is not running with elevated privileges; "
611 "skipping registry view tests\n");
612 return;
613 }
614
615#if 0
616 test_registry_view_win32();
617 test_registry_view_win64();
618 test_registry_view_wow64();
619#endif
620
621}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void test_export(void)
Definition: export.c:236
static void test_command_syntax(void)
Definition: export.c:180
BOOL is_elevated_process(void)
Definition: import.c:21
#define run_reg_exe(c, r)
Definition: reg_test.h:39
#define win_skip
Definition: test.h:160

◆ test_command_syntax()

static void test_command_syntax ( void  )
static

Definition at line 180 of file export.c.

181{
182 DWORD r;
183
185
186 run_reg_exe("reg export", &r);
187 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
188
189 run_reg_exe("reg export /?", &r);
190 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
191
192 run_reg_exe("reg export /h", &r);
193 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
194
195 run_reg_exe("reg export -H", &r);
196 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
197
198 run_reg_exe("reg export \\\\remote-pc\\HKLM\\Wine file.reg", &r);
199 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
200
201 run_reg_exe("reg export HKEY_DYN_DATA file.reg", &r);
202 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
203
204 run_reg_exe("reg export HKDD file.reg", &r);
205 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
206
207 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE, &r);
208 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
209
210 run_reg_exe("reg export file.reg", &r);
211 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
212
213 run_reg_exe("reg export file.reg HKEY_CURRENT_USER\\" KEY_BASE, &r);
214 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
215
216 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE, &r);
217 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
218
219 /* This test fails because the registry key doesn't exist */
220 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r);
221 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
222
223 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg file2.reg", &r);
224 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
225
226 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /reg:32 /reg:32", &r);
227 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
228
229 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /reg:32 /reg:64", &r);
230 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
231
232 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /reg:64 /reg:64", &r);
233 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
234}
#define ok(value,...)
Definition: atltest.h:57
#define REG_EXIT_FAILURE
Definition: reg_test.h:31
#define delete_tree(r, p, s)
Definition: reg_test.h:67
#define REG_EXIT_SUCCESS
Definition: reg_test.h:30
#define KEY_BASE
Definition: reg_test.h:29
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by START_TEST().

◆ test_export()

static void test_export ( void  )
static

Definition at line 236 of file export.c.

237{
238 LONG err;
239 DWORD r, dword, type, size;
240 HKEY hkey, subkey;
241 BYTE hex[4], buffer[8];
242
244
245 /* Test registry export with an empty key */
247
248 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r);
249 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
250 ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
251
252 run_reg_exe("reg export /y HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r);
253 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
254
255 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " /y file.reg", &r);
256 ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
257
258 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
259 ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE), /* winxp */
260 "got exit code %d, expected 0\n", r);
261 ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
262
263 /* Test registry export with a simple data structure */
264 dword = 0x100;
265 add_value(hkey, "DWORD", REG_DWORD, &dword, sizeof(dword));
266 add_value(hkey, "String", REG_SZ, "Your text here...", 18);
267
268 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
269 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
270 ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
271
272 /* Test whether a .reg file extension is required when exporting */
273 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " foo /y", &r);
274 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
275 ok(compare_export("foo", simple_data_test, 0), "compare_export() failed\n");
276
277 /* Test registry export with a complex data structure */
278 add_key(hkey, "Subkey1", 0, &subkey);
279 add_value(subkey, "Binary", REG_BINARY, "\x11\x22\x33\x44", 4);
280 add_value(subkey, "Undefined hex", 0x100, "%PATH%", 7);
281 close_key(subkey);
282
283 add_key(hkey, "Subkey2a", 0, &subkey);
284 add_value(subkey, "double\"quote", REG_SZ, "\"Hello, World!\"", 16);
285 dword = 0x8;
286 add_value(subkey, "single'quote", REG_DWORD, &dword, sizeof(dword));
287 close_key(subkey);
288
289 add_key(hkey, "Subkey2a\\Subkey2b", 0, &subkey);
290 add_value(subkey, NULL, REG_SZ, "Default value name", 19);
291 add_value(subkey, "Multiple strings", REG_MULTI_SZ, "Line1\0Line2\0Line3\0", 19);
292 close_key(subkey);
293
294 add_key(hkey, "Subkey3a", 0, &subkey);
295 add_value(subkey, "Backslash", REG_SZ, "Use \\\\ to escape a backslash", 29);
296 close_key(subkey);
297
298 add_key(hkey, "Subkey3a\\Subkey3b\\Subkey3c", 0, &subkey);
299 add_value(subkey, "String expansion", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14);
300 add_value(subkey, "Zero data type", REG_NONE, "Value", 6);
301 close_key(subkey);
302
303 add_key(hkey, "Subkey4", 0, &subkey);
304 dword = 0x12345678;
305 add_value(subkey, NULL, REG_DWORD, &dword, sizeof(dword));
306 add_value(subkey, "43981", 0xabcd, "Value", 6);
307 close_key(subkey);
308
309 close_key(hkey);
310
311 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
312 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
313 ok(compare_export("file.reg", complex_data_test, 0), "compare_export() failed\n");
315
316 /* Test the export order of registry keys */
318 add_key(hkey, "Subkey2", 0, NULL);
319 add_key(hkey, "Subkey1", 0, NULL);
320
321 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
322 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
323 ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n");
324 delete_key(hkey, "Subkey1", 0);
325 delete_key(hkey, "Subkey2", 0);
326
327 /* Test the export order of registry values. Windows exports registry values
328 * in order of creation; Wine uses alphabetical order.
329 */
330 add_value(hkey, "Value 2", REG_SZ, "I was added first!", 19);
331 add_value(hkey, "Value 1", REG_SZ, "I was added second!", 20);
332 close_key(hkey);
333
334 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
335 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
336 ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n");
338
339 /* Test registry export with empty hex data */
341 add_value(hkey, "Wine1a", REG_NONE, NULL, 0);
342 add_value(hkey, "Wine1b", REG_SZ, NULL, 0);
343 add_value(hkey, "Wine1c", REG_EXPAND_SZ, NULL, 0);
344 add_value(hkey, "Wine1d", REG_BINARY, NULL, 0);
345 add_value(hkey, "Wine1e", REG_DWORD, NULL, 0);
346 add_value(hkey, "Wine1f", REG_MULTI_SZ, NULL, 0);
347 add_value(hkey, "Wine1g", 0x100, NULL, 0);
348 add_value(hkey, "Wine1h", 0xabcd, NULL, 0);
349 close_key(hkey);
350
351 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
352 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
353 ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n");
355
356 /* Test registry export after importing alternative registry data types */
357 test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
358 "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
359 "\"Wine2a\"=hex(1):\n"
360 "\"Wine2b\"=hex(3):\n"
361 "\"Wine2c\"=hex(4):\n\n", &r);
362 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
364 verify_reg(hkey, "Wine2a", REG_SZ, NULL, 0, 0);
365 verify_reg(hkey, "Wine2b", REG_BINARY, NULL, 0, 0);
366 verify_reg(hkey, "Wine2c", REG_DWORD, NULL, 0, 0);
367 close_key(hkey);
368
369 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
370 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
371 ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n");
373
374 test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
375 "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
376 "\"Wine3a\"=hex(1):56,00,61,00,6c,00,75,00,65,00,00,00\n"
377 "\"Wine3b\"=hex(3):12,34,56,78\n"
378 "\"Wine3c\"=hex(4):40,30,20,10\n\n", &r);
379 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
381 verify_reg(hkey, "Wine3a", REG_SZ, "Value", 6, 0);
382 memcpy(hex, "\x12\x34\x56\x78", 4);
383 verify_reg(hkey, "Wine3b", REG_BINARY, hex, 4, 0);
384 dword = 0x10203040;
385 verify_reg(hkey, "Wine3c", REG_DWORD, &dword, sizeof(dword), 0);
386 close_key(hkey);
387
388 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
389 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
390 ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n");
392
393 /* Test registry export with embedded null characters */
394 test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
395 "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
396 "\"Wine4a\"=dword:00000005\n"
397 "\"Wine4b\"=hex(1):00,00,00,00,00,00,00,00\n"
398 "\"Wine4c\"=\"Value\"\n"
399 "\"Wine4d\"=hex(1):00,00,61,00,62,00,63,00\n"
400 "\"Wine4e\"=dword:00000100\n"
401 "\"Wine4f\"=hex(1):00,00,56,00,61,00,6c,00,75,00,65,00,00,00\n"
402 "\"Wine4g\"=\"Value2\"\n"
403 "\"Wine4h\"=hex(1):61,00,62,00,63,00,00,00, \\\n"
404 " 64,00,65,00,66,00,00,00\n\n", &r);
405 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
407 dword = 0x5;
408 verify_reg(hkey, "Wine4a", REG_DWORD, &dword, sizeof(dword), 0);
409 verify_reg(hkey, "Wine4b", REG_SZ, "\0\0\0\0\0\0\0", 4, 0);
410 verify_reg(hkey, "Wine4c", REG_SZ, "Value", 6, 0);
411 /* Wine4d */
412 size = sizeof(buffer);
413 err = RegQueryValueExA(hkey, "Wine4d", NULL, &type, (BYTE *)&buffer, &size);
414 ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
415 ok(type == REG_SZ, "got wrong type %u, expected %u\n", type, REG_SZ);
416 ok(size == 5 || broken(size == 4) /* WinXP */, "got wrong size %u, expected 5\n", size);
417 ok(memcmp(buffer, "\0abc", size) == 0, "got wrong data\n");
418 dword = 0x100;
419 verify_reg(hkey, "Wine4e", REG_DWORD, &dword, sizeof(dword), 0);
420 verify_reg(hkey, "Wine4f", REG_SZ, "\0Value", 7, 0);
421 verify_reg(hkey, "Wine4g", REG_SZ, "Value2", 7, 0);
422 verify_reg(hkey, "Wine4h", REG_SZ, "abc\0def", 8, 0);
423 close_key(hkey);
424
425 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
426 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
427 ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n");
429
430 /* Test registry export with forward and back slashes */
432 add_key(hkey, "https://winehq.org", 0, NULL);
433 add_value(hkey, "count/up", REG_SZ, "one/two/three", 14);
434 add_value(hkey, "\\foo\\bar", REG_SZ, "", 1);
435 close_key(hkey);
436
437 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
438 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
439 ok(compare_export("file.reg", slashes_test, TODO_REG_COMPARE), "compare_export() failed\n");
441
442 /* Test escaped null characters */
444 add_value(hkey, "Wine5a", REG_SZ, "\\0", 3);
445 add_value(hkey, "Wine5b", REG_SZ, "\\0\\0", 5);
446 add_value(hkey, "Wine5c", REG_SZ, "Value1\\0", 9);
447 add_value(hkey, "Wine5d", REG_SZ, "Value2\\0\\0\\0\\0", 15);
448 add_value(hkey, "Wine5e", REG_SZ, "Value3\\0Value4", 15);
449 add_value(hkey, "Wine5f", REG_SZ, "\\0Value5", 9);
450 close_key(hkey);
451
452 run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
453 ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
454 ok(compare_export("file.reg", escaped_null_test, 0), "compare_export() failed\n");
456}
#define broken(x)
Definition: _sntprintf.h:21
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ERROR_SUCCESS
Definition: deptool.c:10
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:4027
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
int hex(char ch)
#define REG_SZ
Definition: layer.c:22
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const char * empty_hex_test2
Definition: export.c:125
const char * hex_types_test
Definition: export.c:132
const char * complex_data_test
Definition: export.c:75
const char * escaped_null_test
Definition: export.c:158
const char * key_order_test
Definition: export.c:101
const char * slashes_test
Definition: export.c:151
const char * embedded_null_test
Definition: export.c:139
const char * simple_data_test
Definition: export.c:69
const char * value_order_test
Definition: export.c:107
const char * empty_hex_test
Definition: export.c:113
const char * empty_key_test
Definition: export.c:65
#define REG_BINARY
Definition: nt_native.h:1496
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define REG_NONE
Definition: nt_native.h:1492
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
long LONG
Definition: pedump.c:60
#define err(...)
#define add_value(k, n, t, d, s)
Definition: reg_test.h:70
#define compare_export(f, e, todo)
Definition: reg_test.h:78
#define test_import_wstr(c, r)
Definition: reg_test.h:101
#define add_key(r, p, s, k)
Definition: reg_test.h:61
#define verify_reg(k, v, t, d, s, todo)
Definition: reg_test.h:42
#define open_key(r, p, s, k)
Definition: reg_test.h:49
#define close_key(k)
Definition: reg_test.h:52
#define delete_key(r, p, s)
Definition: reg_test.h:64
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().

Variable Documentation

◆ complex_data_test

const char* complex_data_test
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"DWORD\"=dword:00000100\r\n"
"\"String\"=\"Your text here...\"\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\r\n"
"\"Binary\"=hex:11,22,33,44\r\n"
"\"Undefined hex\"=hex(100):25,50,41,54,48,25,00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\r\n"
"\"double\\\"quote\"=\"\\\"Hello, World!\\\"\"\r\n"
"\"single'quote\"=dword:00000008\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a\\Subkey2b]\r\n"
"@=\"Default value name\"\r\n"
"\"Multiple strings\"=hex(7):4c,00,69,00,6e,00,65,00,31,00,00,00,4c,00,69,00,6e,\\\r\n"
" 00,65,00,32,00,00,00,4c,00,69,00,6e,00,65,00,33,00,00,00,00,00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a]\r\n"
"\"Backslash\"=\"Use \\\\\\\\ to escape a backslash\"\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a\\Subkey3b]\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey3a\\Subkey3b\\Subkey3c]\r\n"
"\"String expansion\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,25,00,50,\\\r\n"
" 00,41,00,54,00,48,00,25,00,00,00\r\n"
"\"Zero data type\"=hex(0):56,61,6c,75,65,00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4]\r\n"
"@=dword:12345678\r\n"
"\"43981\"=hex(abcd):56,61,6c,75,65,00\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Wine4a\"=dword:00000005\r\n"
"\"Wine4b\"=\"\"\r\n"
"\"Wine4c\"=\"Value\"\r\n"
"\"Wine4d\"=\"\"\r\n"
"\"Wine4e\"=dword:00000100\r\n"
"\"Wine4f\"=\"\"\r\n"
"\"Wine4g\"=\"Value2\"\r\n"
"\"Wine4h\"=\"abc\"\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Wine1a\"=hex(0):\r\n"
"\"Wine1b\"=\"\"\r\n"
"\"Wine1c\"=hex(2):\r\n"
"\"Wine1d\"=hex:\r\n"
"\"Wine1e\"=hex(4):\r\n"
"\"Wine1f\"=hex(7):\r\n"
"\"Wine1g\"=hex(100):\r\n"
"\"Wine1h\"=hex(abcd):\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Wine2a\"=\"\"\r\n"
"\"Wine2b\"=hex:\r\n"
"\"Wine2c\"=hex(4):\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Wine5a\"=\"\\\\0\"\r\n"
"\"Wine5b\"=\"\\\\0\\\\0\"\r\n"
"\"Wine5c\"=\"Value1\\\\0\"\r\n"
"\"Wine5d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\r\n"
"\"Wine5e\"=\"Value3\\\\0Value4\"\r\n"
"\"Wine5f\"=\"\\\\0Value5\"\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Wine3a\"=\"Value\"\r\n"
"\"Wine3b\"=hex:12,34,56,78\r\n"
"\"Wine3c\"=dword:10203040\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_LOCAL_MACHINE\\" KEY_BASE "]\r\n"
"\"DWORD\"=dword:00000100\r\n"
"\"String\"=\"Your text here...\"\r\n\r\n"
"[HKEY_LOCAL_MACHINE\\" KEY_BASE "\\Subkey1]\r\n"
"\"Binary\"=hex:11,22,33,44\r\n"
"\"Undefined hex\"=hex(100):25,50,41,54,48,25,00\r\n\r\n"

Definition at line 168 of file export.c.

◆ simple_data_test

const char* simple_data_test
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"DWORD\"=dword:00000100\r\n"
"\"String\"=\"Your text here...\"\r\n\r\n"

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
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"count/up\"=\"one/two/three\"\r\n"
"\"\\\\foo\\\\bar\"=\"\"\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\r\n\r\n"

Definition at line 151 of file export.c.

Referenced by test_copy_slashes(), and test_export().

◆ value_order_test

const char* value_order_test
Initial value:
=
"\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\r\n"
"\"Value 2\"=\"I was added first!\"\r\n"
"\"Value 1\"=\"I was added second!\"\r\n\r\n"

Definition at line 107 of file export.c.

Referenced by test_copy_value_order(), and test_export().