News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Msvcrt.inc Could Use _getwch PROTO

Started by dedndave, May 19, 2014, 10:30:00 PM

Previous topic - Next topic

dedndave

"crt__getwch" would be nice in future versions for __UNICODE__ builds   :t

MichaelW

Beyond no PROTO, there is no _getwch import in the MASM32 msvcrt.lib import library. The attachment contains all of the components I used to create an import library from the MSVCRT.DLL in the SYSTEM32 directory on my Windows XP SP3 system. Unless you have MinGW with pexports.exe installed you will not be able to use makedef.bat, so you'll be stuck with the module-definition file I included. Note that I modified the file by removing a number of imports, that had what looked like C++ mangled names, between $I10_OUTPUT and _Ciacos, because the original MASM32 import library did not include these. The import library I created is 130KB versus 449KB for the original MASM32 import library. I'm not sure why this is, but the one I created appears to work fine. I tried to compare the two import libraries by using POLIB to extract a module-definition file from the import library, and while this works fine for the one I created it will not work for the MASM32 import library.


Well Microsoft, here's another nice mess you've gotten us into.

dedndave

thanks Michael - i made one using Erol's tools   :P
it can also be dynamically linked with GetProcAddress, i suppose

EDIT: i mentioned the size thing to Erol some time ago
he said that his tools use a "compact" format, or something to that effect
and that Hutch's method uses an "extended" format
so, it's not an error

Vortex

The size difference can be explained with the long \ short library formats :

In an import library with the long format, a single member contains the following information:
Archive member header
File header
Section headers
Data that corresponds to each of the section headers
COFF symbol table
Strings
In contrast, a short import library is written as follows:
Archive member header
Import header
Null-terminated import name string
Null-terminated DLL name string

This is sufficient information to accurately reconstruct the entire contents of the member at the time of its use.


Source  : Microsoft PE and COFF Specification

http://msdn.microsoft.com/en-us/library/gg463119.aspx

pecoff_v83.docx , page 97

My def2lib tool is using the short library format.