Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Illegal" use of RegNotifyChangeKeyValue on WINAPI_PARTITION_GAMES platforms #4624

Open
1 of 4 tasks
redbaron opened this issue Oct 23, 2024 · 8 comments
Open
1 of 4 tasks
Milestone

Comments

@redbaron
Copy link
Contributor

Describe the bug

GAMECORE builds, a.k.a. GDK, a.k.a. WINAPI_PARTITION_GAMES don't normally have access to RegNotifyChangeKeyValue function:

  • it is not defined in winreg.h for GAMES API family
  • this symbol is not provided by GDK's xgameplatform.lib

Currently msquic cheats by:

  • extern defining this function circumventing WINAPI_FAMILY_PARTITION guards in winreg.h
  • linking to advapi32.lib even though this lib is in /NODEFAULTLIB list in GDK samples.

I believe GDK titles are not supposed to link to any regular windows libs, except those provided by GDK itself. As a result msquic essentially uses undocumented function in GAMECORE build. If correct, then this can likely affect game consoles certification of any product bundling msquic as a dependency.

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

GDK builds

MsQuic version

main

Steps taken to reproduce bug

Expected behavior

Actual outcome

Additional details

No response

@nibanks nibanks added this to the Future milestone Oct 23, 2024
@nibanks
Copy link
Member

nibanks commented Oct 23, 2024

I believe we already have consumers of this for xbox, and I've never heard anyone have any problems. I'll try to find someone internally to follow up and ask.

@nibanks
Copy link
Member

nibanks commented Oct 23, 2024

That being said, I don't think it'd be a blocker to not support registry changes for xbox. I don't see it as a common scenario for some external entity to change the registry while a game is running, and then expect the game to dynamically respond. Thoughts?

@redbaron
Copy link
Contributor Author

redbaron commented Oct 23, 2024

It is not just registry access, there are other functions pulled in with some dodgy defines:

advapi32:

platform.lib(storage_winuser.c.obj) : error LNK2019: unresolved external symbol __imp_RegNotifyChangeKeyValue referenced in function CxPlatStorageOpen

ntdll:

platform.lib(crypt_bcrypt.c.obj) : error LNK2019: unresolved external symbol RtlNtStatusToDosError referenced in function CxPlatKeyCreate
platform.lib(datapath_winuser.c.obj) : error LNK2001: unresolved external symbol RtlNtStatusToDosError

Following are defined for WINAPI_PARTITION_GAMES in Windows SDK headers, but symbol is found in secur32.lib only:

platform.lib(tls_schannel.c.obj) : error LNK2019: unresolved external symbol __imp_QuerySecurityContextToken referenced in function CxPlatTlsParamGet

None of these libraries/symbols are in GDK. I couldn't find any mentions whether linking these libs is allowed for Xbox builds, but at least advapi32 is "disabled" in GDK samples.

@nibanks
Copy link
Member

nibanks commented Oct 24, 2024

Those other ones should be fine. I believe I had an internal email thread on them years ago and there were no issues with referencing them. But I don't remember the details.

@nibanks
Copy link
Member

nibanks commented Oct 24, 2024

FYI, while looking, I found that this bug is essentially a duplicate of #3564.

@redbaron
Copy link
Contributor Author

If it fails WACK I expect Xbox certification is even more strict or at least comparable in requirements to UWP.

@nibanks
Copy link
Member

nibanks commented Oct 24, 2024

I pinged my internal thread asking for clarification.

@redbaron
Copy link
Contributor Author

I found this official (?) answer in Xbox forums advising against advapi32: https://forums.xboxlive.com/questions/137981/advapi32libのリンクについて.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants