Windows 7 broken - no PowerDeterminePlatformRoleEx

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby Astaroth » Mon Sep 16, 2019 7:58 pm

Hi, I'm using the automated "spotify" builds of CEF for Win32.
I finally made the leap from VS2017 to VS2019 to get around this known bug where corrupt executables were being generated: viewtopic.php?f=6&t=16910
At the same time, I upgraded from CEF 74.1.19 to 76.1.13.

I'm experiencing a new bug:

>cef_sandbox.lib(win_util.obj) : error LNK2019: unresolved external symbol _PowerDeterminePlatformRoleEx@4 referenced in function "enum _POWER_PLATFORM_ROLE __cdecl base::win::`anonymous namespace'::GetPlatformRole(void)" (?GetPlatformRole@?A0xC6F77B9@win@base@@YA?AW4_POWER_PLATFORM_ROLE@@XZ)

The function in question is a Windows 8 function and I need my app to work on Windows 7.
Is this a known bug in CEF? Should I just implement a substitute to get things working on Windows 7 for now?

Also, if you know, please let me know what on Windows provides these MD5-related functions. (Isn't MD5 kind of outdated?)

>cef_sandbox.lib(md5_boringssl.obj) : error LNK2019: unresolved external symbol _MD5_Init referenced in function "void __cdecl base::MD5Init(struct md5_state_st *)" (?MD5Init@base@@YAXPAUmd5_state_st@@@Z)
>cef_sandbox.lib(md5_boringssl.obj) : error LNK2019: unresolved external symbol _MD5_Update referenced in function "void __cdecl base::MD5Update(struct md5_state_st *,class base::BasicStringPiece<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > const &)" (?MD5Update@base@@YAXPAUmd5_state_st@@ABV?$BasicStringPiece@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z)
>cef_sandbox.lib(md5_boringssl.obj) : error LNK2019: unresolved external symbol _MD5_Final referenced in function "void __cdecl base::MD5Final(struct base::MD5Digest *,struct md5_state_st *)" (?MD5Final@base@@YAXPAUMD5Digest@1@PAUmd5_state_st@@@Z)
>cef_sandbox.lib(md5_boringssl.obj) : error LNK2019: unresolved external symbol _MD5 referenced in function "void __cdecl base::MD5Sum(void const *,unsigned int,struct base::MD5Digest *)" (?MD5Sum@base@@YAXPBXIPAUMD5Digest@1@@Z)

Thank you.
Astaroth
Techie
 
Posts: 35
Joined: Tue Apr 23, 2019 6:23 pm

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby ndesktop » Tue Sep 17, 2019 1:48 am

This comes from Chromium.
It is also wrong, since for Windows 7 caller needs to pass POWER_PLATFORM_ROLE_V1, not V2 as in win_util.cc.

The MD5 functions probably come from boringssl.lib or boringssl_asm.lib.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby Astaroth » Tue Sep 17, 2019 9:13 am

ndesktop wrote:for Windows 7 caller needs to pass POWER_PLATFORM_ROLE_V1, not V2 as in win_util.cc.


It's worse than that, the function isn't supported on Windows 7 at all and you can't link unless you hack in a fake implementation.

"Minimum supported client Windows 8 [desktop apps only]"

https://docs.microsoft.com/en-us/window ... formroleex

The function for Windows 7 has a slightly different name.
Astaroth
Techie
 
Posts: 35
Joined: Tue Apr 23, 2019 6:23 pm

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby magreenblatt » Tue Sep 17, 2019 9:30 am

You mention a link error, which suggests that you’re using an old Windows SDK version. If you link using a recent Windows SDK version does the resulting exe run on Windows 7? You can also test with the “Sample App” from the Spotify builder.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby Czarek » Tue Sep 17, 2019 9:40 am

Chromium code executes the PowerDeterminePlatformRoleEx function only on Windows 8, so this looks like a linking problem only. MD5 symbols linking issue reported here: https://bitbucket.org/chromiumembedded/ ... en-linking
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby Astaroth » Tue Sep 17, 2019 9:47 am

magreenblatt wrote:you’re using an old Windows SDK version


I'm using the latest version (10.0.18362.0) and it doesn't link (because PowerDeterminePlatformRoleEx isn't available when Windows 7 is targeted, also because of the MD5 linking problem).

FWIW the latest version is here: https://developer.microsoft.com/en-us/w ... ows-10-sdk

I think the problems are coming from cef_sandbox.lib.

magreenblatt wrote:You can also test with the “Sample App” from the Spotify builder.


That app runs on Windows 7.
Astaroth
Techie
 
Posts: 35
Joined: Tue Apr 23, 2019 6:23 pm

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby magreenblatt » Tue Sep 17, 2019 10:29 am

How are you targeting Windows 7? Chromium requires SP1 or newer to run.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby ndesktop » Tue Sep 17, 2019 11:21 am

Astaroth wrote:It's worse than that, the function isn't supported on Windows 7 at all and you can't link unless you hack in a fake implementation.
The function for Windows 7 has a slightly different name.

True, I was only emphasizing they also passed an incorrect version to support Win7.
Most likely the right way would be IsWindows8OrGreater+PowerDeterminePlatformRoleEx (or LoadLibrary/GetProcAddress) else PowerDeterminePlatformRole with _V1.
I don't see an issue filed on bugs.chromium.org, so either they dropped Windows 7 being EOL or more likely is a bug.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby ndesktop » Tue Sep 17, 2019 11:33 am

Filed the issue.
It is a link only error, code is never executed (GetPlatformRole is called from the same file only, base/win/win_util.cc and guarded with GetVersion() < Version::WIN8).

I don't know if they will update to what I said. Most likely you need to patch Chromium locally to get rid of the link error.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Windows 7 broken - no PowerDeterminePlatformRoleEx

Postby Astaroth » Tue Sep 17, 2019 11:36 am

magreenblatt wrote:How are you targeting Windows 7? Chromium requires SP1 or newer to run.


I'm using

#define _WIN32_WINNT 0x0601

which chooses Windows 7 (see https://docs.microsoft.com/en-us/cpp/po ... ew=vs-2019).

The function PowerDeterminePlatformRoleEx requires Windows 8 per the docs and it doesn't exist on Windows 7 or Windows 7 SP1.
Astaroth
Techie
 
Posts: 35
Joined: Tue Apr 23, 2019 6:23 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Bing [Bot] and 49 guests