DEV9: windows support unicode fixes

This commit is contained in:
GovanifY 2020-10-03 21:33:15 +02:00 committed by refractionpcsx2
parent eea4e383f9
commit fabef0334b
6 changed files with 25 additions and 35 deletions

View File

@ -1,4 +1,4 @@
include(macros/CompileGResources) include(macros/GlibCompileResourcesSupport)
if (openSUSE) if (openSUSE)

View File

@ -63,7 +63,7 @@ void OnInitDialog(HWND hW)
vector<tap_adapter>* al = GetTapAdapters(); vector<tap_adapter>* al = GetTapAdapters();
for (size_t i = 0; i < al->size(); i++) for (size_t i = 0; i < al->size(); i++)
{ {
int itm = ComboBox_AddString(GetDlgItem(hW, IDC_ETHDEV), al[0][i].name.c_str()); int itm = SendMessageA(GetDlgItem(hW, IDC_ETHDEV), CB_ADDSTRING, NULL, (LPARAM)(LPCTSTR)al[0][i].name.c_str());
ComboBox_SetItemData(GetDlgItem(hW, IDC_ETHDEV), itm, _strdup(al[0][i].guid.c_str())); ComboBox_SetItemData(GetDlgItem(hW, IDC_ETHDEV), itm, _strdup(al[0][i].guid.c_str()));
if (strcmp(al[0][i].guid.c_str(), config.Eth) == 0) if (strcmp(al[0][i].guid.c_str(), config.Eth) == 0)
{ {

View File

@ -1,30 +1,16 @@
/* /* PCSX2 - PS2 Emulator for PCs
* TAP-Win32 -- A kernel driver to provide virtual tap device functionality * Copyright (C) 2002-2010 PCSX2 Dev Team
* on Windows. Originally derived from the CIPE-Win32
* project by Damion K. Wilson, with extensive modifications by
* James Yonan.
* *
* All source code which derives from the CIPE-Win32 project is * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* Copyright (C) Damion K. Wilson, 2003, and is released under the * of the GNU Lesser General Public License as published by the Free Software Found-
* GPL version 2 (see below). * ation, either version 3 of the License, or (at your option) any later version.
* *
* All other source code is Copyright (C) James Yonan, 2003-2004, * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* and is released under the GPL version 2 (see below). * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
* *
* This program is free software; you can redistribute it and/or modify * You should have received a copy of the GNU General Public License along with PCSX2.
* it under the terms of the GNU General Public License as published by * If not, see <http://www.gnu.org/licenses/>.
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING included with this
* distribution); if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
@ -195,9 +181,11 @@ vector<tap_adapter>* GetTapAdapters()
{ {
if (IsTAPDevice(enum_name)) if (IsTAPDevice(enum_name))
{ {
std::string tmp("hello"); std::wstring tmp(name_data);
std::string tmp2("hello"); std::wstring tmp2(enum_name);
tap_adapter t = {tmp, tmp2}; std::string tmp3(tmp.begin(), tmp.end());
std::string tmp4(tmp2.begin(), tmp2.end());
tap_adapter t = {tmp3, tmp4};
tap_nic->push_back(t); tap_nic->push_back(t);
} }
} }

View File

@ -28,8 +28,9 @@ vector<tap_adapter>* GetTapAdapters();
class TAPAdapter : public NetAdapter class TAPAdapter : public NetAdapter
{ {
HANDLE htap; HANDLE htap;
OVERLAPPED read,write; OVERLAPPED read, write;
bool isActive = false; bool isActive = false;
public: public:
TAPAdapter(); TAPAdapter();
virtual bool blocks(); virtual bool blocks();

View File

@ -20,8 +20,10 @@
#include "Utilities/PersistentThread.h" #include "Utilities/PersistentThread.h"
#include "System/SysThreads.h" #include "System/SysThreads.h"
#ifdef _WIN32
#include <WinSock2.h> #include <WinSock2.h>
#include <windows.h> #include <windows.h>
#endif
using namespace Threading; using namespace Threading;

View File

@ -291,7 +291,6 @@ static const std::unique_ptr<BaseSavestateEntry> SavestateEntries[] = {
std::unique_ptr<BaseSavestateEntry>(new PluginSavestateEntry(PluginId_PAD)), std::unique_ptr<BaseSavestateEntry>(new PluginSavestateEntry(PluginId_PAD)),
std::unique_ptr<BaseSavestateEntry>(new PluginSavestateEntry(PluginId_USB)), std::unique_ptr<BaseSavestateEntry>(new PluginSavestateEntry(PluginId_USB)),
}; };
>>>>>>> DEV9: initial work on merge, removing references
// It's bad mojo to have savestates trying to read and write from the same file at the // It's bad mojo to have savestates trying to read and write from the same file at the
// same time. To prevent that we use this mutex lock, which is used by both the // same time. To prevent that we use this mutex lock, which is used by both the