[PATCH] kernelbase: Implement AppPolicyGetMediaFoundationCodecLoading.

Nikolay Sivov nsivov at codeweavers.com
Thu Nov 11 03:40:17 CST 2021



On 11/11/21 9:05 AM, Mohamad Al-Jaf wrote:
> Hi Nikolay, 
>
> Thanks for the feedback.
>
> I'm not sure what you mean by forward, is it in the spec file? Or are
> you referring to forward declaration? Sorry, I'm new to wine
> development and have no idea, but I'm assuming you mean the spec file
> because I see stdcalls that are being forwarded to kernelbase.
>
> Regardless, I did not see any mention of AppPolicy in kernel32 so I
> added the existing AppPolicy functions as well. This is in
> kernel32.spec, is it correct? I don't want to submit a broken patch
> and waste the dev team's time.
>
> @ stdcall AppPolicyGetMediaFoundationCodecLoading(ptr ptr)
> kernelbase.AppPolicyGetMediaFoundationCodecLoading
> @ stdcall AppPolicyGetProcessTerminationMethod(ptr ptr)
> kernelbase.AppPolicyGetProcessTerminationMethod
> @ stdcall AppPolicyGetShowDeveloperDiagnostic(ptr ptr)
> kernelbase.AppPolicyGetShowDeveloperDiagnostic
> @ stdcall AppPolicyGetThreadInitializationType(ptr ptr)
> kernelbase.AppPolicyGetThreadInitializationType
> @ stdcall AppPolicyGetWindowingModel(ptr ptr)
> kernelbase.AppPolicyGetWindowingModel

Yes, that's how it's done. For your patch just add
AppPolicyGetMediaFoundationCodecLoading for now.

>
> Great, so the code in kernelbase/main is correct? What do you mean by
> 'unpackaged binary'? How did you test it? I'm trying to learn as much
> as I can about wine development.

Yes, it seems to work. I haven't checked if it does null argument
validation, but it does return _All on windows. My unpackaged I mean
regular standalone exe. As I understand all of AppPolicy* are meant for
appx bundles, don't know how they are created or what's in there. But
from some docs it must be binary packaged together with some metadata,
with some signing I guess. With that metadata you can control what's
allowed and what's not, and shared code then can use AppPolicy* to
access this configuration.

>
> I'll submit a revision for the function prototype, sorry about that.
>
> Kind regards,
> Mohamad
>
> On Wed, Nov 10, 2021 at 7:24 AM Nikolay Sivov <nsivov at codeweavers.com
> <mailto:nsivov at codeweavers.com>> wrote:
>
>
>
>     On 11/9/21 4:57 AM, Mohamad Al-Jaf wrote:
>     > Enables native Windows 10 media foundation libraries to run.
>     >
>     > Signed-off-by: Mohamad Al-Jaf <mohamadaljaf at gmail.com
>     <mailto:mohamadaljaf at gmail.com>>
>     > ---
>     >  .../api-ms-win-appmodel-runtime-l1-1-2.spec        |  2 +-
>     >  dlls/kernelbase/kernelbase.spec                    |  2 +-
>     >  dlls/kernelbase/main.c                             | 14
>     ++++++++++++++
>     >  include/appmodel.h                                 |  6 ++++++
>     >  4 files changed, 22 insertions(+), 2 deletions(-)
>
>     Apparently kernel32 also has AppPolicy exports, please add a forward
>     there too.
>
>     > diff --git a/dlls/kernelbase/main.c b/dlls/kernelbase/main.c
>     > index b90ee1cba2c..e6cf892a4dc 100644
>     > --- a/dlls/kernelbase/main.c
>     > +++ b/dlls/kernelbase/main.c
>     > @@ -88,6 +88,20 @@ INT WINAPI MulDiv( INT a, INT b, INT c )
>     >      return ret;
>     >  }
>>     >
>     +/***********************************************************************
>     > + *          AppPolicyGetMediaFoundationCodecLoading (KERNELBASE.@)
>     > + */
>     > +
>     > +LONG WINAPI AppPolicyGetMediaFoundationCodecLoading(HANDLE
>     token, AppPolicyMediaFoundationCodecLoading *policy)
>     > +{
>     > +    FIXME("%p, %p\n", token, policy);
>     > +
>     > +    if(policy)
>     > +        *policy = AppPolicyMediaFoundationCodecLoading_All;
>     > +
>     > +    return ERROR_SUCCESS;
>     > +}
>
>     Thanks, this seems to match what unpackaged binary gets according
>     to my
>     quick test, so that's good.
>
>     > +
>>     /***********************************************************************
>     >   *          AppPolicyGetProcessTerminationMethod (KERNELBASE.@)
>     >   */
>     > diff --git a/include/appmodel.h b/include/appmodel.h
>     > index e4288bbfbb0..cf1b9659d14 100644
>     > --- a/include/appmodel.h
>     > +++ b/include/appmodel.h
>     > @@ -22,6 +22,12 @@
>     >  extern "C" {
>     >  #endif
>>     > +typedef enum AppPolicyMediaFoundationCodecLoading
>     > +{
>     > +    AppPolicyMediaFoundationCodecLoading_All       = 0,
>     > +    AppPolicyMediaFoundationCodecLoading_InboxOnly = 1,
>     > +} AppPolicyMediaFoundationCodecLoading;
>     > +
>     >  typedef enum AppPolicyProcessTerminationMethod
>     >  {
>     >      AppPolicyProcessTerminationMethod_ExitProcess      = 0,
>     Please add function prototype as well.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211111/3dcf9740/attachment.htm>


More information about the wine-devel mailing list