issue-#104 calling URLs and commands (InfoCmds capabilities)

Merged to the master branch
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Zinn »

Ivan, sorry I don't understand what the Total Commander has to do with BlackBox.
When this application hang up your computer after its start it is not a BlackBox problem.
Further I don't understand why we need a so complicate solution?
Above I show an easy solution with Hook. What is wrong with it?
It solves the problem with the multiple InfoCmds and the problem with Wine.
- Helmut
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Ivan Denisov »

Zinn wrote:Ivan, sorry I don't understand what the Total Commander has to do with BlackBox.
When this application hang up your computer after its start it is not a BlackBox problem.
Further I don't understand why we need a so complicate solution?
Above I show an easy solution with Hook. What is wrong with it?
It solves the problem with the multiple InfoCmds and the problem with Wine.
- Helmut
Total Commander is an example (by Alex Ilyin) of application that can starts slowly because of hardware reasons (HDD staring). Not the computer will hang up, but the BlackBox will hung up while application opening. If applications are staring in separate thread then there will be no problems.

Actions were introduced in version i21sysCalls which is extensively used by Russian community and by Fyodor Tkachov: http://oberoncore.ru/bbcc/subs/i21sys/calls
Also I used it in my Red version of BlackBox. So without Actions or threads it will not solve the problem with the multiple InfoCmds.
Zinn wrote:Above I show an easy solution with Hook. What is wrong with it?
It solves the problem with the multiple InfoCmds and the problem with Wine.
The execution of all BlackBox command will freeze while called application starting. This is especially bad if you app should handle some data from measuring device or it is like server and should fast answer responses.
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by DGDanforth »

I have a question that I should have asked at the beginning of this discussion.
Where (in what module) should the Start command be located?

I see that it has been moved to Dialog but is that really the correct home for the function?

In addition, why "Start"? I would think "Run" would be more appropriate.

-Doug
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Ivan Denisov »

There was a command Start in HostDialog. I agree that we can rename Start to Run.
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Zinn »

Doug,
yes, calling it Run is a better name as calling it Start.
- Helmut
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Ivan Denisov »

I added IN parameter before procedures arguments and add documentation for two new procedures of Dialog.
http://blackboxframework.org/unstable/i ... a1.447.zip

Changes
http://redmine.blackboxframework.org/pr ... 115335d51f
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Josef Templ »

Ivan Denisov wrote:I made simple demo to demonstrate the security issue.

1. Please, prepare the folder with clean BlackBox.
2. Open this file with BlackBox:
demo.rtf
3. Click the link from imported file
4. Check is there a Docu folder still exists

It is working only under Wine. I noticed, that it does not work in Windows.

In my test under Windows 10 it returned res = 2, which means "file not found".
This results probably from the fact that the arguments of the command are not passed as lpParam but as part of lpFile.
wine may treat this case differently.

This example also shows that error handling is an issue.
It has been ommitted in HostTextConv for the sake of simplicity but could of course be added.
For a general purpose API it would however also be required that the caller has some control
over the error handling. Reporting errors e.g. in the log/status bar is only one possible way.
Other options are to return a result code and let the client handle the error.
But with every such generalization the API gets more complicated and eventually there is the question if
calling WinApi directly is actually simpler and more powerful.

- Josef


- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Zinn »

Ivan Denisov wrote:I made simple demo to demonstrate the security issue.

1. Please, prepare the folder with clean BlackBox.
2. Open this file with BlackBox:
demo.rtf
3. Click the link from imported file
4. Check is there a Docu folder still exists

It is working only under Wine. I noticed, that it does not work in Windows.
On my Wine system it does nothing at all. It does not work.
What is wrong in my Wine installation?

When I exchange Open against Run on my Windows system then I see the black command windows a short time and it closed immediately.
Nothing else was done.

Saving your sample via BlackBox destroy the link.
How did you create the rtf file?

- Helmut
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Post by Ivan Denisov »

This demo silently remove Docu. I recorded video demonstration. I had made this rtf in LibreOffice and then added one space into gedit application. I recorder video to show what I mean.
Attachments

[The extension mp4 has been deactivated and can no longer be displayed.]

Post Reply