You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a UWP app (let's call it "server") with the UWP service inside it and a C++ desktop app (let's call it "client") that connects to the server's UWP service using the WinRT API.
The following code works as expected if the client application is run as a login user::
//Executed inside newly created thread
winrt::init_apartment();
connectionStatus = _appServiceConnection->OpenAsync().get();
winrt::uninit_apartment();
But this code doesn't work if I run the "client" application "as an administrator". (connectionStatus == AppServiceConnectionStatus::Unknown and I see "access denied" exception deeply inside windows libraries).
I don't need to use the WinRT API with admin rights, but other parts of the "client" app sometimes need to do this. Thus, the user should be able to run the "client" with or without administrator rights.
I have a separate thread dedicated to connecting to the UWP service and processing connection. I tried to drop the elevated rights of the thread security token, but was unsuccessful.
Do you have any suggestions?
The text was updated successfully, but these errors were encountered:
Sorry if I chose the wrong place for the question.
I understand that winrt::Windows::ApplicationModel::AppService::AppServiceConnection is just a part of C++ API projection, but I don't know where else to ask a question about my problem, because the "desktop" use of AppServiceConnection is closely related to the C++ WinRT library, and is not related to the clean world of UWP (using .NET), because there are no "Run as administrator" options for UWP apps, all of them are sandboxed and do not have this problem.
Not sure what you mean by "closely related to the C++/WinRT library". You can use UWP classes from .NET desktop apps too. You can follow the instructions on Windows developer support for platform support options. (Click "Forums and community".)
I wrote a UWP app (let's call it "server") with the UWP service inside it and a C++ desktop app (let's call it "client") that connects to the server's UWP service using the WinRT API.
The following code works as expected if the client application is run as a login user::
But this code doesn't work if I run the "client" application "as an administrator". (connectionStatus == AppServiceConnectionStatus::Unknown and I see "access denied" exception deeply inside windows libraries).
I don't need to use the WinRT API with admin rights, but other parts of the "client" app sometimes need to do this. Thus, the user should be able to run the "client" with or without administrator rights.
I have a separate thread dedicated to connecting to the UWP service and processing connection. I tried to drop the elevated rights of the thread security token, but was unsuccessful.
Do you have any suggestions?
The text was updated successfully, but these errors were encountered: