|
|
|
@ -33,99 +33,30 @@
|
|
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
|
#include "winbase.h"
|
|
|
|
|
#include "winuser.h"
|
|
|
|
|
#include "winnls.h"
|
|
|
|
|
#include "objbase.h"
|
|
|
|
|
#include "docobj.h"
|
|
|
|
|
#include "exdisp.h"
|
|
|
|
|
#include "shlguid.h"
|
|
|
|
|
#include "winreg.h"
|
|
|
|
|
#include "wingdi.h"
|
|
|
|
|
#include "winuser.h"
|
|
|
|
|
#include "winver.h"
|
|
|
|
|
#include "winnetwk.h"
|
|
|
|
|
#include "mmsystem.h"
|
|
|
|
|
#include "objbase.h"
|
|
|
|
|
#include "exdisp.h"
|
|
|
|
|
#include "shlobj.h"
|
|
|
|
|
#include "shlwapi.h"
|
|
|
|
|
#include "shellapi.h"
|
|
|
|
|
#include "commdlg.h"
|
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
#include "winreg.h"
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
#include "shlwapi.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
|
|
|
|
|
|
|
|
|
/* Get a function pointer from a DLL handle */
|
|
|
|
|
#define GET_FUNC(func, module, name, fail) \
|
|
|
|
|
do { \
|
|
|
|
|
if (!func) { \
|
|
|
|
|
if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \
|
|
|
|
|
func = (fn##func)GetProcAddress(SHLWAPI_h##module, name); \
|
|
|
|
|
if (!func) return fail; \
|
|
|
|
|
} \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/* DLL handles for late bound calls */
|
|
|
|
|
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_hurlmon;
|
|
|
|
|
extern HMODULE SHLWAPI_hversion;
|
|
|
|
|
|
|
|
|
|
extern DWORD SHLWAPI_ThreadRef_index;
|
|
|
|
|
|
|
|
|
|
/* Function pointers for GET_FUNC macro; these need to be global because of gcc bug */
|
|
|
|
|
typedef LPITEMIDLIST (WINAPI *fnpSHBrowseForFolderW)(LPBROWSEINFOW);
|
|
|
|
|
static fnpSHBrowseForFolderW pSHBrowseForFolderW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpPlaySoundW)(LPCWSTR, HMODULE, DWORD);
|
|
|
|
|
static fnpPlaySoundW pPlaySoundW;
|
|
|
|
|
typedef DWORD (WINAPI *fnpSHGetFileInfoW)(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT);
|
|
|
|
|
static fnpSHGetFileInfoW pSHGetFileInfoW;
|
|
|
|
|
typedef UINT (WINAPI *fnpDragQueryFileW)(HDROP, UINT, LPWSTR, UINT);
|
|
|
|
|
static fnpDragQueryFileW pDragQueryFileW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpSHGetPathFromIDListW)(LPCITEMIDLIST, LPWSTR);
|
|
|
|
|
static fnpSHGetPathFromIDListW pSHGetPathFromIDListW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpShellExecuteExW)(LPSHELLEXECUTEINFOW);
|
|
|
|
|
static fnpShellExecuteExW pShellExecuteExW;
|
|
|
|
|
typedef HICON (WINAPI *fnpSHFileOperationW)(LPSHFILEOPSTRUCTW);
|
|
|
|
|
static fnpSHFileOperationW pSHFileOperationW;
|
|
|
|
|
typedef UINT (WINAPI *fnpExtractIconExW)(LPCWSTR, INT,HICON *,HICON *, UINT);
|
|
|
|
|
static fnpExtractIconExW pExtractIconExW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpSHGetNewLinkInfoW)(LPCWSTR, LPCWSTR, LPCWSTR, BOOL*, UINT);
|
|
|
|
|
static fnpSHGetNewLinkInfoW pSHGetNewLinkInfoW;
|
|
|
|
|
typedef HRESULT (WINAPI *fnpSHDefExtractIconW)(LPCWSTR, int, UINT, HICON*, HICON*, UINT);
|
|
|
|
|
static fnpSHDefExtractIconW pSHDefExtractIconW;
|
|
|
|
|
typedef HICON (WINAPI *fnpExtractIconW)(HINSTANCE, LPCWSTR, UINT);
|
|
|
|
|
static fnpExtractIconW pExtractIconW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpGetSaveFileNameW)(LPOPENFILENAMEW);
|
|
|
|
|
static fnpGetSaveFileNameW pGetSaveFileNameW;
|
|
|
|
|
typedef DWORD (WINAPI *fnpWNetRestoreConnectionW)(HWND, LPWSTR);
|
|
|
|
|
static fnpWNetRestoreConnectionW pWNetRestoreConnectionW;
|
|
|
|
|
typedef DWORD (WINAPI *fnpWNetGetLastErrorW)(LPDWORD, LPWSTR, DWORD, LPWSTR, DWORD);
|
|
|
|
|
static fnpWNetGetLastErrorW pWNetGetLastErrorW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpPageSetupDlgW)(LPPAGESETUPDLGW);
|
|
|
|
|
static fnpPageSetupDlgW pPageSetupDlgW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpPrintDlgW)(LPPRINTDLGW);
|
|
|
|
|
static fnpPrintDlgW pPrintDlgW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpGetOpenFileNameW)(LPOPENFILENAMEW);
|
|
|
|
|
static fnpGetOpenFileNameW pGetOpenFileNameW;
|
|
|
|
|
typedef DWORD (WINAPI *fnpGetFileVersionInfoSizeW)(LPCWSTR,LPDWORD);
|
|
|
|
|
static fnpGetFileVersionInfoSizeW pGetFileVersionInfoSizeW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpGetFileVersionInfoW)(LPCWSTR,DWORD,DWORD,LPVOID);
|
|
|
|
|
static fnpGetFileVersionInfoW pGetFileVersionInfoW;
|
|
|
|
|
typedef WORD (WINAPI *fnpVerQueryValueW)(LPVOID,LPCWSTR,LPVOID*,UINT*);
|
|
|
|
|
static fnpVerQueryValueW pVerQueryValueW;
|
|
|
|
|
typedef BOOL (WINAPI *fnpCOMCTL32_417)(HDC,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
|
|
|
|
|
static fnpCOMCTL32_417 pCOMCTL32_417;
|
|
|
|
|
typedef HRESULT (WINAPI *fnpDllGetVersion)(DLLVERSIONINFO*);
|
|
|
|
|
static fnpDllGetVersion pDllGetVersion;
|
|
|
|
|
typedef HRESULT (WINAPI *fnpCreateFormatEnumerator)(UINT,FORMATETC*,IEnumFORMATETC**);
|
|
|
|
|
static fnpCreateFormatEnumerator pCreateFormatEnumerator;
|
|
|
|
|
typedef HRESULT (WINAPI *fnpRegisterFormatEnumerator)(LPBC,IEnumFORMATETC*,DWORD);
|
|
|
|
|
static fnpRegisterFormatEnumerator pRegisterFormatEnumerator;
|
|
|
|
|
|
|
|
|
|
HRESULT WINAPI IUnknown_QueryService(IUnknown*,REFGUID,REFIID,LPVOID*);
|
|
|
|
|
HRESULT WINAPI SHInvokeCommand(HWND,IShellFolder*,LPCITEMIDLIST,BOOL);
|
|
|
|
|
HRESULT WINAPI CLSIDFromStringWrap(LPCWSTR,CLSID*);
|
|
|
|
|
BOOL WINAPI SHAboutInfoW(LPWSTR,DWORD);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -460,8 +391,7 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown)
|
|
|
|
|
format->tymed = -1;
|
|
|
|
|
|
|
|
|
|
/* Create a clipboard enumerator */
|
|
|
|
|
GET_FUNC(pCreateFormatEnumerator, urlmon, "CreateFormatEnumerator", E_FAIL);
|
|
|
|
|
hRet = pCreateFormatEnumerator(dwNumValues, formatList, &pIEnumFormatEtc);
|
|
|
|
|
hRet = CreateFormatEnumerator(dwNumValues, formatList, &pIEnumFormatEtc);
|
|
|
|
|
|
|
|
|
|
if (FAILED(hRet) || !pIEnumFormatEtc)
|
|
|
|
|
return hRet;
|
|
|
|
@ -496,8 +426,7 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown)
|
|
|
|
|
hRet = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone);
|
|
|
|
|
if (!hRet && pClone)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pRegisterFormatEnumerator, urlmon, "RegisterFormatEnumerator", E_FAIL);
|
|
|
|
|
pRegisterFormatEnumerator(lpBC, pClone, 0);
|
|
|
|
|
RegisterFormatEnumerator(lpBC, pClone, 0);
|
|
|
|
|
|
|
|
|
|
IEnumFORMATETC_Release(pClone);
|
|
|
|
|
}
|
|
|
|
@ -823,32 +752,6 @@ BOOL WINAPI AppendMenuWrapW(HMENU hMenu, UINT flags, UINT id, LPCWSTR str)
|
|
|
|
|
return InsertMenuW(hMenu, -1, flags | MF_BITMAP, id, str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
* @ [SHLWAPI.74]
|
|
|
|
|
*
|
|
|
|
|
* Get the text from a given dialog item.
|
|
|
|
|
*
|
|
|
|
|
* PARAMS
|
|
|
|
|
* hWnd [I] Handle of dialog
|
|
|
|
|
* nItem [I] Index of item
|
|
|
|
|
* lpsDest [O] Buffer for receiving window text
|
|
|
|
|
* nDestLen [I] Length of buffer.
|
|
|
|
|
*
|
|
|
|
|
* RETURNS
|
|
|
|
|
* Success: The length of the returned text.
|
|
|
|
|
* Failure: 0.
|
|
|
|
|
*/
|
|
|
|
|
INT WINAPI GetDlgItemTextWrapW(HWND hWnd, INT nItem, LPWSTR lpsDest,INT nDestLen)
|
|
|
|
|
{
|
|
|
|
|
HWND hItem = GetDlgItem(hWnd, nItem);
|
|
|
|
|
|
|
|
|
|
if (hItem)
|
|
|
|
|
return GetWindowTextW(hItem, lpsDest, nDestLen);
|
|
|
|
|
if (nDestLen)
|
|
|
|
|
*lpsDest = (WCHAR)'\0';
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
* @ [SHLWAPI.138]
|
|
|
|
|
*
|
|
|
|
@ -2784,7 +2687,7 @@ BOOL WINAPI GUIDFromStringA(LPCSTR idstr, CLSID *id)
|
|
|
|
|
{
|
|
|
|
|
WCHAR wClsid[40];
|
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, idstr, -1, wClsid, sizeof(wClsid)/sizeof(WCHAR));
|
|
|
|
|
return SUCCEEDED(CLSIDFromStringWrap(wClsid, id));
|
|
|
|
|
return SUCCEEDED(CLSIDFromString(wClsid, id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -2794,7 +2697,7 @@ BOOL WINAPI GUIDFromStringA(LPCSTR idstr, CLSID *id)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI GUIDFromStringW(LPCWSTR idstr, CLSID *id)
|
|
|
|
|
{
|
|
|
|
|
return SUCCEEDED(CLSIDFromStringWrap(idstr, id));
|
|
|
|
|
return SUCCEEDED(CLSIDFromString((LPOLESTR)idstr, id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -2821,13 +2724,21 @@ DWORD WINAPI WhichPlatform(void)
|
|
|
|
|
static DWORD dwState = 0;
|
|
|
|
|
HKEY hKey;
|
|
|
|
|
DWORD dwRet, dwData, dwSize;
|
|
|
|
|
HMODULE hshell32;
|
|
|
|
|
|
|
|
|
|
if (dwState)
|
|
|
|
|
return dwState;
|
|
|
|
|
|
|
|
|
|
/* If shell32 exports DllGetVersion(), the browser is integrated */
|
|
|
|
|
GET_FUNC(pDllGetVersion, shell32, "DllGetVersion", 1);
|
|
|
|
|
dwState = pDllGetVersion ? 2 : 1;
|
|
|
|
|
dwState = 1;
|
|
|
|
|
hshell32 = LoadLibraryA("shell32.dll");
|
|
|
|
|
if (hshell32)
|
|
|
|
|
{
|
|
|
|
|
FARPROC pDllGetVersion;
|
|
|
|
|
pDllGetVersion = GetProcAddress(hshell32, "DllGetVersion");
|
|
|
|
|
dwState = pDllGetVersion ? 2 : 1;
|
|
|
|
|
FreeLibrary(hshell32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set or delete the key accordingly */
|
|
|
|
|
dwRet = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
|
|
|
@ -3050,8 +2961,7 @@ HRESULT WINAPI IUnknown_CPContainerOnChanged(IUnknown *lpUnknown, DISPID dispID)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI PlaySoundWrapW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pPlaySoundW, winmm, "PlaySoundW", FALSE);
|
|
|
|
|
return pPlaySoundW(pszSound, hmod, fdwSound);
|
|
|
|
|
return PlaySoundW(pszSound, hmod, fdwSound);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3095,18 +3005,6 @@ BOOL WINAPI SHSetIniStringW(LPWSTR str1, LPVOID x, LPWSTR str2, LPWSTR str3)
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
* @ [SHLWAPI.299]
|
|
|
|
|
*
|
|
|
|
|
* See COMCTL32_417.
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI ExtTextOutWrapW(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]
|
|
|
|
|
*
|
|
|
|
@ -3115,8 +3013,7 @@ BOOL WINAPI ExtTextOutWrapW(HDC hdc, INT x, INT y, UINT flags, const RECT *lprec
|
|
|
|
|
DWORD WINAPI SHGetFileInfoWrapW(LPCWSTR path, DWORD dwFileAttributes,
|
|
|
|
|
SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pSHGetFileInfoW, shell32, "SHGetFileInfoW", 0);
|
|
|
|
|
return pSHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags);
|
|
|
|
|
return SHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3126,8 +3023,7 @@ DWORD WINAPI SHGetFileInfoWrapW(LPCWSTR path, DWORD dwFileAttributes,
|
|
|
|
|
*/
|
|
|
|
|
UINT WINAPI DragQueryFileWrapW(HDROP hDrop, UINT lFile, LPWSTR lpszFile, UINT lLength)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pDragQueryFileW, shell32, "DragQueryFileW", 0);
|
|
|
|
|
return pDragQueryFileW(hDrop, lFile, lpszFile, lLength);
|
|
|
|
|
return DragQueryFileW(hDrop, lFile, lpszFile, lLength);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3137,8 +3033,7 @@ UINT WINAPI DragQueryFileWrapW(HDROP hDrop, UINT lFile, LPWSTR lpszFile, UINT lL
|
|
|
|
|
*/
|
|
|
|
|
LPITEMIDLIST WINAPI SHBrowseForFolderWrapW(LPBROWSEINFOW lpBi)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pSHBrowseForFolderW, shell32, "SHBrowseForFolderW", NULL);
|
|
|
|
|
return pSHBrowseForFolderW(lpBi);
|
|
|
|
|
return SHBrowseForFolderW(lpBi);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3148,8 +3043,7 @@ LPITEMIDLIST WINAPI SHBrowseForFolderWrapW(LPBROWSEINFOW lpBi)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl,LPWSTR pszPath)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pSHGetPathFromIDListW, shell32, "SHGetPathFromIDListW", 0);
|
|
|
|
|
return pSHGetPathFromIDListW(pidl, pszPath);
|
|
|
|
|
return SHGetPathFromIDListW(pidl, pszPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3159,8 +3053,7 @@ BOOL WINAPI SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl,LPWSTR pszPath)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI ShellExecuteExWrapW(LPSHELLEXECUTEINFOW lpExecInfo)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pShellExecuteExW, shell32, "ShellExecuteExW", FALSE);
|
|
|
|
|
return pShellExecuteExW(lpExecInfo);
|
|
|
|
|
return ShellExecuteExW(lpExecInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3168,31 +3061,18 @@ BOOL WINAPI ShellExecuteExWrapW(LPSHELLEXECUTEINFOW lpExecInfo)
|
|
|
|
|
*
|
|
|
|
|
* See SHFileOperationW.
|
|
|
|
|
*/
|
|
|
|
|
HICON WINAPI SHFileOperationWrapW(LPSHFILEOPSTRUCTW lpFileOp)
|
|
|
|
|
INT WINAPI SHFileOperationWrapW(LPSHFILEOPSTRUCTW lpFileOp)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pSHFileOperationW, shell32, "SHFileOperationW", 0);
|
|
|
|
|
return pSHFileOperationW(lpFileOp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
* @ [SHLWAPI.337]
|
|
|
|
|
*
|
|
|
|
|
* See ExtractIconExW.
|
|
|
|
|
*/
|
|
|
|
|
UINT WINAPI ExtractIconExWrapW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge,
|
|
|
|
|
HICON *phiconSmall, UINT nIcons)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pExtractIconExW, shell32, "ExtractIconExW", 0);
|
|
|
|
|
return pExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
|
|
|
return SHFileOperationW(lpFileOp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
* @ [SHLWAPI.342]
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
LONG WINAPI SHInterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare)
|
|
|
|
|
PVOID WINAPI SHInterlockedCompareExchange( PVOID *dest, PVOID xchg, PVOID compare )
|
|
|
|
|
{
|
|
|
|
|
return InterlockedCompareExchange(dest, xchg, compare);
|
|
|
|
|
return InterlockedCompareExchangePointer( dest, xchg, compare );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3200,15 +3080,9 @@ LONG WINAPI SHInterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare)
|
|
|
|
|
*
|
|
|
|
|
* See GetFileVersionInfoSizeW.
|
|
|
|
|
*/
|
|
|
|
|
DWORD WINAPI GetFileVersionInfoSizeWrapW(
|
|
|
|
|
LPWSTR x,
|
|
|
|
|
LPVOID y)
|
|
|
|
|
DWORD WINAPI GetFileVersionInfoSizeWrapW( LPCWSTR filename, LPDWORD handle )
|
|
|
|
|
{
|
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
|
|
GET_FUNC(pGetFileVersionInfoSizeW, version, "GetFileVersionInfoSizeW", 0);
|
|
|
|
|
ret = pGetFileVersionInfoSizeW(x, y);
|
|
|
|
|
return 0x208 + ret;
|
|
|
|
|
return GetFileVersionInfoSizeW( filename, handle );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3216,14 +3090,10 @@ DWORD WINAPI GetFileVersionInfoSizeWrapW(
|
|
|
|
|
*
|
|
|
|
|
* See GetFileVersionInfoW.
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI GetFileVersionInfoWrapW(
|
|
|
|
|
LPWSTR w, /* [in] path to dll */
|
|
|
|
|
DWORD x, /* [in] parm 2 to GetFileVersionInfoA */
|
|
|
|
|
DWORD y, /* [in] return value from SHLWAPI_350() - assume length */
|
|
|
|
|
LPVOID z) /* [in/out] buffer (+0x208 sent to GetFileVersionInfoA()) */
|
|
|
|
|
BOOL WINAPI GetFileVersionInfoWrapW( LPCWSTR filename, DWORD handle,
|
|
|
|
|
DWORD datasize, LPVOID data )
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pGetFileVersionInfoW, version, "GetFileVersionInfoW", 0);
|
|
|
|
|
return pGetFileVersionInfoW(w, x, y-0x208, (char*)z+0x208);
|
|
|
|
|
return GetFileVersionInfoW( filename, handle, datasize, data );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3231,14 +3101,10 @@ BOOL WINAPI GetFileVersionInfoWrapW(
|
|
|
|
|
*
|
|
|
|
|
* See VerQueryValueW.
|
|
|
|
|
*/
|
|
|
|
|
WORD WINAPI VerQueryValueWrapW(
|
|
|
|
|
LPVOID w, /* [in] Buffer from SHLWAPI_351() */
|
|
|
|
|
LPWSTR x, /* [in] Value to retrieve - converted and passed to VerQueryValueA() as #2 */
|
|
|
|
|
LPVOID y, /* [out] Ver buffer - passed to VerQueryValueA as #3 */
|
|
|
|
|
UINT* z) /* [in] Ver length - passed to VerQueryValueA as #4 */
|
|
|
|
|
WORD WINAPI VerQueryValueWrapW( LPVOID pBlock, LPCWSTR lpSubBlock,
|
|
|
|
|
LPVOID *lplpBuffer, UINT *puLen )
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pVerQueryValueW, version, "VerQueryValueW", 0);
|
|
|
|
|
return pVerQueryValueW((char*)w+0x208, x, y, z);
|
|
|
|
|
return VerQueryValueW( pBlock, lpSubBlock, lplpBuffer, puLen );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define IsIface(type) SUCCEEDED((hRet = IUnknown_QueryInterface(lpUnknown, &IID_##type, (void**)&lpObj)))
|
|
|
|
@ -3302,8 +3168,7 @@ HRESULT WINAPI IUnknown_EnableModeless(IUnknown *lpUnknown, BOOL bModeless)
|
|
|
|
|
BOOL WINAPI SHGetNewLinkInfoWrapW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
|
|
|
|
|
BOOL *pfMustCopy, UINT uFlags)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pSHGetNewLinkInfoW, shell32, "SHGetNewLinkInfoW", FALSE);
|
|
|
|
|
return pSHGetNewLinkInfoW(pszLinkTo, pszDir, pszName, pfMustCopy, uFlags);
|
|
|
|
|
return SHGetNewLinkInfoW(pszLinkTo, pszDir, pszName, pfMustCopy, uFlags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3314,8 +3179,7 @@ BOOL WINAPI SHGetNewLinkInfoWrapW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszN
|
|
|
|
|
UINT WINAPI SHDefExtractIconWrapW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON* phiconLarge,
|
|
|
|
|
HICON* phiconSmall, UINT nIconSize)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pSHDefExtractIconW, shell32, "SHDefExtractIconW", 0);
|
|
|
|
|
return pSHDefExtractIconW(pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
|
|
|
|
|
return SHDefExtractIconW(pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3391,8 +3255,7 @@ HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST
|
|
|
|
|
HICON WINAPI ExtractIconWrapW(HINSTANCE hInstance, LPCWSTR lpszExeFileName,
|
|
|
|
|
UINT nIconIndex)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pExtractIconW, shell32, "ExtractIconW", NULL);
|
|
|
|
|
return pExtractIconW(hInstance, lpszExeFileName, nIconIndex);
|
|
|
|
|
return ExtractIconW(hInstance, lpszExeFileName, nIconIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3509,8 +3372,7 @@ COLORREF WINAPI ColorAdjustLuma(COLORREF cRGB, int dwLuma, BOOL bUnknown)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI GetSaveFileNameWrapW(LPOPENFILENAMEW ofn)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pGetSaveFileNameW, comdlg32, "GetSaveFileNameW", FALSE);
|
|
|
|
|
return pGetSaveFileNameW(ofn);
|
|
|
|
|
return GetSaveFileNameW(ofn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3520,8 +3382,7 @@ BOOL WINAPI GetSaveFileNameWrapW(LPOPENFILENAMEW ofn)
|
|
|
|
|
*/
|
|
|
|
|
DWORD WINAPI WNetRestoreConnectionWrapW(HWND hwndOwner, LPWSTR lpszDevice)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pWNetRestoreConnectionW, mpr, "WNetRestoreConnectionW", 0);
|
|
|
|
|
return pWNetRestoreConnectionW(hwndOwner, lpszDevice);
|
|
|
|
|
return WNetRestoreConnectionW(hwndOwner, lpszDevice);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3532,8 +3393,7 @@ DWORD WINAPI WNetRestoreConnectionWrapW(HWND hwndOwner, LPWSTR lpszDevice)
|
|
|
|
|
DWORD WINAPI WNetGetLastErrorWrapW(LPDWORD lpError, LPWSTR lpErrorBuf, DWORD nErrorBufSize,
|
|
|
|
|
LPWSTR lpNameBuf, DWORD nNameBufSize)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pWNetGetLastErrorW, mpr, "WNetGetLastErrorW", 0);
|
|
|
|
|
return pWNetGetLastErrorW(lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize);
|
|
|
|
|
return WNetGetLastErrorW(lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3543,8 +3403,7 @@ DWORD WINAPI WNetGetLastErrorWrapW(LPDWORD lpError, LPWSTR lpErrorBuf, DWORD nEr
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI PageSetupDlgWrapW(LPPAGESETUPDLGW pagedlg)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pPageSetupDlgW, comdlg32, "PageSetupDlgW", FALSE);
|
|
|
|
|
return pPageSetupDlgW(pagedlg);
|
|
|
|
|
return PageSetupDlgW(pagedlg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3554,8 +3413,7 @@ BOOL WINAPI PageSetupDlgWrapW(LPPAGESETUPDLGW pagedlg)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI PrintDlgWrapW(LPPRINTDLGW printdlg)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pPrintDlgW, comdlg32, "PrintDlgW", FALSE);
|
|
|
|
|
return pPrintDlgW(printdlg);
|
|
|
|
|
return PrintDlgW(printdlg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3565,8 +3423,7 @@ BOOL WINAPI PrintDlgWrapW(LPPRINTDLGW printdlg)
|
|
|
|
|
*/
|
|
|
|
|
BOOL WINAPI GetOpenFileNameWrapW(LPOPENFILENAMEW ofn)
|
|
|
|
|
{
|
|
|
|
|
GET_FUNC(pGetOpenFileNameW, comdlg32, "GetOpenFileNameW", FALSE);
|
|
|
|
|
return pGetOpenFileNameW(ofn);
|
|
|
|
|
return GetOpenFileNameW(ofn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -3761,99 +3618,10 @@ DWORD WINAPI MLClearMLHInstance(DWORD x)
|
|
|
|
|
*
|
|
|
|
|
* RETURNS
|
|
|
|
|
* S_OK on success or E_INVALIDARG on failure
|
|
|
|
|
*
|
|
|
|
|
* NOTES
|
|
|
|
|
* This is really CLSIDFromString() which is exported by ole32.dll,
|
|
|
|
|
* however the native shlwapi.dll does *not* import ole32. Nor does
|
|
|
|
|
* ole32.dll import this ordinal from shlwapi. Therefore we must conclude
|
|
|
|
|
* that MS duplicated the code for CLSIDFromString(), and yes they did, only
|
|
|
|
|
* it returns an E_INVALIDARG error code on failure.
|
|
|
|
|
* This is a duplicate (with changes for Unicode) of CLSIDFromString16()
|
|
|
|
|
* in "dlls/ole32/compobj.c".
|
|
|
|
|
*/
|
|
|
|
|
HRESULT WINAPI CLSIDFromStringWrap(LPCWSTR idstr, CLSID *id)
|
|
|
|
|
{
|
|
|
|
|
LPCWSTR s = idstr;
|
|
|
|
|
BYTE *p;
|
|
|
|
|
INT i;
|
|
|
|
|
WCHAR table[256];
|
|
|
|
|
|
|
|
|
|
if (!s) {
|
|
|
|
|
memset(id, 0, sizeof(CLSID));
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else { /* validate the CLSID string */
|
|
|
|
|
|
|
|
|
|
if (strlenW(s) != 38)
|
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
|
|
if ((s[0]!=L'{') || (s[9]!=L'-') || (s[14]!=L'-') || (s[19]!=L'-') || (s[24]!=L'-') || (s[37]!=L'}'))
|
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
|
|
for (i=1; i<37; i++)
|
|
|
|
|
{
|
|
|
|
|
if ((i == 9)||(i == 14)||(i == 19)||(i == 24))
|
|
|
|
|
continue;
|
|
|
|
|
if (!(((s[i] >= L'0') && (s[i] <= L'9')) ||
|
|
|
|
|
((s[i] >= L'a') && (s[i] <= L'f')) ||
|
|
|
|
|
((s[i] >= L'A') && (s[i] <= L'F')))
|
|
|
|
|
)
|
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TRACE("%s -> %p\n", debugstr_w(s), id);
|
|
|
|
|
|
|
|
|
|
/* quick lookup table */
|
|
|
|
|
memset(table, 0, 256*sizeof(WCHAR));
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++) {
|
|
|
|
|
table['0' + i] = i;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < 6; i++) {
|
|
|
|
|
table['A' + i] = i+10;
|
|
|
|
|
table['a' + i] = i+10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */
|
|
|
|
|
|
|
|
|
|
p = (BYTE *) id;
|
|
|
|
|
|
|
|
|
|
s++; /* skip leading brace */
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
|
p[3 - i] = table[*s]<<4 | table[*(s+1)];
|
|
|
|
|
s += 2;
|
|
|
|
|
}
|
|
|
|
|
p += 4;
|
|
|
|
|
s++; /* skip - */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
|
p[1-i] = table[*s]<<4 | table[*(s+1)];
|
|
|
|
|
s += 2;
|
|
|
|
|
}
|
|
|
|
|
p += 2;
|
|
|
|
|
s++; /* skip - */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
|
p[1-i] = table[*s]<<4 | table[*(s+1)];
|
|
|
|
|
s += 2;
|
|
|
|
|
}
|
|
|
|
|
p += 2;
|
|
|
|
|
s++; /* skip - */
|
|
|
|
|
|
|
|
|
|
/* these are just sequential bytes */
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
|
*p++ = table[*s]<<4 | table[*(s+1)];
|
|
|
|
|
s += 2;
|
|
|
|
|
}
|
|
|
|
|
s++; /* skip - */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) {
|
|
|
|
|
*p++ = table[*s]<<4 | table[*(s+1)];
|
|
|
|
|
s += 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
|
return CLSIDFromString((LPOLESTR)idstr, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
@ -4441,20 +4209,9 @@ UINT WINAPI ZoneComputePaneSize(HWND hwnd)
|
|
|
|
|
return 0x95;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef void (WINAPI *fnSHChangeNotify)(LONG, UINT, LPCVOID, LPCVOID);
|
|
|
|
|
|
|
|
|
|
void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
|
|
|
|
|
{
|
|
|
|
|
static fnSHChangeNotify fn;
|
|
|
|
|
HMODULE hshell32;
|
|
|
|
|
|
|
|
|
|
if (!fn)
|
|
|
|
|
{
|
|
|
|
|
hshell32 = LoadLibraryA("shell32");
|
|
|
|
|
if (hshell32)
|
|
|
|
|
fn = (fnSHChangeNotify) GetProcAddress(hshell32, "SHChangeNotify");
|
|
|
|
|
}
|
|
|
|
|
fn(wEventId, uFlags, dwItem1, dwItem2);
|
|
|
|
|
SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef struct SHELL_USER_SID { /* according to MSDN this should be in shlobj.h... */
|
|
|
|
|