[PATCH 10/12] shell32/tests: Add INVOKEIDLIST ShellExecuteEx() tests.

Francois Gouget fgouget at codeweavers.com
Mon Jan 4 16:31:56 CST 2016


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 dlls/shell32/tests/shlexec.c | 49 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 3691062..1423e79 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -1804,6 +1804,54 @@ static void test_class(void)
     delete_test_class("shlexec.shname");
 }
 
+static void test_invokeidlist(void)
+{
+    SHELLEXECUTEINFOA sei;
+    char filename[MAX_PATH];
+    INT_PTR rc;
+
+    memset(&sei, 0, sizeof(sei));
+    sei.cbSize=sizeof(sei);
+    sei.lpVerb="notaverb";
+    sprintf(filename, "%s\\test file.shlexec", tmpdir);
+    sei.lpFile=filename;
+    sei.nShow=SW_SHOWNORMAL;
+
+    sei.hProcess=(HANDLE)0xdeadbeef;
+    sei.fMask=SEE_MASK_NOCLOSEPROCESS | SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_NO_UI;
+    ok(!ShellExecuteExA(&sei), "ShellExecuteEx(INVOKEIDLIST, notaverb, %s) succeeded\n", filename);
+    todo_wine ok((INT_PTR)sei.hInstApp == SE_ERR_NOASSOC || broken((INT_PTR)sei.hInstApp == SE_ERR_ACCESSDENIED), "%s -> notaverb returned %lu\n", filename, (INT_PTR)sei.hInstApp);
+    ok(sei.hProcess==NULL, "got an unexpected process handle %p\n", sei.hProcess);
+    sei.lpVerb="properties";
+
+    if (0) { /* FIXME Pops up a dialog in Wine! */
+    sei.hProcess=(HANDLE)0xdeadbeef;
+    sei.fMask=SEE_MASK_NOCLOSEPROCESS | SEE_MASK_INVOKEIDLIST;
+    todo_wine ok(ShellExecuteExA(&sei), "ShellExecuteEx(INVOKEIDLIST, %s) failed\n", filename);
+    todo_wine ok((INT_PTR)sei.hInstApp > 32, "%s -> properties returned %lu\n", filename, (INT_PTR)sei.hInstApp);
+    ok(sei.hProcess==NULL, "got an unexpected process handle %p\n", sei.hProcess);
+
+    sei.hProcess=(HANDLE)0xdeadbeef;
+    sei.fMask=SEE_MASK_NOCLOSEPROCESS | SEE_MASK_INVOKEIDLIST;
+    todo_wine ok(ShellExecuteExA(&sei), "ShellExecuteEx(INVOKEIDLIST, %s) failed\n", filename);
+    todo_wine ok((INT_PTR)sei.hInstApp > 32, "%s -> properties returned %lu\n", filename, (INT_PTR)sei.hInstApp);
+    ok(sei.hProcess==NULL, "got an unexpected process handle %p\n", sei.hProcess);
+    }
+
+    sei.hProcess=(HANDLE)0xdeadbeef;
+    sei.fMask=SEE_MASK_NOCLOSEPROCESS | SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_NO_UI;
+    todo_wine ok(ShellExecuteExA(&sei), "ShellExecuteEx(INVOKEIDLIST|NO_UI, %s) failed\n", filename);
+    todo_wine ok((INT_PTR)sei.hInstApp > 32, "%s -> properties returned %lu\n", filename, (INT_PTR)sei.hInstApp);
+    ok(sei.hProcess==NULL, "got an unexpected process handle %p\n", sei.hProcess);
+
+    rc=shell_execute_ex(SEE_MASK_FLAG_NO_UI, "properties", filename, NULL, NULL, NULL, NULL);
+    ok(rc==SE_ERR_NOASSOC, "%s -> properties returned %lu\n", filename, rc);
+
+    sprintf(filename, "%s\\nonexistent.shlexec", tmpdir);
+    rc=shell_execute_ex(SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_NO_UI, "properties", filename, NULL, NULL, NULL, NULL);
+    todo_wine ok(rc==SE_ERR_FNF, "%s -> properties returned %lu\n", filename, rc);
+}
+
 typedef struct
 {
     const char* urlprefix;
@@ -2920,6 +2968,7 @@ START_TEST(shlexec)
     test_lpFile_parsed();
     test_filename();
     test_class();
+    test_invokeidlist();
     test_fileurls();
     test_urls();
     test_find_executable();
-- 
2.6.4




More information about the wine-patches mailing list