From 2ab1128787fbbf551c312e3306b25be0fa3947e5 Mon Sep 17 00:00:00 2001 From: "jshin%mailaps.org" Date: Fri, 15 Sep 2006 01:52:09 +0000 Subject: [PATCH] back out the patch for bug 344630 git-svn-id: svn://10.0.0.236/trunk@211763 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileWin.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/mozilla/xpcom/io/nsLocalFileWin.cpp b/mozilla/xpcom/io/nsLocalFileWin.cpp index e52561409a4..dcdd9a2caec 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.cpp +++ b/mozilla/xpcom/io/nsLocalFileWin.cpp @@ -71,7 +71,6 @@ #include #include #include -#include #include "nsXPIDLString.h" #include "prproces.h" @@ -1407,26 +1406,30 @@ nsLocalFile::GetVersionInfoField(const char* aField, nsAString& _retval) { LANGANDCODEPAGE* translate = nsnull; UINT pageCount; - BOOL queryResult = ::VerQueryValueW(ver, L"\\VarFileInfo\\Translation", + BOOL queryResult = ::VerQueryValue(ver, "\\VarFileInfo\\Translation", (void**)&translate, &pageCount); if (queryResult && translate) { for (PRInt32 i = 0; i < 2; ++i) { - PRUnichar subBlock[MAX_PATH]; - StringCchPrintfW(subBlock, MAX_PATH, - L"\\StringFileInfo\\%04x%04x\\%s", - (i == 0 ? translate[0].wLanguage - : ::GetUserDefaultLangID()), - translate[0].wCodePage, - NS_ConvertASCIItoUTF16( - nsDependentCString(aField)).get()); + // XXX : need to make sure that we can get away with + // 'VerQueryValueA' here. + char subBlock[MAX_PATH]; + PR_snprintf(subBlock, sizeof(subBlock), + "\\StringFileInfo\\%04x%04x\\%s", + (i == 0 ? translate[0].wLanguage + : ::GetUserDefaultLangID()), + translate[0].wCodePage, aField); + LPVOID value = nsnull; UINT size; - queryResult = ::VerQueryValueW(ver, subBlock, &value, &size); + queryResult = ::VerQueryValueA(ver, subBlock, &value, &size); if (queryResult && value) { - _retval = nsDependentString((const PRUnichar*) value); + NS_ASSERTION(nsCRT::IsAscii((const char*) value), + "Version string has non-ASCII characters"); + CopyASCIItoUTF16(nsDependentCString((const char*) value), + _retval); if (!_retval.IsEmpty()) { rv = NS_OK;