[SHELL32_WINETEST] Sync with Wine Staging 4.18. CORE-16441
[reactos.git] / modules / rostests / winetests / shell32 / shlexec.c
old mode 100755 (executable)
new mode 100644 (file)
index 9db12ce..af4b8e3
  */
 
 /* Needed to get SEE_MASK_NOZONECHECKS with the PSDK */
+#ifndef __REACTOS__
 #define NTDDI_WINXPSP1 0x05010100
 #define NTDDI_VERSION NTDDI_WINXPSP1
 #define _WIN32_WINNT 0x0501
+#endif
 
 #include <stdio.h>
 #include <assert.h>
@@ -44,6 +46,8 @@
 #include "shellapi.h"
 #include "shlwapi.h"
 #include "ddeml.h"
+
+#include "wine/heap.h"
 #include "wine/test.h"
 
 #include "shell32_test.h"
@@ -115,15 +119,15 @@ static char* decodeA(const char* str)
     return ptr;
 }
 
-static void WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...)
+static void WINAPIV WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...)
 {
-    va_list     valist;
+    __ms_va_list valist;
     char        buffer[1024];
     DWORD       w;
 
-    va_start(valist, fmt);
+    __ms_va_start(valist, fmt);
     vsprintf(buffer, fmt, valist);
-    va_end(valist);
+    __ms_va_end(valist);
     WriteFile(h, buffer, strlen(buffer), &w, NULL);
 }
 
@@ -349,16 +353,16 @@ static void dump_child_(const char* file, int line)
  ***/
 
 static char shell_call[2048];
-static void WINETEST_PRINTF_ATTR(2,3) _okShell(int condition, const char *msg, ...)
+static void WINAPIV WINETEST_PRINTF_ATTR(2,3) _okShell(int condition, const char *msg, ...)
 {
-    va_list valist;
+    __ms_va_list valist;
     char buffer[2048];
 
     strcpy(buffer, shell_call);
     strcat(buffer, " ");
-    va_start(valist, msg);
+    __ms_va_start(valist, msg);
     vsprintf(buffer+strlen(buffer), msg, valist);
-    va_end(valist);
+    __ms_va_end(valist);
     winetest_ok(condition, "%s", buffer);
 }
 #define okShell_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : _okShell
@@ -756,10 +760,10 @@ static LSTATUS myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
     dwMaxSubkeyLen++;
     dwMaxValueLen++;
     dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
-    if (dwMaxLen > sizeof(szNameBuf)/sizeof(CHAR))
+    if (dwMaxLen > ARRAY_SIZE(szNameBuf))
     {
         /* Name too big: alloc a buffer for it */
-        if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR))))
+        if (!(lpszName = heap_alloc(dwMaxLen*sizeof(CHAR))))
         {
             ret = ERROR_NOT_ENOUGH_MEMORY;
             goto cleanup;
@@ -794,7 +798,7 @@ static LSTATUS myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
 cleanup:
     /* Free buffer if allocated */
     if (lpszName != szNameBuf)
-        HeapFree( GetProcessHeap(), 0, lpszName);
+        heap_free(lpszName);
     if(lpszSubKey)
         RegCloseKey(hSubKey);
     return ret;
@@ -854,11 +858,11 @@ static void create_test_verb_dde(const char* classname, const char* verb,
     }
     else
     {
-        cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1);
+        cmd = heap_alloc(strlen(argv0) + 10 + strlen(child_file) + 2 + strlen(cmdtail) + 1);
         sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail);
         rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1);
         ok(rc == ERROR_SUCCESS, "setting command failed with %d\n", rc);
-        HeapFree(GetProcessHeap(), 0, cmd);
+        heap_free(cmd);
     }
 
     if (ddeexec)
@@ -1327,7 +1331,7 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
     int i, count;
 
     /* trace("----- cmd='%s'\n", test->cmd); */
