[3/5] ntdll: Implement RtlInstallFunctionTableCallback on x86_64.

Sebastian Lackner sebastian at fds-team.de
Sun Apr 6 21:56:54 CDT 2014


Hi,

Am 07.04.2014 03:08, schrieb Dmitry Timoshkov:
> Sebastian Lackner <sebastian at fds-team.de> wrote:
> 
>> +BOOLEAN CDECL RtlInstallFunctionTableCallback( DWORD64 table, DWORD64 base, DWORD length,
>> +                                               PGET_RUNTIME_FUNCTION_CALLBACK callback, PVOID context, PCWSTR dll )
>> +{

> spec entry doesn't match the implementation. Probably it should be
> (int64 int64 long ptr ptr wstr)

RtlInstallFunctionTableCallback on ARM takes regular DWORDs as
arguments. My idea was to use the same trick as for RtlAddFunctionTable,
to make it possible to use the same spec file entry for both x86_64 and
for ARM (if someone else implements the function later). If int64 !=
long on 64-bit systems then this entry would also be invalid:

declaration:
  BOOLEAN CDECL RtlAddFunctionTable( RUNTIME_FUNCTION *table, DWORD
count, DWORD64 addr )

specfile:
  @ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long)

But I have to agree for the ptr -> wstr replacement, which is probably a
bit better, although I haven't seen any applications yet that use it
(they all just pass NULL pointers). I'll wait for some more feedback and
resubmit the patch if this is the only change.

> 
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms680595%28v=vs.85%29.aspx
> claims that RtlInstallFunctionTableCallback is WINAPI, not CDECL, which
> one is correct?
> 

Based on winnt.h on my Windows 8 machine with it is __cdecl, so i guess
MSDN is wrong - but it wouldn't matter anyway because there is only one
calling convention on x86_64, see:
http://source.winehq.org/source/include/windef.h#L67

Regards,
Sebastian



More information about the wine-devel mailing list