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
3defd321
Commit
3defd321
authored
Jan 21, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't link directly to 16-bit APIs for portability reasons (based on a
patch by Steven Edwards).
parent
15a4fef9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
Makefile.in
programs/rundll32/Makefile.in
+1
-1
rundll32.c
programs/rundll32/rundll32.c
+18
-8
No files found.
programs/rundll32/Makefile.in
View file @
3defd321
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
rundll32.exe
MODULE
=
rundll32.exe
APPMODE
=
cui
APPMODE
=
cui
IMPORTS
=
shell32
user32 kernel32
IMPORTS
=
user32 kernel32
C_SRCS
=
\
C_SRCS
=
\
rundll32.c
rundll32.c
...
...
programs/rundll32/rundll32.c
View file @
3defd321
...
@@ -43,9 +43,6 @@
...
@@ -43,9 +43,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
rundll32
);
WINE_DEFAULT_DEBUG_CHANNEL
(
rundll32
);
extern
void
WINAPI
RunDLL_CallEntry16
(
FARPROC
proc
,
HWND
hwnd
,
HINSTANCE
inst
,
LPCSTR
cmdline
,
INT
cmdshow
);
/*
/*
* Control_RunDLL has these parameters
* Control_RunDLL has these parameters
*/
*/
...
@@ -59,6 +56,11 @@ typedef void (WINAPI *EntryPointA)(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine
...
@@ -59,6 +56,11 @@ typedef void (WINAPI *EntryPointA)(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine
static
TCHAR
*
szTitle
=
"rundll32"
;
static
TCHAR
*
szTitle
=
"rundll32"
;
static
TCHAR
*
szWindowClass
=
"class_rundll32"
;
static
TCHAR
*
szWindowClass
=
"class_rundll32"
;
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
);
static
ATOM
MyRegisterClass
(
HINSTANCE
hInstance
)
static
ATOM
MyRegisterClass
(
HINSTANCE
hInstance
)
{
{
WNDCLASSEX
wcex
;
WNDCLASSEX
wcex
;
...
@@ -82,22 +84,24 @@ static ATOM MyRegisterClass(HINSTANCE hInstance)
...
@@ -82,22 +84,24 @@ static ATOM MyRegisterClass(HINSTANCE hInstance)
static
HINSTANCE16
load_dll16
(
LPCWSTR
dll
)
static
HINSTANCE16
load_dll16
(
LPCWSTR
dll
)
{
{
HINSTANCE16
ret
;
HINSTANCE16
ret
=
0
;
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
dll
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
dll
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
char
*
dllA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
char
*
dllA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
dll
,
-
1
,
dllA
,
len
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
dll
,
-
1
,
dllA
,
len
,
NULL
,
NULL
);
ret
=
LoadLibrary16
(
dllA
);
pLoadLibrary16
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"LoadLibrary16"
);
if
(
pLoadLibrary16
)
ret
=
pLoadLibrary16
(
dllA
);
HeapFree
(
GetProcessHeap
(),
0
,
dllA
);
HeapFree
(
GetProcessHeap
(),
0
,
dllA
);
return
ret
;
return
ret
;
}
}
static
FARPROC16
get_entry_point16
(
HINSTANCE16
inst
,
LPCWSTR
entry
)
static
FARPROC16
get_entry_point16
(
HINSTANCE16
inst
,
LPCWSTR
entry
)
{
{
FARPROC16
ret
;
FARPROC16
ret
=
0
;
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
entry
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
entry
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
char
*
entryA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
char
*
entryA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
entry
,
-
1
,
entryA
,
len
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
entry
,
-
1
,
entryA
,
len
,
NULL
,
NULL
);
ret
=
GetProcAddress16
(
inst
,
entryA
);
pGetProcAddress16
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"GetProcAddress16"
);
if
(
pGetProcAddress16
)
ret
=
pGetProcAddress16
(
inst
,
entryA
);
HeapFree
(
GetProcessHeap
(),
0
,
entryA
);
HeapFree
(
GetProcessHeap
(),
0
,
entryA
);
return
ret
;
return
ret
;
}
}
...
@@ -295,7 +299,13 @@ int main(int argc, char* argv[])
...
@@ -295,7 +299,13 @@ int main(int argc, char* argv[])
WINE_TRACE
(
"Calling %s (%p,%p,%s,%d)
\n
"
,
wine_dbgstr_w
(
szEntryPoint
),
WINE_TRACE
(
"Calling %s (%p,%p,%s,%d)
\n
"
,
wine_dbgstr_w
(
szEntryPoint
),
hWnd
,
instance
,
wine_dbgstr_a
(
cmdline
),
info
.
wShowWindow
);
hWnd
,
instance
,
wine_dbgstr_a
(
cmdline
),
info
.
wShowWindow
);
if
(
win16
)
RunDLL_CallEntry16
(
entry_point
,
hWnd
,
instance
,
cmdline
,
info
.
wShowWindow
);
if
(
win16
)
{
HMODULE
shell
=
LoadLibraryA
(
"shell32.dll"
);
if
(
shell
)
pRunDLL_CallEntry16
=
(
void
*
)
GetProcAddress
(
shell
,
(
LPCSTR
)
122
);
if
(
pRunDLL_CallEntry16
)
pRunDLL_CallEntry16
(
entry_point
,
hWnd
,
instance
,
cmdline
,
info
.
wShowWindow
);
}
else
else
{
{
EntryPointA
pEntryPointA
=
entry_point
;
EntryPointA
pEntryPointA
=
entry_point
;
...
...
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