View previous topic :: View next topic |
Author |
Message |
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Thu Mar 30, 2017 3:19 pm Post subject: Problems with START_PROCESS@ |
|
|
When migrating from FTN95 7.xx to FTN95 8.xx (32bit), I get problems with the call of START_PROCESS@. The return code is now -1, which means a problem with calling the new process.
How can I get more information about the reason of this problem? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Thu Mar 30, 2017 3:54 pm Post subject: |
|
|
START_PROCESS@ returns -1 when
a) the length of the command string is zero (i.e. only spaces in Fortran)
b) the resulting call to the API CreateProcess returns NULL.
Case (b) is far more likely but that's as far as I can go.
I have wondered what happens if you try to start up a 32 bit app from a 64 bit app. |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Thu Mar 30, 2017 4:08 pm Post subject: |
|
|
I try to start up a 32 bit app from a 32 bit app.
When I reduce my project to a small example it is working, but in the complete project I get this problem. I can't see any relevant message when compiling and linking the app. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Thu Mar 30, 2017 4:20 pm Post subject: |
|
|
In answer to Paul's speculation, I'd expect it to just work, same as calling a 64 bit app from a 32 bit one on a 64 bit system. The question is, what return message do you get when calling a 64 bit app from a 32 bit one on a 32 bit system?
My money is on START_PPROCESS@ at best resorting to a Windows message, and START_PROCESS@ causing a mess/crash/hang. Or maybe both cause a mess etc. Or maybe pigs do fly.
Only experimentation will tell.
Eddie |
|
Back to top |
|
|
BILLDOWS
Joined: 22 Jul 2005 Posts: 86 Location: Swansea, UK
|
Posted: Thu Mar 30, 2017 4:56 pm Post subject: |
|
|
Hi, Have you tried:
START_PROCESS_AND_WAIT@
This solved a recent problem I was having with START_PROCESS - might not help but might be worth a try.
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Thu Mar 30, 2017 9:39 pm Post subject: |
|
|
Another one is START_PPROCESS@ (P is repeated).
They probably all end up calling CreateProcess.
If the problem persists then I could look into recovering the API error report following the call to CreateProcess. Thinking about it, you might even be able to get this report directly in your Fortran code. |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Fri Mar 31, 2017 7:57 am Post subject: |
|
|
START_PROCESS_AND_WAIT@ returns also error code -1.
START_PPROCESS@ leads to a "Floating point stack overflow" in __clearwin when executing the line with SDBG. |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Fri Mar 31, 2017 8:04 am Post subject: |
|
|
I called now GetLastError() immediate after START_PROCESS@ and got error code 740, which means: "The requested operation requires elevation."
I don't know the meaning of this error code? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Mar 31, 2017 9:16 am Post subject: |
|
|
Google does. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1888
|
Posted: Fri Mar 31, 2017 10:00 am Post subject: |
|
|
The message simply states that your code is attempting to do something such as changing an item in the Windows registry, etc., that requires "elevated privilege". When you attempt such actions in Windows Explorer, you get a pop-up that you have to accept with a click or by entering an Admin password.
No, it does not require you to take your laptop into the Kehlsteinhaus :) .
Last edited by mecej4 on Sat Apr 01, 2017 3:21 am; edited 1 time in total |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Fri Mar 31, 2017 11:09 am Post subject: |
|
|
Mecej4,
According to Godwin's Law, even with such an oblique reference, your last post has to be declared unhelpful! ;-)
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Mar 31, 2017 3:18 pm Post subject: |
|
|
If the application is just for your own use then you can probably fix this by running the primary application under "Run as administrator". |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Fri Mar 31, 2017 3:47 pm Post subject: |
|
|
Obviously when starting the second app with START_PROCESS@ Windows will give a User Account Control message.
This message does not appear when I start the second app directly and it does not appear when I compile with FTN95 7.xx.
I have also another app compiled with FTN95 8.10 which uses the same algorithms and the same second app and there is no such message. START_PROCESS@ works properly in this case. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Mar 31, 2017 5:12 pm Post subject: |
|
|
Are you testing on more than one machine with different operating systems?
If you are only using one machine then the behaviour is very strange.
Can you construct a working sample for me to look at? |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Sun Apr 02, 2017 9:11 am Post subject: |
|
|
I'm just testing on one machine running Windows 10 Pro 64-bit.
I will try to build an example, but it will need some time. |
|
Back to top |
|
|
|