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
1cba8c3f
Commit
1cba8c3f
authored
Oct 07, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rundll32: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e5b3b4aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
rundll32.c
programs/rundll32/rundll32.c
+8
-15
No files found.
programs/rundll32/rundll32.c
View file @
1cba8c3f
...
...
@@ -83,20 +83,14 @@ static void call_entry_point( void *func, HWND hwnd, HINSTANCE inst, void *cmdli
}
#endif
/*
* Control_RunDLL needs to have a window. So lets make us a very
* simple window class.
*/
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
);
static
void
(
WINAPI
*
pRunDLL_CallEntry16
)(
FARPROC
proc
,
HWND
hwnd
,
HINSTANCE
inst
,
LPCSTR
cmdline
,
INT
cmdshow
);
/*
* Control_RunDLL needs to have a window. So lets make us a very simple window class.
*/
static
ATOM
register_class
(
void
)
{
WNDCLASSEXW
wcex
;
...
...
@@ -112,7 +106,7 @@ static ATOM register_class(void)
wcex
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPCWSTR
)
IDC_ARROW
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_WINDOW
+
1
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
szWindowClass
;
wcex
.
lpszClassName
=
L"class_rundll32"
;
wcex
.
hIconSm
=
NULL
;
return
RegisterClassExW
(
&
wcex
);
...
...
@@ -127,7 +121,7 @@ static HINSTANCE16 load_dll16( LPCWSTR dll )
if
(
dllA
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
dll
,
-
1
,
dllA
,
len
,
NULL
,
NULL
);
pLoadLibrary16
=
(
void
*
)
GetProcAddress
(
GetModuleHandleW
(
kernel32
),
(
LPCSTR
)
35
);
pLoadLibrary16
=
(
void
*
)
GetProcAddress
(
GetModuleHandleW
(
L"kernel32.dll"
),
(
LPCSTR
)
35
);
if
(
pLoadLibrary16
)
ret
=
pLoadLibrary16
(
dllA
);
HeapFree
(
GetProcessHeap
(),
0
,
dllA
);
}
...
...
@@ -143,7 +137,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
(
GetModuleHandleW
(
kernel32
),
(
LPCSTR
)
37
);
pGetProcAddress16
=
(
void
*
)
GetProcAddress
(
GetModuleHandleW
(
L"kernel32.dll"
),
(
LPCSTR
)
37
);
if
(
pGetProcAddress16
)
ret
=
pGetProcAddress16
(
inst
,
entryA
);
HeapFree
(
GetProcessHeap
(),
0
,
entryA
);
}
...
...
@@ -289,8 +283,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE hOldInstance, LPWSTR szCmdLine
/* Initialize the rundll32 class */
register_class
();
hWnd
=
CreateWindowW
(
szWindowClass
,
szTitle
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
hWnd
=
CreateWindowW
(
L"class_rundll32"
,
L"rundll32"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
CW_USEDEFAULT
,
0
,
CW_USEDEFAULT
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
/* Get the dll name and API EntryPoint */
...
...
@@ -359,7 +352,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE hOldInstance, LPWSTR szCmdLine
if
(
win16
)
{
HMODULE
shell
=
LoadLibraryW
(
shell32
);
HMODULE
shell
=
LoadLibraryW
(
L"shell32.dll"
);
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