comp.lang.ada
 help / color / mirror / Atom feed
From: "bubble" <bubble@riskm.com.tw>
Subject: Re: linking problem in DPAPI
Date: Fri, 30 Dec 2005 12:07:36 +0800
Date: 2005-12-30T12:07:36+08:00	[thread overview]
Message-ID: <dp2bqc$hn5$1@netnews.hinet.net> (raw)
In-Reply-To: uvex7zirm.fsf@acm.org

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.





  reply	other threads:[~2005-12-30  4:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-28  9:15 linking problem in DPAPI bubble
2005-12-28 12:28 ` Stephen Leake
2005-12-29  4:19   ` bubble
2005-12-29 13:39     ` Jeffrey Creem
2005-12-29 21:38     ` Stephen Leake
2005-12-30  4:07       ` bubble [this message]
2005-12-31 12:56         ` Stephen Leake
2005-12-31 14:32           ` Pascal Obry
2006-01-03  7:10         ` bubble
2006-01-03 11:22           ` Stephen Leake
2005-12-29  6:23   ` bubble
2005-12-29 21:37     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox