mirror of https://github.com/PCSX2/pcsx2.git
spu2-x:windows: Replace GUIDFromString with IIDFromString
Does the same thing.
This commit is contained in:
parent
4889e9783f
commit
5c1023a332
|
@ -40,7 +40,6 @@ extern BOOL CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int SendDialogMsg(HWND hwnd, int dlgId, UINT code, WPARAM wParam, LPARAM lParam);
|
extern int SendDialogMsg(HWND hwnd, int dlgId, UINT code, WPARAM wParam, LPARAM lParam);
|
||||||
extern HRESULT GUIDFromString(const wchar_t *str, LPGUID guid);
|
|
||||||
|
|
||||||
extern void AssignSliderValue(HWND idcwnd, HWND hwndDisplay, int value);
|
extern void AssignSliderValue(HWND idcwnd, HWND hwndDisplay, int value);
|
||||||
extern void AssignSliderValue(HWND hWnd, int idc, int editbox, int value);
|
extern void AssignSliderValue(HWND hWnd, int idc, int editbox, int value);
|
||||||
|
|
|
@ -114,7 +114,7 @@ public:
|
||||||
if (m_Device.empty())
|
if (m_Device.empty())
|
||||||
throw std::runtime_error("screw it");
|
throw std::runtime_error("screw it");
|
||||||
|
|
||||||
if ((FAILED(GUIDFromString(m_Device, &cGuid))) ||
|
if ((FAILED(IIDFromString(m_Device, &cGuid))) ||
|
||||||
FAILED(DirectSoundCreate8(&cGuid, &dsound, NULL)))
|
FAILED(DirectSoundCreate8(&cGuid, &dsound, NULL)))
|
||||||
throw std::runtime_error("try again?");
|
throw std::runtime_error("try again?");
|
||||||
} catch (std::runtime_error &) {
|
} catch (std::runtime_error &) {
|
||||||
|
@ -267,7 +267,7 @@ private:
|
||||||
case WM_INITDIALOG: {
|
case WM_INITDIALOG: {
|
||||||
wchar_t temp[128];
|
wchar_t temp[128];
|
||||||
|
|
||||||
haveGuid = !FAILED(GUIDFromString(m_Device, &DevGuid));
|
haveGuid = !FAILED(IIDFromString(m_Device, &DevGuid));
|
||||||
SendMessage(GetDlgItem(hWnd, IDC_DS_DEVICE), CB_RESETCONTENT, 0, 0);
|
SendMessage(GetDlgItem(hWnd, IDC_DS_DEVICE), CB_RESETCONTENT, 0, 0);
|
||||||
|
|
||||||
ndevs = 0;
|
ndevs = 0;
|
||||||
|
|
|
@ -23,46 +23,6 @@ int SendDialogMsg(HWND hwnd, int dlgId, UINT code, WPARAM wParam, LPARAM lParam)
|
||||||
return SendMessage(GetDlgItem(hwnd, dlgId), code, wParam, lParam);
|
return SendMessage(GetDlgItem(hwnd, dlgId), code, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT GUIDFromString(const wchar_t *str, LPGUID guid)
|
|
||||||
{
|
|
||||||
// "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
|
|
||||||
|
|
||||||
// VS2015 supports the hh format specifier (finally). VS2013 doesn't though,
|
|
||||||
// so this will do for now.
|
|
||||||
u32 guid_u32;
|
|
||||||
u16 guid_u16[2];
|
|
||||||
u16 guid_u8[8];
|
|
||||||
|
|
||||||
int r = swscanf_s(str, L"{%08x-%04hx-%04hx-%02hx%02hx-%02hx%02hx%02hx%02hx%02hx%02hx}",
|
|
||||||
&guid_u32,
|
|
||||||
&guid_u16[0],
|
|
||||||
&guid_u16[1],
|
|
||||||
&guid_u8[0],
|
|
||||||
&guid_u8[1],
|
|
||||||
&guid_u8[2],
|
|
||||||
&guid_u8[3],
|
|
||||||
&guid_u8[4],
|
|
||||||
&guid_u8[5],
|
|
||||||
&guid_u8[6],
|
|
||||||
&guid_u8[7]);
|
|
||||||
|
|
||||||
if (r != 11)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
guid->Data1 = guid_u32;
|
|
||||||
guid->Data2 = guid_u16[0];
|
|
||||||
guid->Data3 = guid_u16[1];
|
|
||||||
guid->Data4[0] = (u8)guid_u8[0];
|
|
||||||
guid->Data4[1] = (u8)guid_u8[1];
|
|
||||||
guid->Data4[2] = (u8)guid_u8[2];
|
|
||||||
guid->Data4[3] = (u8)guid_u8[3];
|
|
||||||
guid->Data4[4] = (u8)guid_u8[4];
|
|
||||||
guid->Data4[5] = (u8)guid_u8[5];
|
|
||||||
guid->Data4[6] = (u8)guid_u8[6];
|
|
||||||
guid->Data4[7] = (u8)guid_u8[7];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline void Verifyc(HRESULT hr, const char *fn)
|
__forceinline void Verifyc(HRESULT hr, const char *fn)
|
||||||
{
|
{
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
|
|
Loading…
Reference in New Issue