WindowsAppSDK
WindowsAppSDK copied to clipboard
DeriveAppContainerSidFromAppContainerName doesn't work if container name same as caller package family name
Describe the bug
When DeriveAppContainerSidFromAppContainerName is used get sid for a package family name, if package family name is same as caller package family name the function call succeeds (no error code returned) but sid isn't retrived.
Steps to reproduce the bug
Steps to reproduce the behavior:
- Create sample cppwinrt console application.
- Create new packaging project and add the above console application project as reference.
- Add following snippet to the main function with required headers and namespaces, and deploy the package.
PSID pSid = NULL;
check_hresult(DeriveAppContainerSidFromAppContainerName(Package::Current().Id().FamilyName().c_str(), &pSid ));
if (pSid == NULL)
{
printf("Failed to retrieve sid");
}
- When running the console app see output on console.
Expected behavior
Should retrieve sid even if package family name are same.
Version Info
Not applicable.
NuGet package version: Not applicable
| Windows 10 version | Saw the problem? |
|---|---|
| Insider Build (xxxxx) | |
| May 2020 Update (19041) | Yes |
| November 2019 Update (18363) | |
| May 2019 Update (18362) | |
| October 2018 Update (17763) |
Additional context
This is necessary for sharing named objects between uwp and win32 process packaged together.
Not sure if this issue is scope of reunion but it sill is an issue with windows api.
Hi @soumyamahunt, thanks for reporting this.
I think there might be a different way of using this API, but looking at the docs you referenced, they don't explain much at all, seems like we definitely have to improve our docs.
The main dev that knows this area the best is currently out-of-office till 5/17. Another dev mentioned that this API you're using will drive the SID of a child AppContainer if it's invoked from within an AppContainer - you can NOT use this API to pass in a package family name and get the SID of the (non-child) AppContainer within which you're currently running.
We'll hopefully have a better answer the week of 5/17 for you, I apologize for the delay. I'll work with the team to get the docs updated too!
Any updates on this?!