[PATCH] psapi: Replace .spec forwards by forward implementations.

Alexandre Julliard julliard at winehq.org
Thu Sep 19 05:47:05 CDT 2019


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Alexandre Julliard <julliard at winehq.org> wrote:
>
>> > The application I'm working on hooks psapi.dll APIs and can't cope
>> > with PE forwards. Inspection of psapi.dll in Windows shows that it
>> > doesn't contain PE forwards at all.
>> >
>> > Since the API names are prepened with K32 it's impossible to use
>> > -import in the .spec file for automatic forwards generation.
>> 
>> It should work fine with -import. Are you getting an error?
>
> I get enrties calling to itself because of psapi.h redefinitions,
> if you know the recipe to avoid that then please add -import instead.

I don't see why psapi.h would be an issue for the spec file. Something
like this should work:

diff --git a/dlls/psapi/psapi.spec b/dlls/psapi/psapi.spec
index 6a7bc14815af..0e2e3eb87b32 100644
--- a/dlls/psapi/psapi.spec
+++ b/dlls/psapi/psapi.spec
@@ -1,27 +1,27 @@
-@ stdcall EmptyWorkingSet(long) kernel32.K32EmptyWorkingSet
-@ stdcall EnumDeviceDrivers(ptr long ptr) kernel32.K32EnumDeviceDrivers
-@ stdcall EnumPageFilesA(ptr ptr) kernel32.K32EnumPageFilesA
-@ stdcall EnumPageFilesW(ptr ptr) kernel32.K32EnumPageFilesW
-@ stdcall EnumProcessModules(long ptr long ptr) kernel32.K32EnumProcessModules
-@ stdcall EnumProcessModulesEx(long ptr long ptr long) kernel32.K32EnumProcessModulesEx
-@ stdcall EnumProcesses(ptr long ptr) kernel32.K32EnumProcesses
-@ stdcall GetDeviceDriverBaseNameA(ptr ptr long) kernel32.K32GetDeviceDriverBaseNameA
-@ stdcall GetDeviceDriverBaseNameW(ptr ptr long) kernel32.K32GetDeviceDriverBaseNameW
-@ stdcall GetDeviceDriverFileNameA(ptr ptr long) kernel32.K32GetDeviceDriverFileNameA
-@ stdcall GetDeviceDriverFileNameW(ptr ptr long) kernel32.K32GetDeviceDriverFileNameW
-@ stdcall GetMappedFileNameA(long ptr ptr long) kernel32.K32GetMappedFileNameA
-@ stdcall GetMappedFileNameW(long ptr ptr long) kernel32.K32GetMappedFileNameW
-@ stdcall GetModuleBaseNameA(long long ptr long) kernel32.K32GetModuleBaseNameA
-@ stdcall GetModuleBaseNameW(long long ptr long) kernel32.K32GetModuleBaseNameW
-@ stdcall GetModuleFileNameExA(long long ptr long) kernel32.K32GetModuleFileNameExA
-@ stdcall GetModuleFileNameExW(long long ptr long) kernel32.K32GetModuleFileNameExW
-@ stdcall GetModuleInformation(long long ptr long) kernel32.K32GetModuleInformation
-@ stdcall GetPerformanceInfo(ptr long) kernel32.K32GetPerformanceInfo
-@ stdcall GetProcessImageFileNameA(long ptr long) kernel32.K32GetProcessImageFileNameA
-@ stdcall GetProcessImageFileNameW(long ptr long) kernel32.K32GetProcessImageFileNameW
-@ stdcall GetProcessMemoryInfo(long ptr long) kernel32.K32GetProcessMemoryInfo
-@ stdcall GetWsChanges(long ptr long) kernel32.K32GetWsChanges
-@ stdcall GetWsChangesEx(long ptr ptr) kernel32.K32GetWsChangesEx
-@ stdcall InitializeProcessForWsWatch(long) kernel32.K32InitializeProcessForWsWatch
-@ stdcall QueryWorkingSet(long ptr long) kernel32.K32QueryWorkingSet
-@ stdcall QueryWorkingSetEx(long ptr long) kernel32.K32QueryWorkingSetEx
+@ stdcall -import EmptyWorkingSet(long) K32EmptyWorkingSet
+@ stdcall -import EnumDeviceDrivers(ptr long ptr) K32EnumDeviceDrivers
+@ stdcall -import EnumPageFilesA(ptr ptr) K32EnumPageFilesA
+@ stdcall -import EnumPageFilesW(ptr ptr) K32EnumPageFilesW
+@ stdcall -import EnumProcessModules(long ptr long ptr) K32EnumProcessModules
+@ stdcall -import EnumProcessModulesEx(long ptr long ptr long) K32EnumProcessModulesEx
+@ stdcall -import EnumProcesses(ptr long ptr) K32EnumProcesses
+@ stdcall -import GetDeviceDriverBaseNameA(ptr ptr long) K32GetDeviceDriverBaseNameA
+@ stdcall -import GetDeviceDriverBaseNameW(ptr ptr long) K32GetDeviceDriverBaseNameW
+@ stdcall -import GetDeviceDriverFileNameA(ptr ptr long) K32GetDeviceDriverFileNameA
+@ stdcall -import GetDeviceDriverFileNameW(ptr ptr long) K32GetDeviceDriverFileNameW
+@ stdcall -import GetMappedFileNameA(long ptr ptr long) K32GetMappedFileNameA
+@ stdcall -import GetMappedFileNameW(long ptr ptr long) K32GetMappedFileNameW
+@ stdcall -import GetModuleBaseNameA(long long ptr long) K32GetModuleBaseNameA
+@ stdcall -import GetModuleBaseNameW(long long ptr long) K32GetModuleBaseNameW
+@ stdcall -import GetModuleFileNameExA(long long ptr long) K32GetModuleFileNameExA
+@ stdcall -import GetModuleFileNameExW(long long ptr long) K32GetModuleFileNameExW
+@ stdcall -import GetModuleInformation(long long ptr long) K32GetModuleInformation
+@ stdcall -import GetPerformanceInfo(ptr long) K32GetPerformanceInfo
+@ stdcall -import GetProcessImageFileNameA(long ptr long) K32GetProcessImageFileNameA
+@ stdcall -import GetProcessImageFileNameW(long ptr long) K32GetProcessImageFileNameW
+@ stdcall -import GetProcessMemoryInfo(long ptr long) K32GetProcessMemoryInfo
+@ stdcall -import GetWsChanges(long ptr long) K32GetWsChanges
+@ stdcall -import GetWsChangesEx(long ptr ptr) K32GetWsChangesEx
+@ stdcall -import InitializeProcessForWsWatch(long) K32InitializeProcessForWsWatch
+@ stdcall -import QueryWorkingSet(long ptr long) K32QueryWorkingSet
+@ stdcall -import QueryWorkingSetEx(long ptr long) K32QueryWorkingSetEx

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list