Psexec vs MFC application

I am having problems starting an MFC application in remote using
psexec (from http://www.sysinternals.com/).  It works well with most
applications (ex: notepad.exe), but it creates problems with MFC
applications.  The application starts, but it aborts with an
"Application Error" saying "Windows cannot continue from this
exception".

We then wrote our own psexec-like tool to spawn remote applications,
but we have the same problem.  The way psexec (and our tool) works, is
by starting a service on the remote computer, which then waits for a
request to start a process locally.  When the psexec service is
started (like ours), it runs as a child process of the services.exe
Windows process.

We found this suspicious and so we modified our own tool; Instead of
starting a service on the remote machine that waits for remote-spawn
requests, we changed it to simply start a regular user-mode process
that does the same thing (i.e. wait for requests to spawn a process). 
Now, because it is a regular user-mode process, and because we start
it locally on the computer, it is no more a child of the services.exe
process.  With this new scheme, all our MFC application can be
remotely spawn without any problem.  So a quick conclusion seems to be
that a process that is a child of services.exe can not spawn an MFC
process.

Now, the question is why?  What is going on with MFC that stops psexec
from spawning it?  Is there something special I should know about
security attributes and all that stuff?

Thanks,

Ozo.
0
Ozo (1)
3/4/2004 12:03:51 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
429 Views

Similar Articles

[PageSpeed] 45

You might try on of the programming groups as more hard
core programmers will likely view -- and answer -- your
post.

My guesses:  psexec is going to run under the system account
and perhaps under a service that has no access to the desktop.
Most MFC apps will default to using the GUI, so that will cause
an error.

That notepad works, argues against my idea though.

Another possibility:  Just the act of loading it different is
accidently cause it to reference memory or make a call
incorrectly that just doesn't get exposed otherwise.

-- 
Herb Martin
"Ozo" <Ozo@whoever.com> wrote in message
news:841e93f3.0403031603.145bb615@posting.google.com...
> I am having problems starting an MFC application in remote using
> psexec (from http://www.sysinternals.com/).  It works well with most
> applications (ex: notepad.exe), but it creates problems with MFC
> applications.  The application starts, but it aborts with an
> "Application Error" saying "Windows cannot continue from this
> exception".
>
> We then wrote our own psexec-like tool to spawn remote applications,
> but we have the same problem.  The way psexec (and our tool) works, is
> by starting a service on the remote computer, which then waits for a
> request to start a process locally.  When the psexec service is
> started (like ours), it runs as a child process of the services.exe
> Windows process.
>
> We found this suspicious and so we modified our own tool; Instead of
> starting a service on the remote machine that waits for remote-spawn
> requests, we changed it to simply start a regular user-mode process
> that does the same thing (i.e. wait for requests to spawn a process).
> Now, because it is a regular user-mode process, and because we start
> it locally on the computer, it is no more a child of the services.exe
> process.  With this new scheme, all our MFC application can be
> remotely spawn without any problem.  So a quick conclusion seems to be
> that a process that is a child of services.exe can not spawn an MFC
> process.
>
> Now, the question is why?  What is going on with MFC that stops psexec
> from spawning it?  Is there something special I should know about
> security attributes and all that stuff?
>
> Thanks,
>
> Ozo.


0
news5667 (39)
3/4/2004 7:16:32 AM
Knowing what the exception was and what threw it would be useful.  I'm not
sure why MFC is the immediate suspect without knowing more about the app and
why it's failing.  I suspect that Herb is right about this one, though.

Psexec has a switch to run the app interactively with the desktop.  I don't
know how Mark (Russinovich, the psexec author) decides which desktop that is
or what he does when there's nobody logged on interactively - his
documentation is kinda skimpy.

A couple of security concerns with the psexec-like approach:
1. Services that interact with user desktops can be dangerous - google for
"shatter attack" if you're interested.
2. Psexec sends passwords over the wire in plaintext.  I don't know if your
in-house app does that or not.

If this app needs to be run on an interactively-logged on user's desktop,
have you considered terminal services?
-- 
Drew Cooper [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.


"Herb Martin" <news@LearnQuick.com> wrote in message
news:%23z6HgibAEHA.132@TK2MSFTNGP10.phx.gbl...
> You might try on of the programming groups as more hard
> core programmers will likely view -- and answer -- your
> post.
>
> My guesses:  psexec is going to run under the system account
> and perhaps under a service that has no access to the desktop.
> Most MFC apps will default to using the GUI, so that will cause
> an error.
>
> That notepad works, argues against my idea though.
>
> Another possibility:  Just the act of loading it different is
> accidently cause it to reference memory or make a call
> incorrectly that just doesn't get exposed otherwise.
>
> -- 
> Herb Martin
> "Ozo" <Ozo@whoever.com> wrote in message
> news:841e93f3.0403031603.145bb615@posting.google.com...
> > I am having problems starting an MFC application in remote using
> > psexec (from http://www.sysinternals.com/).  It works well with most
> > applications (ex: notepad.exe), but it creates problems with MFC
> > applications.  The application starts, but it aborts with an
> > "Application Error" saying "Windows cannot continue from this
> > exception".
> >
> > We then wrote our own psexec-like tool to spawn remote applications,
> > but we have the same problem.  The way psexec (and our tool) works, is
> > by starting a service on the remote computer, which then waits for a
> > request to start a process locally.  When the psexec service is
> > started (like ours), it runs as a child process of the services.exe
> > Windows process.
> >
> > We found this suspicious and so we modified our own tool; Instead of
> > starting a service on the remote machine that waits for remote-spawn
> > requests, we changed it to simply start a regular user-mode process
> > that does the same thing (i.e. wait for requests to spawn a process).
> > Now, because it is a regular user-mode process, and because we start
> > it locally on the computer, it is no more a child of the services.exe
> > process.  With this new scheme, all our MFC application can be
> > remotely spawn without any problem.  So a quick conclusion seems to be
> > that a process that is a child of services.exe can not spawn an MFC
> > process.
> >
> > Now, the question is why?  What is going on with MFC that stops psexec
> > from spawning it?  Is there something special I should know about
> > security attributes and all that stuff?
> >
> > Thanks,
> >
> > Ozo.
>
>


0
dcoop (1)
3/4/2004 9:19:05 PM
Reply:

Similar Artilces:

Administrator vs User
When I installed Windows on this new hard drive, I never set up a user account - just administator - and used no passwords. That is the way it is on other two hard drives. For 3 days, until I updated Windows, I never had to log in. Now after updates I have only one choice to log in - that is as "Ron Patterson" In Control Panel / User Accounts there are three icons: Ron Patterson, Computer Administrator Guest - "Guest account is off" Asp Net Machine - Limited Account When I boot up I have to log in as user - Ron Patterson. But when I try to...

Outlook 2007 vs 2003
I have just upgraded my home version of Office. I run 2007 on Vista. At the office where I use a laptop, we have Office 2003 and XP. I use Outlook on both configured to the same e-mail address. I have two questions: 1. I have marked the option on both systems to leave messages on the server so that I can read new messages from either location. While messages I pick up at the office appear in my home inbox, messages that I download to my home computer do not appear in my office outlook. Is there something else I can do? 2. I have also tried to import my home address book into my offi...

Psexec vs MFC application
I am having problems starting an MFC application in remote using psexec (from http://www.sysinternals.com/). It works well with most applications (ex: notepad.exe), but it creates problems with MFC applications. The application starts, but it aborts with an "Application Error" saying "Windows cannot continue from this exception". We then wrote our own psexec-like tool to spawn remote applications, but we have the same problem. The way psexec (and our tool) works, is by starting a service on the remote computer, which then waits for a request to start a process locally. ...

excel vs quattro
Is there a feature in excel that is the same as quattro's feature "Notebook query"? ...

2000 vs 2003 printing problem
I have upgraded from Publisher 2000 to Publisher 2003. In a Publisher 2000 document that is an 11 x 17 landscape document page with each half of the document page showing the contents of an 8.5 x 11 sheet. In a printing process (for hard copy to do edit checking) I would have a page property set up for an 8.5 x 11 portrait output. When the 11 x 17 document page printed the results was two 8.5 x 11 sheets each with 1/2 of the 11 x 17 document page, which is what I desired. I have yet to find a means in Publisher 2003 to accomplish this. Can you advise? thanks, don tulo <tulomaus...

ActiveX : Visual Basic vs Visual C++
I know that it is possible to write ActiveX control under Visual Basic and I think that you can also do it under Visual C++. In this condition if you write an ActiveX control with the same functionalities in Vb or in C++, will it be slower with Visual Basic ? Does the ActiveX control inherit the slowness of VB ? Last question : is it really more difficult to do it with VC ? mosfet wrote: > I know that it is possible to write ActiveX control under Visual Basic and I > think that you can also do it under Visual C++. > In this condition if you write an ActiveX control with the same ...

worksheets vs. templates
Hello, I am an excel newbie. I am using Excel 2000 and cannot find any templates installed on the system which I am using (which is a public system that I do not own). I would like to know what the difference is between an excel worksheet and an excel template. Thanks, John Goche A template is a workbook that you can use to create a certain look and feel for specific tasks, and when you open that template a new workbook is added with all of its attributes. -- __________________________________ HTH Bob "John Goche" <johngoche99@googlemail.com> wrote in message news:...

Print/Print Preview in MFC ActiveX control
Hi I have developed an activex control in MFC that has Document View architechture support. This control will be embedded in a html page on a browser. I want to print a screenshot of my activex control using the browser's print/print preview option. When i try to see the print preview of this control using the browser's print-preview option, i see a blank page. It would be a great help if i could get any valuable suggestions from anyone. Thanks in advance Arup Hi Arup, Generally speaking, the Doc/View architecture isn't supported as an ActiveX Control. You must have jumped throu...

Single Instance of Application
Hi, I have an interesting requirement. My application is launched by windows explorer, the command line argument for the application is the directory path that is selected from the windows explorer. Reqt: I launch my application from some directory say C:\Temp\xyz. I minimize the application and goto explorer and select another directory say C:\Temp\abc, I hv to show the same application for the selected directory. I have used MUTEX for single instance, but now I want to parse the command line for the second time. My first code was like this BOOL CDpoiApp::InitInstance() { if (g_SingleIn...

Can I use gdi+ in vs 6?
in "stdafx" I add #if defined(_WIN64) typedef unsigned __int64 ULONG_PTR; #else typedef unsigned long ULONG_PTR; #endif #include "gdiplus.h" #pragma comment( lib, "gdiplus.lib" ) and CWinApp::InitInstance(); ��Gdiplus::GdiplusStartupInput gdiplusStartupInput; ��Gdiplus::GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL); Gdiplus::GdiplusShutdown(m_gdiplusToken); ��return CWinApp::ExitInstance(); It compiles OK. But when I add Graphics graphics( pDC->m_hDC ); it tell me error C2065: 'Graphics' : undeclared identifier why ??ho...

MS outlook vs pocket outlook
Hello: I hope someone can help me with this. I have been out of the loop on pocket pc's etc. I bought a PDA about 8 years ago however it could not enter reminders for tasks like regular outlook could and therefore I ceased using it. I am looking to buy a new one and potentially use MObile OUlook but i need to know if this shortcoming has been fixed. This is what I need. Regular MS Outlook had a wonderful feature that Pocket OUtlook did not. IN regular OUtlook I could set reminders for an event x days prior to the event and it would show up daily in my to do list. SO say there was...

Enterprise VS Standard
Hello, I have never used the Enterprise version of Exchange 2003 and I have one question about it's capabilities. I can deploy OWA on the enterprise version without a front end server...correct? Thanks in advance Aaron Yes. OWA is enabled out of the box. -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.msexchangeblog.com "ABoone" <ABoone@discussions.microsoft.com> wrote in message news:C745D81A-278A-4E18-B725-971837A8497E@microsoft.com... > Hello, > > I have never used the Enterprise version of Exchange 2003 and I hav...

Exchange 2k3 imap VS startup
I have an E2k3 SP1 enterprise edition server. Whenever I reboot, the IMAP4 Virtual server does not start back up. I have to go into Exchange System Manager and manually start it. How do I make it start automatically? Tim How is the service set up - to start manually or automatically? Also, I'd check the dependencies the service has. It may be that it's trying to start before the other services have completed starting. Missy "Tim" <tjc7546@yahoo.com> wrote in message news:u14PBseFFHA.3120@TK2MSFTNGP12.phx.gbl... I have an E2k3 SP1 enterprise edition serve...

Discrepancy between manually formatting sheet vs. using VBA macro
I receive a number of tab delimited text files which I need to convert to Excel spreadsheets. Each file is similar in format: the first line contains only one entry which is to become the "title" of the report. The second line contains column headings (always the same) and the remaining lines contain the variable data; every column in every row always has a value. When I format the spreadsheet manually I select A1:M1, Format Cells, and merge cells, bold, and center horizontally. Then I select A2:M2, Format Cells, and bold. Then I select column A, Format Cells, bold and custom...

Converting from VS 2003 to VS 2005
I have recently converted a fully working application from VS 2003 to VS 2005. I now seem to have lost XP Themes and none of my combo boxes are working. Does anyone have any ideas? Chris "Chris Day" ha scritto nel messaggio news:20089248422chris.day@onwight.net... >I have recently converted a fully working application from VS 2003 to VS >2005. I now seem to have lost XP Themes and none of my combo boxes are >working. Does anyone have any ideas? Hi Chris, do you compile in Unicode mode in VC++ 2005? I'm not sure, but I seem to recall that VC++2005 removes new XP ...

How to add MFC Support to ATL Service in Visual C++.NET
This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C4A62F.EF5DEB80 Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable I=B4m trying to add MFC support to a ATL Service in VC7 but it doesn=B4t = seem to be the same way you do it in VC6, anyone knows howto? Regards ------=_NextPart_000_0008_01C4A62F.EF5DEB80 Content-Type: text/html; charset="windows-1256" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <ME...

XML in VS.Net 2K5 vs VS.Net 2K3
I just started using VS 2K5 beta 2 the other day. I am trying to move a project I created over to in pieces to 2K5. I can't seem to figure out why the follow XPath returns nothing in 2K5 "descendant::element[@ref='CurrDate']". The XML I am trying to select from is as follows: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="CurrDate" type="xs:string"/> <xs:element name="NextGenReport"...

Contacts vs Addressbook
Running Windows XP Home Edition and Outlook 2000. It "appears" that Contacts and Addressbook are synchronized. I need to be able to have Contacts contain phone information for my Palm download and Address Book contain e-mail addresses. HOW can I make the distinction??? Thanks.................Dr Bob this is going to be more of a concern through your PDA sync software as opposed to actual Outlook... i.s. >-----Original Message----- >Running Windows XP Home Edition and Outlook 2000. > >It "appears" that Contacts and Addressbook are >synchronized. I ...

WLM vs Hotmail
I posted a question a few days ago about WLMD and got a reply which included the mention of the D having been dropped some time ago which begs the question how does one tell the versions? Or, maybe I'm mistaken but when I go online and log into my ID, it's listed as Windows Live Mail. I had thought the former Hotmail and MSN mail were being merged into the new Live Mail but if the desktop version is also Windows Live Mail, I must be mistaken. Hotmail, MSN Mail, etc were created originally as web-based mail services. Traditionally, a subscriber would use a web-browser...

Problem with VS.Net Class View
Hello All I am working on a relatively large application suite consisting of around 20 VC++ Projects. We have created a solution and added all the projects to it. I am facing problems while using auto hide feature of VS.Net 2003 Class View. Every other tab like solution explorer etc are working fine but the class view takes a lot of time to display. Auto hide is a very cool feature but because of the time delay in loading the class view i can not use it properly (it takes a lot of time to parse the classes being diaplyed). Has any one faced this problem and is there any solution availabl...

Call stored procedure in mfc
Hi guys, does anyone know how to call stored procedure in MFC using ODBC connection? Please help me step by step, because i am kind of new to this. Thanks for your help. Krish Executing Stroed Procedure is no different than executing any SQL statement. Some ODBC drivers like to have SP parameters passed in a certain way. Look at Codeguru/Codeproject for samples for MFC/ODBC. MSDN also has samples of MFC database classes. Following is the link to database section of Codeguru: http://www.codeguru.com/Cpp/data/mfc_database/ ------------------- Ajay Kalra ajaykalra@yahoo.com krish_jasmi...

VS 2005 vs VS 2002
Is it worth upgrading to VS.net 2005 from our VS.net 2002 Enterprise? All we can seem to get into 2002 are monochrome, 16 colour and 256 colour icons. So can 2005 handle Vista icons with alpha channel colours? Or is the problem that we are running on XP? > Is it worth upgrading to VS.net 2005 from our VS.net 2002 Enterprise? > > All we can seem to get into 2002 are monochrome, 16 colour and 256 colour > icons. So can 2005 handle Vista icons with alpha channel colours? Or is the > problem that we are running on XP? I dont have any idea about the specific issue you wrote. ...

Exchange vs Sharepoint
Currently using GP 8.0. I will be purchasing a new HP DL380, 2.0, 8 Geg ram. I need to share Outlook calenders. I have no need for Exchange mail functions (I use a pop server). I have a small business and I do not need any of Sharepoint's "workflow" features. In relation to the new capabilities of GP version 10, what are the benefits of purchasing Exchange with out Sharepoint? Thank you. Your comment "I have no need for Exchange mail functions (I use a pop server). " sort of sums it up. That is what Exchange does, email. And if you have no use for Sharepoint...

Outlook preview vs normal mode
Outlook 2007. When you open an email with attachments you can see the body of the email. When you click on an attachment the email goes into a preview mode of some kind, with a list of attachments and previews of the attachments, but you can't see the email text any more. Without closing the email and reopening it, how do you go back to the normal view? "M Skabialka" <mskabialka@NOSPAMdrc.com> wrote in message news:e17bn91xKHA.5576@TK2MSFTNGP05.phx.gbl... > Outlook 2007. When you open an email with attachments you can see the body > of the ...

Differences between MFC, Win32 API and .NET?
Hello, I am new to windows development. I was curious if someone could give me a brief summary of each of the topics? .NET, MFC and Win32API. Also, someone told me that not many people use the MFC anymore, and everyone programs with .NET. is that true? My two cents: Win32 API is the interface (functions) that Windows exposes so you can create your applications (Application Programming Interface). This was the way to program apps back in the day with C. To make programming easier, Microsoft developed MFC (Microsoft Foundation Classes) to make Windows programming easier, and it worked...