Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b8b1a565
Commit
b8b1a565
authored
May 03, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
May 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rundll32: Convert rundll32 to Unicode.
parent
e6bd6d12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
22 deletions
+17
-22
Makefile.in
programs/rundll32/Makefile.in
+2
-1
rundll32.c
programs/rundll32/rundll32.c
+15
-21
No files found.
programs/rundll32/Makefile.in
View file @
b8b1a565
...
...
@@ -3,8 +3,9 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
rundll32.exe
APPMODE
=
-mwindows
APPMODE
=
-mwindows
-municode
IMPORTS
=
user32 kernel32
EXTRADEFS
=
-DWINE_NO_UNICODE_MACROS
C_SRCS
=
\
rundll32.c
...
...
programs/rundll32/rundll32.c
View file @
b8b1a565
...
...
@@ -53,8 +53,10 @@ typedef void (WINAPI *EntryPointA)(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine
* Control_RunDLL needs to have a window. So lets make us a very
* simple window class.
*/
static
const
TCHAR
*
szTitle
=
"rundll32"
;
static
const
TCHAR
*
szWindowClass
=
"class_rundll32"
;
static
const
WCHAR
szTitle
[]
=
{
'r'
,
'u'
,
'n'
,
'd'
,
'l'
,
'l'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
szWindowClass
[]
=
{
'c'
,
'l'
,
'a'
,
's'
,
's'
,
'_'
,
'r'
,
'u'
,
'n'
,
'd'
,
'l'
,
'l'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
kernel32
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
shell32
[]
=
{
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
HINSTANCE16
(
WINAPI
*
pLoadLibrary16
)(
LPCSTR
libname
);
static
FARPROC16
(
WINAPI
*
pGetProcAddress16
)(
HMODULE16
hModule
,
LPCSTR
name
);
...
...
@@ -63,23 +65,23 @@ static void (WINAPI *pRunDLL_CallEntry16)( FARPROC proc, HWND hwnd, HINSTANCE in
static
ATOM
register_class
(
void
)
{
WNDCLASSEX
wcex
;
WNDCLASSEX
W
wcex
;
wcex
.
cbSize
=
sizeof
(
WNDCLASSEX
);
wcex
.
cbSize
=
sizeof
(
WNDCLASSEX
W
);
wcex
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wcex
.
lpfnWndProc
=
DefWindowProc
;
wcex
.
lpfnWndProc
=
DefWindowProc
W
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
NULL
;
wcex
.
hIcon
=
NULL
;
wcex
.
hCursor
=
LoadCursor
(
NULL
,
IDC_ARROW
);
wcex
.
hCursor
=
LoadCursor
W
(
NULL
,
(
LPCWSTR
)
IDC_ARROW
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_WINDOW
+
1
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
szWindowClass
;
wcex
.
hIconSm
=
NULL
;
return
RegisterClassEx
(
&
wcex
);
return
RegisterClassEx
W
(
&
wcex
);
}
static
HINSTANCE16
load_dll16
(
LPCWSTR
dll
)
...
...
@@ -91,7 +93,7 @@ static HINSTANCE16 load_dll16( LPCWSTR dll )
if
(
dllA
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
dll
,
-
1
,
dllA
,
len
,
NULL
,
NULL
);
pLoadLibrary16
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
A
(
"kernel32.dll"
),
(
LPCSTR
)
35
);
pLoadLibrary16
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
W
(
kernel32
),
(
LPCSTR
)
35
);
if
(
pLoadLibrary16
)
ret
=
pLoadLibrary16
(
dllA
);
HeapFree
(
GetProcessHeap
(),
0
,
dllA
);
}
...
...
@@ -107,7 +109,7 @@ static FARPROC16 get_entry_point16( HINSTANCE16 inst, LPCWSTR entry )
if
(
entryA
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
entry
,
-
1
,
entryA
,
len
,
NULL
,
NULL
);
pGetProcAddress16
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
A
(
"kernel32.dll"
),
(
LPCSTR
)
37
);
pGetProcAddress16
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
W
(
kernel32
),
(
LPCSTR
)
37
);
if
(
pGetProcAddress16
)
ret
=
pGetProcAddress16
(
inst
,
entryA
);
HeapFree
(
GetProcessHeap
(),
0
,
entryA
);
}
...
...
@@ -223,10 +225,9 @@ static LPWSTR get_next_arg(LPWSTR *cmdline)
return
arg
;
}
int
WINAPI
WinMain
(
HINSTANCE
instance
,
HINSTANCE
hOldInstance
,
LPSTR
szCmdArgs
,
int
nCmdShow
)
int
WINAPI
wWinMain
(
HINSTANCE
instance
,
HINSTANCE
hOldInstance
,
LPWSTR
szCmdLine
,
int
nCmdShow
)
{
HWND
hWnd
;
LPWSTR
szCmdLine
;
LPWSTR
szDllName
,
szEntryPoint
;
void
*
entry_point
;
BOOL
unicode
=
FALSE
,
win16
;
...
...
@@ -239,19 +240,12 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE hOldInstance, LPSTR szCmdArgs,
/* Initialize the rundll32 class */
register_class
();
hWnd
=
CreateWindow
(
szWindowClass
,
szTitle
,
hWnd
=
CreateWindow
W
(
szWindowClass
,
szTitle
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
CW_USEDEFAULT
,
0
,
CW_USEDEFAULT
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
/* Skip the rundll32.exe path */
szCmdLine
=
GetCommandLineW
();
WINE_TRACE
(
"CmdLine=%s
\n
"
,
wine_dbgstr_w
(
szCmdLine
));
szDllName
=
get_next_arg
(
&
szCmdLine
);
if
(
!
szDllName
||
*
szDllName
==
0
)
goto
CLEANUP
;
HeapFree
(
GetProcessHeap
(),
0
,
szDllName
);
/* Get the dll name and API EntryPoint */
WINE_TRACE
(
"CmdLine=%s
\n
"
,
wine_dbgstr_w
(
szCmdLine
));
szDllName
=
get_next_arg
(
&
szCmdLine
);
if
(
!
szDllName
||
*
szDllName
==
0
)
goto
CLEANUP
;
...
...
@@ -318,7 +312,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE hOldInstance, LPSTR szCmdArgs,
if
(
win16
)
{
HMODULE
shell
=
LoadLibrary
A
(
"shell32.dll"
);
HMODULE
shell
=
LoadLibrary
W
(
shell32
);
if
(
shell
)
pRunDLL_CallEntry16
=
(
void
*
)
GetProcAddress
(
shell
,
(
LPCSTR
)
122
);
if
(
pRunDLL_CallEntry16
)
pRunDLL_CallEntry16
(
entry_point
,
hWnd
,
instance
,
cmdline
,
info
.
wShowWindow
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment