reactos/base/applications/cmdutils/reg/reg.h

66 lines
1.9 KiB
C
Raw Normal View History

/*
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
* Copyright 2017 Hugh McMaster
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
#ifndef __REG_H__
#define __REG_H__
#include <stdlib.h>
#include <windows.h>
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
#include "resource.h"
2018-01-21 21:04:40 +00:00
#define MAX_SUBKEY_LEN 257
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
/* reg.c */
struct reg_type_rels {
DWORD type;
const WCHAR *name;
};
extern const struct reg_type_rels type_rels[8];
2018-01-21 21:04:40 +00:00
void output_writeconsole(const WCHAR *str, DWORD wlen);
void WINAPIV output_message(unsigned int id, ...);
void WINAPIV output_string(const WCHAR *fmt, ...);
2018-01-21 21:04:40 +00:00
BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info);
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
HKEY path_get_rootkey(const WCHAR *path);
2018-01-21 21:04:40 +00:00
WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len);
WCHAR *get_long_key(HKEY root, WCHAR *path);
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path);
BOOL is_char(const WCHAR s, const WCHAR c);
BOOL is_switch(const WCHAR *s, const WCHAR c);
/* add.c */
int reg_add(int argc, WCHAR *argvW[]);
/* copy.c */
int reg_copy(int argc, WCHAR *argvW[]);
/* delete.c */
int reg_delete(int argc, WCHAR *argvW[]);
/* export.c */
int reg_export(int argc, WCHAR *argvW[]);
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
/* import.c */
int reg_import(int argc, WCHAR *argvW[]);
/* query.c */
int reg_query(int argc, WCHAR *argvW[]);
2018-01-21 21:04:40 +00:00
[REG] Sync with Wine Staging 2.16. CORE-13762 39e0e81 reg: Null-terminate incomplete REG_EXPAND_SZ and REG_MULTI_SZ Unicode data. 82fc4c8 reg: Close any open registry keys before starting the key deletion process. 5de883c reg: Use the correct return codes during the import operation. 56e58e4 reg: Delete registry keys via the state machine. d90f2a5 reg: Delete registry values via the state machine. db98cc4 reg: Handle unknown registry data types in the state machine. 32d5368 reg: Import hex data via the state machine. f1874c1 reg: Import REG_DWORD data via the state machine. 038f1c6 reg: Parse data types and import REG_SZ data via the state machine. 0565934 reg: Parse key names and value names in the state machine. 3e87a70 reg: Introduce a partial state machine for importing Windows 3.1 registry data. aa386af reg: Add initial support for the import operation. f2fbbec reg: Rename reg.h to resource.h. c6c95a0 reg: Compile with msvcrt. 8c253c4 reg: Make some variables 'static const'. 337e0f4 reg: Avoid an uninitialized variable warning. 8abec73 reg: Dynamically allocate memory for the value name buffer when deleting all registry values in a specified key. e7ea838 reg: Use a helper function to resize a memory buffer. a1bc33a reg: Use a helper function to free allocated memory. a6e28cc reg: Use a helper function to allocate memory and die on failure. 90da210 reg: Account for sizeof(WCHAR) when resizing the value name buffer during the query operation. fb22f6c reg: Avoid using RegQueryInfoKey() to enumerate subkeys and values in the query operation. svn path=/trunk/; revision=75958
2017-09-24 11:33:04 +00:00
#endif /* __REG_H__ */