ReactOS 0.4.15-dev-5666-gc548b97
main.c
Go to the documentation of this file.
1/*
2 * Wine Conformance Test EXE
3 *
4 * Copyright 2003, 2004 Jakob Eriksson (for Solid Form Sweden AB)
5 * Copyright 2003 Dimitrie O. Paun
6 * Copyright 2003 Ferenc Wagner
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 *
22 * This program is dedicated to Anna Lindh,
23 * Swedish Minister of Foreign Affairs.
24 * Anna was murdered September 11, 2003.
25 *
26 */
27
28#include "config.h"
29#include "wine/port.h"
30
31#include <stdio.h>
32#include <stdlib.h>
33#include <assert.h>
34#include <errno.h>
35#ifdef HAVE_UNISTD_H
36# include <unistd.h>
37#endif
38#include <windows.h>
39
40#include "winetest.h"
41#include "resource.h"
42#include <reason.h>
43
45{
46 char *name;
49 char **subtests;
50 char *exename;
51};
52
54{
55 const char* file;
56 const char* rev;
57};
58
59char *tag = NULL;
60static struct wine_test *wine_tests;
62static struct rev_info *rev_infos = NULL;
63static const char whitespace[] = " \t\r\n";
64static const char testexe[] = "_test.exe";
65
66static char * get_file_version(char * file_name)
67{
68 static char version[32];
69 DWORD size;
71
73 if (size) {
74 char * data = xmalloc(size);
75 if (data) {
77 static char backslash[] = "\\";
78 VS_FIXEDFILEINFO *pFixedVersionInfo;
79 UINT len;
80 if (VerQueryValueA(data, backslash, (LPVOID *)&pFixedVersionInfo, &len)) {
81 sprintf(version, "%d.%d.%d.%d",
82 pFixedVersionInfo->dwFileVersionMS >> 16,
83 pFixedVersionInfo->dwFileVersionMS & 0xffff,
84 pFixedVersionInfo->dwFileVersionLS >> 16,
85 pFixedVersionInfo->dwFileVersionLS & 0xffff);
86 } else
87 sprintf(version, "version not available");
88 } else
89 sprintf(version, "unknown");
90 free(data);
91 } else
92 sprintf(version, "failed");
93 } else
94 sprintf(version, "version not available");
95
96 return version;
97}
98
99static int running_under_wine (void)
100{
101 HMODULE module = GetModuleHandleA("ntdll.dll");
102
103 if (!module) return 0;
104 return (GetProcAddress(module, "wine_server_call") != NULL);
105}
106
108{
109 HWND desktop;
110 HMODULE huser32 = GetModuleHandle("user32.dll");
111 FARPROC pGetProcessWindowStation = GetProcAddress(huser32, "GetProcessWindowStation");
112 FARPROC pGetUserObjectInformationA = GetProcAddress(huser32, "GetUserObjectInformationA");
113
114 desktop = GetDesktopWindow();
115 if (!GetWindowLongPtrW(desktop, GWLP_WNDPROC)) /* Win9x */
116 return IsWindowVisible(desktop);
117
118 if (pGetProcessWindowStation && pGetUserObjectInformationA)
119 {
120 DWORD len;
121 HWINSTA wstation;
122 USEROBJECTFLAGS uoflags;
123
124 wstation = (HWINSTA)pGetProcessWindowStation();
125 assert(pGetUserObjectInformationA(wstation, UOI_FLAGS, &uoflags, sizeof(uoflags), &len));
126 return (uoflags.dwFlags & WSF_VISIBLE) != 0;
127 }
128 return IsWindowVisible(desktop);
129}
130
131static void print_version (void)
132{
133 OSVERSIONINFOEX ver;
134 BOOL ext;
135 int is_win2k3_r2;
136 const char *(*wine_get_build_id)(void);
137
139 if (!(ext = GetVersionEx ((OSVERSIONINFO *) &ver)))
140 {
142 if (!GetVersionEx ((OSVERSIONINFO *) &ver))
143 report (R_FATAL, "Can't get OS version.");
144 }
145
146 xprintf (" bRunningUnderWine=%d\n", running_under_wine ());
147 xprintf (" bRunningOnVisibleDesktop=%d\n", running_on_visible_desktop ());
148 xprintf (" dwMajorVersion=%ld\n dwMinorVersion=%ld\n"
149 " dwBuildNumber=%ld\n PlatformId=%ld\n szCSDVersion=%s\n",
151 ver.dwPlatformId, ver.szCSDVersion);
152
153 wine_get_build_id = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_build_id");
154 if (wine_get_build_id) xprintf( " WineBuild=%s\n", wine_get_build_id() );
155
156 is_win2k3_r2 = GetSystemMetrics(SM_SERVERR2);
157 if(is_win2k3_r2)
158 xprintf(" R2 build number=%d\n", is_win2k3_r2);
159
160 if (!ext) return;
161
162 xprintf (" wServicePackMajor=%d\n wServicePackMinor=%d\n"
163 " wSuiteMask=%d\n wProductType=%d\n wReserved=%d\n",
165 ver.wProductType, ver.wReserved);
166}
167
168static inline int is_dot_dir(const char* x)
169{
170 return ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))));
171}
172
173static void remove_dir (const char *dir)
174{
175 HANDLE hFind;
176 WIN32_FIND_DATA wfd;
177 char path[MAX_PATH];
178 size_t dirlen = strlen (dir);
179
180 /* Make sure the directory exists before going further */
181 memcpy (path, dir, dirlen);
182 strcpy (path + dirlen++, "\\*");
183 hFind = FindFirstFile (path, &wfd);
184 if (hFind == INVALID_HANDLE_VALUE) return;
185
186 do {
187 char *lp = wfd.cFileName;
188
189 if (!lp[0]) lp = wfd.cAlternateFileName; /* ? FIXME not (!lp) ? */
190 if (is_dot_dir (lp)) continue;
191 strcpy (path + dirlen, lp);
192 if (FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes)
194 else if (!DeleteFile (path))
195 report (R_WARNING, "Can't delete file %s: error %d",
196 path, GetLastError ());
197 } while (FindNextFile (hFind, &wfd));
198 FindClose (hFind);
199 if (!RemoveDirectory (dir))
200 report (R_WARNING, "Can't remove directory %s: error %d",
201 dir, GetLastError ());
202}
203
204static const char* get_test_source_file(const char* test, const char* subtest)
205{
206 static const char* special_dirs[][2] = {
207 { 0, 0 }
208 };
209 static char buffer[MAX_PATH];
210 int i;
211
212 for (i = 0; special_dirs[i][0]; i++) {
213 if (strcmp(test, special_dirs[i][0]) == 0) {
214 test = special_dirs[i][1];
215 break;
216 }
217 }
218
219 snprintf(buffer, sizeof(buffer), "dlls/%s/tests/%s.c", test, subtest);
220 return buffer;
221}
222
223static const char* get_file_rev(const char* file)
224{
225 const struct rev_info* rev;
226
227 for(rev = rev_infos; rev->file; rev++) {
228 if (strcmp(rev->file, file) == 0) return rev->rev;
229 }
230
231 return "-";
232}
233
234static void extract_rev_infos (void)
235{
236 char revinfo[256], *p;
237 int size = 0, i;
238 unsigned int len;
240
241 for (i = 0; TRUE; i++) {
242 if (i >= size) {
243 size += 100;
244 rev_infos = xrealloc (rev_infos, size * sizeof (*rev_infos));
245 }
246 memset(rev_infos + i, 0, sizeof(rev_infos[i]));
247
248 len = LoadStringA (module, REV_INFO+i, revinfo, sizeof(revinfo));
249 if (len == 0) break; /* end of revision info */
250 if (len >= sizeof(revinfo) - 1)
251 report (R_FATAL, "Revision info too long.");
252 if(!(p = strrchr(revinfo, ':')))
253 report (R_FATAL, "Revision info malformed (i=%d)", i);
254 *p = 0;
255 rev_infos[i].file = strdup(revinfo);
256 rev_infos[i].rev = strdup(p + 1);
257 }
258}
259
261{
262 HRSRC rsrc;
263 HGLOBAL hdl;
264 LPVOID addr;
265
266 if (!(rsrc = FindResource (NULL, name, MAKEINTRESOURCE(type))) ||
267 !(*size = SizeofResource (0, rsrc)) ||
268 !(hdl = LoadResource (0, rsrc)) ||
269 !(addr = LockResource (hdl)))
270 return NULL;
271 return addr;
272}
273
274/* Fills in the name and exename fields */
275static void
276extract_test (struct wine_test *test, const char *dir, LPTSTR res_name)
277{
278 BYTE* code;
279 DWORD size;
280 FILE* fout;
281 char *exepos;
282
283 code = extract_rcdata (res_name, TESTRES, &size);
284 if (!code) report (R_FATAL, "Can't find test resource %s: %d",
285 res_name, GetLastError ());
286 test->name = xstrdup( res_name );
287 test->exename = strmake (NULL, "%s/%s", dir, test->name);
288 exepos = strstr (test->name, testexe);
289 if (!exepos) report (R_FATAL, "Not an .exe file: %s", test->name);
290 *exepos = 0;
291 test->name = xrealloc (test->name, exepos - test->name + 1);
292 report (R_STEP, "Extracting: %s", test->name);
293
294 if (!(fout = fopen (test->exename, "wb")) ||
295 (fwrite (code, size, 1, fout) != 1) ||
296 fclose (fout)) report (R_FATAL, "Failed to write file %s.",
297 test->exename);
298}
299
300/* Run a command for MS milliseconds. If OUT != NULL, also redirect
301 stdout to there.
302
303 Return the exit status, -2 if can't create process or the return
304 value of WaitForSingleObject.
305 */
306static int
307run_ex (char *cmd, const char *out, const char *tempdir, DWORD ms)
308{
309 STARTUPINFO si;
311 int fd, oldstdout = -1;
312 DWORD wait, status;
313
314 GetStartupInfo (&si);
315 si.dwFlags = 0;
316
317 if (out) {
318 fd = open (out, O_WRONLY | O_CREAT, 0666);
319 if (-1 == fd)
320 report (R_FATAL, "Can't open '%s': %d", out, errno);
321 oldstdout = dup (1);
322 if (-1 == oldstdout)
323 report (R_FATAL, "Can't save stdout: %d", errno);
324 if (-1 == dup2 (fd, 1))
325 report (R_FATAL, "Can't redirect stdout: %d", errno);
326 close (fd);
327 }
328
330 NULL, tempdir, &si, &pi)) {
331 status = -2;
332 } else {
333 CloseHandle (pi.hThread);
334 wait = WaitForSingleObject (pi.hProcess, ms);
335 if (wait == WAIT_OBJECT_0) {
336 GetExitCodeProcess (pi.hProcess, &status);
337 } else {
338 switch (wait) {
339 case WAIT_FAILED:
340 report (R_ERROR, "Wait for '%s' failed: %d", cmd,
341 GetLastError ());
342 break;
343 case WAIT_TIMEOUT:
344 report (R_ERROR, "Process '%s' timed out.", cmd);
345 break;
346 default:
347 report (R_ERROR, "Wait returned %d", wait);
348 }
349 status = wait;
350 if (!TerminateProcess (pi.hProcess, 257))
351 report (R_ERROR, "TerminateProcess failed: %d",
352 GetLastError ());
353 wait = WaitForSingleObject (pi.hProcess, 5000);
354 switch (wait) {
355 case WAIT_FAILED:
357 "Wait for termination of '%s' failed: %d",
358 cmd, GetLastError ());
359 break;
360 case WAIT_OBJECT_0:
361 break;
362 case WAIT_TIMEOUT:
363 report (R_ERROR, "Can't kill process '%s'", cmd);
364 break;
365 default:
366 report (R_ERROR, "Waiting for termination: %d",
367 wait);
368 }
369 }
370 CloseHandle (pi.hProcess);
371 }
372
373 if (out) {
374 close (1);
375 if (-1 == dup2 (oldstdout, 1))
376 report (R_FATAL, "Can't recover stdout: %d", errno);
377 close (oldstdout);
378 }
379 return status;
380}
381
382static void
383get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name)
384{
385 char *subname, *cmd;
386 FILE *subfile;
387 size_t total;
388 char buffer[8192], *index;
389 static const char header[] = "Valid test names:";
390 int allocated;
391
392 test->subtest_count = 0;
393
394 subname = tempnam (0, "sub");
395 if (!subname) report (R_FATAL, "Can't name subtests file.");
396
397 extract_test (test, tempdir, res_name);
398 cmd = strmake (NULL, "%s --list", test->exename);
399 run_ex (cmd, subname, tempdir, 5000);
400 free (cmd);
401
402 subfile = fopen (subname, "r");
403 if (!subfile) {
404 report (R_ERROR, "Can't open subtests output of %s: %d",
405 test->name, errno);
406 goto quit;
407 }
408 total = fread (buffer, 1, sizeof buffer, subfile);
409 fclose (subfile);
410 if (sizeof buffer == total) {
411 report (R_ERROR, "Subtest list of %s too big.",
412 test->name, sizeof buffer);
413 goto quit;
414 }
415 buffer[total] = 0;
416
418 if (!index) {
419 report (R_ERROR, "Can't parse subtests output of %s",
420 test->name);
421 goto quit;
422 }
423 index += sizeof header;
424
425 allocated = 10;
426 test->subtests = xmalloc (allocated * sizeof(char*));
428 while (index) {
429 if (test->subtest_count == allocated) {
430 allocated *= 2;
431 test->subtests = xrealloc (test->subtests,
432 allocated * sizeof(char*));
433 }
434 test->subtests[test->subtest_count++] = strdup (index);
436 }
437 test->subtests = xrealloc (test->subtests,
438 test->subtest_count * sizeof(char*));
439
440 quit:
441 if (remove (subname))
442 report (R_WARNING, "Can't delete file '%s': %d",
443 subname, errno);
444 free (subname);
445}
446
447static void
448run_test (struct wine_test* test, const char* subtest, const char *tempdir)
449{
450 int status;
451 const char* file = get_test_source_file(test->name, subtest);
452 const char* rev = get_file_rev(file);
453 char *cmd = strmake (NULL, "%s %s", test->exename, subtest);
454
455 xprintf ("%s:%s start %s %s\n", test->name, subtest, file, rev);
456 status = run_ex (cmd, NULL, tempdir, 120000);
457 free (cmd);
458 xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
459}
460
461static BOOL CALLBACK
463 LPTSTR lpszName, LONG_PTR lParam)
464{
465 (*(int*)lParam)++;
466 return TRUE;
467}
468
469static BOOL CALLBACK
471 LPTSTR lpszName, LONG_PTR lParam)
472{
473 const char *tempdir = (const char *)lParam;
474 char dllname[MAX_PATH];
475 HMODULE dll;
476
477 /* Check if the main dll is present on this system */
478 CharLowerA(lpszName);
479 strcpy(dllname, lpszName);
480 *strstr(dllname, testexe) = 0;
481
483 if (!dll) {
484 xprintf (" %s=dll is missing\n", dllname);
485 return TRUE;
486 }
488
489 xprintf (" %s=%s\n", dllname, get_file_version(dllname));
490
491 get_subtests( tempdir, &wine_tests[nr_of_files], lpszName );
492 nr_of_tests += wine_tests[nr_of_files].subtest_count;
493 nr_of_files++;
494 return TRUE;
495}
496
497static char *
498run_tests (char *logname)
499{
500 int i;
501 char *tempdir, *shorttempdir;
502 int logfile;
503 char *strres, *eol, *nextline;
504 DWORD strsize;
505 char build[64];
506
508
509 if (!logname) {
510 logname = tempnam (0, "res");
511 if (!logname) report (R_FATAL, "Can't name logfile.");
512 }
513 report (R_OUT, logname);
514
515 logfile = open (logname, O_WRONLY | O_CREAT | O_EXCL | O_APPEND,
516 0666);
517 if (-1 == logfile) {
518 if (EEXIST == errno)
519 report (R_FATAL, "File %s already exists.", logname);
520 else report (R_FATAL, "Could not open logfile: %d", errno);
521 }
522 if (-1 == dup2 (logfile, 1))
523 report (R_FATAL, "Can't redirect stdout: %d", errno);
524 close (logfile);
525
526 tempdir = tempnam (0, "wct");
527 if (!tempdir)
528 report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
529 shorttempdir = strdup (tempdir);
530 if (shorttempdir) { /* try stable path for ZoneAlarm */
531 strstr (shorttempdir, "wct")[3] = 0;
532 if (CreateDirectoryA (shorttempdir, NULL)) {
533 free (tempdir);
534 tempdir = shorttempdir;
535 } else free (shorttempdir);
536 }
537 if (tempdir != shorttempdir && !CreateDirectoryA (tempdir, NULL))
538 report (R_FATAL, "Could not create directory: %s", tempdir);
539 report (R_DIR, tempdir);
540
541 xprintf ("Version 4\n");
542 strres = extract_rcdata (MAKEINTRESOURCE(WINE_BUILD), STRINGRES, &strsize);
543 xprintf ("Tests from build ");
544 if (LoadStringA( 0, IDS_BUILD_ID, build, sizeof(build) )) xprintf( "%s\n", build );
545 else if (strres) xprintf ("%.*s", strsize, strres);
546 else xprintf ("-\n");
547 strres = extract_rcdata (MAKEINTRESOURCE(TESTS_URL), STRINGRES, &strsize);
548 xprintf ("Archive: ");
549 if (strres) xprintf ("%.*s", strsize, strres);
550 else xprintf ("-\n");
551 xprintf ("Tag: %s\n", tag);
552 xprintf ("Build info:\n");
553 strres = extract_rcdata (MAKEINTRESOURCE(BUILD_INFO), STRINGRES, &strsize);
554 while (strres) {
555 eol = memchr (strres, '\n', strsize);
556 if (!eol) {
557 nextline = NULL;
558 eol = strres + strsize;
559 } else {
560 strsize -= eol - strres + 1;
561 nextline = strsize?eol+1:NULL;
562 if (eol > strres && *(eol-1) == '\r') eol--;
563 }
564 xprintf (" %.*s\n", eol-strres, strres);
565 strres = nextline;
566 }
567 xprintf ("Operating system version:\n");
568 print_version ();
569 xprintf ("Dll info:\n" );
570
571 report (R_STATUS, "Counting tests");
574 report (R_FATAL, "Can't enumerate test files: %d",
575 GetLastError ());
577
578 report (R_STATUS, "Extracting tests");
580 nr_of_files = 0;
581 nr_of_tests = 0;
583 extract_test_proc, (LPARAM)tempdir))
584 report (R_FATAL, "Can't enumerate test files: %d",
585 GetLastError ());
586
587 xprintf ("Test output:\n" );
588
589 report (R_DELTA, 0, "Extracting: Done");
590
591 report (R_STATUS, "Running tests");
593 for (i = 0; i < nr_of_files; i++) {
594 struct wine_test *test = wine_tests + i;
595 int j;
596
597 for (j = 0; j < test->subtest_count; j++) {
598 report (R_STEP, "Running: %s:%s", test->name,
599 test->subtests[j]);
600 run_test (test, test->subtests[j], tempdir);
601 }
602 }
603 report (R_DELTA, 0, "Running: Done");
604
605 report (R_STATUS, "Cleaning up");
606 close (1);
607 remove_dir (tempdir);
608 free (tempdir);
610
611 return logname;
612}
613
614static void
615usage (void)
616{
618"Usage: winetest [OPTION]...\n\n"
619" -c console mode, no GUI\n"
620" -e preserve the environment\n"
621" -h print this message and exit\n"
622" -p shutdown when the tests are done\n"
623" -q quiet mode, no output at all\n"
624" -o FILE put report into FILE, do not submit\n"
625" -s FILE submit FILE, do not run tests\n"
626" -t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n");
627}
628
630 LPSTR cmdLine, int cmdShow)
631{
632 char *logname = NULL;
633 const char *cp, *submit = NULL;
634 int reset_env = 1;
635 int poweroff = 0;
636 int interactive = 1;
637
638 /* initialize the revision information first */
640
641 cmdLine = strtok (cmdLine, whitespace);
642 while (cmdLine) {
643 if (cmdLine[0] != '-' || cmdLine[2]) {
644 report (R_ERROR, "Not a single letter option: %s", cmdLine);
645 usage ();
646 exit (2);
647 }
648 switch (cmdLine[1]) {
649 case 'c':
651 interactive = 0;
652 break;
653 case 'e':
654 reset_env = 0;
655 break;
656 case 'h':
657 case '?':
658 usage ();
659 exit (0);
660 case 'p':
661 poweroff = 1;
662 break;
663 case 'q':
664 report (R_QUIET);
665 interactive = 0;
666 break;
667 case 's':
668 submit = strtok (NULL, whitespace);
669 if (tag)
670 report (R_WARNING, "ignoring tag for submission");
671 send_file (submit);
672 break;
673 case 'o':
674 logname = strtok (NULL, whitespace);
675 break;
676 case 't':
678 if (strlen (tag) > MAXTAGLEN)
679 report (R_FATAL, "tag is too long (maximum %d characters)",
680 MAXTAGLEN);
682 if (cp) {
683 report (R_ERROR, "invalid char in tag: %c", *cp);
684 usage ();
685 exit (2);
686 }
687 break;
688 default:
689 report (R_ERROR, "invalid option: -%c", cmdLine[1]);
690 usage ();
691 exit (2);
692 }
693 cmdLine = strtok (NULL, whitespace);
694 }
695 if (!submit) {
696 static CHAR platform_windows[] = "WINETEST_PLATFORM=windows",
697 platform_wine[] = "WINETEST_PLATFORM=wine",
698 debug_yes[] = "WINETEST_DEBUG=1",
699 interactive_no[] = "WINETEST_INTERACTIVE=0",
700 report_success_no[] = "WINETEST_REPORT_SUCCESS=0";
701 CHAR *platform;
702
703 report (R_STATUS, "Starting up");
704
706 report (R_FATAL, "Tests must be run on a visible desktop");
707
708 platform = running_under_wine () ? platform_wine : platform_windows;
709
710 if (reset_env && (putenv (platform) ||
711 putenv (debug_yes) ||
712 putenv (interactive_no) ||
713 putenv (report_success_no)))
714 report (R_FATAL, "Could not reset environment: %d", errno);
715
716 if (!tag) {
717 if (!interactive)
718 report (R_FATAL, "Please specify a tag (-t option) if "
719 "running noninteractive!");
720 if (guiAskTag () == IDABORT) exit (1);
721 }
722 report (R_TAG);
723
724 if (!logname) {
725 logname = run_tests (NULL);
726 if (report (R_ASK, MB_YESNO, "Do you want to submit the "
727 "test results?") == IDYES)
728 if (!send_file (logname) && remove (logname))
729 report (R_WARNING, "Can't remove logfile: %d.", errno);
730 free (logname);
731 } else run_tests (logname);
732 report (R_STATUS, "Finished");
733 }
734 if (poweroff)
735 {
736 HANDLE hToken;
738
739 /* enable the shutdown privilege for the current process */
741 {
743 npr.PrivilegeCount = 1;
745 AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
746 CloseHandle(hToken);
747 }
748 ExitWindowsEx(EWX_SHUTDOWN | EWX_POWEROFF | EWX_FORCEIFHUNG, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER);
749 }
750 exit (0);
751}
#define EEXIST
Definition: acclib.h:88
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * strtok(char *String, const char *Delimiters)
Definition: utclib.c:338
#define O_WRONLY
Definition: acwin.h:111
#define O_CREAT
Definition: acwin.h:110
#define open
Definition: acwin.h:95
#define close
Definition: acwin.h:98
unsigned int dir
Definition: maze.c:112
int rev
Definition: sort.c:17
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
Definition: main.c:8
char * xstrdup(const char *s)
Definition: uimain.c:768
void * xmalloc(int size)
Definition: uimain.c:747
void * xrealloc(void *oldmem, size_t size)
Definition: uimain.c:736
#define index(s, c)
Definition: various.h:29
void quit(int argc, const char *argv[])
Definition: cmds.c:1606
int code
Definition: main.c:75
int interactive
Definition: main.c:63
LPARAM lParam
Definition: combotst.c:139
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI LookupPrivilegeValueA(LPCSTR lpSystemName, LPCSTR lpName, PLUID lpLuid)
Definition: misc.c:732
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
HMODULE hModule
Definition: animate.c:44
static void report(const DATA_BLOB *pDataIn, const DATA_BLOB *pOptionalEntropy, CRYPTPROTECT_PROMPTSTRUCT *pPromptStruct, DWORD dwFlags)
Definition: protectdata.c:769
#define CloseHandle
Definition: compat.h:739
int(* FARPROC)()
Definition: compat.h:36
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
static const WCHAR *const ext[]
Definition: module.c:53
static const WCHAR version[]
Definition: asmname.c:66
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:749
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:159
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
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)
Definition: proc.c:4742
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define is_dot_dir(x)
Definition: files.c:873
DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR filename, LPDWORD handle)
Definition: version.c:619
BOOL WINAPI VerQueryValueA(LPCVOID pBlock, LPCSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:993
BOOL WINAPI GetFileVersionInfoA(LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:853
#define assert(x)
Definition: debug.h:53
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
size_t total
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum const GLvoid * addr
Definition: glext.h:9621
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
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
Definition: glfuncs.h:248
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 GLint GLint j
Definition: glfuncs.h:250
#define O_EXCL
Definition: fcntl.h:40
#define O_APPEND
Definition: fcntl.h:37
_CRTIMP char *__cdecl tempnam(_In_opt_z_ const char *_Directory, _In_opt_z_ const char *_FilePrefix)
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP int __cdecl putenv(_In_z_ const char *_EnvString)
#define dup
Definition: syshdrs.h:51
POINT cp
Definition: magnifier.c:59
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memchr(s, c, n)
Definition: mkisofs.h:875
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static HMODULE dll
Definition: str.c:188
static BOOL run_tests(void)
Definition: run.c:2754
static HMODULE huser32
Definition: profile.c:34
static refpint_t pi[]
Definition: server.c:96
static LPCWSTR file_name
Definition: protocol.c:147
int guiAskTag(void)
Definition: gui.c:353
static void print_version(void)
Definition: main.c:131
static char * get_file_version(char *file_name)
Definition: main.c:66
static void * extract_rcdata(LPTSTR name, int type, DWORD *size)
Definition: main.c:260
static int run_ex(char *cmd, const char *out, const char *tempdir, DWORD ms)
Definition: main.c:307
static void extract_rev_infos(void)
Definition: main.c:234
static struct wine_test * wine_tests
Definition: main.c:60
static const char whitespace[]
Definition: main.c:63
static int running_on_visible_desktop(void)
Definition: main.c:107
static const char testexe[]
Definition: main.c:64
static struct rev_info * rev_infos
Definition: main.c:62
static void remove_dir(const char *dir)
Definition: main.c:173
static const char * get_test_source_file(const char *test, const char *subtest)
Definition: main.c:204
static int nr_of_tests
Definition: main.c:61
static int nr_of_files
Definition: main.c:61
static const char * get_file_rev(const char *file)
Definition: main.c:223
static BOOL CALLBACK extract_test_proc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam)
Definition: main.c:470
static BOOL CALLBACK EnumTestFileProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam)
Definition: main.c:462
static void extract_test(struct wine_test *test, const char *dir, LPTSTR res_name)
Definition: main.c:276
static void get_subtests(const char *tempdir, struct wine_test *test, LPTSTR res_name)
Definition: main.c:383
static int running_under_wine(void)
Definition: main.c:99
#define REV_INFO
Definition: resource.h:59
#define WINE_BUILD
Definition: resource.h:54
#define STRINGRES
Definition: resource.h:50
#define TESTS_URL
Definition: resource.h:56
#define TESTRES
Definition: resource.h:49
#define BUILD_INFO
Definition: resource.h:55
#define IDS_BUILD_ID
Definition: resource.h:45
int send_file(const char *name)
Definition: send.c:105
char * strmake(size_t *lenp,...)
Definition: util.c:82
const char * findbadtagchar(const char *tag)
Definition: util.c:124
#define run_test(test)
Definition: ms_seh.c:71
int remove
Definition: msacm.c:1366
platform
Definition: msipriv.h:364
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define SEM_NOGPFAULTERRORBOX
Definition: rtltypes.h:70
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
static FILE * out
Definition: regtests2xml.c:44
#define test
Definition: rosglue.h:37
#define errno
Definition: errno.h:18
_Check_return_ _CRTIMP int __cdecl dup2(_In_ int _FileHandleSrc, _In_ int _FileHandleDst)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define exit(n)
Definition: config.h:202
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
void xprintf(const char *fmt,...)
Definition: shimdbg.c:16
ULONG dwMajorVersion
Definition: rtltypes.h:256
ULONG dwMinorVersion
Definition: rtltypes.h:257
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:255
ULONG dwBuildNumber
Definition: rtltypes.h:258
USHORT wServicePackMajor
Definition: rtltypes.h:261
CHAR szCSDVersion[128]
Definition: rtltypes.h:260
USHORT wSuiteMask
Definition: rtltypes.h:263
UCHAR wProductType
Definition: rtltypes.h:264
USHORT wServicePackMinor
Definition: rtltypes.h:262
ULONG dwPlatformId
Definition: rtltypes.h:259
DWORD dwFlags
Definition: winbase.h:842
$ULONG PrivilegeCount
Definition: setypes.h:1019
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1020
Definition: ftp_var.h:139
Definition: inflate.c:139
char * name
Definition: compiler.c:66
Definition: fci.c:127
Definition: name.c:39
Definition: main.c:54
const char * file
Definition: main.c:55
const char * rev
Definition: main.c:56
Definition: ps.c:97
Definition: pseh.c:2763
DWORD dwFileVersionLS
Definition: compat.h:903
DWORD dwFileVersionMS
Definition: compat.h:902
Definition: ecma_167.h:138
Definition: main.c:45
char * name
Definition: main.c:46
int resource
Definition: main.c:47
char * exename
Definition: main.c:50
int subtest_count
Definition: main.c:48
char ** subtests
Definition: main.c:49
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define GWLP_WNDPROC
Definition: treelist.c:66
#define RemoveDirectory
Definition: winbase.h:3766
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define GetStartupInfo
Definition: winbase.h:3712
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:342
#define GetModuleHandle
Definition: winbase.h:3698
#define CREATE_DEFAULT_ERROR_MODE
Definition: winbase.h:194
#define DeleteFile
Definition: winbase.h:3635
#define EnumResourceNames
Definition: winbase.h:3643
#define FindNextFile
Definition: winbase.h:3659
#define GetVersionEx
Definition: winbase.h:3723
#define WAIT_OBJECT_0
Definition: winbase.h:406
#define FindFirstFile
Definition: winbase.h:3653
#define WAIT_FAILED
Definition: winbase.h:413
#define FindResource
Definition: winbase.h:3664
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
@ R_ERROR
Definition: winetest.h:55
@ R_TEXTMODE
Definition: winetest.h:58
@ R_QUIET
Definition: winetest.h:59
@ R_DELTA
Definition: winetest.h:50
@ R_PROGRESS
Definition: winetest.h:48
@ R_ASK
Definition: winetest.h:57
@ R_STEP
Definition: winetest.h:49
@ R_WARNING
Definition: winetest.h:54
@ R_STATUS
Definition: winetest.h:47
@ R_OUT
Definition: winetest.h:53
@ R_DIR
Definition: winetest.h:52
@ R_FATAL
Definition: winetest.h:56
@ R_TAG
Definition: winetest.h:51
#define MAXTAGLEN
Definition: winetest.h:62
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:384
#define snprintf
Definition: wintirpc.h:48
#define EWX_POWEROFF
Definition: winuser.h:632
#define EWX_SHUTDOWN
Definition: winuser.h:634
#define GetWindowLongPtrW
Definition: winuser.h:4819
LPSTR WINAPI CharLowerA(_Inout_ LPSTR)
#define MB_YESNO
Definition: winuser.h:811
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define WSF_VISIBLE
Definition: winuser.h:2442
#define IDABORT
Definition: winuser.h:826
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define UOI_FLAGS
Definition: winuser.h:1077
#define IDYES
Definition: winuser.h:829
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
OSVERSIONINFOEXA OSVERSIONINFOEX
Definition: rtltypes.h:290
OSVERSIONINFOA OSVERSIONINFO
Definition: rtltypes.h:293
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:926
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
char * LPSTR
Definition: xmlstorage.h:182
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193