Am I Insane? Wine moves PID around.

Questions about Wine on Linux
Locked
EntroPadding
Newbie
Newbie
Posts: 2
Joined: Sat Sep 28, 2019 10:36 am

Am I Insane? Wine moves PID around.

Post by EntroPadding »

Hi,

I just want to ask if I really observe this behaviour right or am becoming stupid. I tried googling it but couldn't find anything even close to my problem.

I have a process, and I have code (a DLL) I want to inject in this process.

I am on arch and tried a few wine versions, more than 20, packages as well as self compiled. Currently on 4.16 TKG Staging, but this doesn't matter.

Here's what's happening. The process ID of the .exe I want to inject the code into changes shortly after launching it. Let's say it comes up with process ID 45, 1 to 2 seconds later it will have a process ID lower than 10 and I can't inject the DLL anymore?

I need to be really fast to be able to, sometimes it takes like 30 tries and this is killing me tbh.

Does anyone have any idea where to start looking if this is an issue I have to live with?

Best Regards
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: Am I Insane? Wine moves PID around.

Post by DarkShadow44 »

Wine might start a new process. But once it runs, there should be no changing anymore.
EntroPadding
Newbie
Newbie
Posts: 2
Joined: Sat Sep 28, 2019 10:36 am

Re: Am I Insane? Wine moves PID around.

Post by EntroPadding »

Are you sure? I mean within the Wine Prefix, the abstracted Windows Process Id. Especially this PID becoming always lower than 10 makes me suspicious. Also it the process starts with a "normal" PID like say >50 and it changes. There's no restart of the process involved.

I am using something like
https://github.com/Arvanaghi/Windows-DL ... Injector.c

Not really something fancy. If I let my application echo the pe32.th32ProcessID each second it looks like this

12:00:00 echo pid 51
12:00:01 echo pid 51
12:00:02 echo pid 7
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: Am I Insane? Wine moves PID around.

Post by DarkShadow44 »

Mind giving a small sample to reproduce?
Locked