Files
0443166b6a fix: vita networking(#23)
VITA Networking is now working. but it can only connect to non LARGE_WORLDS.

---------

Co-authored-by: 552eden <552eden@gmail.com>
Reviewed-on: #23
Co-authored-by: ubergamer-pie <16+ubergamer-pie@noreply.localhost>
2026-08-05 16:59:22 +00:00

49 lines
1.4 KiB
C++

#include "stdafx.h"
// From Xbox documentation
typedef struct tagTHREADNAME_INFO {
DWORD dwType; // Must be 0x1000
LPCSTR szName; // Pointer to name (in user address space)
DWORD dwThreadID; // Thread ID (-1 for caller thread)
DWORD dwFlags; // Reserved for future use; must be zero
} THREADNAME_INFO;
void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName )
{
#ifndef __PS3__
THREADNAME_INFO info;
info.dwType = 0x1000;
info.szName = szThreadName;
info.dwThreadID = dwThreadID;
info.dwFlags = 0;
#if ( defined _WINDOWS64 | defined _DURANGO )
// 0x406D1388 is a debugger protocol, not a real exception - only a debugger
// can consume it. With nothing attached it terminates the process.
if( !IsDebuggerPresent() )
return;
__try
{
// count is in ULONG_PTRs, not DWORDs - on x64 the DWORD count made
// RaiseException read past the end of info
RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR *)&info );
}
__except( GetExceptionCode()==0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_EXECUTE_HANDLER )
{
}
#endif
#ifdef _XBOX
__try
{
RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(DWORD), (DWORD *)&info );
}
__except( GetExceptionCode()==0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_EXECUTE_HANDLER )
{
}
#endif
#endif // __PS3__
}