mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
Fix "Core" to build with "Unicode".
This commit is contained in:
@ -44,7 +44,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
@ -602,4 +602,4 @@
|
|||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
@ -137,7 +137,7 @@ void SConfig::SaveSettings()
|
|||||||
ini.Get("General", "GCMPathes", &oldPaths, 0);
|
ini.Get("General", "GCMPathes", &oldPaths, 0);
|
||||||
for (int i = numPaths; i < oldPaths; i++)
|
for (int i = numPaths; i < oldPaths; i++)
|
||||||
{
|
{
|
||||||
TCHAR tmp[16];
|
char tmp[16];
|
||||||
sprintf(tmp, "GCMPath%i", i);
|
sprintf(tmp, "GCMPath%i", i);
|
||||||
ini.DeleteKey("General", tmp);
|
ini.DeleteKey("General", tmp);
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ void SConfig::SaveSettings()
|
|||||||
|
|
||||||
for (int i = 0; i < numPaths; i++)
|
for (int i = 0; i < numPaths; i++)
|
||||||
{
|
{
|
||||||
TCHAR tmp[16];
|
char tmp[16];
|
||||||
sprintf(tmp, "GCMPath%i", i);
|
sprintf(tmp, "GCMPath%i", i);
|
||||||
ini.Set("General", tmp, m_ISOFolder[i]);
|
ini.Set("General", tmp, m_ISOFolder[i]);
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ void SConfig::LoadSettings()
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < numGCMPaths; i++)
|
for (int i = 0; i < numGCMPaths; i++)
|
||||||
{
|
{
|
||||||
TCHAR tmp[16];
|
char tmp[16];
|
||||||
sprintf(tmp, "GCMPath%i", i);
|
sprintf(tmp, "GCMPath%i", i);
|
||||||
std::string tmpPath;
|
std::string tmpPath;
|
||||||
ini.Get("General", tmp, &tmpPath, "");
|
ini.Get("General", tmp, &tmpPath, "");
|
||||||
|
@ -98,8 +98,8 @@ void Console_Submit(const char *cmd)
|
|||||||
}
|
}
|
||||||
CASE("dump")
|
CASE("dump")
|
||||||
{
|
{
|
||||||
TCHAR temp[256];
|
char temp[256];
|
||||||
TCHAR filename[256];
|
char filename[256];
|
||||||
u32 start;
|
u32 start;
|
||||||
u32 end;
|
u32 end;
|
||||||
sscanf(cmd, "%s %08x %08x %s", temp, &start, &end, filename);
|
sscanf(cmd, "%s %08x %08x %s", temp, &start, &end, filename);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
namespace Win32TAPHelper
|
namespace Win32TAPHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
bool IsTAPDevice(const char *guid)
|
bool IsTAPDevice(const TCHAR *guid)
|
||||||
{
|
{
|
||||||
HKEY netcard_key;
|
HKEY netcard_key;
|
||||||
LONG status;
|
LONG status;
|
||||||
@ -39,13 +39,13 @@ bool IsTAPDevice(const char *guid)
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
char enum_name[256];
|
TCHAR enum_name[256];
|
||||||
char unit_string[256];
|
TCHAR unit_string[256];
|
||||||
HKEY unit_key;
|
HKEY unit_key;
|
||||||
char component_id_string[] = "ComponentId";
|
TCHAR component_id_string[] = _T("ComponentId");
|
||||||
char component_id[256];
|
TCHAR component_id[256];
|
||||||
char net_cfg_instance_id_string[] = "NetCfgInstanceId";
|
TCHAR net_cfg_instance_id_string[] = _T("NetCfgInstanceId");
|
||||||
char net_cfg_instance_id[256];
|
TCHAR net_cfg_instance_id[256];
|
||||||
DWORD data_type;
|
DWORD data_type;
|
||||||
|
|
||||||
len = sizeof(enum_name);
|
len = sizeof(enum_name);
|
||||||
@ -56,7 +56,7 @@ bool IsTAPDevice(const char *guid)
|
|||||||
else if (status != ERROR_SUCCESS)
|
else if (status != ERROR_SUCCESS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
snprintf(unit_string, sizeof(unit_string), "%s\\%s", ADAPTER_KEY, enum_name);
|
_sntprintf(unit_string, sizeof(unit_string), _T("%s\\%s"), ADAPTER_KEY, enum_name);
|
||||||
|
|
||||||
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, unit_string, 0, KEY_READ, &unit_key);
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, unit_string, 0, KEY_READ, &unit_key);
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ bool IsTAPDevice(const char *guid)
|
|||||||
|
|
||||||
if (status == ERROR_SUCCESS && data_type == REG_SZ)
|
if (status == ERROR_SUCCESS && data_type == REG_SZ)
|
||||||
{
|
{
|
||||||
if (!strcmp(component_id, TAP_COMPONENT_ID) &&
|
if (!_tcscmp(component_id, TAP_COMPONENT_ID) &&
|
||||||
!strcmp(net_cfg_instance_id, guid))
|
!_tcscmp(net_cfg_instance_id, guid))
|
||||||
{
|
{
|
||||||
RegCloseKey(unit_key);
|
RegCloseKey(unit_key);
|
||||||
RegCloseKey(netcard_key);
|
RegCloseKey(netcard_key);
|
||||||
@ -96,7 +96,7 @@ bool IsTAPDevice(const char *guid)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetGUIDs(std::vector<std::string>& guids)
|
bool GetGUIDs(std::vector<std::basic_string<TCHAR>>& guids)
|
||||||
{
|
{
|
||||||
LONG status;
|
LONG status;
|
||||||
HKEY control_net_key;
|
HKEY control_net_key;
|
||||||
@ -111,12 +111,12 @@ bool GetGUIDs(std::vector<std::string>& guids)
|
|||||||
|
|
||||||
while (!found_all)
|
while (!found_all)
|
||||||
{
|
{
|
||||||
char enum_name[256];
|
TCHAR enum_name[256];
|
||||||
char connection_string[256];
|
TCHAR connection_string[256];
|
||||||
HKEY connection_key;
|
HKEY connection_key;
|
||||||
char name_data[256];
|
TCHAR name_data[256];
|
||||||
DWORD name_type;
|
DWORD name_type;
|
||||||
const char name_string[] = "Name";
|
const TCHAR name_string[] = _T("Name");
|
||||||
|
|
||||||
len = sizeof(enum_name);
|
len = sizeof(enum_name);
|
||||||
status = RegEnumKeyEx(control_net_key, i, enum_name,
|
status = RegEnumKeyEx(control_net_key, i, enum_name,
|
||||||
@ -127,8 +127,8 @@ bool GetGUIDs(std::vector<std::string>& guids)
|
|||||||
else if (status != ERROR_SUCCESS)
|
else if (status != ERROR_SUCCESS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
snprintf(connection_string, sizeof(connection_string),
|
_sntprintf(connection_string, sizeof(connection_string),
|
||||||
"%s\\%s\\Connection", NETWORK_CONNECTIONS_KEY, enum_name);
|
_T("%s\\%s\\Connection"), NETWORK_CONNECTIONS_KEY, enum_name);
|
||||||
|
|
||||||
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, connection_string,
|
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, connection_string,
|
||||||
0, KEY_READ, &connection_key);
|
0, KEY_READ, &connection_key);
|
||||||
@ -165,15 +165,11 @@ bool GetGUIDs(std::vector<std::string>& guids)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenTAP(HANDLE& adapter, const std::string device_guid)
|
bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& device_guid)
|
||||||
{
|
{
|
||||||
char device_path[256];
|
auto const device_path = USERMODEDEVICEDIR + device_guid + TAPSUFFIX;
|
||||||
|
|
||||||
/* Open Windows TAP-Win32 adapter */
|
adapter = CreateFile(device_path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0,
|
||||||
snprintf(device_path, sizeof(device_path), "%s%s%s",
|
|
||||||
USERMODEDEVICEDIR, device_guid.c_str(), TAPSUFFIX);
|
|
||||||
|
|
||||||
adapter = CreateFile(device_path, GENERIC_READ | GENERIC_WRITE, 0, 0,
|
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0);
|
OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0);
|
||||||
|
|
||||||
if (adapter == INVALID_HANDLE_VALUE)
|
if (adapter == INVALID_HANDLE_VALUE)
|
||||||
@ -192,7 +188,7 @@ bool CEXIETHERNET::Activate()
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
DWORD len;
|
DWORD len;
|
||||||
std::vector<std::string> device_guids;
|
std::vector<std::basic_string<TCHAR>> device_guids;
|
||||||
|
|
||||||
if (!Win32TAPHelper::GetGUIDs(device_guids))
|
if (!Win32TAPHelper::GetGUIDs(device_guids))
|
||||||
{
|
{
|
||||||
|
@ -65,18 +65,18 @@
|
|||||||
// Registry keys
|
// Registry keys
|
||||||
//=================
|
//=================
|
||||||
|
|
||||||
#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
#define ADAPTER_KEY _T("SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}")
|
||||||
|
|
||||||
#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
#define NETWORK_CONNECTIONS_KEY _T("SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}")
|
||||||
|
|
||||||
//======================
|
//======================
|
||||||
// Filesystem prefixes
|
// Filesystem prefixes
|
||||||
//======================
|
//======================
|
||||||
|
|
||||||
#define USERMODEDEVICEDIR "\\\\.\\Global\\"
|
#define USERMODEDEVICEDIR _T("\\\\.\\Global\\")
|
||||||
#define SYSDEVICEDIR "\\Device\\"
|
#define SYSDEVICEDIR _T("\\Device\\")
|
||||||
#define USERDEVICEDIR "\\DosDevices\\Global\\"
|
#define USERDEVICEDIR _T("\\DosDevices\\Global\\")
|
||||||
#define TAPSUFFIX ".tap"
|
#define TAPSUFFIX _T(".tap")
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
// TAP_COMPONENT_ID -- This string defines the TAP driver
|
// TAP_COMPONENT_ID -- This string defines the TAP driver
|
||||||
@ -84,4 +84,4 @@
|
|||||||
// simultaneously.
|
// simultaneously.
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
|
||||||
#define TAP_COMPONENT_ID "tap0901"
|
#define TAP_COMPONENT_ID _T("tap0901")
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <regex>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
@ -464,9 +463,6 @@ int Wiimote::IOWrite(const u8* buf, int len)
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void ProcessWiimotes(bool new_scan, T& callback)
|
void ProcessWiimotes(bool new_scan, T& callback)
|
||||||
{
|
{
|
||||||
// match strings like "Nintendo RVL-WBC-01", "Nintendo RVL-CNT-01", "Nintendo RVL-CNT-01-TR"
|
|
||||||
const std::wregex wiimote_device_name(L"Nintendo RVL-.*");
|
|
||||||
|
|
||||||
BLUETOOTH_DEVICE_SEARCH_PARAMS srch;
|
BLUETOOTH_DEVICE_SEARCH_PARAMS srch;
|
||||||
srch.dwSize = sizeof(srch);
|
srch.dwSize = sizeof(srch);
|
||||||
srch.fReturnAuthenticated = true;
|
srch.fReturnAuthenticated = true;
|
||||||
@ -509,7 +505,7 @@ void ProcessWiimotes(bool new_scan, T& callback)
|
|||||||
DEBUG_LOG(WIIMOTE, "authed %i connected %i remembered %i ",
|
DEBUG_LOG(WIIMOTE, "authed %i connected %i remembered %i ",
|
||||||
btdi.fAuthenticated, btdi.fConnected, btdi.fRemembered);
|
btdi.fAuthenticated, btdi.fConnected, btdi.fRemembered);
|
||||||
|
|
||||||
if (std::regex_match(btdi.szName, wiimote_device_name))
|
if (IsValidBluetoothName(UTF16ToUTF8(btdi.szName)))
|
||||||
{
|
{
|
||||||
callback(hRadio, radioInfo, btdi);
|
callback(hRadio, radioInfo, btdi);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public:
|
|||||||
int int_sock; // Interrupt socket
|
int int_sock; // Interrupt socket
|
||||||
|
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
std::string devicepath; // Unique wiimote reference
|
std::basic_string<TCHAR> devicepath; // Unique wiimote reference
|
||||||
//ULONGLONG btaddr; // Bluetooth address
|
//ULONGLONG btaddr; // Bluetooth address
|
||||||
HANDLE dev_handle; // HID handle
|
HANDLE dev_handle; // HID handle
|
||||||
OVERLAPPED hid_overlap_read, hid_overlap_write; // Overlap handle
|
OVERLAPPED hid_overlap_read, hid_overlap_write; // Overlap handle
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#include "CommonPaths.h"
|
#include "CommonPaths.h"
|
||||||
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
||||||
#include "../Movie.h"
|
#include "../Movie.h"
|
||||||
|
#include "StringUtil.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
@ -926,7 +927,7 @@ u32 CWII_IPC_HLE_Device_es::ES_DIVerify(u8* _pTMD, u32 _sz)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MoveFile(savePath.c_str(), (savePath + "../backup/").c_str());
|
MoveFile(UTF8ToTStr(savePath).c_str(), UTF8ToTStr(savePath + "../backup/").c_str());
|
||||||
#else
|
#else
|
||||||
File::CopyDir(savePath.c_str(),(savePath + "../backup/").c_str());
|
File::CopyDir(savePath.c_str(),(savePath + "../backup/").c_str());
|
||||||
File::DeleteDirRecursively(savePath.c_str());
|
File::DeleteDirRecursively(savePath.c_str());
|
||||||
@ -940,7 +941,7 @@ u32 CWII_IPC_HLE_Device_es::ES_DIVerify(u8* _pTMD, u32 _sz)
|
|||||||
if (File::Exists((savePath + "banner.bin").c_str()))
|
if (File::Exists((savePath + "banner.bin").c_str()))
|
||||||
File::DeleteDirRecursively(savePath);
|
File::DeleteDirRecursively(savePath);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MoveFile((savePath + "../backup/").c_str(), savePath.c_str());
|
MoveFile(UTF8ToTStr(savePath + "../backup/").c_str(), UTF8ToTStr(savePath).c_str());
|
||||||
#else
|
#else
|
||||||
File::CopyDir((savePath + "../backup/").c_str(), savePath.c_str());
|
File::CopyDir((savePath + "../backup/").c_str(), savePath.c_str());
|
||||||
File::DeleteDirRecursively((savePath + "../backup/").c_str());
|
File::DeleteDirRecursively((savePath + "../backup/").c_str());
|
||||||
|
Reference in New Issue
Block a user