Commit e0d8bd3f authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

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

parent 6888e92e
...@@ -54,6 +54,7 @@ static DLLVERSIONINFO dllver; ...@@ -54,6 +54,7 @@ static DLLVERSIONINFO dllver;
static BOOL skip_shlexec_tests = FALSE; static BOOL skip_shlexec_tests = FALSE;
static BOOL skip_noassoc_tests = FALSE; static BOOL skip_noassoc_tests = FALSE;
static HANDLE dde_ready_event; static HANDLE dde_ready_event;
static BOOL is_elevated;
/*** /***
...@@ -2257,6 +2258,19 @@ static void test_exes(void) ...@@ -2257,6 +2258,19 @@ static void test_exes(void)
skip("Could not create associtation.\n"); 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) if (! skip_noassoc_tests)
{ {
sprintf(filename, "%s\\test file.noassoc", tmpdir); sprintf(filename, "%s\\test file.noassoc", tmpdir);
...@@ -2698,6 +2712,9 @@ static void init_test(void) ...@@ -2698,6 +2712,9 @@ static void init_test(void)
lnk_desc_t desc; lnk_desc_t desc;
DWORD rc; DWORD rc;
HRESULT r; HRESULT r;
TOKEN_ELEVATION elevation;
HANDLE token;
BOOL ret;
hdll=GetModuleHandleA("shell32.dll"); hdll=GetModuleHandleA("shell32.dll");
pDllGetVersion=(void*)GetProcAddress(hdll, "DllGetVersion"); pDllGetVersion=(void*)GetProcAddress(hdll, "DllGetVersion");
...@@ -2822,6 +2839,13 @@ static void init_test(void) ...@@ -2822,6 +2839,13 @@ static void init_test(void)
/* Set an environment variable to see if it is inherited */ /* Set an environment variable to see if it is inherited */
SetEnvironmentVariableA("ShlexecVar", "Present"); 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) static void cleanup_test(void)
......
...@@ -272,6 +272,7 @@ HKCR,DirectShow,,16 ...@@ -272,6 +272,7 @@ HKCR,DirectShow,,16
HKCR,exefile,,2,"Application" HKCR,exefile,,2,"Application"
HKCR,exefile\DefaultIcon,,2,"%1" HKCR,exefile\DefaultIcon,,2,"%1"
HKCR,exefile\shell\open\command,,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,,2,"[ViewFolder("%l", %I, %S)]"
HKCR,folder\shell\open\ddeexec,"NoActivateHandler",2,"" HKCR,folder\shell\open\ddeexec,"NoActivateHandler",2,""
HKCR,folder\shell\open\ddeexec\application,,2,"Folders" HKCR,folder\shell\open\ddeexec\application,,2,"Folders"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment