loader/wine.inf: Add runas shell execute verb.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
This commit is contained in:
Paul Gofman 2022-06-29 20:52:44 -05:00 committed by Alexandre Julliard
parent 6888e92ebc
commit e0d8bd3f5a
Notes: Alexandre Julliard 2022-07-19 22:54:19 +02:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/353
2 changed files with 25 additions and 0 deletions

View file

@ -54,6 +54,7 @@ static DLLVERSIONINFO dllver;
static BOOL skip_shlexec_tests = FALSE;
static BOOL skip_noassoc_tests = FALSE;
static HANDLE dde_ready_event;
static BOOL is_elevated;
/***
@ -2257,6 +2258,19 @@ static void test_exes(void)
skip("Could not create associtation.\n");
}
if (is_elevated)
{
rc = shell_execute_ex(SEE_MASK_NOZONECHECKS | SEE_MASK_CLASSNAME | SEE_MASK_FLAG_NO_UI, "runas", argv0, params,
NULL, ".exe");
okShell(rc > 32, "returned %Iu\n", rc);
okChildInt("argcA", 4);
okChildString("argvA3", "Exec");
}
else
{
skip("No admin privileges, skipping runas test.\n");
}
if (! skip_noassoc_tests)
{
sprintf(filename, "%s\\test file.noassoc", tmpdir);
@ -2698,6 +2712,9 @@ static void init_test(void)
lnk_desc_t desc;
DWORD rc;
HRESULT r;
TOKEN_ELEVATION elevation;
HANDLE token;
BOOL ret;
hdll=GetModuleHandleA("shell32.dll");
pDllGetVersion=(void*)GetProcAddress(hdll, "DllGetVersion");
@ -2822,6 +2839,13 @@ static void init_test(void)
/* Set an environment variable to see if it is inherited */
SetEnvironmentVariableA("ShlexecVar", "Present");
ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
ok(ret, "OpenProcessToken failed.\n");
ret = GetTokenInformation(token, TokenElevation, &elevation, sizeof(elevation), &rc);
ok(ret, "GetTokenInformation failed.\n");
is_elevated = elevation.TokenIsElevated;
CloseHandle(token);
}
static void cleanup_test(void)

View file

@ -272,6 +272,7 @@ HKCR,DirectShow,,16
HKCR,exefile,,2,"Application"
HKCR,exefile\DefaultIcon,,2,"%1"
HKCR,exefile\shell\open\command,,2,"""%1"" %*"
HKCR,exefile\shell\runas\command,,2,"""%1"" %*"
HKCR,folder\shell\open\ddeexec,,2,"[ViewFolder("%l", %I, %S)]"
HKCR,folder\shell\open\ddeexec,"NoActivateHandler",2,""
HKCR,folder\shell\open\ddeexec\application,,2,"Folders"