include \masm32\MasmBasic\MasmBasic.inc ; download (http://masm32.com/board/index.php?topic=94.0)
Init
GetRegArray "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs", Dll$(), Name$() ; the optional second array takes the values
QSort Name$()
For_ ecx=0 To eax-1 ; skip the 2 folder names
PrintLine Str$(ecx+1), Tb$, Name$(ecx)
Next
Inkey
EndOfCode
Output Win XP:1 %SystemRoot%\system32
2 advapi32.dll
3 comdlg32.dll
4 gdi32.dll
5 imagehlp.dll
6 kernel32.dll
7 lz32.dll
8 ole32.dll
9 oleaut32.dll
10 olecli32.dll
11 olecnv32.dll
12 olesvr32.dll
13 olethk32.dll
14 rpcrt4.dll
15 shell32.dll
16 url.dll
17 urlmon.dll
18 user32.dll
19 version.dll
20 wininet.dll
21 wldap32.dll
Output Win7-64:1 %SystemRoot%\system32
2 %SystemRoot%\syswow64
3 advapi32.dll
4 clbcatq.dll
5 COMDLG32.dll
6 difxapi.dll
7 gdi32.dll
8 IERTUTIL.dll
9 IMAGEHLP.dll
10 IMM32.dll
11 kernel32.dll
12 LPK.dll
13 MSCTF.dll
14 MSVCRT.dll
15 NORMALIZ.dll
16 NSI.dll
17 ole32.dll
18 OLEAUT32.dll
19 PSAPI.DLL
20 rpcrt4.dll
21 sechost.dll
22 Setupapi.dll
23 SHELL32.dll
24 SHLWAPI.dll
25 URLMON.dll
26 user32.dll
27 USP10.dll
28 WININET.dll
29 WLDAP32.dll
30 WS2_32.dll
Output Win10:1 advapi32.dll
2 clbcatq.dll
3 combase.dll
4 COMDLG32.dll
5 coml2.dll
6 difxapi.dll
7 gdi32.dll
8 gdiplus.dll
9 IMAGEHLP.dll
10 IMM32.dll
11 kernel32.dll
12 LPK.dll
13 MSCTF.dll
14 MSVCRT.dll
15 NORMALIZ.dll
16 NSI.dll
17 ole32.dll
18 OLEAUT32.dll
19 PSAPI.DLL
20 rpcrt4.dll
21 sechost.dll
22 Setupapi.dll
23 SHELL32.dll
24 SHLWAPI.dll
25 user32.dll
26 WLDAP32.dll
27 Wow64.dll
28 Wow64cpu.dll
29 Wow64win.dll
30 WS2_32.dll
Some more (exe attached)?
Question: What is missing in the recent OS versions' lists above? Has anybody ever used a DLL that is NOT in the list?
Not sure what you're getting at here, KnownDlls is a hint to the loader to short-circuit the usual dll search pattern.
>Has anybody ever used a DLL that is NOT in the list?
Plenty. unrar.dll, nvapi.dll
Quote from: sinsi on September 25, 2016, 11:21:36 PMKnownDlls is a hint to the loader to short-circuit the usual dll search pattern.
Yes, with possibly nasty consequences (Raymond Chen (https://technet.microsoft.com/en-us/magazine/2007.09.windowsconfidential)):
QuoteThere was one program that had a file called Version.dll in the application directory. Under normal rules, this private copy of Version.dll would override the one in the system directory, but in Windows XP, Version.dll is listed as a known DLL. This means that the copy in the application directory is ignored and the version in the system directory wins.
Quote>Has anybody ever used a DLL that is NOT in the list?
Plenty. unrar.dll, nvapi.dll
I meant DLLs that are part of Windows, and would typically appear in \Masm32\include
The question here is if we really need to cover all the crap that Microsoft has added over the years. 95% of all the includes listed will never be used in a "normal" project. If we could use the Known DLLs as a "core library", the occasionally missing PROTO could easily be added to the beginning of the source...
Look at these behemoths of VS - I have lost 12 GB of disk space so far. The whole Masm32 folder is less than 0.3% of that 8)
ComCtl32.dll?
Quote from: MichaelW on September 26, 2016, 05:46:38 AM
ComCtl32.dll?
Good point :t
\Masm32\include\masm32rt.inc
; -------------------------
; Windows API include files
; -------------------------
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\Comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\shell32.inc
include \masm32\include\oleaut32.inc
include \masm32\include\ole32.inc
include \masm32\include\msvcrt.inc
ComCtl32.dll is version dependent?
Quote from: TWell on September 26, 2016, 06:38:11 AM
ComCtl32.dll is version dependent?
InitCommonControls is present in all Windows versions since '95.
Or did you mean something else?
On anything after win98se you really need to InitCommonControlsEx with the structure so that you can use a wider range of common controls.
Quote from: hutch-- on September 26, 2016, 09:34:42 AM
On anything after win98se you really need to InitCommonControlsEx with the structure so that you can use a wider range of common controls.
Sure. Question here is really why M$ doesn't list it in the "known" dlls ::)
Program can use version 5 or version 6 ComCtl32.dll and those are different dll's.
OS can't use same preload dll for it.
Those was IE stuff some time ago.
Yes, that could be an explanation: You can't put it into the "known" list because an application that relies on an earlier version, and has it in the exe's folder, would get C:\Windows\System32\comctl32.dll instead. That implies, however, that the functionality has changed. Sounds messy...
A propos messy: Pairing libraries with header files (http://stackoverflow.com/questions/16307303/pairing-libraries-with-header-files)
QuoteI know what .h, .dll, and .lib files do and how they work together. I say that because the question seems to be asked and answered frequently, and it's not my question. I need to know how to find out which library file goes with which .h file.
The answer is that there is no answer. The compiler knows somehow, but it's not documented anywhere.
> I need to know how to find out which library file goes with which .h file
This is an unsound assumption in that Microsoft header files have never matched their libraries. You can routinely get the name of imports from libraries with a simple search but the header files are all over the place and it would seem to be deliberate obfuscation.
Quote from: hutch-- on September 27, 2016, 12:31:14 AMit would seem to be deliberate obfuscation.
Indeed :icon_mrgreen: