From d276fcc1d3bf9f1b0d024934c90a3641d238e9f4 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Wed, 28 Jan 2004 20:10:01 +0000 Subject: [PATCH] merged back commited WINE patches svn path=/trunk/; revision=7896 --- reactos/lib/shell32/changenotify.c | 2 +- reactos/lib/shell32/pidl.c | 38 ++++++--------- reactos/lib/shell32/shell32_main.c | 75 ++++++++---------------------- reactos/lib/shell32/shell32_main.h | 5 -- 4 files changed, 33 insertions(+), 87 deletions(-) diff --git a/reactos/lib/shell32/changenotify.c b/reactos/lib/shell32/changenotify.c index 78bb2c79ac5..38469877b4a 100644 --- a/reactos/lib/shell32/changenotify.c +++ b/reactos/lib/shell32/changenotify.c @@ -331,7 +331,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID break; case SHCNF_PRINTERA: case SHCNF_PRINTERW: - FIXME("SHChangeNotify with (uFlags & SHCNF_PRINTER)"); + FIXME("SHChangeNotify with (uFlags & SHCNF_PRINTER)\n"); return; case SHCNF_DWORD: default: diff --git a/reactos/lib/shell32/pidl.c b/reactos/lib/shell32/pidl.c index 57eac1ee0ff..4168954c974 100644 --- a/reactos/lib/shell32/pidl.c +++ b/reactos/lib/shell32/pidl.c @@ -39,7 +39,6 @@ #include "shlguid.h" #include "winerror.h" #include "winnls.h" -#include "winternl.h" #include "undocshell.h" #include "shell32_main.h" #include "shellapi.h" @@ -124,7 +123,7 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa flag = SHGDN_INFOLDER; break; default: - FIXME("Unknown type parameter = %lx", type); + FIXME("Unknown type parameter = %lx\n", type); flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR; break; } @@ -1040,35 +1039,24 @@ static HRESULT WINAPI _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, */ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath) { - LPITEMIDLIST pidl = NULL; - -#if 0 /* don't link directly to ntdll */ - UNICODE_STRING wPath; - - RtlCreateUnicodeStringFromAsciiz(&wPath, lpszPath); - _ILParsePathW(wPath.Buffer, NULL, TRUE, &pidl, NULL); - RtlFreeUnicodeString(&wPath); -#else - LPWSTR wPath; + LPITEMIDLIST pidl = NULL; + LPWSTR wPath = NULL; int len; - TRACE("%s\n", debugstr_a(lpszPath)); + TRACE("%s\n", debugstr_a(lpszPath)); - if (lpszPath) { - len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0); - wPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len); - } else - wPath = NULL; + if (lpszPath) + { + len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0); + wPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len); + } _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL); - if (wPath) - HeapFree(GetProcessHeap(), 0, wPath); -#endif - - TRACE("%s %p\n", debugstr_a(lpszPath), pidl); - return pidl; + if (wPath) HeapFree(GetProcessHeap(), 0, wPath); + TRACE("%s %p\n", debugstr_a(lpszPath), pidl); + return pidl; } LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath) diff --git a/reactos/lib/shell32/shell32_main.c b/reactos/lib/shell32/shell32_main.c index ab66f87e047..7afba34621a 100644 --- a/reactos/lib/shell32/shell32_main.c +++ b/reactos/lib/shell32/shell32_main.c @@ -30,7 +30,6 @@ #include "winbase.h" #include "winerror.h" #include "winreg.h" -#include "winternl.h" #include "dlgs.h" #include "shellapi.h" #include "winuser.h" @@ -799,42 +798,26 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon ) { BOOL ret; - -#if 0 /* don't link directly to ntdll */ - UNICODE_STRING appW, otherW; - - RtlCreateUnicodeStringFromAsciiz( &appW, szApp ); - RtlCreateUnicodeStringFromAsciiz( &otherW, szOtherStuff ); - ret = ShellAboutW( hWnd, appW.Buffer, otherW.Buffer, hIcon ); - RtlFreeUnicodeString( &appW ); - RtlFreeUnicodeString( &otherW ); -#else - LPWSTR appW, otherW; + LPWSTR appW = NULL, otherW = NULL; int len; - if (szApp) { - len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0); - appW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len); - } else - appW = NULL; - - if (szOtherStuff) { - len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0); - otherW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len); - } else - otherW = NULL; + if (szApp) + { + len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0); + appW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len); + } + if (szOtherStuff) + { + len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0); + otherW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len); + } ret = ShellAboutW(hWnd, appW, otherW, hIcon); - if (otherW) - HeapFree(GetProcessHeap(), 0, otherW); - - if (appW) - HeapFree(GetProcessHeap(), 0, appW); -#endif - + if (otherW) HeapFree(GetProcessHeap(), 0, otherW); + if (appW) HeapFree(GetProcessHeap(), 0, appW); return ret; } @@ -909,8 +892,6 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi) * all are once per process * */ -void (WINAPI *pDLLInitComctl)(LPVOID); - HINSTANCE shell32_hInstance = 0; HIMAGELIST ShellSmallIconList = 0; HIMAGELIST ShellBigIconList = 0; @@ -931,31 +912,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { case DLL_PROCESS_ATTACH: shell32_hInstance = hinstDLL; - - /* get full path to this DLL for IExtractIconW_fnGetIconLocation() */ - GetModuleFileNameW(hinstDLL, swShell32Name, MAX_PATH); - WideCharToMultiByte(CP_ACP, 0, swShell32Name, -1, sShell32Name, MAX_PATH, NULL, NULL); - -#if 0 /* why not directly link to InitCommonControlsEx()? */ - hComctl32 = GetModuleHandleA("COMCTL32.DLL"); DisableThreadLibraryCalls(shell32_hInstance); - if (!hComctl32) - { - ERR("P A N I C SHELL32 loading failed\n"); - return FALSE; - } + /* get full path to this DLL for IExtractIconW_fnGetIconLocation() */ + GetModuleFileNameW(hinstDLL, swShell32Name, MAX_PATH); + WideCharToMultiByte(CP_ACP, 0, swShell32Name, -1, sShell32Name, MAX_PATH, NULL, NULL); - /* comctl32 */ - pDLLInitComctl = (void*)GetProcAddress(hComctl32,"InitCommonControlsEx"); - /* initialize the common controls */ - if (pDLLInitComctl) - { - pDLLInitComctl(NULL); - } -#else - InitCommonControlsEx(NULL); -#endif + InitCommonControlsEx(NULL); SIC_Initialize(); SYSTRAY_Init(); diff --git a/reactos/lib/shell32/shell32_main.h b/reactos/lib/shell32/shell32_main.h index 446646a5a1f..6709f0b3fd9 100644 --- a/reactos/lib/shell32/shell32_main.h +++ b/reactos/lib/shell32/shell32_main.h @@ -46,11 +46,6 @@ extern HIMAGELIST ShellSmallIconList; extern HIMAGELIST ShellBigIconList; extern HDPA sic_hdpa; -/******************************************* -* pointer to functions dynamically loaded -*/ -extern void (WINAPI *pDLLInitComctl)(LPVOID); - BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList); /* Iconcache */