Problem involving CreateProcessW function.

  • Thread starter Thread starter shangjiaxuan
  • Start date Start date
S

shangjiaxuan

Guest
The function works on actual executable and does what it is mean to do, but when I rename a random file with an ".exe" extension to see what will happen if the user gives a wrong input, a window pops up with the title "Unsupported 16-Bit Application". This is expected.


However, when I tried to rename the file back to what it was, I found out that the file handle does not close even after I closed the calling application. It seems that the handle was open in explorer.exe. I tried to restart the explorer process (reopened from task manager), but it seems that I still cannot rename the file.


I know I wasn't supposed to use the function in such a manner, but if I want to allow the user to launch other executable from a console app, is it really necessary or useful to verify with the starting bits 4D5A?


Edit: I tried again and found out that this also happens when I double click another renamed file directly. May this be an actual problem? (I'm running Windows 10 x64, by the way)

Continue reading...
 
Back
Top