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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1044a3857acae1e1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-05 16:26:04 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!enst!enst.fr!not-for-mail From: "Alexandre E. Kopilovitch" Newsgroups: comp.lang.ada Subject: Re: GNAT and a very foreign DLL Date: Sun, 6 Jan 2002 03:31:15 +0300 (MSK) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: avanie.enst.fr 1010276762 62022 137.194.161.2 (6 Jan 2002 00:26:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 6 Jan 2002 00:26:02 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Mailer: Mail/@ [v2.44 MSDOS] Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18583 Date: 2002-01-06T03:31:15+03:00 Ted Dennison wrote: >> The problem appears to be with the combination of the call convention and >>the names of the DLL's entry points: the call convention is surely Stdcall, >>but the entry point names do not contain usual suffixes "@nn" - they look as >>common C identifiers. >.. >> As the Stdcall convention is unavoidable anyway, I was forced to create some >>"post-linker", which post-processes my executable, replacing "@" in the DLL's >>entry point names by zero bytes. After that post-processing all works fine, > >If the problem is just the name, why don't you just use the "Link_Name" >parameter to "pragm Import" to specify the name they actually used? Because with that Link_Name the suffix "@nn" is still appended. As the GNAT User's Guide honestly says (at the end of Microsoft Windows Topics/Windows Calling Conventions/Stdcall Calling Convention section): "... there is no trailing underscore but the appropriate @nn is always added at the end of the Link_Name by the compiler. " >However, you may want to check the C header files for that routine to make sure >the calling convention is what you think it is. I have seen DLL's with routines >with different conventions in them before. I checked that, and there are the Stdcall directives indeed. And moreover, all that stuff works properly with the Stdcall calls. Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia