On Fri Aug 5 18:13:12 2022 +0000, Nikolay Sivov wrote:
I still don't see why it's necessary to change that much. CABINETDLLVERSIONINFO type is identical to DLLVERSIONINFO, renaming DllGetVersion() function to something else is not necessary. Same for changing function prototype. Adding version information block to the dll is fine, if it's present on Windows. We usually do that when we find application that checks the version.
The test I added in the first commit doesn't return the version when called with a CABINETDLLVERSION structure, which is expected in Windows. When I recall correctly, they are not exactly the same, I might be wrong though (I also don't have to much experience with how structures behave in WINAPI/C).
It was proposed above to rename DllGetVersion(): "That is because DllGetVersion() is also the name of an optional function supported by COM server DLLs" (can be found in the unresolved thread). When it's not renamed, compilation fails. Do you have any other solution to this?
I add the version information block as I didn't find another way to access the version information within the same DLL. The only other solution I came up with was to hard-code the dll version somewhere else as well, but this creates redundancy and one would have to change the version in multiple spots when wanted. This approach eliminates this issue.