62 for (
i = 0;
i < size_bytes;
i++)
70 const int zero_x_dword = 10;
78 const int two_wchars = 2 *
sizeof(
WCHAR);
83 if (size_bytes <= two_wchars)
90 tmp_size = size_bytes - two_wchars;
94 for (
i = 0, destindex = 0;
i <
len;
i++, destindex++)
100 buffer[destindex++] =
'\\';
119 if (value_name && value_name[0])
148 DWORD max_data_bytes = 2048, data_size;
153 WCHAR *subkey_name, *subkey_path;
160 data_size = max_data_bytes;
164 max_data_bytes = data_size;
184 if (value_name && *value_name)
209 query_value(subkey, value_name, subkey_path, recurse);
225 DWORD num_subkeys, num_values;
226 DWORD max_value_len = 256, value_len;
227 DWORD max_data_bytes = 2048, data_size;
230 WCHAR *value_name, *subkey_name, *subkey_path;
238 if (num_values || recursing)
241 value_name =
malloc(max_value_len *
sizeof(
WCHAR));
247 value_len = max_value_len;
248 data_size = max_data_bytes;
257 if (data_size > max_data_bytes)
259 max_data_bytes = data_size;
265 value_name =
realloc(value_name, max_value_len *
sizeof(
WCHAR));
325 if (value_name || value_empty)
353 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
376 else if (!
str[0] ||
str[1])
382 if (value_name || !(value_name = argvW[++
i]))
394 if (value_name && value_empty)
static int query_all(HKEY hkey, WCHAR *path, BOOL recurse, BOOL recursing)
static const WCHAR * newlineW
static int query_value(HKEY hkey, WCHAR *value_name, WCHAR *path, BOOL recurse)
static WCHAR * reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes)
static void output_value(const WCHAR *value_name, DWORD type, BYTE *data, DWORD data_size)
static const WCHAR * reg_type_to_wchar(DWORD type)
static unsigned int num_values_found
static int run_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL recurse)
int reg_query(int argc, WCHAR *argvW[])
WCHAR * get_long_key(HKEY root, WCHAR *path)
WCHAR * build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len)
void WINAPIV output_string(const WCHAR *fmt,...)
void WINAPIV output_message(unsigned int id,...)
const struct reg_type_rels type_rels[]
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
#define STRING_VALUE_NOT_SET
#define STRING_INVALID_SYNTAX
#define STRING_DEFAULT_VALUE
#define STRING_VALUE_NONEXIST
#define STRING_KEY_NONEXIST
#define STRING_MATCHES_FOUND
#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)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
#define ERROR_FILE_NOT_FOUND
static const WCHAR invalid[]
#define REG_DWORD_BIG_ENDIAN
_CRTIMP wchar_t *__cdecl _wcsupr(_Inout_z_ wchar_t *_String)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)