38#define read_reg_output(c,b,s,r) read_reg_output_(__FILE__,__LINE__,c,b,s,r)
43 HANDLE pipe_stdout_rd, pipe_stdout_wr;
52 sa.lpSecurityDescriptor =
NULL;
54 if (!
CreatePipe(&pipe_stdout_rd, &pipe_stdout_wr, &
sa, 0))
87#define compare_query(b,e,c,todo) compare_query_(__FILE__,__LINE__,b,e,c,todo)
91 const char *
str = (
const char *)
buf;
92 const char *
err =
"query output does not match expected output";
149 const char *
test1 =
"\r\n"
150 "HKEY_CURRENT_USER\\" KEY_BASE "\r\n"
151 " Test1 REG_SZ Hello, World\r\n"
152 " Test2 REG_DWORD 0x123\r\n\r\n";
154 const char *
test2 =
"\r\n"
155 "HKEY_CURRENT_USER\\" KEY_BASE "\r\n"
156 " Test1 REG_SZ Hello, World\r\n\r\n";
158 const char *
test3 =
"\r\n"
159 "HKEY_CURRENT_USER\\" KEY_BASE "\r\n"
160 " Test1 REG_SZ Hello, World\r\n"
161 " Test2 REG_DWORD 0x123\r\n"
162 " Wine REG_SZ First instance\r\n\r\n"
163 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey\r\n";
165 const char *
test4 =
"\r\n"
166 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey\r\n"
167 " Test3 REG_SZ Some string data\r\n"
168 " Test4 REG_DWORD 0xabc\r\n\r\n";
170 const char *
test5 =
"\r\n"
171 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey\r\n"
172 " Test4 REG_DWORD 0xabc\r\n\r\n";
174 const char *
test6 =
"\r\n"
175 "HKEY_CURRENT_USER\\" KEY_BASE "\r\n"
176 " Test1 REG_SZ Hello, World\r\n"
177 " Test2 REG_DWORD 0x123\r\n"
178 " Wine REG_SZ First instance\r\n\r\n"
179 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey\r\n"
180 " Test3 REG_SZ Some string data\r\n"
181 " Test4 REG_DWORD 0xabc\r\n"
182 " Wine REG_SZ Second instance\r\n\r\n";
184 const char *
test7 =
"\r\n"
185 "HKEY_CURRENT_USER\\" KEY_BASE "\r\n"
186 " Wine REG_SZ First instance\r\n\r\n"
187 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey\r\n"
188 " Wine REG_SZ Second instance\r\n\r\n";
190 const char *test8a =
"\r\n"
191 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey1\r\n"
192 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey2\r\n"
193 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey3\r\n"
194 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey4\r\n";
196 const char *test8b =
"\r\n"
197 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey1\r\n\r\n"
198 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey2\r\n\r\n"
199 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey3\r\n\r\n"
200 "HKEY_CURRENT_USER\\" KEY_BASE "\\subkey4\r\n\r\n";
226 "got exit code %d, expected 0\n",
r);
238 add_key(hkey,
"subkey", 0, &subkey);
272 "got exit code %d, expected 0\n",
r);
285 "got exit code %d, expected 0\n",
r);
309static const char *test9a =
"\r\n"
310 "HKEY_LOCAL_MACHINE\\" KEY_BASE "\r\n"
311 " Test1 REG_SZ Hello, World\r\n"
312 " Test2 REG_DWORD 0x123\r\n"
313 " Wine REG_SZ First instance\r\n\r\n"
314 "HKEY_LOCAL_MACHINE\\" KEY_BASE "\\subkey\r\n";
316static const char *test9b =
"\r\n"
317 "HKEY_LOCAL_MACHINE\\" KEY_BASE "\r\n"
318 " Test1 REG_SZ Hello, World\r\n"
319 " Test2 REG_DWORD 0x123\r\n"
320 " Wine REG_SZ First instance\r\n\r\n"
321 "HKEY_LOCAL_MACHINE\\" KEY_BASE "\\subkey\r\n"
322 " Test3 REG_SZ Some string data\r\n"
323 " Test4 REG_DWORD 0xabc\r\n"
324 " Wine REG_SZ Second instance\r\n\r\n";
326static const char *test9c =
"\r\n"
327 "HKEY_LOCAL_MACHINE\\" KEY_BASE "\r\n"
328 " Wine REG_SZ First instance\r\n\r\n"
329 "HKEY_LOCAL_MACHINE\\" KEY_BASE "\\subkey\r\n"
330 " Wine REG_SZ Second instance\r\n\r\n";
353static void test_registry_view_win32(
void)
360 is_win32 = !
is_wow64 && (
sizeof(
void *) ==
sizeof(
int));
362 if (!is_win32)
return;
401static void test_registry_view_win64(
void)
450static void test_registry_view_wow64(
void)
504 win_skip(
"reg.exe not available, skipping 'query' tests\n");
514 win_skip(
"reg.exe is not running with elevated privileges; "
515 "skipping registry view tests\n");
520 test_registry_view_win32();
521 test_registry_view_win64();
522 test_registry_view_wow64();
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
static struct sockaddr_in sa
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define GetCurrentProcess()
BOOL WINAPI SetHandleInformation(IN HANDLE hObject, IN DWORD dwMask, IN DWORD dwFlags)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
static const BOOL is_win64
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
#define todo_wine_if(is_todo)
BOOL is_elevated_process(void)
static void read_from_pipe(HANDLE child_proc_stdout, BYTE *buf, DWORD buf_size)
static void compare_query_(const char *file, unsigned line, const BYTE *buf, const char *expected, BOOL cmp_len, DWORD todo)
static void test_query(void)
#define read_reg_output(c, b, s, r)
static void test_command_syntax(void)
static BOOL read_reg_output_(const char *file, unsigned line, const char *cmd, BYTE *buf, DWORD buf_size, DWORD *rc)
#define compare_query(b, e, c, todo)
BOOL WINAPI CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
#define add_value(k, n, t, d, s)
#define add_key(r, p, s, k)
#define delete_tree(r, p, s)
#define run_reg_exe(c, r)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define HANDLE_FLAG_INHERIT
#define STARTF_USESTDHANDLES
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER