From cc7042f9ec57d9d123a3eb1ab4e6e9d213994f27 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 16 Aug 2002 01:43:11 +0000 Subject: [PATCH] Implement comctl32.417 and shlwapi.299. This avoids crash in IE's History. --- dlls/comctl32/comctl32.spec | 2 +- dlls/comctl32/comctl32undoc.c | 12 +++++++++++- dlls/shlwapi/ordinal.c | 14 ++++++++++++++ dlls/shlwapi/shlwapi.spec | 2 +- dlls/shlwapi/shlwapi_main.c | 1 + 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index a8cd4fcea74..3ab0d291b45 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -110,7 +110,7 @@ init COMCTL32_LibMain 414 stub @ 415 stdcall @(long long long long long) COMCTL32_415 416 stub @ -417 stub @ +417 stdcall @(long long long long ptr wstr long ptr) COMCTL32_417 418 stub @ 419 stdcall @(long long long long) COMCTL32_419 420 stub @ diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index 2b97f91b36d..0611fa8a043 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c @@ -1845,7 +1845,7 @@ DPA_GetPtrIndex (const HDPA hdpa, LPVOID p) { INT i; - if (!hdpa->ptrs) + if (!hdpa || !hdpa->ptrs) return -1; for (i = 0; i < hdpa->nItemCount; i++) { @@ -2811,6 +2811,16 @@ BOOL WINAPI COMCTL32_415( HWND hwnd, DWORD b, DWORD c, DWORD d, DWORD e) return TRUE; } +/************************************************************************** + * @ [COMCTL32.417] + * + */ +BOOL WINAPI COMCTL32_417(HDC hdc, INT x, INT y, UINT flags, const RECT *lprect, + LPCWSTR str, UINT count, const INT *lpDx) +{ + return ExtTextOutW(hdc, x, y, flags, lprect, str, count, lpDx); +} + /************************************************************************** * @ [COMCTL32.419] * diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 2398e1c6a18..a39eaf9aadc 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -47,6 +47,7 @@ extern HINSTANCE shlwapi_hInstance; extern HMODULE SHLWAPI_hshell32; extern HMODULE SHLWAPI_hwinmm; extern HMODULE SHLWAPI_hcomdlg32; +extern HMODULE SHLWAPI_hcomctl32; extern HMODULE SHLWAPI_hmpr; extern HMODULE SHLWAPI_hmlang; extern HMODULE SHLWAPI_hversion; @@ -136,6 +137,7 @@ static BOOL (WINAPI *pGetOpenFileNameW)(LPOPENFILENAMEW); static DWORD (WINAPI *pGetFileVersionInfoSizeW)(LPCWSTR,LPDWORD); static BOOL (WINAPI *pGetFileVersionInfoW)(LPCWSTR,DWORD,DWORD,LPVOID); static WORD (WINAPI *pVerQueryValueW)(LPVOID,LPCWSTR,LPVOID*,UINT*); +static BOOL (WINAPI *pCOMCTL32_417)(HDC,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*); /* NOTES: Most functions exported by ordinal seem to be superflous. @@ -1823,6 +1825,18 @@ BOOL WINAPI SHLWAPI_295(LPWSTR str1, LPVOID x, LPWSTR str2, LPWSTR str3) return TRUE; } +/************************************************************************* + * @ [SHLWAPI.299] + * + * Late bound call to comctl32.417 + */ +BOOL WINAPI SHLWAPI_299(HDC hdc, INT x, INT y, UINT flags, const RECT *lprect, + LPCWSTR str, UINT count, const INT *lpDx) +{ + GET_FUNC(pCOMCTL32_417, comctl32, (LPCSTR)417, FALSE); + return pCOMCTL32_417(hdc, x, y, flags, lprect, str, count, lpDx); +} + /************************************************************************* * @ [SHLWAPI.313] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 5091c76f13f..85d2faada04 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -298,7 +298,7 @@ init SHLWAPI_LibMain 296 stub @ 297 stub @ 298 forward @ kernel32.WritePrivateProfileStringW -299 stub @ +299 stdcall @(long long long long ptr wstr long ptr) SHLWAPI_299 300 forward @ gdi32.CreateFontW 301 forward @ user32.DrawTextExW 302 forward @ user32.GetMenuItemInfoW diff --git a/dlls/shlwapi/shlwapi_main.c b/dlls/shlwapi/shlwapi_main.c index 1ce77a19973..c54fced233a 100644 --- a/dlls/shlwapi/shlwapi_main.c +++ b/dlls/shlwapi/shlwapi_main.c @@ -32,6 +32,7 @@ HINSTANCE shlwapi_hInstance = 0; HMODULE SHLWAPI_hshell32 = 0; HMODULE SHLWAPI_hwinmm = 0; HMODULE SHLWAPI_hcomdlg32 = 0; +HMODULE SHLWAPI_hcomctl32 = 0; HMODULE SHLWAPI_hmpr = 0; HMODULE SHLWAPI_hmlang = 0; HMODULE SHLWAPI_hversion = 0;