🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.nativeapi
Article #12133

Re: How to call sscanf() from ntdll.dll correctly?

#12133
From: Robert Marquardt
Date: Sun, 24 Nov 2002 15:42
25 lines
2057 bytes
Oliver wrote:
> Hi everybody,
> 
> I tried already to call the sscanf() function, declaring it as follows:
> 
> function sscanf(inp:PWideChar; fmt:PWideChar; pdw:PDWORD):integer;stdcall;external 'ntdll.dll';
> 
> Interestingly I could get the entry point and call it without errors (I tried with integer values, since they don't need extra memory allocation).
> Please note, I derived the above declaration from that found in C headers in the PSDK (The function itself is neither listed in the 08/2002 PSDK nor in the W2K SP1 DDK). The only difference to the declaration in the header is the calling convention which was initially cdecl instead stdcall (native api).
> 
> Can anyone help?
> 
> Cheers,
> 
> Oliver aka Assarbad
> 
> ---
> ICQ: 281645
> http://assarbad.org

This is definitely a function which NEEDS cdecl calling convention.
I would also guess that the function has PChar parameters not
PWideChar parameters.
You need also the new ellipsis syntax of Delphi 6 for the variable 
parameter count.
Technical Details
Message-ID: <3de0f385@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail
References: <3de09fa4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f94dd,71c30f887e8e0a13
X-Google-Attributes: gidf94dd,public
X-Google-ArrivalTime: 2002-11-24 08:15:29 PST
Date: Sun, 24 Nov 2002 16:42:55 +0100
From: Robert Marquardt <robert_marquardt@gmx.de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: de-DE, en
MIME-Version: 1.0
Newsgroups: borland.public.delphi.nativeapi
Subject: Re: How to call sscanf() from ntdll.dll correctly?
References: <3de09fa4$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.6.210.65
Message-ID: <3de0f385@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038152581 213.6.210.65 (24 Nov 2002 07:43:01 -0800)
Lines: 26
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail