mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-12 16:22:15 +00:00
Merge upstream/dev into issue/64-remove-winapi-primitives
This commit is contained in:
@@ -4,39 +4,37 @@
|
||||
// From Xbox documentation
|
||||
|
||||
typedef struct tagTHREADNAME_INFO {
|
||||
std::uint32_t dwType; // Must be 0x1000
|
||||
const char *szName; // Pointer to name (in user address space)
|
||||
std::uint32_t dwThreadID; // Thread ID (-1 for caller thread)
|
||||
std::uint32_t dwFlags; // Reserved for future use; must be zero
|
||||
std::uint32_t dwType; // Must be 0x1000
|
||||
const char* szName; // Pointer to name (in user address space)
|
||||
std::uint32_t dwThreadID; // Thread ID (-1 for caller thread)
|
||||
std::uint32_t dwFlags; // Reserved for future use; must be zero
|
||||
} THREADNAME_INFO;
|
||||
|
||||
void SetThreadName(std::uint32_t threadId, const char *threadName)
|
||||
{
|
||||
void SetThreadName(std::uint32_t threadId, const char* threadName) {
|
||||
#ifndef __PS3__
|
||||
THREADNAME_INFO info;
|
||||
|
||||
|
||||
info.dwType = 0x1000;
|
||||
info.szName = threadName;
|
||||
info.dwThreadID = threadId;
|
||||
info.dwFlags = 0;
|
||||
|
||||
#if ( defined _WINDOWS64 | defined _DURANGO )
|
||||
__try
|
||||
{
|
||||
RaiseException(0x406D1388, 0, sizeof(info) / sizeof(std::uint32_t), reinterpret_cast<ULONG_PTR *>(&info));
|
||||
}
|
||||
__except( GetExceptionCode()==0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_EXECUTE_HANDLER )
|
||||
{
|
||||
}
|
||||
|
||||
#if (defined _WINDOWS64 | defined _DURANGO)
|
||||
__try {
|
||||
RaiseException(0x406D1388, 0, sizeof(info) / sizeof(std::uint32_t),
|
||||
reinterpret_cast<ULONG_PTR*>(&info));
|
||||
} __except (GetExceptionCode() == 0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION
|
||||
: EXCEPTION_EXECUTE_HANDLER) {
|
||||
}
|
||||
#endif
|
||||
#ifdef _XBOX
|
||||
__try
|
||||
{
|
||||
RaiseException(0x406D1388, 0, sizeof(info) / sizeof(std::uint32_t), reinterpret_cast<std::uint32_t *>(&info));
|
||||
}
|
||||
__except( GetExceptionCode()==0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_EXECUTE_HANDLER )
|
||||
{
|
||||
__try {
|
||||
RaiseException(
|
||||
0x406D1388, 0, sizeof(info) / sizeof(std::uint32_t),
|
||||
reinterpret_cast<std::uint32_t*>(&info));
|
||||
} __except (GetExceptionCode() == 0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION
|
||||
: EXCEPTION_EXECUTE_HANDLER) {
|
||||
}
|
||||
#endif
|
||||
#endif // __PS3__
|
||||
#endif // __PS3__
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user