[PATCH 2/4] kernel32: Forward SetCachedSigningLevel to kernelbase.

Mohamad Al-Jaf mohamadaljaf at gmail.com
Tue Nov 30 18:24:09 CST 2021


Hi Paul,

Thank you for the brief but informative tutorial. Based on my understanding
of what Chip said, the function should be imported because the address
differs between kernel32 and kernelbase. I have submitted a revised patch.

On Tue, Nov 30, 2021 at 3:20 AM Paul Gofman <pgofman at codeweavers.com> wrote:

> You can examine GetProcAddress result. E. g. call GetProcAddress for the
> function in question from kernel32 and kernelbase and see if the result is
> the same or not.
>
> On 30 Nov 2021, at 07:31, Mohamad Al-Jaf <mohamadaljaf at gmail.com> wrote:
>
> 
> Hi Chip,
>
> Thanks for the detailed explanation, I think I understand the difference
> between the two now. But how do you determine if a function should be
> forwarded or imported? Is there a way to find out for certain? So
> for SetCachedSigningLevel, how can I know if it's better to forward it or
> import it?
>
> On Mon, Nov 29, 2021 at 9:57 PM Chip Davis <cdavis at codeweavers.com> wrote:
>
>> Normally, a forwarded function gets a special export entry which records
>> the name of the DLL that has the real implementation and the name or
>> ordinal of the target function. That way, when the loader resolves imports,
>> it can resolve them directly to the real implementation instead of to a
>> thunk in the imported DLL, like you'd have otherwise. But on Windows, a
>> number of functions that would otherwise be forwarded to kernelbase from
>> kernel32 instead use these thunks that call the target in
>> kernelbase--presumably because existing programs abuse hotpatching to hook
>> functions that were in kernel32. For these cases, winebuild supports a
>> special option on a forwarded export which causes it to generate this thunk.
>>
>> November 29, 2021 7:08 PM, "Mohamad Al-Jaf" <mohamadaljaf at gmail.com
>> <mohamadaljaf at gmail.com?to=%22Mohamad%20Al-Jaf%22%20%3Cmohamadaljaf at gmail.com%3E>>
>> wrote:
>>
>> E-mail resend: Forgot to reply-all.
>> Interesting, why do you think this? How does one know how to find out if
>> forwarding or importing is more appropriate? Also, what exactly is the
>> difference between the two?
>> On Mon, Nov 29, 2021 at 3:11 AM Nikolay Sivov <nsivov at codeweavers.com>
>> wrote:
>>
>> It's possible it should be using -import for this function.
>>
>>
>>
>> Chip
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211130/8fdf5597/attachment.htm>


More information about the wine-devel mailing list