flat assembler
Message board for the users of flat assembler.

Index > Windows > ..

Author
Thread Post new topic Reply to topic
pool



Joined: 08 Jan 2007
Posts: 97
pool 28 Aug 2012, 23:20
..


Last edited by pool on 17 Mar 2013, 12:11; edited 1 time in total
Post 28 Aug 2012, 23:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 29 Aug 2012, 00:19
You could use a mutex in your program to detect if an instance is already in use.

BTW: What do you mean by "fastest"?
Post 29 Aug 2012, 00:19
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 29 Aug 2012, 07:20
What to do really depends on your needs.

Are you trying to be sneaky, or do you just want the best non-sneaky way to do it? You'll also have to consider if you want to allow one instance per *machine*, or per *user* - keep in mind that there's something called Terminal Services Smile
Post 29 Aug 2012, 07:20
View user's profile Send private message Visit poster's website Reply with quote
pool



Joined: 08 Jan 2007
Posts: 97
pool 29 Aug 2012, 08:27
..


Last edited by pool on 17 Mar 2013, 12:11; edited 1 time in total
Post 29 Aug 2012, 08:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 29 Aug 2012, 08:32
pool wrote:
Fastest. I mean I don't need functions that uses search methods.
We don't really have any reliable way to determine which OS functions use search and which don't. It could be that a mutex call does more searching than your Process32Next calls. And different versions of the OS might use different methods. My suggestion is that if your program is so fragile that the time taken to find another running exe could make or break it then you are doing something very wrong.
Post 29 Aug 2012, 08:32
View user's profile Send private message Visit poster's website Reply with quote
pool



Joined: 08 Jan 2007
Posts: 97
pool 29 Aug 2012, 08:42
..


Last edited by pool on 17 Mar 2013, 12:11; edited 1 time in total
Post 29 Aug 2012, 08:42
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 29 Aug 2012, 08:44
pool wrote:
I'm actually using a named file mapping object on each exe. If happen when the other exe fail then it's named file mapping object is also invalid and its memory pointer. So to access it again I'm gonna execute that exe again to have the file mapped object again.
Perhaps WaitForMultipleObjects will suit your purpose. You can wait on multiple process handles and detect when one closes.
Post 29 Aug 2012, 08:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.