Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
NoNameNeeded

Use Win98 user32.dll and user.exe in Win95

Recommended Posts

Well, of course I added this function to the dll file.

But I've tested it now.

On Win98 it works just fine. The application uses the function from the dll1.dll file. I've tested this by removing the function again and the application complains about dll1.dll missing that function (which makes perfect sense and proves that the application checks the dll1.dll file for that function)

So, as it seems I did everything correctly as far as this import/export/redirecting stuff is concerned.

The application just doesn't work on Win95 and as it seems, it doesn't even bother to check that dll1.dll. It just complains about a missing function in user32.dll

Strange but true.

Share this post


Link to post
Share on other sites

That's because missing function is still in the imports list, you need to "open" your application into HEX editor and rename this missing function to name of some unused function from user32.dll

for example "PaintDesktop" or some other unused function, and that will do the trick.

1YKFVCz.png

Edited by ABCDEFG

Share this post


Link to post
Share on other sites

Oh, interesting.

But I don't know how to replace the name of the function.

I've tried it in several different ways but when I save the file as an exe file the icon is gone and Windows says it's not a valid file so how am I supposed to change it?
 

Share this post


Link to post
Share on other sites

Probably because you change size of application. Overwrite name letter by letter! Do not use insert / copy&paste method!

And it must be NULL terminated string

54 72 61 63 6B 4D 6F 75 73 65 45 76 65 6E 74 00 00 - TrackMouseEvent
50 61 69 6E 74 44 65 73 6B 74 6F 70 00 00 00 00 00 - PaintDesktop

Share this post


Link to post
Share on other sites

That's cumbersome...

It worked now by manually typing it but the application still doesn't work because now there is an error message complaining about a missing function in dll1.dll

Guess which function...
PaintDesktop!
;)

Are you sure it works this way?
 

Share this post


Link to post
Share on other sites

Of course i am sure!

And i don't know why you need that dll1.dll for foxit reader?

It does not use TrackMouseEvent from user32.dll it uses it from comctl32.dll

Share this post


Link to post
Share on other sites

 I don't know which file it really uses, but the error message says that there is a missing function in user32.dll and its name is TrackMouseEvent

That's why I started the whole thread and I can only rely on what Windows and dependency walker tells me.

All I know is that it's now looking for PaintDesktop in dll1.dll and even though I really don't know much about this stuff, it kinda makes sense to me, because I pointed it to this function by editing the application, so no big surprise...

Edited by NoNameNeeded

Share this post


Link to post
Share on other sites

I just cheked it about 1hour ago and i saw that it does not use that function from user32.dll

so, forward exported functions and additional dlls are not needed for foxit reader.

Share this post


Link to post
Share on other sites

But the application thinks it needs this function from user32.dll and won't start without it.

And this redirection stuff only seems to work if there is the same function in user32.dll (like in Win98), which makes no sense, because why would anyone bother to redirect this function if the application still looks for it in its original place?

Share this post


Link to post
Share on other sites

...or to put it differently:
Even though this redirection process seems to have worked, there is apparently more that needs to be done because there are still references to this function in user32.dll, even after redirecting.

So these other references apparently also need to be changed to the new dll and just renaming the function to another missing function doesn't seem to help.

Share this post


Link to post
Share on other sites

Ok, I finally got it to work by changing one of the two references to "GetWindowInfo" so yes, it works now.

But this redirection ordeal kinda led to nowhere...

Share this post


Link to post
Share on other sites
User32.dll : TrackMouseEvent takes one parameter, returns a BOOL (boolean), and sets extended error information.
GetWindowInfo takes two parameters and will corrupt the stack if called when used to replace TrackMouseEvent.

Instead use one of the following:
  CloseDesktop
  CloseWindow
  CopyIcon
  DestroyCursor
  DestroyIcon
  DestroyMenu
  DestroyWindow
  DrawMenuBar
  GetDlgCtrlID
  GetKeyboardType

Do not attempt to use User32.dll from Win98 in Win95.
Do not attempt to redirect DLL's in Win95.

Edited by jumper

Share this post


Link to post
Share on other sites
7 hours ago, jumper said:

Do not attempt to use User32.dll from Win98 in Win95.
Do not attempt to redirect DLL's in Win95.
 

Thx for your information!

No, user32.dll from Win98 doesn't work in Win95 anyway, I've tried that even though I didn't expect it to work and I was right.

However, I have another user32.dll from a beta version of Win98, which does work (if replaced together with user.exe from that same build). That's how I found out that several applications would actually work with just a little bit of more functions in user32.dll and that's basically why I started this thread.

So it's in general a bad idea to redirect dlls in Win95?

Why?

Doesn't it work or are applications very prone to crash when redirected?
-------


Could you name a few safe "replacement" functions for kernel32.dll?

Edited by NoNameNeeded

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...