mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-05-17 00:48:10 +03:00
steam.exe: Use ProcessWineUnixDebuggerPid to detect unix debugger.
This commit is contained in:
parent
3f2d345fb5
commit
c75d03fb4a
@ -815,24 +815,14 @@ static DWORD WINAPI steam_drm_thread(void *arg)
|
|||||||
|
|
||||||
BOOL is_ptraced(void)
|
BOOL is_ptraced(void)
|
||||||
{
|
{
|
||||||
char key[50];
|
DWORD len;
|
||||||
int value;
|
int pid;
|
||||||
FILE *fp = fopen("/proc/self/status", "r");
|
|
||||||
BOOL ret = FALSE;
|
|
||||||
|
|
||||||
if (!fp) return FALSE;
|
if (NtQueryInformationProcess( GetCurrentProcess(), 1100 /* ProcessWineUnixDebuggerPid */,
|
||||||
|
&pid, sizeof(pid), &len ))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
while (fscanf(fp, " %s %d\n", key, &value) > 0)
|
return !!pid;
|
||||||
{
|
|
||||||
if (!strcmp("TracerPid:", key))
|
|
||||||
{
|
|
||||||
ret = (value != 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user