steam.exe: Use ProcessWineUnixDebuggerPid to detect unix debugger.

This commit is contained in:
Rémi Bernon 2025-01-09 11:01:04 +01:00 committed by Arkadiusz Hiler
parent 3f2d345fb5
commit c75d03fb4a

View File

@ -815,24 +815,14 @@ static DWORD WINAPI steam_drm_thread(void *arg)
BOOL is_ptraced(void)
{
char key[50];
int value;
FILE *fp = fopen("/proc/self/status", "r");
BOOL ret = FALSE;
DWORD len;
int pid;
if (!fp) return FALSE;
if (NtQueryInformationProcess( GetCurrentProcess(), 1100 /* ProcessWineUnixDebuggerPid */,
&pid, sizeof(pid), &len ))
return FALSE;
while (fscanf(fp, " %s %d\n", key, &value) > 0)
{
if (!strcmp("TracerPid:", key))
{
ret = (value != 0);
break;
}
}
fclose(fp);
return ret;
return !!pid;
}
int main(int argc, char *argv[])