2 * Copyright 1999 Marcus Meissner
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 static int WINAPIV
mywprintf(const WCHAR
*format
, ...)
27 static char output_bufA
[65536];
28 static WCHAR output_bufW
[sizeof(output_bufA
)];
32 HANDLE hout
= GetStdHandle(STD_OUTPUT_HANDLE
);
34 __ms_va_start(parms
, format
);
35 vswprintf(output_bufW
, ARRAY_SIZE(output_bufW
), format
, parms
);
38 /* Try to write as unicode whenever we think it's a console */
39 if (((DWORD_PTR
)hout
& 3) == 3)
41 res
= WriteConsoleW(hout
, output_bufW
, lstrlenW(output_bufW
), &nOut
, NULL
);
47 /* Convert to OEM, then output */
48 convertedChars
= WideCharToMultiByte(GetConsoleOutputCP(), 0, output_bufW
, -1,
49 output_bufA
, sizeof(output_bufA
),
51 res
= WriteFile(hout
, output_bufA
, convertedChars
, &nOut
, FALSE
);
54 return res
? nOut
: 0;
57 int __cdecl
wmain(int argc
, WCHAR
* argv
[])
59 int i
, n
=0,doabout
=0,doconfigure
=0;
61 for (i
= 1; i
< argc
; i
++) {
62 if (!lstrcmpW(argv
[i
], L
"-about"))
64 else if (!lstrcmpW(argv
[i
], L
"-configure"))
67 mywprintf(L
"Unknown option: %s\n", argv
[i
]);
72 mywprintf(L
"%s", L
"Currently installed Video Compressors:\n");
77 ii
.dwSize
= sizeof(ii
);
78 if (!ICInfo(ICTYPE_VIDEO
,n
++,&ii
))
80 if (!(hic
=ICOpen(ii
.fccType
,ii
.fccHandler
,ICMODE_QUERY
)))
82 if (!ICGetInfo(hic
,&ii
,sizeof(ii
))) {
87 mywprintf(L
"%c%c%c%c.%c%c%c%c: %s\n",
88 LOBYTE(ii
.fccType
),LOBYTE(ii
.fccType
>>8),LOBYTE(ii
.fccType
>>16),LOBYTE(ii
.fccType
>>24),
89 LOBYTE(ii
.fccHandler
),LOBYTE(ii
.fccHandler
>>8),LOBYTE(ii
.fccHandler
>>16),LOBYTE(ii
.fccHandler
>>24),
91 mywprintf(L
"\tdwFlags: 0x%08x (",ii
.dwFlags
);
93 if (ii
.dwFlags
& VIDCF_QUALITY
) mywprintf(L
"%s ", L
"VIDCF_QUALITY");
94 if (ii
.dwFlags
& VIDCF_CRUNCH
) mywprintf(L
"%s ", L
"VIDCF_CRUNCH");
95 if (ii
.dwFlags
& VIDCF_TEMPORAL
) mywprintf(L
"%s ", L
"VIDCF_TEMPORAL");
96 if (ii
.dwFlags
& VIDCF_COMPRESSFRAMES
) mywprintf(L
"%s ", L
"VIDCF_COMPRESSFRAMES");
97 if (ii
.dwFlags
& VIDCF_DRAW
) mywprintf(L
"%s ", L
"VIDCF_DRAW");
98 if (ii
.dwFlags
& VIDCF_FASTTEMPORALC
) mywprintf(L
"%s ", L
"VIDCF_FASTTEMPORALC");
99 if (ii
.dwFlags
& VIDCF_FASTTEMPORALD
) mywprintf(L
"%s ", L
"VIDCF_FASTTEMPORALD");
100 if (ii
.dwFlags
& VIDCF_QUALITYTIME
) mywprintf(L
"%s ", L
"VIDCF_QUALITYTIME");
102 mywprintf(L
"%s", L
")\n");
103 mywprintf(L
"\tdwVersion: 0x%08x\n", ii
.dwVersion
);
104 mywprintf(L
"\tdwVersionICM: 0x%08x\n", ii
.dwVersionICM
);
105 mywprintf(L
"\tszDescription: %s\n", ii
.szDescription
);
106 if (doabout
) ICAbout(hic
,0);
107 if (doconfigure
&& ICQueryConfigure(hic
))