-    MultiByteToWideChar(CP_ACP, 0, test->cmd, -1, cmdW, sizeof(cmdW)/sizeof(*cmdW));
+    MultiByteToWideChar(CP_ACP, 0, test->cmd, -1, cmdW, ARRAY_SIZE(cmdW));
     argsW = cl2a = CommandLineToArgvW(cmdW, &cl2a_count);
     if (argsW == NULL && cl2a_count == -1)
     {
@@ -1347,7 +1351,7 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
     {
         if (i < count)
         {
-            MultiByteToWideChar(CP_ACP, 0, test->args[i], -1, argW, sizeof(argW)/sizeof(*argW));
+            MultiByteToWideChar(CP_ACP, 0, test->args[i], -1, argW, ARRAY_SIZE(argW));
             todo_wine_if(test->todo & (1 << (i+4)))
                 ok(!lstrcmpW(*argsW, argW), "%s: arg[%d] expected %s but got %s\n", test->cmd, i, wine_dbgstr_w(argW), wine_dbgstr_w(*argsW));
         }
@@ -1393,7 +1397,7 @@ static void test_commandline2argv(void)
        "expected NULL-terminated list of commandline arguments\n");
     if (numargs == 1)
     {
-        GetModuleFileNameW(NULL, strW, sizeof(strW)/sizeof(*strW));
+        GetModuleFileNameW(NULL, strW, ARRAY_SIZE(strW));
         ok(!lstrcmpW(args[0], strW), "wrong path to the current executable: %s instead of %s\n", wine_dbgstr_w(args[0]), wine_dbgstr_w(strW));
     }
     if (args) LocalFree(args);
@@ -1416,8 +1420,8 @@ typedef struct
     const char* verb;
     const char* params;
     int todo;
-    cmdline_tests_t cmd;
-    cmdline_tests_t broken;
+    const char *cmd;
+    const char *broken;
 } argify_tests_t;
 
 static const argify_tests_t argify_tests[] =
@@ -1427,33 +1431,28 @@ static const argify_tests_t argify_tests[] =
      * parameters string, including the trailing spaces, no matter what
      * arguments have already been used.
      */
-    {"Params232S", "p2 p3 p4 ", 0xc2,
-     {" p2 p3 \"p2\" \"p2 p3 p4 \"",
-      {"", "p2", "p3", "p2", "p2 p3 p4 ", NULL}, 0}},
+    {"Params232S", "p2 p3 p4 ", TRUE,
+     " p2 p3 \"p2\" \"p2 p3 p4 \""},
 
     /* Unquoted argument references like %2 don't automatically quote their
      * argument. Similarly, when they are quoted they don't escape the quotes
      * that their argument may contain.
      */
-    {"Params232S", "\"p two\" p3 p4  ", 0x3f3,
-     {" p two p3 \"p two\" \"\"p two\" p3 p4  \"",
-      {"", "p", "two", "p3", "p two", "p", "two p3 p4  ", NULL}, 0}},
+    {"Params232S", "\"p two\" p3 p4  ", TRUE,
+     " p two p3 \"p two\" \"\"p two\" p3 p4  \""},
 
     /* Only single digits are supported so only %1 to %9. Shown here with %20
      * because %10 is a pain.
      */
-    {"Params20", "p", 0,
-     {" \"p0\"",
-      {"", "p0", NULL}, 0}},
+    {"Params20", "p", FALSE,
+     " \"p0\""},
 
     /* Only (double-)quotes have a special meaning. */
-    {"Params23456", "'p2 p3` p4\\ $even", 0x40,
-     {" \"'p2\" \"p3`\" \"p4\\\" \"$even\" \"\"",
-      {"", "'p2", "p3`", "p4\" $even \"", NULL}, 0}},
+    {"Params23456", "'p2 p3` p4\\ $even", FALSE,
+     " \"'p2\" \"p3`\" \"p4\\\" \"$even\" \"\""},
 
-    {"Params23456", "p=2 p-3 p4\tp4\rp4\np4", 0x1c2,
-     {" \"p=2\" \"p-3\" \"p4\tp4\rp4\np4\" \"\" \"\"",
-      {"", "p=2", "p-3", "p4\tp4\rp4\np4", "", "", NULL}, 0}},
+    {"Params23456", "p=2 p-3 p4\tp4\rp4\np4", TRUE,
+     " \"p=2\" \"p-3\" \"p4\tp4\rp4\np4\" \"\" \"\""},
 
     /* In unquoted strings, quotes are treated are a parameter separator just
      * like spaces! However they can be doubled to get a literal quote.
@@ -1461,125 +1460,102 @@ static const argify_tests_t argify_tests[] =
      * 2n   quotes -> n quotes
      * 2n+1 quotes -> n quotes and a parameter separator
      */
-    {"Params23456789", "one\"quote \"p four\" one\"quote p7", 0xff3,
-     {" \"one\" \"quote\" \"p four\" \"one\" \"quote\" \"p7\" \"\" \"\"",
-      {"", "one", "quote", "p four", "one", "quote", "p7", "", "", NULL}, 0}},
+    {"Params23456789", "one\"quote \"p four\" one\"quote p7", TRUE,
+     " \"one\" \"quote\" \"p four\" \"one\" \"quote\" \"p7\" \"\" \"\""},
 
-    {"Params23456789", "two\"\"quotes \"p three\" two\"\"quotes p5", 0xf2,
-     {" \"two\"quotes\" \"p three\" \"two\"quotes\" \"p5\" \"\" \"\" \"\" \"\"",
-      {"", "twoquotes p", "three twoquotes", "p5", "", "", "", "", NULL}, 0}},
+    {"Params23456789", "two\"\"quotes \"p three\" two\"\"quotes p5", TRUE,
+     " \"two\"quotes\" \"p three\" \"two\"quotes\" \"p5\" \"\" \"\" \"\" \"\""},
 
-    {"Params23456789", "three\"\"\"quotes \"p four\" three\"\"\"quotes p6", 0xff3,
-     {" \"three\"\" \"quotes\" \"p four\" \"three\"\" \"quotes\" \"p6\" \"\" \"\"",
-      {"", "three\"", "quotes", "p four", "three\"", "quotes", "p6", "", "", NULL}, 0}},
+    {"Params23456789", "three\"\"\"quotes \"p four\" three\"\"\"quotes p6", TRUE,
+     " \"three\"\" \"quotes\" \"p four\" \"three\"\" \"quotes\" \"p6\" \"\" \"\""},
 
-    {"Params23456789", "four\"\"\"\"quotes \"p three\" four\"\"\"\"quotes p5", 0xf3,
-     {" \"four\"\"quotes\" \"p three\" \"four\"\"quotes\" \"p5\" \"\" \"\" \"\" \"\"",
-      {"", "four\"quotes p", "three fourquotes p5 \"", "", "", "", NULL}, 0}},
+    {"Params23456789", "four\"\"\"\"quotes \"p three\" four\"\"\"\"quotes p5", TRUE,
+     " \"four\"\"quotes\" \"p three\" \"four\"\"quotes\" \"p5\" \"\" \"\" \"\" \"\""},
 
     /* Quoted strings cannot be continued by tacking on a non space character
      * either.
      */
-    {"Params23456", "\"p two\"p3 \"p four\"p5 p6", 0x1f3,
-     {" \"p two\" \"p3\" \"p four\" \"p5\" \"p6\"",
-      {"", "p two", "p3", "p four", "p5", "p6", NULL}, 0}},
+    {"Params23456", "\"p two\"p3 \"p four\"p5 p6", TRUE,
+     " \"p two\" \"p3\" \"p four\" \"p5\" \"p6\""},
 
     /* In quoted strings, the quotes are halved and an odd number closes the
      * string. Specifically:
      * 2n   quotes -> n quotes
      * 2n+1 quotes -> n quotes and closes the string and hence the parameter
      */
-    {"Params23456789", "\"one q\"uote \"p four\" \"one q\"uote p7", 0xff3,
-     {" \"one q\" \"uote\" \"p four\" \"one q\" \"uote\" \"p7\" \"\" \"\"",
-      {"", "one q", "uote", "p four", "one q", "uote", "p7", "", "", NULL}, 0}},
+    {"Params23456789", "\"one q\"uote \"p four\" \"one q\"uote p7", TRUE,
+     " \"one q\" \"uote\" \"p four\" \"one q\" \"uote\" \"p7\" \"\" \"\""},
 
-    {"Params23456789", "\"two \"\" quotes\" \"p three\" \"two \"\" quotes\" p5", 0x1ff3,
-     {" \"two \" quotes\" \"p three\" \"two \" quotes\" \"p5\" \"\" \"\" \"\" \"\"",
-      {"", "two ", "quotes p", "three two", " quotes", "p5", "", "", "", "", NULL}, 0}},
+    {"Params23456789", "\"two \"\" quotes\" \"p three\" \"two \"\" quotes\" p5", TRUE,
+     " \"two \" quotes\" \"p three\" \"two \" quotes\" \"p5\" \"\" \"\" \"\" \"\""},
 
-    {"Params23456789", "\"three q\"\"\"uotes \"p four\" \"three q\"\"\"uotes p7", 0xff3,
-     {" \"three q\"\" \"uotes\" \"p four\" \"three q\"\" \"uotes\" \"p7\" \"\" \"\"",
-      {"", "three q\"", "uotes", "p four", "three q\"", "uotes", "p7", "", "", NULL}, 0}},
+    {"Params23456789", "\"three q\"\"\"uotes \"p four\" \"three q\"\"\"uotes p7", TRUE,
+     " \"three q\"\" \"uotes\" \"p four\" \"three q\"\" \"uotes\" \"p7\" \"\" \"\""},
 
-    {"Params23456789", "\"four \"\"\"\" quotes\" \"p three\" \"four \"\"\"\" quotes\" p5", 0xff3,
-     {" \"four \"\" quotes\" \"p three\" \"four \"\" quotes\" \"p5\" \"\" \"\" \"\" \"\"",
-      {"", "four \"", "quotes p", "three four", "", "quotes p5 \"", "", "", "", NULL}, 0}},
+    {"Params23456789", "\"four \"\"\"\" quotes\" \"p three\" \"four \"\"\"\" quotes\" p5", TRUE,
+     " \"four \"\" quotes\" \"p three\" \"four \"\" quotes\" \"p5\" \"\" \"\" \"\" \"\""},
 
     /* The quoted string rules also apply to consecutive quotes at the start
      * of a parameter but don't count the opening quote!
      */
-    {"Params23456789", "\"\"twoquotes \"p four\" \"\"twoquotes p7", 0xbf3,
-     {" \"\" \"twoquotes\" \"p four\" \"\" \"twoquotes\" \"p7\" \"\" \"\"",
-      {"", "", "twoquotes", "p four", "", "twoquotes", "p7", "", "", NULL}, 0}},
+    {"Params23456789", "\"\"twoquotes \"p four\" \"\"twoquotes p7", TRUE,
+     " \"\" \"twoquotes\" \"p four\" \"\" \"twoquotes\" \"p7\" \"\" \"\""},
 
-    {"Params23456789", "\"\"\"three quotes\" \"p three\" \"\"\"three quotes\" p5", 0x6f3,
-     {" \"\"three quotes\" \"p three\" \"\"three quotes\" \"p5\" \"\" \"\" \"\" \"\"",
-      {"", "three", "quotes p", "three \"three", "quotes p5 \"", "", "", "", NULL}, 0}},
+    {"Params23456789", "\"\"\"three quotes\" \"p three\" \"\"\"three quotes\" p5", TRUE,
+     " \"\"three quotes\" \"p three\" \"\"three quotes\" \"p5\" \"\" \"\" \"\" \"\""},
 
-    {"Params23456789", "\"\"\"\"fourquotes \"p four\" \"\"\"\"fourquotes p7", 0xbf3,
-     {" \"\"\" \"fourquotes\" \"p four\" \"\"\" \"fourquotes\" \"p7\" \"\" \"\"",
-      {"", "\"", "fourquotes", "p four", "\"", "fourquotes", "p7", "", "", NULL}, 0}},
+    {"Params23456789", "\"\"\"\"fourquotes \"p four\" \"\"\"\"fourquotes p7", TRUE,
+     " \"\"\" \"fourquotes\" \"p four\" \"\"\" \"fourquotes\" \"p7\" \"\" \"\""},
 
     /* An unclosed quoted string gets lost! */
-    {"Params23456", "p2 \"p3\" \"p4 is lost", 0x1c3,
-     {" \"p2\" \"p3\" \"\" \"\" \"\"",
-      {"", "p2", "p3", "", "", "", NULL}, 0},
-     {" \"p2\" \"p3\" \"p3\" \"\" \"\"",
-       {"", "p2", "p3", "p3", "", "", NULL}, 0}},
+    {"Params23456", "p2 \"p3\" \"p4 is lost", TRUE,
+     " \"p2\" \"p3\" \"\" \"\" \"\"",
+     " \"p2\" \"p3\" \"p3\" \"\" \"\""},    /* NT4/2k */
 
     /* Backslashes have no special meaning even when preceding quotes. All
      * they do is start an unquoted string.
      */
-    {"Params23456", "\\\"p\\three \"pfour\\\" pfive", 0x73,
-     {" \"\\\" \"p\\three\" \"pfour\\\" \"pfive\" \"\"",
-      {"", "\" p\\three pfour\"", "pfive", "", NULL}, 0}},
+    {"Params23456", "\\\"p\\three \"pfour\\\" pfive", TRUE,
+     " \"\\\" \"p\\three\" \"pfour\\\" \"pfive\" \"\""},
 
     /* Environment variables are left untouched. */
-    {"Params23456", "%TMPDIR% %t %c", 0,
-     {" \"%TMPDIR%\" \"%t\" \"%c\" \"\" \"\"",
-      {"", "%TMPDIR%", "%t", "%c", "", "", NULL}, 0}},
+    {"Params23456", "%TMPDIR% %t %c", FALSE,
+     " \"%TMPDIR%\" \"%t\" \"%c\" \"\" \"\""},
 
     /* %~2 is equivalent to %*. However %~3 and higher include the spaces
      * before the parameter!
      * (but not the previous parameter's closing quote fortunately)
      */
-    {"Params2345Etc", "p2  p3 \"p4\"  p5 p6 ", 0x3f3,
-     {" ~2=\"p2  p3 \"p4\"  p5 p6 \" ~3=\"  p3 \"p4\"  p5 p6 \" ~4=\" \"p4\"  p5 p6 \" ~5=  p5 p6 ",
-      {"", "~2=p2  p3 p4  p5 p6 ", "~3=  p3 p4  p5 p6 ", "~4= p4  p5 p6 ", "~5=", "p5", "p6", NULL}, 0}},
+    {"Params2345Etc", "p2  p3 \"p4\"  p5 p6 ", TRUE,
+     " ~2=\"p2  p3 \"p4\"  p5 p6 \" ~3=\"  p3 \"p4\"  p5 p6 \" ~4=\" \"p4\"  p5 p6 \" ~5=  p5 p6 "},
 
     /* %~n works even if there is no nth parameter. */
-    {"Params9Etc", "p2 p3 p4 p5 p6 p7 p8   ", 0x12,
-     {" ~9=\"   \"",
-      {"", "~9=   ", NULL}, 0}},
+    {"Params9Etc", "p2 p3 p4 p5 p6 p7 p8   ", TRUE,
+     " ~9=\"   \""},
 
-    {"Params9Etc", "p2 p3 p4 p5 p6 p7   ", 0x12,
-     {" ~9=\"\"",
-      {"", "~9=", NULL}, 0}},
+    {"Params9Etc", "p2 p3 p4 p5 p6 p7   ", TRUE,
+     " ~9=\"\""},
 
     /* The %~n directives also transmit the tenth parameter and beyond. */
-    {"Params9Etc", "p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 and beyond!", 0x12,
-     {" ~9=\" p9 p10 p11 and beyond!\"",
-      {"", "~9= p9 p10 p11 and beyond!", NULL}, 0}},
+    {"Params9Etc", "p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 and beyond!", TRUE,
+     " ~9=\" p9 p10 p11 and beyond!\""},
 
     /* Bad formatting directives lose their % sign, except those followed by
      * a tilde! Environment variables are not expanded but lose their % sign.
      */
-    {"ParamsBad", "p2 p3 p4 p5", 0x12,
-     {" \"% - %~ %~0 %~1 %~a %~* a b c TMPDIR\"",
-      {"", "% - %~ %~0 %~1 %~a %~* a b c TMPDIR", NULL}, 0}},
+    {"ParamsBad", "p2 p3 p4 p5", TRUE,
+     " \"% - %~ %~0 %~1 %~a %~* a b c TMPDIR\""},
 
-    {NULL, NULL, 0, {NULL, {NULL}, 0}}
+    {0}
 };
 
 static void test_argify(void)
 {
-    BOOL has_cl2a = TRUE;
     char fileA[MAX_PATH], params[2*MAX_PATH+12];
     INT_PTR rc;
     const argify_tests_t* test;
-    const cmdline_tests_t *bad;
+    const char *bad;
     const char* cmd;
-    unsigned i, count;
 
     /* Test with a long parameter */
     for (rc = 0; rc < MAX_PATH; rc++)
@@ -1612,21 +1588,11 @@ static void test_argify(void)
     test = argify_tests;
     while (test->params)
     {
-        bad = test->broken.cmd ? &test->broken : &test->cmd;
+        bad = test->broken ? test->broken : test->cmd;
 
-        /* trace("***** verb='%s' params='%s'\n", test->verb, test->params); */
         rc = shell_execute_ex(SEE_MASK_DOENVSUBST, test->verb, fileA, test->params, NULL, NULL);
         okShell(rc > 32, "failed: rc=%lu\n", rc);
 
-        count = 0;
-        while (test->cmd.args[count])
-            count++;
-        /* +4 for the shlexec arguments, -1 because of the added ""
-         * argument for the CommandLineToArgvW() tests.
-         */
-        todo_wine_if(test->todo & 0x1)
-            okChildInt("argcA", 4 + count - 1);
-
         cmd = getChildString("Child", "cmdlineA");
         /* Our commands are such that the verb immediately precedes the
          * part we are interested in.
@@ -1634,20 +1600,9 @@ static void test_argify(void)
         if (cmd) cmd = strstr(cmd, test->verb);
         if (cmd) cmd += strlen(test->verb);
         if (!cmd) cmd = "(null)";
-        todo_wine_if(test->todo & 0x2)
-            okShell(!strcmp(cmd, test->cmd.cmd) || broken(!strcmp(cmd, bad->cmd)),
-                    "the cmdline is '%s' instead of '%s'\n", cmd, test->cmd.cmd);
-
-        for (i = 0; i < count - 1; i++)
-        {
-            char argname[18];
-            sprintf(argname, "argvA%d", 4 + i);
-            todo_wine_if(test->todo & (1 << (i+4)))
-                okChildStringBroken(argname, test->cmd.args[i+1], bad->args[i+1]);
-        }
-
-        if (has_cl2a)
-            has_cl2a = test_one_cmdline(&(test->cmd));
+        todo_wine_if(test->todo)
+            okShell(!strcmp(cmd, test->cmd) || broken(!strcmp(cmd, bad)),
+                    "expected '%s', got '%s'\n", cmd, test->cmd);
         test++;
     }
 }
@@ -1827,7 +1782,7 @@ static fileurl_tests_t fileurl_tests[]=
     {"file:///", "%%TMPDIR%%\\test file.shlexec", 0, 0},
 
     /* Test shortcuts vs. URLs */
-    {"file://///", "%s\\test_shortcut_shlexec.lnk", 0, 0x1d},
+    {"file://///", "%s\\test_shortcut_shlexec.lnk", 0, 0x1c},
 
     /* Confuse things by mixing protocols */
     {"file://", "shlproto://foo/bar", USE_COLON, 0},
@@ -1857,7 +1812,7 @@ static void test_fileurls(void)
         return;
     }
 
-    get_long_path_name(tmpdir, longtmpdir, sizeof(longtmpdir)/sizeof(*longtmpdir));
+    get_long_path_name(tmpdir, longtmpdir, ARRAY_SIZE(longtmpdir));
     SetEnvironmentVariableA("urlprefix", "file:///");
 
     test=fileurl_tests;
@@ -1973,11 +1928,11 @@ static void test_urls(void)
     }
 
     /* A .lnk ending does not turn a URL into a shortcut */
-    todo_wait rc = shell_execute(NULL, "shlproto://foo/bar.lnk", NULL, NULL);
+    rc = shell_execute(NULL, "shlproto://foo/bar.lnk", NULL, NULL);
     ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
     okChildInt("argcA", 5);
-    todo_wine okChildString("argvA3", "URL");
-    todo_wine okChildString("argvA4", "shlproto://foo/bar.lnk");
+    okChildString("argvA3", "URL");
+    okChildString("argvA4", "shlproto://foo/bar.lnk");
 
     /* Neither does a .exe extension */
     rc = shell_execute(NULL, "shlproto://foo/bar.exe", NULL, NULL);
@@ -2180,13 +2135,13 @@ static void test_lnks(void)
         get_long_path_name(params, filename, sizeof(filename));
         okChildPath("argvA4", filename);
 
-        todo_wait rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL);
+        rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL);
         okShell(rc > 32, "failed: rc=%lu err=%u\n", rc, GetLastError());
         okChildInt("argcA", 5);
-        todo_wine okChildString("argvA3", "Open");
+        okChildString("argvA3", "Open");
         sprintf(params, "%s\\test file.shlexec", tmpdir);
         get_long_path_name(params, filename, sizeof(filename));
-        todo_wine okChildPath("argvA4", filename);
+        okChildPath("argvA4", filename);
     }
 
     /* Should just run our executable */
@@ -2777,7 +2732,7 @@ static void init_test(void)
 
     /* Setup the test shortcuts */
     sprintf(filename, "%s\\test_shortcut_shlexec.lnk", tmpdir);
-    MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, sizeof(lnkfile)/sizeof(*lnkfile));
+    MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, ARRAY_SIZE(lnkfile));
     desc.description=NULL;
     desc.workdir=NULL;
     sprintf(filename, "%s\\test file.shlexec", tmpdir);
@@ -2791,7 +2746,7 @@ static void init_test(void)
     create_lnk(lnkfile, &desc, 0);
 
     sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir);
-    MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, sizeof(lnkfile)/sizeof(*lnkfile));
+    MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, ARRAY_SIZE(lnkfile));
     desc.description=NULL;
     desc.workdir=NULL;
     desc.path=argv0;
@@ -2876,7 +2831,7 @@ static void test_directory(void)
     okShell(rc > 32, "returned %lu\n", rc);
     okChildInt("argcA", 4);
     okChildString("argvA3", "Exec");
-    todo_wine okChildPath("longPath", path);
+    okChildPath("longPath", path);
     SetCurrentDirectoryA(curdir);
 
     rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
@@ -2889,7 +2844,7 @@ static void test_directory(void)
     okShell(rc > 32, "returned %lu\n", rc);
     okChildInt("argcA", 4);
     okChildString("argvA3", "Exec");
-    todo_wine okChildPath("longPath", path);
+    okChildPath("longPath", path);
 
     /* Specify it through an environment variable */
     rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_FLAG_NO_UI,
@@ -2901,7 +2856,7 @@ static void test_directory(void)
     okShell(rc > 32, "returned %lu\n", rc);
     okChildInt("argcA", 4);
     okChildString("argvA3", "Exec");
-    todo_wine okChildPath("longPath", path);
+    okChildPath("longPath", path);
 
     /* Not a colon-separated directory list */
     sprintf(dirpath, "%s:%s", curdir, tmpdir);