Re: linking problem in DPAPI



a good news.
my guess is wrong.
ld seem can direct linking to a dll...
2nd url,Jerrrey provid.
It said...

<copy from
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/win32.html>

direct linking to a dll
The cygwin/mingw ports of ld support the direct linking, including data
symbols, to a dll without the usage of any import libraries. This is much
faster and uses much less memory than does the traditional import library
method, expecially when linking large libraries or applications. When ld
creates an import lib, each function or variable exported from the dll is
stored in its own bfd, even though a single bfd could contain many exports.
The overhead involved in storing, loading, and processing so many bfd's is
quite large, and explains the tremendous time, memory, and storage needed to
link against particularly large or complex libraries when using import libs.

Linking directly to a dll uses no extra command-line switches other than -L
and -l, because ld already searches for a number of names to match each
library. All that is needed from the developer's perspective is an
understanding of this search, in order to force ld to select the dll instead
of an import library.

For instance, when ld is called with the argument -lxxx it will attempt to
find, in the first directory of its search path,

libxxx.dll.a
xxx.dll.a
libxxx.a
cygxxx.dll (*)
libxxx.dll
xxx.dll



</copy from
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/win32.html>


after some error.
I have a solution.

I copy crypt32.dll from c:\windows\system32 to project home.
and change pragma (not use Stdcall Calling Convention ).
pragma Import (C, CryptProtectData, "CryptProtectData");
then it work..

I have new question..
in windows SDK document ,the WINAPI declare should mapping to Stdcall.
It's mean who's responsibility to clean stack frame.
http://www.unixwiz.net/techtips/win32-callconv.html
if I use "C" calling conventions in a "WINAPI" funciton , colud system clean
stack twice and cause some problems?



> Well, I meant the dll tools that come with GNAT. Read the user guide.
> It's been a while since I had to do this.


.



Relevant Pages

  • Re: linking problem in DPAPI
    ... >>The cygwin/mingw ports of ld support the direct linking, ... to a dll without the usage of any import libraries. ...
    (comp.lang.ada)
  • Re: How to get imagebase after a DLL gets loaded
    ... The main difference between DLL and static library in this context is ... so that it is not meant to be integrated with the client code ... SPEAKING ABOUT STATIC LIBRARIES HERE, AND I *EXPLICITLY* SAID IT THIS ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How to get a .lib from .dll
    ... Using the Borland tools, you should first run "IMPDEF" on the DLL file ... information in it to create ".LIB" import libraries with;)... ... from Windows version to Windows version...so, ...
    (comp.lang.asm.x86)
  • Re: How to get a .lib from .dll
    ... Using the Borland tools, you should first run "IMPDEF" on the DLL file ... information in it to create ".LIB" import libraries with;)... ... from Windows version to Windows version...so, ...
    (alt.lang.asm)
  • Re: How to get imagebase after a DLL gets loaded
    ... During the process of building the DLL, ... Implementing a library that requires users of the library to instantiate ... predict what variable name you will use at initialization time. ... Some third-party libraries DO require that you instantiate a pre-defined ...
    (microsoft.public.win32.programmer.kernel)