kernel32: Add an ability to execute 32-bit applications from 16-bit ones using winoldap.dll

Andrey Turkin andrey.turkin at gmail.com
Tue Dec 25 03:30:55 CST 2007


Dmitry Timoshkov wrote:
> Hello,
>
> this patch should fix the problem reported in the bug 3620.
>
> winoldap.mod in Windows is a 16-bit .exe which uses its command line to load
> a 32-bit module and pass the parameters to it. Since winebuild doesn't allow
> to create a 16-bit builtin exe, I decided to create a 16-bit builtin dll
> instead. That adds some complexity due to need to create another thread to
> launch a 32-bit application from, and wait until it finishes.
>   
The application mentioned in the bug change current directory to output
dir and then uses WINEXEC with relative filename to start child application.
Thread created by winoldap uses another current directory because of
something, so CreateProcess fails with your patch.

<snip>


> +    if (CreateProcessA( NULL, cmdline, NULL, NULL, FALSE,
> +                        0, NULL, NULL, &startup, &info ))
> +    {
> +        HINSTANCE16 hwinoldap;
> +
> +        /* Give 30 seconds to the app to come up */
> +        wait_input_idle( info.hProcess, 30000 );
> +
> +        args->ret = TRUE;
> +        SetEvent(args->event);
> +
> +        WaitForSingleObject( info.hProcess, INFINITE );
> +
> +        CloseHandle( info.hThread );
> +        CloseHandle( info.hProcess );
> +
> +        /* decrement WINOLDAP usage count to signal that we have finished */
> +        hwinoldap = GetModuleHandle16( "winoldap" );
> +        FreeLibrary16( hwinoldap );
> +    }
>   
Usage count should be decremented regardless of CreateProcess return value.
> +
> +    RestoreThunkLock( count );
> +    HeapFree( GetProcessHeap(), 0, cmdline );
> +
> +    if (!args->ret);
> +        SetEvent( args->event );
>   
Typo.




More information about the wine-devel mailing list