reg_test.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2021 Hugh McMaster
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. #ifndef __REG_TEST_H__
  19. #define __REG_TEST_H__
  20. #include <stdio.h>
  21. #include <windows.h>
  22. #include "wine/test.h"
  23. /* Common #defines */
  24. #define lok ok_(file,line)
  25. #define KEY_WINE "Software\\Wine"
  26. #define KEY_BASE KEY_WINE "\\reg_test"
  27. #define REG_EXIT_SUCCESS 0
  28. #define REG_EXIT_FAILURE 1
  29. /* add.c */
  30. #define run_reg_exe(c,r) run_reg_exe_(__FILE__,__LINE__,c,r)
  31. BOOL run_reg_exe_(const char *file, unsigned line, const char *cmd, DWORD *rc);
  32. #define verify_reg(k,v,t,d,s,todo) verify_reg_(__FILE__,__LINE__,k,v,t,d,s,todo)
  33. void verify_reg_(const char *file, unsigned line, HKEY hkey, const char *value,
  34. DWORD exp_type, const void *exp_data, DWORD exp_size, DWORD todo);
  35. #define verify_reg_nonexist(k,v) verify_reg_nonexist_(__FILE__,__LINE__,k,v)
  36. void verify_reg_nonexist_(const char *file, unsigned line, HKEY hkey, const char *value);
  37. #define open_key(b,p,s,k) open_key_(__FILE__,__LINE__,b,p,s,k)
  38. void open_key_(const char *file, unsigned line, const HKEY base, const char *path,
  39. const DWORD sam, HKEY *hkey);
  40. #define close_key(k) close_key_(__FILE__,__LINE__,k)
  41. void close_key_(const char *file, unsigned line, HKEY hkey);
  42. #define verify_key(k,s) verify_key_(__FILE__,__LINE__,k,s)
  43. void verify_key_(const char *file, unsigned line, HKEY key_base, const char *subkey);
  44. #define verify_key_nonexist(k,s) verify_key_nonexist_(__FILE__,__LINE__,k,s)
  45. void verify_key_nonexist_(const char *file, unsigned line, HKEY key_base, const char *subkey);
  46. #define add_key(k,p,s) add_key_(__FILE__,__LINE__,k,p,s)
  47. void add_key_(const char *file, unsigned line, const HKEY hkey, const char *path, HKEY *subkey);
  48. #define delete_key(k,p) delete_key_(__FILE__,__LINE__,k,p)
  49. void delete_key_(const char *file, unsigned line, const HKEY hkey, const char *path);
  50. LONG delete_tree(const HKEY key, const char *subkey);
  51. #define add_value(k,n,t,d,s) add_value_(__FILE__,__LINE__,k,n,t,d,s)
  52. void add_value_(const char *file, unsigned line, HKEY hkey, const char *name,
  53. DWORD type, const void *data, size_t size);
  54. #define delete_value(k,n) delete_value_(__FILE__,__LINE__,k,n)
  55. void delete_value_(const char *file, unsigned line, const HKEY hkey, const char *name);
  56. /* import.c */
  57. #define test_import_str(c,r) import_reg(__FILE__,__LINE__,c,FALSE,r)
  58. #define test_import_wstr(c,r) import_reg(__FILE__,__LINE__,c,TRUE,r)
  59. BOOL import_reg(const char *file, unsigned line, const char *contents, BOOL unicode, DWORD *rc);
  60. #endif /* __REG_TEST_H__ */