Exchange IE BHO C ++ data between tabs

I would like BHO instances of my IE extension to be able to share common data. I just need them to share a couple of variables, so I'm trying to find an easy solution to the problem.

Alternatives that I can think of, from simpler to more complex:

1) Writing / reading data to / from the file system or to the registry, see MSDN article and Codeproject article . Question : is this information available from BHO instances running on different threads?

2) Development of a Windows service or background application that interacts with all BHO instances, see the MSDN article . Problem . I have no IDEA how to do this or where to start. I am worried that the user has to install many things.

3) Providing IPC mechanisms so that different instances of BHO can communicate directly with each other. Similar to using IGlobalInterfaceTable, see ookii article . Problem . Yes, you can store pointers in this IGlobalInterfaceTable and get cookies to access them, but how can you share one cookie received in instance BHO 1 with BHO instance 2 so that the second instance can access the data inserted into IGlobalInterfaceTable first? Don't we have the same data exchange problem here?

Well, as you can see, after a whole week of finding a solution, I just don’t know how to start dealing with this problem. Any help would be greatly appreciated.

+4
source share
2 answers

Often, memory files are used for this. However, this is not a trivial amount of work, as you have to make sure that they are ACL'd correctly in order to allow access to the cross process (each tab can be in a different process) and work with several levels of integrity.

+1
source

1 view, with the exception of the place that a normal website can write, isolated from a trusted website, can be accessed .

2 Writing a service is probably the easiest way, given the rich amount of documentation on how to write a Windows service (you even get the ATL project wizard if you use Visual C ++), and your broker code can survive the tab process crashes or even user logout.

3 Indeed, you again have one problem with the exchange, COM messages are blocked by UIPI if you cannot change the message filter, but the messages used by COM are not documented. I would use something like a named pipe / memory file mapping.

You need to place the communication intermediary code somewhere and create it only once. You can write something like the computers in the workgroup select the main browser (type of chat) or have an intermediary process to do the work (for example, in the Windows service).

+1
source

All Articles