Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a1ffd507
Commit
a1ffd507
authored
Dec 01, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Dec 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Don't use GetProcAddress for GetOpenFileName[AW].
parent
a6218a81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
40 deletions
+4
-40
Makefile.in
dlls/shell32/Makefile.in
+1
-1
dialogs.c
dlls/shell32/dialogs.c
+1
-13
shellord.c
dlls/shell32/shellord.c
+2
-26
No files found.
dlls/shell32/Makefile.in
View file @
a1ffd507
MODULE
=
shell32.dll
IMPORTLIB
=
shell32
IMPORTS
=
uuid shlwapi user32 gdi32 advapi32
DELAYIMPORTS
=
ole32 oleaut32 shdocvw version comctl32 gdiplus
DELAYIMPORTS
=
ole32 oleaut32 shdocvw version comctl32
comdlg32
gdiplus
C_SRCS
=
\
appbar.c
\
...
...
dlls/shell32/dialogs.c
View file @
a1ffd507
...
...
@@ -271,8 +271,6 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
case
IDC_RUNDLG_BROWSE
:
{
HMODULE
hComdlg
=
NULL
;
LPFNOFN
ofnProc
=
NULL
;
WCHAR
szFName
[
1024
]
=
{
0
};
WCHAR
filter_exe
[
256
],
filter_all
[
256
],
filter
[
MAX_PATH
],
szCaption
[
MAX_PATH
];
OPENFILENAMEW
ofn
;
...
...
@@ -292,15 +290,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
ofn
.
Flags
=
OFN_ENABLESIZING
|
OFN_FILEMUSTEXIST
|
OFN_HIDEREADONLY
|
OFN_PATHMUSTEXIST
;
ofn
.
lpstrInitialDir
=
prfdp
->
lpstrDirectory
;
if
(
NULL
==
(
hComdlg
=
LoadLibraryExW
(
L"comdlg32.dll"
,
NULL
,
0
))
||
NULL
==
(
ofnProc
=
(
LPFNOFN
)
GetProcAddress
(
hComdlg
,
"GetOpenFileNameW"
)))
{
ERR
(
"Couldn't get GetOpenFileName function entry (lib=%p, proc=%p)
\n
"
,
hComdlg
,
ofnProc
);
ShellMessageBoxW
(
shell32_hInstance
,
hwnd
,
MAKEINTRESOURCEW
(
IDS_RUNDLG_BROWSE_ERROR
),
NULL
,
MB_OK
|
MB_ICONERROR
);
return
TRUE
;
}
if
(
ofnProc
(
&
ofn
))
if
(
GetOpenFileNameW
(
&
ofn
))
{
SetFocus
(
GetDlgItem
(
hwnd
,
IDOK
))
;
SetWindowTextW
(
GetDlgItem
(
hwnd
,
IDC_RUNDLG_EDITPATH
),
szFName
)
;
...
...
@@ -308,8 +298,6 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
SetFocus
(
GetDlgItem
(
hwnd
,
IDOK
))
;
}
FreeLibrary
(
hComdlg
)
;
return
TRUE
;
}
}
...
...
dlls/shell32/shellord.c
View file @
a1ffd507
...
...
@@ -188,8 +188,6 @@ static BOOL GetFileNameFromBrowseA(
LPCSTR
lpstrFilter
,
LPCSTR
lpstrTitle
)
{
HMODULE
hmodule
;
BOOL
(
WINAPI
*
pGetOpenFileNameA
)(
LPOPENFILENAMEA
);
OPENFILENAMEA
ofn
;
BOOL
ret
;
...
...
@@ -197,15 +195,6 @@ static BOOL GetFileNameFromBrowseA(
hwndOwner
,
lpstrFile
,
nMaxFile
,
lpstrInitialDir
,
lpstrDefExt
,
lpstrFilter
,
lpstrTitle
);
hmodule
=
LoadLibraryA
(
"comdlg32.dll"
);
if
(
!
hmodule
)
return
FALSE
;
pGetOpenFileNameA
=
(
void
*
)
GetProcAddress
(
hmodule
,
"GetOpenFileNameA"
);
if
(
!
pGetOpenFileNameA
)
{
FreeLibrary
(
hmodule
);
return
FALSE
;
}
memset
(
&
ofn
,
0
,
sizeof
(
ofn
));
ofn
.
lStructSize
=
sizeof
(
ofn
);
...
...
@@ -217,9 +206,8 @@ static BOOL GetFileNameFromBrowseA(
ofn
.
lpstrTitle
=
lpstrTitle
;
ofn
.
lpstrDefExt
=
lpstrDefExt
;
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_HIDEREADONLY
|
OFN_FILEMUSTEXIST
;
ret
=
p
GetOpenFileNameA
(
&
ofn
);
ret
=
GetOpenFileNameA
(
&
ofn
);
FreeLibrary
(
hmodule
);
return
ret
;
}
...
...
@@ -235,8 +223,6 @@ static BOOL GetFileNameFromBrowseW(
LPCWSTR
lpstrFilter
,
LPCWSTR
lpstrTitle
)
{
HMODULE
hmodule
;
BOOL
(
WINAPI
*
pGetOpenFileNameW
)(
LPOPENFILENAMEW
);
OPENFILENAMEW
ofn
;
BOOL
ret
;
...
...
@@ -244,15 +230,6 @@ static BOOL GetFileNameFromBrowseW(
hwndOwner
,
debugstr_w
(
lpstrFile
),
nMaxFile
,
debugstr_w
(
lpstrInitialDir
),
debugstr_w
(
lpstrDefExt
),
debugstr_w
(
lpstrFilter
),
debugstr_w
(
lpstrTitle
));
hmodule
=
LoadLibraryA
(
"comdlg32.dll"
);
if
(
!
hmodule
)
return
FALSE
;
pGetOpenFileNameW
=
(
void
*
)
GetProcAddress
(
hmodule
,
"GetOpenFileNameW"
);
if
(
!
pGetOpenFileNameW
)
{
FreeLibrary
(
hmodule
);
return
FALSE
;
}
memset
(
&
ofn
,
0
,
sizeof
(
ofn
));
ofn
.
lStructSize
=
sizeof
(
ofn
);
...
...
@@ -264,9 +241,8 @@ static BOOL GetFileNameFromBrowseW(
ofn
.
lpstrTitle
=
lpstrTitle
;
ofn
.
lpstrDefExt
=
lpstrDefExt
;
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_HIDEREADONLY
|
OFN_FILEMUSTEXIST
;
ret
=
p
GetOpenFileNameW
(
&
ofn
);
ret
=
GetOpenFileNameW
(
&
ofn
);
FreeLibrary
(
hmodule
);
return
ret
;
}
...
...
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