2

Good morning. Sorry to my bad English. Now I have encountered one problem. I have succeeded in executing a function with one parameter, but in case of several parameters, I failed. here is what I tried.

rundll32.exe "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll", ImageView_FullScreen C:\Users\ADMIN\Documents\a.jpg // succeeded;

but I noticed that the exported function is imageview_fullscreenW, and the syntax requires 4 parameters. The 3rd parameter is the full path to the image and the other parameters are just ignored.

rundll32.exe "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll", ImageView_FullScreenW 0 0  C:\Users\ADMIN\Documents\a.jpg 0 // failed;

So what's wrong with this? I am struggling with this problem for two hours! I will be really thankful if anyone finds an answer! thanks in advance.

greg hoglund
  • 21
  • 1
  • 2
  • `Rundll32` calls the function specified in the dll specified with this format -`hwnd as long, hinst as long (filled in by Rundll32), lpszCmdLine as pointer to string, nCmdShow as integer` –  Dec 15 '19 at 02:16
  • __In the above command line, the comma (,) between the and the function name is extremely important. If the comma separator is missing, Rundll or Rundll32 will fail without indicating any errors. In addition, there cannot be any white spaces in between the , the comma, and the function.__ –  Dec 15 '19 at 02:18
  • thank you for your comment, Mark. But have you tried what I did? In the above case, imageview_fullscreenW function requires 4 params(windows 7 32bit). It doesn't work. can you consider this problem once again? – greg hoglund Dec 15 '19 at 14:41
  • There is no problem to consider. Rundll32 calls functions that have been designed to be called by it. –  Dec 15 '19 at 18:54
  • Does this answer your question? [How to run Photoviewer.dll in command line](https://stackoverflow.com/questions/6190271/how-to-run-photoviewer-dll-in-command-line) – CristiFati Dec 15 '19 at 21:23
  • that's what I referenced. But the problem is: the dependency walker showed me that the exported function of photoviewer.dll is ImageView_FullScreenW, not ImageView_Fullscreen. So I just wanted to test with 'W' version. But It requires 4 params. – greg hoglund Dec 15 '19 at 23:51

0 Answers0