Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.net webservice security preventing WndProc & run with parameters
    primarykey
    data
    text
    <p>I have a webservice with a couple of methods that attempt to run or message another .EXE on the system to do a specific task.</p> <p>Either we can start the .EXE process with certain parameters or send it a WndProc message to make it do the desired operation. This works fine locally on my system calling the exe with parameters in cmd or sending a WndProc message from the webservice when debugging it in Visual Studio.</p> <p>None of this works over a real environment however. I had the run .Exe with parameters method (DoSomething) write the exception to a file:</p> <pre><code>System.ComponentModel.Win32Exception (0x80004005): No Access at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Someprogram.ProgramService.DoSomething(String text) </code></pre> <p>The other method for wndproc sendmessage I wrapped in a try/catch as well but no exception thrown. It actually locates the process though as I had it print a file:</p> <pre><code>public static void SendMessageToSomeProgram(string message) { Process[] processes = Process.GetProcessesByName("SomeProgram"); if (processes.Length &gt;= 1) { //iterate through all running target applications foreach (Process p in processes) { //test write if process found TextWriter tw = new StreamWriter(@"c:\wndprocfile.txt"); //this file is printed tw.WriteLine(DateTime.Now.ToString()); tw.Close(); //do stuff try { byte[] sarr = System.Text.Encoding.Default.GetBytes(message); int len = sarr.Length; COPYDATASTRUCT cds; cds.dwData = (IntPtr)100; cds.lpData = message; cds.cbData = len + 1; SendMessage(p.MainWindowHandle, WM_COPYDATA, 0, ref cds); } catch (Exception ex) { TextWriter tw2 = new StreamWriter(@"c:\wndProc_errorfile.txt"); //not printed tw2.WriteLine(DateTime.Now.ToString() + "Exception: " + ex.ToString()); tw2.Close(); } } } </code></pre> <p>Now I see why it's nice to have security like this in place but is there an easy way around this? Maybe just some settings in IIS?</p> <p>UPDATED INFO: The server is running IIS 5.1 so no Application Pool feature.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload