From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8dd1b8da682c35ae X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!newshub.sdsu.edu!newsfeed.media.kyoto-u.ac.jp!Spring.edu.tw!news.nctu.edu.tw!feeder.seed.net.tw!netnews!not-for-mail From: "bubble" Newsgroups: comp.lang.ada Subject: Re: linking problem in DPAPI Date: Fri, 30 Dec 2005 12:07:36 +0800 Organization: HiNetNews Message-ID: References: NNTP-Posting-Host: 211-21-128-195.hinet-ip.hinet.net X-Trace: netnews.hinet.net 1135915660 18149 211.21.128.195 (30 Dec 2005 04:07:40 GMT) X-Complaints-To: usenet@HiNetnews.hinet.net NNTP-Posting-Date: Fri, 30 Dec 2005 04:07:40 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Xref: g2news1.google.com comp.lang.ada:2398 Date: 2005-12-30T12:07:36+08:00 List-Id: a good news. my guess is wrong. ld seem can direct linking to a dll... 2nd url,Jerrrey provid. It said... 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 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.