2 * DxDiag Implementation
4 * Copyright 2009 Austin English
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define WIN32_LEAN_AND_MEAN
23 #include "wine/debug.h"
24 #include "wine/unicode.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(dxdiag
);
29 Process options [/WHQL:ON|OFF][/X outfile][/T outfile]
30 Returns TRUE if options were present, FALSE otherwise
31 FIXME: Native behavior seems to be:
32 Only one of /X and /T is allowed, /WHQL must come before /X and /T,
33 quotes are optional around the filename, even if it contains spaces.
36 static BOOL
ProcessCommandLine(const WCHAR
*s
)
38 WCHAR outfile
[MAX_PATH
+1];
42 int opt_given
= FALSE
;
47 /* Skip whitespace before arg */
50 /* Check for option */
51 if (*s
!= '-' && *s
!= '/')
56 case 't': opt_t
= TRUE
; want_arg
= TRUE
; opt_given
= TRUE
; break;
58 case 'x': opt_x
= TRUE
; want_arg
= TRUE
; opt_given
= TRUE
; break;
62 while (isalphaW(*s
) || *s
== ':')
65 default: opt_help
= TRUE
; opt_given
= TRUE
; break;
67 /* Skip any spaces before next option or filename */
74 for (i
=0; i
< MAX_PATH
&& *s
&& *s
!= '"'; i
++, s
++)
81 WINE_FIXME("help unimplemented\n");
83 WINE_FIXME("/t unimplemented\n");
85 WINE_FIXME("/x unimplemented\n");
89 int WINAPI
wWinMain(HINSTANCE hInst
, HINSTANCE hPrevInst
, LPWSTR cmdline
, int cmdshow
)
91 if (ProcessCommandLine(cmdline
))