-
Notifications
You must be signed in to change notification settings - Fork 369
Experimental Microsoft.Windows.Storage.Pickers.* API #5240
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
Merged
Merged
Changes from 55 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
a243907
Microsoft.Windows.Storage.Pickers.FileOpenPicker.PickSingleFileAsync …
DinahK-2SO 7a282f2
add one telemetry
DinahK-2SO e6997b5
Merge codes from branch 'user/xianghong/pickers-prototype' at \protot…
DinahK-2SO e34f272
add the pickers
DinahK-2SO 9356b17
Fix build errors
DinahK-2SO 3af3177
Cleanup ; add into projections
DinahK-2SO 3ae4f6d
fix build errors; clean up
DinahK-2SO 16581a0
Merge remote-tracking branch 'origin/main' into user/xianghong/mergin…
b1253ca
Merge remote-tracking branch 'origin/main' into user/xianghong/mergin…
1b84f8c
graceful solution
DinahK-2SO fd22a12
Merge branch 'main' of github.com:microsoft/WindowsAppSDK into user/x…
DinahK-2SO 764103b
Merge pull request #4978 from microsoft/user/xiaomgao/storage-pickers…
DinahK-2SO 9ad9cc8
add ad hoc working in progress fix
7cb3d59
Merge branch 'user/xianghong/storage-pickers-develop' of https://gith…
965abec
adding basic tests
bc22a5c
allow optional filters; add test configs
DinahK-2SO 30bc81a
use relative path for postbuild script
DinahK-2SO 963de7f
update script - add cleanup
DinahK-2SO 228d2a9
Merge branch 'user/xianghong/storage-pickers-develop' into user/xiang…
Hong-Xiang bce05bf
Merge remote-tracking branch 'origin/main' into user/xianghong/adding…
Hong-Xiang b42b781
work in progress
Hong-Xiang 8680c9e
Squashed commit of the following:
DinahK-2SO 77cc485
ad hoc working, examing in progress
Hong-Xiang 97e227c
Merge branch 'user/xianghong/adding-test-prototype' of github.com:mic…
DinahK-2SO c4d2768
add unit test project for storage pickers APIs
Hong-Xiang 999b3b4
Merge branch 'user/xianghong/storage-pickers-develop' into user/xiang…
Hong-Xiang a1e2c91
fix project name
Hong-Xiang bed7090
Merge pull request #5040 from microsoft/user/xianghong/adding-test-pr…
Hong-Xiang f8e8e54
remove [default_interface] in idl files
DinahK-2SO d10e7fb
Merge branch 'user/xianghong/storage-pickers-develop' of github.com:m…
DinahK-2SO 522a85a
filesavepicker-autoapply-filetypechoices when extension's missing
DinahK-2SO b5c0a11
Merge pull request #5154 from microsoft/user/DinahK-2SO/filesavepicke…
DinahK-2SO 7ae526d
set default folder - consistent to UWP picker behaviour
DinahK-2SO 9ecade3
fall back to Documents, if the specified location doesn't exists.
DinahK-2SO 663e3fa
use winrt::hresult
DinahK-2SO 59845dc
Merge pull request #5195 from microsoft/user/DinahK-2SO/storagepicker…
DinahK-2SO da6a44e
use the telemetry guid generated by TlgGuid tool
DinahK-2SO 5f83dd3
update idl file
Hong-Xiang 841f879
work in progress
Hong-Xiang e8d6dd0
adding resume to ui context
Hong-Xiang 7a63bcc
Merge pull request #5235 from microsoft/user/xianghong/refactor-to-us…
Hong-Xiang 826ff76
fix get path
Hong-Xiang 8d707b6
Merge pull request #5236 from microsoft/user/xianghong/refactor-to-us…
Hong-Xiang 509fc8b
code clean, add velocity related code
Hong-Xiang dda1b7c
Merge pull request #5239 from microsoft/user/xianghong/refactor-to-us…
Hong-Xiang 84f112a
Merge branch 'main' into user/xianghong/merge-main-code
Hong-Xiang 18573ed
code clean for merge
Hong-Xiang 5276803
update taef version
Hong-Xiang 147cb88
fixing com_array initialization
Hong-Xiang 02f9024
remove unexpected change
Hong-Xiang 16fe020
update copyright headers
Hong-Xiang 0d01aa8
code clean and minor test text fixes
Hong-Xiang 7765fa6
comment out tests require manual interactive, adding more basic prope…
Hong-Xiang a8db2c8
add telemetry
DinahK-2SO c19343f
Add telemetry: Merge pull request #5268 from microsoft/user/DinahK-2S…
DinahK-2SO 1845a65
fixes accroding to PR comments
Hong-Xiang 360e3fe
Move storagepickerstelemetryhelper to the pickers folder
DinahK-2SO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Copyright (c) Microsoft Corporation and Contributors. | ||
// Licensed under the MIT License. | ||
#pragma once | ||
|
||
#include "TelemetryHelper.h" | ||
#include <shlobj.h> // For IsUserAnAdmin | ||
#include <processthreadsapi.h> // For process APIs | ||
#include <wil/resource.h> | ||
|
||
class StoragePickersTelemetryHelper : public TelemetryHelper | ||
{ | ||
public: | ||
StoragePickersTelemetryHelper() : TelemetryHelper() | ||
{ | ||
m_asAdmin = IsAsAdmin(); | ||
m_inContainer = IsInContainer(); | ||
} | ||
|
||
inline bool IsRunningAsAdmin() const | ||
{ | ||
return m_asAdmin; | ||
} | ||
|
||
inline bool IsRunningInContainer() const | ||
{ | ||
return m_inContainer; | ||
} | ||
|
||
private: | ||
bool m_asAdmin; | ||
bool m_inContainer; | ||
|
||
BOOL IsAsAdmin() | ||
{ | ||
BOOL fIsRunAsAdmin = FALSE; | ||
DWORD dwError = ERROR_SUCCESS; | ||
PSID pAdministratorsGroup = NULL; | ||
|
||
// Allocate and initialize a SID of the administrators group. | ||
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; | ||
if (!AllocateAndInitializeSid(&NtAuthority, 2, | ||
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, | ||
0, 0, 0, 0, 0, 0, | ||
&pAdministratorsGroup)) | ||
{ | ||
dwError = GetLastError(); | ||
} | ||
else | ||
{ | ||
// Determine whether the SID of administrators group is enabled in | ||
// the primary access token of the process. | ||
if (!CheckTokenMembership(NULL, pAdministratorsGroup, &fIsRunAsAdmin)) | ||
{ | ||
dwError = GetLastError(); | ||
} | ||
|
||
FreeSid(pAdministratorsGroup); | ||
} | ||
|
||
return fIsRunAsAdmin; | ||
} | ||
|
||
BOOL IsInContainer() | ||
{ | ||
BOOL fIsInSandbox = FALSE; | ||
DWORD dwError = ERROR_SUCCESS; | ||
|
||
// Get the process token | ||
HANDLE hToken = NULL; | ||
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) | ||
{ | ||
dwError = GetLastError(); | ||
return FALSE; | ||
} | ||
|
||
// Check if the process is running in an AppContainer | ||
DWORD dwIsAppContainer = 0; | ||
DWORD dwSize = sizeof(dwIsAppContainer); | ||
BOOL ans = GetTokenInformation(hToken, TokenIsAppContainer, &dwIsAppContainer, dwSize, &dwSize); | ||
if (!ans) | ||
{ | ||
dwError = GetLastError(); | ||
CloseHandle(hToken); | ||
return FALSE; | ||
} | ||
|
||
fIsInSandbox = (dwIsAppContainer != 0); | ||
|
||
CloseHandle(hToken); | ||
return fIsInSandbox; | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Microsoft Corporation and Contributors. | ||
// Licensed under the MIT License. | ||
|
||
// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT IT | ||
|
||
// INPUT FILE: dev\Common\TerminalVelocityFeatures-StoragePickers.xml | ||
// OPTIONS: -Channel Experimental -Language C++ -Namespace Microsoft.Windows.Storage.Pickers -Path dev\Common\TerminalVelocityFeatures-StoragePickers.xml -Output dev\Common\TerminalVelocityFeatures-StoragePickers.h | ||
|
||
#if defined(__midlrt) | ||
namespace features | ||
{ | ||
feature_name Feature_StoragePickers = { DisabledByDefault, FALSE }; | ||
} | ||
#endif // defined(__midlrt) | ||
|
||
// Feature constants | ||
#define WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_STORAGE_PICKERS_FEATURE_STORAGEPICKERS_ENABLED 1 | ||
|
||
#if defined(__cplusplus) | ||
|
||
namespace Microsoft::Windows::Storage::Pickers | ||
{ | ||
|
||
__pragma(detect_mismatch("ODR_violation_WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_STORAGE_PICKERS_FEATURE_STORAGEPICKERS_ENABLED_mismatch", "AlwaysEnabled")) | ||
struct Feature_StoragePickers | ||
{ | ||
static constexpr bool IsEnabled() { return WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_STORAGE_PICKERS_FEATURE_STORAGEPICKERS_ENABLED == 1; } | ||
}; | ||
|
||
} // namespace Microsoft.Windows.Storage.Pickers | ||
|
||
#endif // defined(__cplusplus) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0"?> | ||
<features xmlns="http://microsoft.com/windowsappsdk/TerminalVelocity/20210729/TerminalVelocityFeatures.xsd"> | ||
|
||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the MIT License. See LICENSE in the project root for license information. | ||
--> | ||
|
||
<!-- See docs/Coding-Guidelines/TerminalVelocity.md for more info. --> | ||
|
||
<!-- Enabled variants --> | ||
<feature> | ||
<name>Feature_StoragePickers</name> | ||
<description>StoragePickers for the WindowsAppRuntime</description> | ||
<state>AlwaysEnabled</state> | ||
<alwaysDisabledChannelTokens> | ||
<channelToken>Preview</channelToken> | ||
<channelToken>Stable</channelToken> | ||
</alwaysDisabledChannelTokens> | ||
</feature> | ||
</features> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.