Jump to content
  • Advertisement
Sign in to follow this  
AckPacket

More than one instance detection

This topic is 5403 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all. Well here is my problem. I have a program, and it will not allow me to open more than one instance of it. If it detects another instance, it terminated immediatly. My questions are these. How is it detecting if it is already open already? Is there any way i can prevent it from checking if it's already open already? If you wish to test out different things, let me give you some background on the situation more. I want to open more than one version of America Online 8.0, and i don't know how it's finding out if it's already open. What possible API calls could it be making? Any c++ code is always useful. If you can help me put together some concepts for code that would load aol but not give it access to information, for instance deny it requests for other processes, that would be awsome.

Share this post


Link to post
Share on other sites
Advertisement
This is platform dependent. What OS are you using?

If you are using Windows, you may be able to make a cope of the aol exe and change the name to aol_second.exe and run them both. However this will result in undefined behaviour as they both try to obtain the same resources (modem, whathaveyou).

[Edited by - flangazor on October 4, 2004 9:39:07 AM]

Share this post


Link to post
Share on other sites
It's probably using a named semaphore (or mutex).
Try searching for some kind of spy program that can give you the name of this semaphore and then you could just unlock it manually.

AOL has probably got a good reason for restricting you to one instance though so be careful. And make sure that they don't try to access the same database.

Share this post


Link to post
Share on other sites
I have a better question, WHY are you trying to open two copies of AOL? The main AOL application is there to allow you to log in and connect to the internet, if you are having two copies open they are going to conflict and want to fight over your internet connection.

Share this post


Link to post
Share on other sites
Quote:
Original post by doynax
It's probably using a named semaphore (or mutex).
Try searching for some kind of spy program that can give you the name of this semaphore and then you could just unlock it manually.

AOL has probably got a good reason for restricting you to one instance though so be careful. And make sure that they don't try to access the same database.
The spyware program you talk about would actually be called a daemon (or "service" in Windows nomenclature).

Share this post


Link to post
Share on other sites
If you are using Windows, the standard way to prevent an application from opening another copy of itself is to try and create a global mutex (mentioned above). If the creation of the mutex fails, this mutex has already been created and hence a copy of the program is already running.

Magius

Share this post


Link to post
Share on other sites
This almost certainly goes against your lisence agreement, so I'm only saying this for informational purposes. Disassemble the exe file, and see if you can find a reference to the semaphore being created or tested for creation. Then replace the testing code with noop instructions.

But as hammerstein_02 said; Why?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Evil Steve
This almost certainly goes against your lisence agreement, so I'm only saying this for informational purposes. Disassemble the exe file, and see if you can find a reference to the semaphore being created or tested for creation. Then replace the testing code with noop instructions.

But as hammerstein_02 said; Why?


What would i look for after i disassemle the exe file? What is a semaphore, or a mutex?

As to why, the answer is this: I would simply like to log onto aol on more than one screen name at once.


Please, don't anyone post warning me of potential problems this could cause, as i am fully aware of the risks and have done many similar things with other versions of aol. The only problem i have to solve is opening more than one version. I'm grateful to the people that have posted helpful comments, but anyone that takes the time to write "you shouldn't do that", or something similar, is just waisting posts and filling up the thread.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!