From: Alex Henrie alexhenrie24@gmail.com
--- dlls/shell32/Makefile.in | 2 +- dlls/shell32/dialogs.c | 14 +------------- dlls/shell32/shellord.c | 28 ++-------------------------- 3 files changed, 4 insertions(+), 40 deletions(-)
diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index 9e2395126fc..13af5aa0dfc 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -1,7 +1,7 @@ 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 \ diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 9d35e15c3f4..a2ab99499b5 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -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 ; } } diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 66e5caf08da..ac5864cb682 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -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 = pGetOpenFileNameA(&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 = pGetOpenFileNameW(&ofn); + ret = GetOpenFileNameW(&ofn);
- FreeLibrary(hmodule); return ret; }