how to set Security attributes of a process
Hi
i stuck in a strange problem i have exe file on my system when i double click on that exe file a window opens.But when i try to launch the same .exe file using CreateProcess( ) or ShellExecute() API calls then no window opens but the call does not return an error infact PROCESS_INFORMATION structure that i pass to the CreateProcess( ) call have a Handle to the Process and Handle to the thread.
i Checked the task Manager but there is not exe running of that name. Then i used the spy++ tool that comes with the visual Studio from the tools options and searches for the process handle that i get in PROCESS_INFORMATION structure,but no process have the same handle.
I think it may be due to some security attribute setting of the exe file but don't know how to set or change them can any body help me out.
I need to run the exe file through Code.
thanks,
Gagan
[898 byte] By [
gagan] at [2007-12-16]
"anonymous@discussions.microsoft.com"
<gagan@discussions.microsoft.com>
wrote in
message
news:5bd2913e-707c-4e04-b2b9-8fb69e430fe5_WBRev1_@discussions.microsoft.com
>
i stuck in a strange problem i have exe file on my system when i
> double
click on that exe file a window opens.But when i try to launch
> the same
..exe file using CreateProcess( ) or ShellExecute() API calls
> then no
window opens but the call does not return an error infact
>
PROCESS_INFORMATION structure that i pass to the CreateProcess( )
> call
have a Handle to the Process and Handle to the thread.
Do you, by any chance, create the process from inside a service? Services
normally run on their own desktop, that a logged-on user does not see. Any
process started from a service would also run on that desktop. So the process is
running, you just don't see it.
You can specify an alternative desktop for the process using
STARTUPINFO::lpDesktop field. I'm not sure, however, as to how to obtain the
name of the desktop belonging to the currently logged-on user. Besides, there
may me several users logged on at the same time, each with her own
desktop.
--
With best wishes,
Igor
Tandetnik
Hi Gagan,
Can you turn on audit tracking for processes and see what entries you get in the event log:
In the Start menu: Administrative tools, Local Security Policy
Select Audit Policy under the Local Policies Node in the left hand tre control and then enable Adit Process Tracking for both success and faillure in the right hand pane.
Ronald Laeremans
Visual C++ team