winapi - Launching an external application from within a NPAPI Plugin -


I'm trying to do a NPAPI plugin that I've written, which means Javascript call, via Javascript call Can not use CreateProcess () or ShellExecute () to launch an application from a specified path from

I can use any of these methods and they withdraw the success, i.e. no error code. But the application does not just launch, I have tried to modify the parameters used when using them, to create new process groups etc. But it appears that there is no effect.

I know that this may look like a security risk, but for very specific purpose

Using Windows XP Pro SP3, Firefox 3.5 and the following code:

/ P>

  Xeromomy (& amp; si; Size (SI)); Si.cb = Size (C); Ziromori (and p, size (pi)); If (CreateProcess (NULL, wFileName, NULL, NULL, FALSE, CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP, NULL, NULL, & amp; si, & amp; pi)) {bSuccess = true; // Stop process and thread handheld WaitForSingleObject (pi.hProcess, Infinite); CloseHandle (pi.hProcess); CloseHandle (pi.hThread); }  

It is difficult to cheat on any code without giving it a snippet Hint:

I do not know why it should not work on XP Are you sure that CreateProcess () / ShellExecute () calls are successful?

Things to try:

  • Do you also pass the ShellExecute () calls that are also passed to an invalid path?

  • If you use a hard-coded path (eg notepad.exe path, path without spaces, etc.)?

  • Check with the process monitor (formerly filemon), if you are trying to launch, that executable file has been accepted.

Probably does not perform executable because no DLL is found.
Keep in mind that the working / current directory is the browser directory, when the application launches from within a plugin.
The DLL that is located in that application folder could not be found.


Comments