2002-11-15 02:41:20 +01:00
|
|
|
/*
|
|
|
|
* PURPOSE: Load a DLL and run an entry point with the specified parameters
|
|
|
|
*
|
|
|
|
* Copyright 2002 Alberto Massari
|
2003-09-08 21:38:45 +02:00
|
|
|
* Copyright 2001-2003 Aric Stewart for CodeWeavers
|
|
|
|
* Copyright 2003 Mike McCormack for CodeWeavers
|
2002-11-15 02:41:20 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-11-15 02:41:20 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* rundll32 dllname,entrypoint [arguments]
|
|
|
|
*
|
|
|
|
* Documentation for this utility found on KB Q164787
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2003-07-22 02:59:56 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
/* Exclude rarely-used stuff from Windows headers */
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2003-12-03 21:29:24 +01:00
|
|
|
#include "windows.h"
|
|
|
|
#include "wine/winbase16.h"
|
2020-01-21 20:58:47 +01:00
|
|
|
#include "wine/asm.h"
|
2003-12-03 21:29:24 +01:00
|
|
|
#include "wine/debug.h"
|
2002-11-15 02:41:20 +01:00
|
|
|
|
2003-07-22 02:59:56 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(rundll32);
|
2002-11-15 02:41:20 +01:00
|
|
|
|
2003-07-22 02:59:56 +02:00
|
|
|
|
2020-01-21 20:58:47 +01:00
|
|
|
#ifdef __i386__
|
|
|
|
/* wrapper for dlls that declare the entry point incorrectly */
|
|
|
|
extern void call_entry_point( void *func, HWND hwnd, HINSTANCE inst, void *cmdline, int show );
|
|
|
|
__ASM_GLOBAL_FUNC( call_entry_point,
|
|
|
|
"pushl %ebp\n\t"
|
|
|
|
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
|
|
|
|
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
|
|
|
|
"movl %esp,%ebp\n\t"
|
|
|
|
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
|
|
|
|
"pushl %edi\n\t"
|
|
|
|
__ASM_CFI(".cfi_rel_offset %edi,-4\n\t")
|
|
|
|
"pushl %esi\n\t"
|
|
|
|
__ASM_CFI(".cfi_rel_offset %esi,-8\n\t")
|
|
|
|
"pushl %ebx\n\t"
|
|
|
|
__ASM_CFI(".cfi_rel_offset %ebx,-12\n\t")
|
|
|
|
"subl $12,%esp\n\t"
|
|
|
|
"pushl 24(%ebp)\n\t"
|
|
|
|
"pushl 20(%ebp)\n\t"
|
|
|
|
"pushl 16(%ebp)\n\t"
|
|
|
|
"pushl 12(%ebp)\n\t"
|
|
|
|
"call *8(%ebp)\n\t"
|
|
|
|
"leal -12(%ebp),%esp\n\t"
|
|
|
|
"popl %ebx\n\t"
|
|
|
|
__ASM_CFI(".cfi_same_value %ebx\n\t")
|
|
|
|
"popl %esi\n\t"
|
|
|
|
__ASM_CFI(".cfi_same_value %esi\n\t")
|
|
|
|
"popl %edi\n\t"
|
|
|
|
__ASM_CFI(".cfi_same_value %edi\n\t")
|
|
|
|
"leave\n\t"
|
|
|
|
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
|
|
|
|
__ASM_CFI(".cfi_same_value %ebp\n\t")
|
|
|
|
"ret" )
|
|
|
|
#else
|
|
|
|
static void call_entry_point( void *func, HWND hwnd, HINSTANCE inst, void *cmdline, int show )
|
|
|
|
{
|
|
|
|
void (WINAPI *entry_point)( HWND hwnd, HINSTANCE inst, void *cmdline, int show ) = func;
|
|
|
|
entry_point( hwnd, inst, cmdline, show );
|
|
|
|
}
|
|
|
|
#endif
|
2003-07-22 02:59:56 +02:00
|
|
|
|
2004-01-21 03:20:29 +01:00
|
|
|
static HINSTANCE16 (WINAPI *pLoadLibrary16)(LPCSTR libname);
|
|
|
|
static FARPROC16 (WINAPI *pGetProcAddress16)(HMODULE16 hModule, LPCSTR name);
|
|
|
|
static void (WINAPI *pRunDLL_CallEntry16)( FARPROC proc, HWND hwnd, HINSTANCE inst,
|
|
|
|
LPCSTR cmdline, INT cmdshow );
|
|
|
|
|
2020-10-07 23:34:33 +02:00
|
|
|
/*
|
|
|
|
* Control_RunDLL needs to have a window. So lets make us a very simple window class.
|
|
|
|
*/
|
2010-05-02 06:08:10 +02:00
|
|
|
static ATOM register_class(void)
|
2003-08-15 05:51:19 +02:00
|
|
|
{
|
2010-05-03 21:22:25 +02:00
|
|
|
WNDCLASSEXW wcex;
|
2003-07-22 02:59:56 +02:00
|
|
|
|
2010-05-03 21:22:25 +02:00
|
|
|
wcex.cbSize = sizeof(WNDCLASSEXW);
|
2003-07-22 02:59:56 +02:00
|
|
|
|
|
|
|
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
2010-05-03 21:22:25 +02:00
|
|
|
wcex.lpfnWndProc = DefWindowProcW;
|
2003-07-22 02:59:56 +02:00
|
|
|
wcex.cbClsExtra = 0;
|
|
|
|
wcex.cbWndExtra = 0;
|
2010-05-02 06:08:10 +02:00
|
|
|
wcex.hInstance = NULL;
|
2003-07-22 02:59:56 +02:00
|
|
|
wcex.hIcon = NULL;
|
2010-05-03 21:22:25 +02:00
|
|
|
wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
|
2003-07-22 02:59:56 +02:00
|
|
|
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
|
|
|
wcex.lpszMenuName = NULL;
|
2020-10-07 23:34:33 +02:00
|
|
|
wcex.lpszClassName = L"class_rundll32";
|
2003-07-22 02:59:56 +02:00
|
|
|
wcex.hIconSm = NULL;
|
|
|
|
|
2010-05-03 21:22:25 +02:00
|
|
|
return RegisterClassExW(&wcex);
|
2003-08-15 05:51:19 +02:00
|
|
|
}
|
2003-07-22 02:59:56 +02:00
|
|
|
|
2003-12-03 21:29:24 +01:00
|
|
|
static HINSTANCE16 load_dll16( LPCWSTR dll )
|
|
|
|
{
|
2004-01-21 03:20:29 +01:00
|
|
|
HINSTANCE16 ret = 0;
|
2003-12-03 21:29:24 +01:00
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, dll, -1, NULL, 0, NULL, NULL );
|
|
|
|
char *dllA = HeapAlloc( GetProcessHeap(), 0, len );
|
2010-05-03 21:22:17 +02:00
|
|
|
|
|
|
|
if (dllA)
|
|
|
|
{
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, dll, -1, dllA, len, NULL, NULL );
|
2020-10-07 23:34:33 +02:00
|
|
|
pLoadLibrary16 = (void *)GetProcAddress( GetModuleHandleW(L"kernel32.dll"), (LPCSTR)35 );
|
2010-05-03 21:22:17 +02:00
|
|
|
if (pLoadLibrary16) ret = pLoadLibrary16( dllA );
|
|
|
|
HeapFree( GetProcessHeap(), 0, dllA );
|
|
|
|
}
|
2003-12-03 21:29:24 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static FARPROC16 get_entry_point16( HINSTANCE16 inst, LPCWSTR entry )
|
|
|
|
{
|
2004-01-21 03:20:29 +01:00
|
|
|
FARPROC16 ret = 0;
|
2003-12-03 21:29:24 +01:00
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, entry, -1, NULL, 0, NULL, NULL );
|
|
|
|
char *entryA = HeapAlloc( GetProcessHeap(), 0, len );
|
2010-05-03 21:22:17 +02:00
|
|
|
|
|
|
|
if (entryA)
|
|
|
|
{
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, entry, -1, entryA, len, NULL, NULL );
|
2020-10-07 23:34:33 +02:00
|
|
|
pGetProcAddress16 = (void *)GetProcAddress( GetModuleHandleW(L"kernel32.dll"), (LPCSTR)37 );
|
2010-05-03 21:22:17 +02:00
|
|
|
if (pGetProcAddress16) ret = pGetProcAddress16( inst, entryA );
|
|
|
|
HeapFree( GetProcessHeap(), 0, entryA );
|
|
|
|
}
|
2003-12-03 21:29:24 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *get_entry_point32( HMODULE module, LPCWSTR entry, BOOL *unicode )
|
|
|
|
{
|
|
|
|
void *ret;
|
2010-05-03 21:22:17 +02:00
|
|
|
|
2010-05-04 14:46:20 +02:00
|
|
|
/* determine if the entry point is an ordinal */
|
|
|
|
if (entry[0] == '#')
|
|
|
|
{
|
2019-05-01 10:39:49 +02:00
|
|
|
INT_PTR ordinal = wcstol( entry + 1, NULL, 10 );
|
2010-05-04 14:46:20 +02:00
|
|
|
if (ordinal <= 0)
|
|
|
|
return NULL;
|
2003-12-03 21:29:24 +01:00
|
|
|
|
2010-05-04 14:46:20 +02:00
|
|
|
*unicode = TRUE;
|
|
|
|
ret = GetProcAddress( module, (LPCSTR)ordinal );
|
|
|
|
}
|
|
|
|
else
|
2003-12-03 21:29:24 +01:00
|
|
|
{
|
2010-05-04 14:46:20 +02:00
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, entry, -1, NULL, 0, NULL, NULL );
|
|
|
|
char *entryA = HeapAlloc( GetProcessHeap(), 0, len + 1 );
|
|
|
|
|
|
|
|
if (!entryA)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, entry, -1, entryA, len, NULL, NULL );
|
|
|
|
|
|
|
|
/* first try the W version */
|
|
|
|
*unicode = TRUE;
|
|
|
|
strcat( entryA, "W" );
|
2003-12-03 21:29:24 +01:00
|
|
|
if (!(ret = GetProcAddress( module, entryA )))
|
|
|
|
{
|
2010-05-04 14:46:20 +02:00
|
|
|
/* now the A version */
|
|
|
|
*unicode = FALSE;
|
|
|
|
entryA[strlen(entryA)-1] = 'A';
|
|
|
|
if (!(ret = GetProcAddress( module, entryA )))
|
|
|
|
{
|
|
|
|
/* now the version without suffix */
|
|
|
|
entryA[strlen(entryA)-1] = 0;
|
|
|
|
ret = GetProcAddress( module, entryA );
|
|
|
|
}
|
2003-12-03 21:29:24 +01:00
|
|
|
}
|
2010-05-04 14:46:20 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, entryA );
|
2003-12-03 21:29:24 +01:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2010-05-02 06:08:10 +02:00
|
|
|
static LPWSTR get_next_arg(LPWSTR *cmdline)
|
2003-08-15 05:51:19 +02:00
|
|
|
{
|
2003-12-03 21:29:24 +01:00
|
|
|
LPWSTR s;
|
2003-07-22 02:59:56 +02:00
|
|
|
LPWSTR arg,d;
|
2014-02-05 23:39:59 +01:00
|
|
|
BOOL in_quotes;
|
|
|
|
int bcount,len=0;
|
2003-07-22 02:59:56 +02:00
|
|
|
|
|
|
|
/* count the chars */
|
|
|
|
bcount=0;
|
2014-02-05 23:39:59 +01:00
|
|
|
in_quotes=FALSE;
|
2003-07-22 02:59:56 +02:00
|
|
|
s=*cmdline;
|
|
|
|
while (1) {
|
|
|
|
if (*s==0 || ((*s=='\t' || *s==' ') && !in_quotes)) {
|
|
|
|
/* end of this command line argument */
|
|
|
|
break;
|
|
|
|
} else if (*s=='\\') {
|
|
|
|
/* '\', count them */
|
|
|
|
bcount++;
|
|
|
|
} else if ((*s=='"') && ((bcount & 1)==0)) {
|
|
|
|
/* unescaped '"' */
|
|
|
|
in_quotes=!in_quotes;
|
|
|
|
bcount=0;
|
|
|
|
} else {
|
|
|
|
/* a regular character */
|
|
|
|
bcount=0;
|
|
|
|
}
|
|
|
|
s++;
|
|
|
|
len++;
|
|
|
|
}
|
|
|
|
arg=HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
|
|
|
|
if (!arg)
|
2002-11-15 02:41:20 +01:00
|
|
|
return NULL;
|
2003-07-22 02:59:56 +02:00
|
|
|
|
|
|
|
bcount=0;
|
2014-02-05 23:39:59 +01:00
|
|
|
in_quotes=FALSE;
|
2003-07-22 02:59:56 +02:00
|
|
|
d=arg;
|
|
|
|
s=*cmdline;
|
|
|
|
while (*s) {
|
|
|
|
if ((*s=='\t' || *s==' ') && !in_quotes) {
|
|
|
|
/* end of this command line argument */
|
|
|
|
break;
|
|
|
|
} else if (*s=='\\') {
|
|
|
|
/* '\\' */
|
|
|
|
*d++=*s++;
|
|
|
|
bcount++;
|
|
|
|
} else if (*s=='"') {
|
|
|
|
/* '"' */
|
|
|
|
if ((bcount & 1)==0) {
|
2005-02-25 15:07:56 +01:00
|
|
|
/* Preceded by an even number of '\', this is half that
|
2003-07-22 02:59:56 +02:00
|
|
|
* number of '\', plus a quote which we erase.
|
|
|
|
*/
|
|
|
|
d-=bcount/2;
|
|
|
|
in_quotes=!in_quotes;
|
|
|
|
s++;
|
|
|
|
} else {
|
2005-02-25 15:07:56 +01:00
|
|
|
/* Preceded by an odd number of '\', this is half that
|
2003-07-22 02:59:56 +02:00
|
|
|
* number of '\' followed by a '"'
|
|
|
|
*/
|
|
|
|
d=d-bcount/2-1;
|
|
|
|
*d++='"';
|
|
|
|
s++;
|
|
|
|
}
|
|
|
|
bcount=0;
|
|
|
|
} else {
|
|
|
|
/* a regular character */
|
|
|
|
*d++=*s++;
|
|
|
|
bcount=0;
|
2003-08-15 05:51:19 +02:00
|
|
|
}
|
2002-11-15 02:41:20 +01:00
|
|
|
}
|
2003-07-22 02:59:56 +02:00
|
|
|
*d=0;
|
|
|
|
*cmdline=s;
|
|
|
|
|
|
|
|
/* skip the remaining spaces */
|
|
|
|
while (**cmdline=='\t' || **cmdline==' ') {
|
|
|
|
(*cmdline)++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return arg;
|
2002-11-15 02:41:20 +01:00
|
|
|
}
|
|
|
|
|
2010-05-03 21:22:25 +02:00
|
|
|
int WINAPI wWinMain(HINSTANCE instance, HINSTANCE hOldInstance, LPWSTR szCmdLine, int nCmdShow)
|
2002-11-15 02:41:20 +01:00
|
|
|
{
|
2003-07-22 02:59:56 +02:00
|
|
|
HWND hWnd;
|
|
|
|
LPWSTR szDllName,szEntryPoint;
|
2003-12-03 21:29:24 +01:00
|
|
|
void *entry_point;
|
2010-05-03 21:22:17 +02:00
|
|
|
BOOL unicode = FALSE, win16;
|
2003-12-03 21:29:24 +01:00
|
|
|
STARTUPINFOW info;
|
2008-10-30 17:10:34 +01:00
|
|
|
HMODULE hDll;
|
2003-07-22 02:59:56 +02:00
|
|
|
|
|
|
|
hWnd=NULL;
|
|
|
|
hDll=NULL;
|
|
|
|
szDllName=NULL;
|
|
|
|
|
|
|
|
/* Initialize the rundll32 class */
|
2010-05-02 06:08:10 +02:00
|
|
|
register_class();
|
2020-10-07 23:34:33 +02:00
|
|
|
hWnd = CreateWindowW(L"class_rundll32", L"rundll32", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
|
2003-07-22 02:59:56 +02:00
|
|
|
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
/* Get the dll name and API EntryPoint */
|
2010-05-03 21:22:25 +02:00
|
|
|
WINE_TRACE("CmdLine=%s\n",wine_dbgstr_w(szCmdLine));
|
2010-05-02 06:08:10 +02:00
|
|
|
szDllName = get_next_arg(&szCmdLine);
|
2003-07-22 02:59:56 +02:00
|
|
|
if (!szDllName || *szDllName==0)
|
|
|
|
goto CLEANUP;
|
|
|
|
WINE_TRACE("DllName=%s\n",wine_dbgstr_w(szDllName));
|
2019-05-01 10:39:49 +02:00
|
|
|
if ((szEntryPoint = wcschr(szDllName, ',' )))
|
2005-07-14 14:34:04 +02:00
|
|
|
*szEntryPoint++=0;
|
|
|
|
else
|
2010-05-02 06:08:10 +02:00
|
|
|
szEntryPoint = get_next_arg(&szCmdLine);
|
2003-07-22 02:59:56 +02:00
|
|
|
WINE_TRACE("EntryPoint=%s\n",wine_dbgstr_w(szEntryPoint));
|
|
|
|
|
|
|
|
/* Load the library */
|
|
|
|
hDll=LoadLibraryW(szDllName);
|
2003-12-03 21:29:24 +01:00
|
|
|
if (hDll)
|
|
|
|
{
|
|
|
|
win16 = FALSE;
|
|
|
|
entry_point = get_entry_point32( hDll, szEntryPoint, &unicode );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
HINSTANCE16 dll = load_dll16( szDllName );
|
|
|
|
if (dll <= 32)
|
|
|
|
{
|
|
|
|
/* Windows has a MessageBox here... */
|
|
|
|
WINE_ERR("Unable to load %s\n",wine_dbgstr_w(szDllName));
|
|
|
|
goto CLEANUP;
|
|
|
|
}
|
|
|
|
win16 = TRUE;
|
|
|
|
unicode = FALSE;
|
|
|
|
entry_point = get_entry_point16( dll, szEntryPoint );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!entry_point)
|
2002-11-15 02:41:20 +01:00
|
|
|
{
|
2003-07-22 02:59:56 +02:00
|
|
|
/* Windows has a MessageBox here... */
|
2003-12-03 21:29:24 +01:00
|
|
|
WINE_ERR( "Unable to find the entry point %s in %s\n",
|
|
|
|
wine_dbgstr_w(szEntryPoint), wine_dbgstr_w(szDllName) );
|
2003-07-22 02:59:56 +02:00
|
|
|
goto CLEANUP;
|
2002-11-15 02:41:20 +01:00
|
|
|
}
|
|
|
|
|
2003-12-03 21:29:24 +01:00
|
|
|
GetStartupInfoW( &info );
|
|
|
|
if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWDEFAULT;
|
|
|
|
|
|
|
|
if (unicode)
|
2002-11-15 02:41:20 +01:00
|
|
|
{
|
2003-12-03 21:29:24 +01:00
|
|
|
WINE_TRACE( "Calling %s (%p,%p,%s,%d)\n", wine_dbgstr_w(szEntryPoint),
|
|
|
|
hWnd, instance, wine_dbgstr_w(szCmdLine), info.wShowWindow );
|
|
|
|
|
2020-01-21 20:58:47 +01:00
|
|
|
call_entry_point( entry_point, hWnd, instance, szCmdLine, info.wShowWindow );
|
2002-11-15 02:41:20 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-12-03 21:29:24 +01:00
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, szCmdLine, -1, NULL, 0, NULL, NULL );
|
|
|
|
char *cmdline = HeapAlloc( GetProcessHeap(), 0, len );
|
2010-05-03 21:22:17 +02:00
|
|
|
|
|
|
|
if (!cmdline)
|
|
|
|
goto CLEANUP;
|
|
|
|
|
2003-12-03 21:29:24 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, szCmdLine, -1, cmdline, len, NULL, NULL );
|
|
|
|
|
|
|
|
WINE_TRACE( "Calling %s (%p,%p,%s,%d)\n", wine_dbgstr_w(szEntryPoint),
|
|
|
|
hWnd, instance, wine_dbgstr_a(cmdline), info.wShowWindow );
|
|
|
|
|
2004-01-21 03:20:29 +01:00
|
|
|
if (win16)
|
|
|
|
{
|
2020-10-07 23:34:33 +02:00
|
|
|
HMODULE shell = LoadLibraryW( L"shell32.dll" );
|
2004-01-21 03:20:29 +01:00
|
|
|
if (shell) pRunDLL_CallEntry16 = (void *)GetProcAddress( shell, (LPCSTR)122 );
|
|
|
|
if (pRunDLL_CallEntry16)
|
|
|
|
pRunDLL_CallEntry16( entry_point, hWnd, instance, cmdline, info.wShowWindow );
|
|
|
|
}
|
2020-01-21 20:58:47 +01:00
|
|
|
else call_entry_point( entry_point, hWnd, instance, cmdline, info.wShowWindow );
|
|
|
|
|
2003-12-03 21:29:24 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, cmdline );
|
2003-07-22 02:59:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
if (hWnd)
|
|
|
|
DestroyWindow(hWnd);
|
|
|
|
if (hDll)
|
|
|
|
FreeLibrary(hDll);
|
2004-12-23 18:06:43 +01:00
|
|
|
HeapFree(GetProcessHeap(),0,szDllName);
|
2003-07-22 02:59:56 +02:00
|
|
|
return 0; /* rundll32 always returns 0! */
|
2002-11-15 02:41:20 +01:00
|
|
|
}
|