31 size_t i, escape_count,
pos;
34 for (
i = 0, escape_count = 0;
i <
str_len;
i++)
40 if (
c ==
'\r' ||
c ==
'\n' ||
c ==
'\\' ||
c ==
'"')
82 static const WCHAR *default_name =
L"@=";
105 size_t len = 0, line_len;
143#define MAX_HEX_CHARS 77
148 size_t num_commas,
i,
pos;
154 num_commas =
size - 1;
160 if (
i == num_commas)
break;
177 static const WCHAR *newline =
L"\r\n";
231 DWORD max_value_len = 256, value_len;
232 DWORD max_data_bytes = 2048, data_size;
235 WCHAR *value_name, *subkey_name, *subkey_path;
241 value_name =
malloc(max_value_len *
sizeof(
WCHAR));
247 value_len = max_value_len;
248 data_size = max_data_bytes;
258 if (data_size > max_data_bytes)
260 max_data_bytes = data_size;
266 value_name =
realloc(value_name, max_value_len *
sizeof(
WCHAR));
304 static const WCHAR header[] =
L"\xFEFFWindows Registry Editor Version 5.00\r\n";
365 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
371 overwrite_file =
TRUE;
static WCHAR * escape_string(WCHAR *str, size_t str_len, size_t *line_len)
static HANDLE get_file_handle(WCHAR *filename, BOOL overwrite_file)
static void export_key_name(HANDLE hFile, WCHAR *name)
static void export_dword_data(WCHAR **buf, DWORD *data)
static void export_hex_data(HANDLE hFile, WCHAR **buf, DWORD type, DWORD line_len, void *data, DWORD size)
static void export_newline(HANDLE hFile)
static void export_file_header(HANDLE hFile)
int reg_export(int argc, WCHAR *argvW[])
static void export_string_data(WCHAR **buf, WCHAR *data, size_t size)
static int export_registry_data(HANDLE hFile, HKEY hkey, WCHAR *path, REGSAM sam)
static size_t export_value_name(HANDLE hFile, WCHAR *name, size_t len)
static void write_file(HANDLE hFile, const WCHAR *str)
static size_t export_hex_data_type(HANDLE hFile, DWORD type)
static void export_data(HANDLE hFile, WCHAR *value_name, DWORD value_len, DWORD type, void *data, size_t size)
void output_writeconsole(const WCHAR *str, DWORD wlen)
WCHAR * get_long_key(HKEY root, WCHAR *path)
BOOL is_char(const WCHAR s, const WCHAR c)
WCHAR * build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len)
BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info)
void WINAPIV output_message(unsigned int id,...)
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
#define STRING_INVALID_SYNTAX
#define STRING_KEY_NONEXIST
#define STRING_OVERWRITE_FILE
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define create_file(name, size)
static const WCHAR invalid[]
_CRTIMP wchar_t *__cdecl _wcsupr(_Inout_z_ wchar_t *_String)
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_IGNORE_INSERTS
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
#define ERROR_FILE_EXISTS