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

Mohamad Al-Jaf mohamadaljaf at gmail.com
Mon Nov 29 22:30:49 CST 2021


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/20211129/e457c871/attachment.htm>


More information about the wine-devel mailing list