Don't prepend file:// in wxUtils::Explore() on windows. Wxw will just remove it, and/or blow up trying to remove it, if the path isn't ascii.

This fixes issue 6721.
(cherry picked from commit cc05f66ba1)

Fix unicode support for File::Rename() on windows.

Partial fix of issue 6721.

(cherry picked from commit 99c89ae109)

Missed a accept error handler.
Init instead of memset.

(cherry picked from commit 935ed814ea)

Fix accept() bug, which was using the wrong isRW for error conversion.
Also fixed a debug issue where local_name is used uninitialised.

(cherry picked from commit f811dbb575)

Only add real HID devices to HID list.

(cherry picked from commit e805bf6068)

Add dxsdk_dir to vc++ paths via base.props. This means you no longer need the paths in a global property sheet. In fact if you have them in such a file, you should remove them as it will cause conflicts with the vs2013 build.

(cherry picked from commit 0791a9ef80)
This commit is contained in:
Tony Wasserka 2013-11-28 15:04:22 +01:00
parent d8fd449745
commit 8a887a6fea
6 changed files with 32 additions and 6 deletions

View File

@ -241,7 +241,11 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename)
{
INFO_LOG(COMMON, "Rename: %s --> %s",
srcFilename.c_str(), destFilename.c_str());
#ifdef _WIN32
if (_trename(UTF8ToTStr(srcFilename).c_str(), UTF8ToTStr(destFilename).c_str()) == 0)
#else
if (rename(srcFilename.c_str(), destFilename.c_str()) == 0)
#endif
return true;
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());

View File

@ -398,12 +398,12 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize)
Memory::WriteBigEData((const u8*)&wii_device, OffsetBuffer, Align(wii_device.bLength, 4));
OffsetBuffer += Align(wii_device.bLength, 4);
bool deviceValid = true;
bool isHID = false;
for (c = 0; deviceValid && c < desc.bNumConfigurations; c++)
{
struct libusb_config_descriptor *config = NULL;
int cRet = libusb_get_config_descriptor(device, c, &config);
// do not try to use usb devices with more than one interface, games can crash
if(cRet == 0 && config->bNumInterfaces <= MAX_HID_INTERFACES)
{
@ -415,10 +415,14 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize)
for (ic = 0; ic < config->bNumInterfaces; ic++)
{
const struct libusb_interface *interfaceContainer = &config->interface[ic];
for (i = 0; i < interfaceContainer->num_altsetting; i++)
{
const struct libusb_interface_descriptor *interface = &interfaceContainer->altsetting[i];
if (interface->bInterfaceClass == LIBUSB_CLASS_HID)
isHID = true;
WiiHIDInterfaceDescriptor wii_interface;
ConvertInterfaceToWii(&wii_interface, interface);
Memory::WriteBigEData((const u8*)&wii_interface, OffsetBuffer, Align(wii_interface.bLength, 4));
@ -448,6 +452,12 @@ void CWII_IPC_HLE_Device_hid::FillOutDevices(u32 BufferOut, u32 BufferOutSize)
}
} // configs
if (!isHID)
{
deviceValid = false;
OffsetBuffer = OffsetStart;
}
if (deviceValid)
{
Memory::Write_U32(OffsetBuffer-OffsetStart, OffsetStart); // fill in length

View File

@ -236,14 +236,14 @@ void WiiSocket::update(bool read, bool write, bool except)
socklen_t addrlen = sizeof(sockaddr_in);
int ret = (s32)accept(fd, (sockaddr*)&local_name, &addrlen);
ReturnValue = WiiSockMan::getNetErrorCode(ret, "SO_ACCEPT", false);
ReturnValue = WiiSockMan::getNetErrorCode(ret, "SO_ACCEPT", true);
WiiSockMan::Convert(local_name, *wii_name, addrlen);
}
else
{
int ret = (s32)accept(fd, NULL, 0);
ReturnValue = WiiSockMan::getNetErrorCode(ret, "SO_ACCEPT", false);
ReturnValue = WiiSockMan::getNetErrorCode(ret, "SO_ACCEPT", true);
}
WiiSockMan::getInstance().addSocket(ReturnValue);
@ -432,7 +432,7 @@ void WiiSocket::update(bool read, bool write, bool except)
// send/sendto only handles MSG_OOB
flags &= SO_MSG_OOB;
sockaddr_in local_name;
sockaddr_in local_name = {0};
if (has_destaddr)
{
WiiSockAddrIn* wii_name = (WiiSockAddrIn*)Memory::GetPointer(BufferIn2 + 0x0C);

View File

@ -131,12 +131,12 @@ bool IsInvalidVersion()
return false;
}
// Timebomb only active from 2013-Nov-07.
// Timebomb only active from 2014-Jan-01.
bool IsTimebombActive()
{
SYSTEMTIME t;
GetSystemTime(&t);
return (t.wYear > 2013) || (t.wMonth > 11) || (t.wMonth >= 11 && t.wDay >= 07);
return (t.wYear >= 2014);
}
#endif

View File

@ -24,11 +24,13 @@ void Launch(const char *filename)
void Explore(const char *path)
{
wxString wxPath = StrToWxStr(path);
#ifndef _WIN32
// Default to file
if (! wxPath.Contains(wxT("://")))
{
wxPath = wxT("file://") + wxPath;
}
#endif
#ifdef __WXGTK__
wxPath.Replace(wxT(" "), wxT("\\ "));

View File

@ -6,6 +6,16 @@
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='Win32'">
<IncludePath>$(DXSDK_DIR)Include;$(IncludePath)</IncludePath>
<LibraryPath>$(DXSDK_DIR)Lib\x86;$(LibraryPath)</LibraryPath>
<ExecutablePath>$(DXSDK_DIR)Utilities\Bin\x86;$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='x64'">
<IncludePath>$(DXSDK_DIR)Include;$(IncludePath)</IncludePath>
<LibraryPath>$(DXSDK_DIR)Lib\x64;$(LibraryPath)</LibraryPath>
<ExecutablePath>$(DXSDK_DIR)Utilities\Bin\x64;$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;USE_UPNP;%(PreprocessorDefinitions)</PreprocessorDefinitions>