NO

Author Topic: [solved] PoLib fails at HeapSummary  (Read 2966 times)

sapero

  • Guest
[solved] PoLib fails at HeapSummary
« on: December 01, 2009, 06:32:39 PM »
I have tried to create 'full' import library for kernel32.dll with Polib 6.0.1, but it shows me this message:
Code: [Select]
POLIB: fatal error: Invalid syntax near 'HeapSummary' in module-definition file 'kernel32.def'.The command line was
Code: [Select]
polib /def:kernel32.def /out:kernel32.libAnd the dll comes from XP sp3. I have attached my .def file, so in any case you can compare results. Note, this .def file is designed for my current project, where the import library will be undecorated from C mangling, just raw symbol names.

Now a second report - PoLink does not search for .o and .obj files in directories specified in /libpatch. I have some customized startup object files, different for each target (gui/console) and character set.
Code: [Select]
polink.exe /LIBPATH: ... app.obj winStartupW.obj

message: POLINK: fatal error: File not found: 'winStartupW.obj'.
The file exists, its location is specified in the first /LIBPATH. But when I put the .obj file into separate static library, PoLib is not failing, does a search in all given locations.
« Last Edit: December 18, 2009, 12:50:25 AM by sapero »

Offline Vortex

  • Member
  • *
  • Posts: 865
    • http://www.vortex.masmcode.com
Re: PoLib fails at HeapSummary
« Reply #1 on: December 01, 2009, 08:32:59 PM »
You have to enclose the symbols between double quotes :

Code: [Select]
LIBRARY kernel32
EXPORTS
"ActivateActCtx"
"AddAtomA"
"AddAtomW"
"AddConsoleAliasA"
"AddConsoleAliasW"
"AddLocalAlternateComputerNameA"
"AddLocalAlternateComputerNameW"
"AddRefActCtx"
.
.
.

You can check the attachment to create the import library.
Code it... That's all...

sapero

  • Guest
Re: PoLib fails at HeapSummary
« Reply #2 on: December 01, 2009, 09:24:29 PM »
Thank you Vortex for this tip, I have no idea why, but it helped.

My next report is for /debug with CodeView type:
Code: [Select]
1. parser
2. nasmw.exe -f win32 "bingo machine.asm"
3. polink.exe" /MACHINE:X86 /DEBUG /DEBUGTYPE:CV /NOLOGO /SUBSYSTEM:WINDOWS /BASE:0x400000 /ENTRY:eb_main /OUT:"bingo machine.exe" "bingo machine.obj" ..libs..

Writing debug information
POLINK: fatal error: Internal error: convert_types_from_V4_to_V2.
Error(s) compiling D:\EBDev\forum\bingo machine.eba - exit code 0x1 (Unzulässige Funktion.)
After adding line numbers to .obj file (nasm -g option), polink 6010 is crashing at 410f17 - access violation.


The parser I have used here does not use any symbol mangling, so I needed to undecorate all required .lib files (symbol names and IMPORT_OBJECT_HEADER.NameType member) with the exception for *_IMPORT_DESCRIPTOR* symbols. I have first tried with Microsoft linker, but it does not even accept naked symbols (like __imp_Sleep or just Sleep)
« Last Edit: December 01, 2009, 09:34:20 PM by sapero »