Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

user32.dll (Announce)

posted by marcov, 03.07.2021, 19:48

To get the discussion further, I took a sizable binary (the fullscreen textmode IDE fp.exe) and looked at its user32.dll dependencies with MS dependency walker, the result is at. Note that this is for FPC 3.2.2, older versions might have less:

https://pasteboard.co/K9uqGZb.png

The resulting functions fall in a few categories:
1 basic charset conversions (anything with charupper/lower oemto etc) in it.
2 clipboard related stuff (the textmode IDE allows to copy/paste from/to windows)
3 a few functions for console input like getKeyboardlayout and vkKeyscanexa), as to be expected in a full screen textmode program.
4 a few functions for GUI popup boxes of exceptions (messagebox, messagebeep, maybe also enumwindows)
5 a few misc functions (getsystemmetrics, enumwindows again, getwindowthreadprocessid

For the first (1) set of calls , keep in mind that the Windows console is in a different (OEM) encoding than the api (ANSI). How do you handle that difference (OEM vs Ansi) in your program? Otherwise simply make a few functions that map them as 1:1 output=input to eliminate them, but keep the functionality.

Clipboard (2) and console input (3) stuff is in advanced units that are not necessary if you keep to basic ansi screen control only. Not necessary for the early stuff

The GUI Popup(4) stuff is in case the program turns GUI (which can be a runtime decision). You can probably easily comment these calls without much problems.

Leaves (5) which have to be evaluated on a case by case basis. Some might also not be in the basic RTL (e.g. enumwindows and getwindowthreadprocessid), but for the more complex app only (like getsystemmetric which is afaik used to query console dimensions)

None of these have equivalents in msvcrt.dll

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 367 users online (0 registered, 367 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum