Delete unused multibyte methods from PAL (#42157)
[platform/upstream/dotnet/runtime.git] / src / coreclr / src / pal / tests / palsuite / threading / OpenEventW / test3 / test3.cpp
index 18f88b5..702455b 100644 (file)
@@ -79,9 +79,10 @@ int __cdecl main( int argc, char **argv )
         Fail ("Error: Insufficient lpCommandline for\n");
     }
 
+    LPWSTR lpCommandLineW = convert(lpCommandLine);
     /* launch the child process */
     if( !CreateProcess(     NULL,               /* module name to execute */
-                            lpCommandLine,    /* command line */
+                            lpCommandLineW,     /* command line */
                             NULL,               /* process handle not */
                                                 /* inheritable */
                             NULL,               /* thread handle not */
@@ -95,10 +96,14 @@ int __cdecl main( int argc, char **argv )
                             &pi )               /* process info struct */
         )
     {
+        DWORD dwError = GetLastError();
+        free(lpCommandLineW);
         Fail( "ERROR:%lu:CreateProcess call failed\n",
-              GetLastError() );
+              dwError);
     }
 
+    free(lpCommandLineW);
+
     /* verify that the event is signalled by the child process */
     dwRet = WaitForSingleObject( hEvent, TIMEOUT );
     if( dwRet != WAIT_OBJECT_0 )