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!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!logbridge.uoregon.edu!canoe.uoregon.edu!newsfeed.news.ucla.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: Tue, 3 Jan 2006 15:10:40 +0800 Organization: HiNetNews Message-ID: References: NNTP-Posting-Host: 211-21-128-195.hinet-ip.hinet.net X-Trace: netnews.hinet.net 1136272252 10546 211.21.128.195 (3 Jan 2006 07:10:52 GMT) X-Complaints-To: usenet@HiNetnews.hinet.net NNTP-Posting-Date: Tue, 3 Jan 2006 07:10:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Xref: g2news1.google.com comp.lang.ada:2420 Date: 2006-01-03T15:10:40+08:00 List-Id: > 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 can invoke the CryptProtectData,CryptUnprotectData and get a output. then it will crash after executing some statement. the result is in expect and bad. and I have test pragma Import (Stdcall, CryptProtectData, "CryptProtectData","CryptProtectData"); and still fail in linking. crypt functions loading by loadLibrary and GetProcAddress have some strange behaviors ,I am still in testing. a document from MS has explain calling convention more. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_core_Calling_Conventions_Topics.asp I don't the understand the reason why MS need 2 different " STDCALL " calling convention. (maybe MS's programers confused or they using special naked function call in security issuse) If MS really want 2 stdcall, they should be name stdcall and stdcall2 or something. the problem should forward to MS news group. It's not ada compiler or linker problem... :( if therer is no way to remove @xxx in function suffix, may be I can add "esp register adjust" patch code after calling crypt family functions. :( > 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. > >