This should fix problems with non-ASCII filenames for Win32, and 0-sized files contained in archived files should not cause loading valid roms to fail anymore.

This commit is contained in:
aquanull 2010-10-28 13:22:51 +00:00
parent 317c56ba9d
commit f5f30838f9
2 changed files with 16 additions and 1 deletions

View File

@ -449,7 +449,7 @@ ArchiveScanRecord FCEUD_ScanArchive(std::string fname)
PROPVARIANT prop;
prop.vt = VT_EMPTY;
if (FAILED(object->GetProperty( i, kpidSize, &prop )) || prop.vt != VT_UI8 || !prop.uhVal.LowPart || prop.uhVal.HighPart)
if (FAILED(object->GetProperty( i, kpidSize, &prop )) || prop.vt != VT_UI8 /*|| !prop.uhVal.LowPart*/ || prop.uhVal.HighPart)
goto bomb;
item.size = prop.uhVal.LowPart;

View File

@ -630,6 +630,21 @@ static BOOL CALLBACK EnumCallbackFCEUXInstantiated(HWND hWnd, LPARAM lParam)
#include "x6502.h"
int main(int argc,char *argv[])
{
{
#ifdef MULTITHREAD_STDLOCALE_WORKAROUND
// Note: there's a known threading bug regarding std::locale with MSVC according to
// http://connect.microsoft.com/VisualStudio/feedback/details/492128/std-locale-constructor-modifies-global-locale-via-setlocale
int iPreviousFlag = ::_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
#endif
using std::locale;
locale::global(locale(locale::classic(), "", locale::collate | locale::ctype));
#ifdef MULTITHREAD_STDLOCALE_WORKAROUND
if (iPreviousFlag > 0 )
::_configthreadlocale(iPreviousFlag);
#endif
}
SetThreadAffinityMask(GetCurrentThread(),1);
printf("%08x",opsize);