Great as usual. I remember one day that a malware was taking an app's mutex at startup which prevents the original app from starting. Interesting
@zodiacon
Жыл бұрын
You can do that for media player as well :)
@thefastjojo
Жыл бұрын
Nice content Pavel! I'm looking forward to keeping following you in those quick videos!
@chicoern
Жыл бұрын
That's a cool concept to apply in PS scripts. Very nice.
@MarekKnapek
Жыл бұрын
If you have such single-instance application, it is nice, when you launch the second instance, to activate the first instance's window. Because when the user launches an application they expect some window to appear. It is important to choose proper combination of of single-instancing and window-activating functions. It happened to me, back in he Windows XP days, that launching Firefox web browser did nothing. Because second instance of Firefox could not activate window of first the instance. It was because I was using SysInternals Desktops to create multiple desktops (Windows' terminology, similar to session, different from window-management feature introduced in Windows 10). Single-instancing worked fine across desktops (because named mutexes are per-session), but existing browser window could not be displayed on screen, because I was at different desktop. I was confused for a while: double-clicking Firefox did "nothing".
@zodiacon
Жыл бұрын
Indeed. Media Player uses FindWindow to locate its other window, which is common, but only works for the caller's desktop.
@newpatch6510
15 күн бұрын
Hi Pavel great video, i wanted to ask for example the application i tried to close the window is having 2 same mutant handle (with the same name) if i close either one of them it will success, if i try to close the last mutant handle, it will not able to close it (i've tried using handle.exe -p -c -y it will successfully close but i checked using process explorer it will still be there (even if i close it using process explorer it will still be there). any idea why?
@zodiacon
15 күн бұрын
No idea, this can't really happen. Maybe your Process Explorer view is paused (press/release Space Bar) so it's not updated.
@newpatch6510
15 күн бұрын
@@zodiacon Found it, Seems like the 2 same mutant handle is having a different attribute (I checked it using your Object Explorer great apps pavel), one of them is None (0) and the other is Protect (1) and i can't seems to close the Protect (1). could this indicate that my user login windows is not higher authority ? if so, any idea how to close the Protect (1) mutant handle?
@zodiacon
15 күн бұрын
The Protect flag prevents closing the handle. You need to call SetHandleInformation(h, HANDLE_FLAG_PROTECT, 0) from within that process to remove the Protect bit. Who put the Protect bit there?
@newpatch6510
15 күн бұрын
nvm... even if i use process explorer, it will says i successfully close it but it still showing on it. this could be protected by something. any idea how to trace it?
@zodiacon
15 күн бұрын
There is nothing to trace once the flag is there. You could set a breakpoint in SetHandleInformation, maybe something will show up.
Пікірлер: 13