Commit d4fa8265 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dxdiag: Use wide-char string literals.

parent 80912728
...@@ -27,25 +27,6 @@ ...@@ -27,25 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dxdiag); WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
static const WCHAR szTimeEnglish[] = {'s','z','T','i','m','e','E','n','g','l','i','s','h',0};
static const WCHAR szTimeLocalized[] = {'s','z','T','i','m','e','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szMachineNameEnglish[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','E','n','g','l','i','s','h',0};
static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0};
static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szLanguagesEnglish[] = {'s','z','L','a','n','g','u','a','g','e','s','E','n','g','l','i','s','h',0};
static const WCHAR szLanguagesLocalized[] = {'s','z','L','a','n','g','u','a','g','e','s','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szSystemManufacturerEnglish[] = {'s','z','S','y','s','t','e','m','M','a','n','u','f','a','c','t','u','r','e','r','E','n','g','l','i','s','h',0};
static const WCHAR szSystemModelEnglish[] = {'s','z','S','y','s','t','e','m','M','o','d','e','l','E','n','g','l','i','s','h',0};
static const WCHAR szBIOSEnglish[] = {'s','z','B','I','O','S','E','n','g','l','i','s','h',0};
static const WCHAR szProcessorEnglish[] = {'s','z','P','r','o','c','e','s','s','o','r','E','n','g','l','i','s','h',0};
static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0};
static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0};
static const WCHAR szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0};
static const WCHAR szWindowsDir[] = {'s','z','W','i','n','d','o','w','s','D','i','r',0};
static const WCHAR szDirectXVersionLongEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','o','n','g','E','n','g','l','i','s','h',0};
static const WCHAR szSetupParamEnglish[] = {'s','z','S','e','t','u','p','P','a','r','a','m','E','n','g','l','i','s','h',0};
static const WCHAR szDxDiagVersion[] = {'s','z','D','x','D','i','a','g','V','e','r','s','i','o','n',0};
struct property_list struct property_list
{ {
const WCHAR *property_name; const WCHAR *property_name;
...@@ -108,41 +89,41 @@ static inline void fill_system_property_list(struct dxdiag_information *dxdiag_i ...@@ -108,41 +89,41 @@ static inline void fill_system_property_list(struct dxdiag_information *dxdiag_i
{ {
struct system_information *system_info = &dxdiag_info->system_info; struct system_information *system_info = &dxdiag_info->system_info;
list[0].property_name = szTimeEnglish; list[0].property_name = L"szTimeEnglish";
list[0].output = &system_info->szTimeEnglish; list[0].output = &system_info->szTimeEnglish;
list[1].property_name = szTimeLocalized; list[1].property_name = L"szTimeLocalized";
list[1].output = &system_info->szTimeLocalized; list[1].output = &system_info->szTimeLocalized;
list[2].property_name = szMachineNameEnglish; list[2].property_name = L"szMachineNameEnglish";
list[2].output = &system_info->szMachineNameEnglish; list[2].output = &system_info->szMachineNameEnglish;
list[3].property_name = szOSExLongEnglish; list[3].property_name = L"szOSExLongEnglish";
list[3].output = &system_info->szOSExLongEnglish; list[3].output = &system_info->szOSExLongEnglish;
list[4].property_name = szOSExLocalized; list[4].property_name = L"szOSExLocalized";
list[4].output = &system_info->szOSExLocalized; list[4].output = &system_info->szOSExLocalized;
list[5].property_name = szLanguagesEnglish; list[5].property_name = L"szLanguagesEnglish";
list[5].output = &system_info->szLanguagesEnglish; list[5].output = &system_info->szLanguagesEnglish;
list[6].property_name = szLanguagesLocalized; list[6].property_name = L"szLanguagesLocalized";
list[6].output = &system_info->szLanguagesLocalized; list[6].output = &system_info->szLanguagesLocalized;
list[7].property_name = szSystemManufacturerEnglish; list[7].property_name = L"szSystemManufacturerEnglish";
list[7].output = &system_info->szSystemManufacturerEnglish; list[7].output = &system_info->szSystemManufacturerEnglish;
list[8].property_name = szSystemModelEnglish; list[8].property_name = L"szSystemModelEnglish";
list[8].output = &system_info->szSystemModelEnglish; list[8].output = &system_info->szSystemModelEnglish;
list[9].property_name = szBIOSEnglish; list[9].property_name = L"szBIOSEnglish";
list[9].output = &system_info->szBIOSEnglish; list[9].output = &system_info->szBIOSEnglish;
list[10].property_name = szProcessorEnglish; list[10].property_name = L"szProcessorEnglish";
list[10].output = &system_info->szProcessorEnglish; list[10].output = &system_info->szProcessorEnglish;
list[11].property_name = szPhysicalMemoryEnglish; list[11].property_name = L"szPhysicalMemoryEnglish";
list[11].output = &system_info->szPhysicalMemoryEnglish; list[11].output = &system_info->szPhysicalMemoryEnglish;
list[12].property_name = szPageFileEnglish; list[12].property_name = L"szPageFileEnglish";
list[12].output = &system_info->szPageFileEnglish; list[12].output = &system_info->szPageFileEnglish;
list[13].property_name = szPageFileLocalized; list[13].property_name = L"szPageFileLocalized";
list[13].output = &system_info->szPageFileLocalized; list[13].output = &system_info->szPageFileLocalized;
list[14].property_name = szWindowsDir; list[14].property_name = L"szWindowsDir";
list[14].output = &system_info->szWindowsDir; list[14].output = &system_info->szWindowsDir;
list[15].property_name = szDirectXVersionLongEnglish; list[15].property_name = L"szDirectXVersionLongEnglish";
list[15].output = &system_info->szDirectXVersionLongEnglish; list[15].output = &system_info->szDirectXVersionLongEnglish;
list[16].property_name = szSetupParamEnglish; list[16].property_name = L"szSetupParamEnglish";
list[16].output = &system_info->szSetupParamEnglish; list[16].output = &system_info->szSetupParamEnglish;
list[17].property_name = szDxDiagVersion; list[17].property_name = L"szDxDiagVersion";
list[17].output = &system_info->szDxDiagVersion; list[17].output = &system_info->szDxDiagVersion;
} }
...@@ -172,8 +153,6 @@ static BOOL fill_system_information(IDxDiagContainer *container, struct dxdiag_i ...@@ -172,8 +153,6 @@ static BOOL fill_system_information(IDxDiagContainer *container, struct dxdiag_i
return TRUE; return TRUE;
} }
static const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0};
static const struct information_fillers static const struct information_fillers
{ {
const WCHAR *child_container_name; const WCHAR *child_container_name;
...@@ -181,7 +160,7 @@ static const struct information_fillers ...@@ -181,7 +160,7 @@ static const struct information_fillers
void (*free_function)(struct dxdiag_information *); void (*free_function)(struct dxdiag_information *);
} filler_list[] = } filler_list[] =
{ {
{DxDiag_SystemInfo, fill_system_information, free_system_information}, {L"DxDiag_SystemInfo", fill_system_information, free_system_information},
}; };
void free_dxdiag_information(struct dxdiag_information *system_info) void free_dxdiag_information(struct dxdiag_information *system_info)
......
...@@ -105,11 +105,6 @@ static BOOL process_file_name(const WCHAR *cmdline, enum output_type output_type ...@@ -105,11 +105,6 @@ static BOOL process_file_name(const WCHAR *cmdline, enum output_type output_type
static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info *info) static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info *info)
{ {
static const WCHAR whql_colonW[] = {'w','h','q','l',':',0};
static const WCHAR offW[] = {'o','f','f',0};
static const WCHAR onW[] = {'o','n',0};
static const WCHAR dontskipW[] = {'d','o','n','t','s','k','i','p',0};
info->whql_check = FALSE; info->whql_check = FALSE;
info->output_type = OUTPUT_NONE; info->output_type = OUTPUT_NONE;
...@@ -143,17 +138,17 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info ...@@ -143,17 +138,17 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info
ARRAY_SIZE(info->outfile)); ARRAY_SIZE(info->outfile));
case 'W': case 'W':
case 'w': case 'w':
if (wcsnicmp(cmdline, whql_colonW, 5)) if (wcsnicmp(cmdline, L"whql:", 5))
return FALSE; return FALSE;
cmdline += 5; cmdline += 5;
if (!wcsnicmp(cmdline, offW, 3)) if (!wcsnicmp(cmdline, L"off", 3))
{ {
info->whql_check = FALSE; info->whql_check = FALSE;
cmdline += 2; cmdline += 2;
} }
else if (!wcsnicmp(cmdline, onW, 2)) else if (!wcsnicmp(cmdline, L"on", 2))
{ {
info->whql_check = TRUE; info->whql_check = TRUE;
cmdline++; cmdline++;
...@@ -165,7 +160,7 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info ...@@ -165,7 +160,7 @@ static BOOL process_command_line(const WCHAR *cmdline, struct command_line_info
case 'd': case 'd':
case 'D': case 'D':
if (wcsnicmp(cmdline, dontskipW, 8)) if (wcsnicmp(cmdline, L"dontskip", 8))
return FALSE; return FALSE;
cmdline += 8; cmdline += 8;
break; break;
......
...@@ -33,26 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxdiag); ...@@ -33,26 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxdiag);
static char output_buffer[1024]; static char output_buffer[1024];
static const char crlf[2] = "\r\n"; static const char crlf[2] = "\r\n";
static const WCHAR DxDiag[] = {'D','x','D','i','a','g',0};
static const WCHAR SystemInformation[] = {'S','y','s','t','e','m','I','n','f','o','r','m','a','t','i','o','n',0};
static const WCHAR Time[] = {'T','i','m','e',0};
static const WCHAR MachineName[] = {'M','a','c','h','i','n','e','N','a','m','e',0};
static const WCHAR OperatingSystem[] = {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0};
static const WCHAR Language[] = {'L','a','n','g','u','a','g','e',0};
static const WCHAR SystemManufacturer[] = {'S','y','s','t','e','m','M','a','n','u','f','a','c','t','u','r','e','r',0};
static const WCHAR SystemModel[] = {'S','y','s','t','e','m','M','o','d','e','l',0};
static const WCHAR BIOS[] = {'B','I','O','S',0};
static const WCHAR Processor[] = {'P','r','o','c','e','s','s','o','r',0};
static const WCHAR Memory[] = {'M','e','m','o','r','y',0};
static const WCHAR PageFile[] = {'P','a','g','e','F','i','l','e',0};
static const WCHAR WindowsDir[] = {'W','i','n','d','o','w','s','D','i','r',0};
static const WCHAR DirectXVersion[] = {'D','i','r','e','c','t','X','V','e','r','s','i','o','n',0};
static const WCHAR DXSetupParameters[] = {'D','X','S','e','t','u','p','P','a','r','a','m','e','t','e','r','s',0};
static const WCHAR DxDiagVersion[] = {'D','x','D','i','a','g','V','e','r','s','i','o','n',0};
static const WCHAR DxDiagUnicode[] = {'D','x','D','i','a','g','U','n','i','c','o','d','e',0};
static const WCHAR DxDiag64Bit[] = {'D','x','D','i','a','g','6','4','B','i','t',0};
struct text_information_field struct text_information_field
{ {
const char *field_name; const char *field_name;
...@@ -241,41 +221,38 @@ static HRESULT save_xml_document(IXMLDOMDocument *xmldoc, const WCHAR *filename) ...@@ -241,41 +221,38 @@ static HRESULT save_xml_document(IXMLDOMDocument *xmldoc, const WCHAR *filename)
static inline void fill_system_xml_output_table(struct dxdiag_information *dxdiag_info, struct xml_information_field *fields) static inline void fill_system_xml_output_table(struct dxdiag_information *dxdiag_info, struct xml_information_field *fields)
{ {
static const WCHAR zeroW[] = {'0',0}; fields[0].tag_name = L"Time";
static const WCHAR oneW[] = {'1',0};
fields[0].tag_name = Time;
fields[0].value = dxdiag_info->system_info.szTimeEnglish; fields[0].value = dxdiag_info->system_info.szTimeEnglish;
fields[1].tag_name = MachineName; fields[1].tag_name = L"MachineName";
fields[1].value = dxdiag_info->system_info.szMachineNameEnglish; fields[1].value = dxdiag_info->system_info.szMachineNameEnglish;
fields[2].tag_name = OperatingSystem; fields[2].tag_name = L"OperatingSystem";
fields[2].value = dxdiag_info->system_info.szOSExLongEnglish; fields[2].value = dxdiag_info->system_info.szOSExLongEnglish;
fields[3].tag_name = Language; fields[3].tag_name = L"Language";
fields[3].value = dxdiag_info->system_info.szLanguagesEnglish; fields[3].value = dxdiag_info->system_info.szLanguagesEnglish;
fields[4].tag_name = SystemManufacturer; fields[4].tag_name = L"SystemManufacturer";
fields[4].value = dxdiag_info->system_info.szSystemManufacturerEnglish; fields[4].value = dxdiag_info->system_info.szSystemManufacturerEnglish;
fields[5].tag_name = SystemModel; fields[5].tag_name = L"SystemModel";
fields[5].value = dxdiag_info->system_info.szSystemModelEnglish; fields[5].value = dxdiag_info->system_info.szSystemModelEnglish;
fields[6].tag_name = BIOS; fields[6].tag_name = L"BIOS";
fields[6].value = dxdiag_info->system_info.szBIOSEnglish; fields[6].value = dxdiag_info->system_info.szBIOSEnglish;
fields[7].tag_name = Processor; fields[7].tag_name = L"Processor";
fields[7].value = dxdiag_info->system_info.szProcessorEnglish; fields[7].value = dxdiag_info->system_info.szProcessorEnglish;
fields[8].tag_name = Memory; fields[8].tag_name = L"Memory";
fields[8].value = dxdiag_info->system_info.szPhysicalMemoryEnglish; fields[8].value = dxdiag_info->system_info.szPhysicalMemoryEnglish;
fields[9].tag_name = PageFile; fields[9].tag_name = L"PageFile";
fields[9].value = dxdiag_info->system_info.szPageFileEnglish; fields[9].value = dxdiag_info->system_info.szPageFileEnglish;
fields[10].tag_name = WindowsDir; fields[10].tag_name = L"WindowsDir";
fields[10].value = dxdiag_info->system_info.szWindowsDir; fields[10].value = dxdiag_info->system_info.szWindowsDir;
fields[11].tag_name = DirectXVersion; fields[11].tag_name = L"DirectXVersion";
fields[11].value = dxdiag_info->system_info.szDirectXVersionLongEnglish; fields[11].value = dxdiag_info->system_info.szDirectXVersionLongEnglish;
fields[12].tag_name = DXSetupParameters; fields[12].tag_name = L"DXSetupParameters";
fields[12].value = dxdiag_info->system_info.szSetupParamEnglish; fields[12].value = dxdiag_info->system_info.szSetupParamEnglish;
fields[13].tag_name = DxDiagVersion; fields[13].tag_name = L"DxDiagVersion";
fields[13].value = dxdiag_info->system_info.szDxDiagVersion; fields[13].value = dxdiag_info->system_info.szDxDiagVersion;
fields[14].tag_name = DxDiagUnicode; fields[14].tag_name = L"DxDiagUnicode";
fields[14].value = oneW; fields[14].value = L"1";
fields[15].tag_name = DxDiag64Bit; fields[15].tag_name = L"DxDiag64Bit";
fields[15].value = dxdiag_info->system_info.win64 ? oneW : zeroW; fields[15].value = dxdiag_info->system_info.win64 ? L"1" : L"0";
} }
static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const WCHAR *filename) static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const WCHAR *filename)
...@@ -286,7 +263,7 @@ static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const ...@@ -286,7 +263,7 @@ static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const
struct xml_information_field fields[50]; struct xml_information_field fields[50];
} output_table[] = } output_table[] =
{ {
{SystemInformation}, {L"SystemInformation"},
}; };
IXMLDOMDocument *xmldoc = NULL; IXMLDOMDocument *xmldoc = NULL;
...@@ -304,7 +281,7 @@ static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const ...@@ -304,7 +281,7 @@ static BOOL output_xml_information(struct dxdiag_information *dxdiag_info, const
goto error; goto error;
} }
if (!(dxdiag_element = xml_create_element(xmldoc, DxDiag))) if (!(dxdiag_element = xml_create_element(xmldoc, L"DxDiag")))
goto error; goto error;
hr = IXMLDOMDocument_appendChild(xmldoc, (IXMLDOMNode *)dxdiag_element, NULL); hr = IXMLDOMDocument_appendChild(xmldoc, (IXMLDOMNode *)dxdiag_element, NULL);
...@@ -380,13 +357,11 @@ static struct output_backend ...@@ -380,13 +357,11 @@ static struct output_backend
{ {
/* OUTPUT_TEXT */ /* OUTPUT_TEXT */
{ {
{'.','t','x','t',0}, L".txt", output_text_information,
output_text_information,
}, },
/* OUTPUT_XML */ /* OUTPUT_XML */
{ {
{'.','x','m','l',0}, L".xml", output_xml_information,
output_xml_information,
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment