Commit 516b50f3 authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard

- don't link directly to NTDLL; use MultiByteToWideChar() instead of

RtlCreateUnicodeStringFromAsciiz() - directly call InitCommonControlsEx()
parent 703676f5
......@@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shell32.dll
# fixme: avoid ole32.dll import
IMPORTS = ole32 shlwapi comctl32 user32 gdi32 advapi32 kernel32 ntdll
IMPORTS = ole32 shlwapi comctl32 user32 gdi32 advapi32 kernel32
ALTNAMES = shell.dll
EXTRALIBS = $(LIBUUID) $(LIBUNICODE)
......
......@@ -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"
......@@ -1041,18 +1040,24 @@ static HRESULT WINAPI _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile,
*/
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath)
{
LPITEMIDLIST pidl = NULL;
UNICODE_STRING wPath;
LPITEMIDLIST pidl = NULL;
LPWSTR wPath = NULL;
int len;
TRACE("%s\n", debugstr_a(lpszPath));
TRACE("%s\n", debugstr_a(lpszPath));
RtlCreateUnicodeStringFromAsciiz(&wPath, 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);
}
_ILParsePathW(wPath.Buffer, NULL, TRUE, &pidl, NULL);
RtlFreeUnicodeString(&wPath);
_ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
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)
......
......@@ -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"
......@@ -798,14 +797,27 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
*/
BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon )
{
UNICODE_STRING appW, otherW;
BOOL ret;
LPWSTR appW = NULL, otherW = NULL;
int len;
RtlCreateUnicodeStringFromAsciiz( &appW, szApp );
RtlCreateUnicodeStringFromAsciiz( &otherW, szOtherStuff );
ret = ShellAboutW( hWnd, appW.Buffer, otherW.Buffer, hIcon );
RtlFreeUnicodeString( &appW );
RtlFreeUnicodeString( &otherW );
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);
return ret;
}
......@@ -880,10 +892,6 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
* all are once per process
*
*/
void (WINAPI *pDLLInitComctl)(LPVOID);
static HINSTANCE hComctl32;
HINSTANCE shell32_hInstance = 0;
HIMAGELIST ShellSmallIconList = 0;
HIMAGELIST ShellBigIconList = 0;
......@@ -904,27 +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);
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);
}
InitCommonControlsEx(NULL);
SIC_Initialize();
SYSTRAY_Init();
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment