mirror of
https://github.com/reactos/reactos.git
synced 2025-06-14 15:08:30 +00:00
[shell32.dll]
[FORMATTING] - Second wave of formatting. At least now we won't have any tabs and spaces mixed in. svn path=/branches/shell32_new-bringup/; revision=53651
This commit is contained in:
parent
13df60a8ec
commit
ec47e5b8d5
35 changed files with 5181 additions and 5181 deletions
|
@ -71,9 +71,9 @@ static DWORD __inline BrowseFlagsToSHCONTF(UINT ulFlags)
|
|||
static void browsefolder_callback( LPBROWSEINFOW lpBrowseInfo, HWND hWnd,
|
||||
UINT msg, LPARAM param )
|
||||
{
|
||||
if (!lpBrowseInfo->lpfn)
|
||||
return;
|
||||
lpBrowseInfo->lpfn( hWnd, msg, param, lpBrowseInfo->lParam );
|
||||
if (!lpBrowseInfo->lpfn)
|
||||
return;
|
||||
lpBrowseInfo->lpfn( hWnd, msg, param, lpBrowseInfo->lParam );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -215,17 +215,17 @@ static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
|
|||
*/
|
||||
static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
|
||||
{
|
||||
BOOL bSuccess=TRUE;
|
||||
STRRET str;
|
||||
BOOL bSuccess=TRUE;
|
||||
STRRET str;
|
||||
|
||||
TRACE("%p %p %x %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
|
||||
if (SUCCEEDED(lpsf->GetDisplayNameOf(lpi, dwFlags, &str)))
|
||||
TRACE("%p %p %x %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
|
||||
if (SUCCEEDED(lpsf->GetDisplayNameOf(lpi, dwFlags, &str)))
|
||||
bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi);
|
||||
else
|
||||
bSuccess = FALSE;
|
||||
else
|
||||
bSuccess = FALSE;
|
||||
|
||||
TRACE("-- %s\n", debugstr_w(lpFriendlyName));
|
||||
return bSuccess;
|
||||
TRACE("-- %s\n", debugstr_w(lpFriendlyName));
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -247,39 +247,39 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
|
|||
LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL,
|
||||
HTREEITEM hParent)
|
||||
{
|
||||
TVITEMW tvi;
|
||||
TVINSERTSTRUCTW tvins;
|
||||
WCHAR szBuff[MAX_PATH];
|
||||
LPTV_ITEMDATA lptvid=0;
|
||||
TVITEMW tvi;
|
||||
TVINSERTSTRUCTW tvins;
|
||||
WCHAR szBuff[MAX_PATH];
|
||||
LPTV_ITEMDATA lptvid=0;
|
||||
|
||||
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
|
||||
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
|
||||
|
||||
tvi.cChildren= pEnumIL ? 1 : 0;
|
||||
tvi.mask |= TVIF_CHILDREN;
|
||||
tvi.cChildren= pEnumIL ? 1 : 0;
|
||||
tvi.mask |= TVIF_CHILDREN;
|
||||
|
||||
lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) );
|
||||
if (!lptvid)
|
||||
return NULL;
|
||||
lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) );
|
||||
if (!lptvid)
|
||||
return NULL;
|
||||
|
||||
if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
|
||||
return NULL;
|
||||
if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
|
||||
return NULL;
|
||||
|
||||
tvi.pszText = szBuff;
|
||||
tvi.cchTextMax = MAX_PATH;
|
||||
tvi.lParam = (LPARAM)lptvid;
|
||||
tvi.pszText = szBuff;
|
||||
tvi.cchTextMax = MAX_PATH;
|
||||
tvi.lParam = (LPARAM)lptvid;
|
||||
|
||||
lpsf->AddRef();
|
||||
lptvid->lpsfParent = lpsf;
|
||||
lptvid->lpi = ILClone(pidl);
|
||||
lptvid->lpifq = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
|
||||
lptvid->pEnumIL = pEnumIL;
|
||||
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
|
||||
lpsf->AddRef();
|
||||
lptvid->lpsfParent = lpsf;
|
||||
lptvid->lpi = ILClone(pidl);
|
||||
lptvid->lpifq = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
|
||||
lptvid->pEnumIL = pEnumIL;
|
||||
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
|
||||
|
||||
tvins.item = tvi;
|
||||
tvins.hInsertAfter = NULL;
|
||||
tvins.hParent = hParent;
|
||||
tvins.item = tvi;
|
||||
tvins.hInsertAfter = NULL;
|
||||
tvins.hParent = hParent;
|
||||
|
||||
return (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_INSERTITEM, 0, (LPARAM)&tvins );
|
||||
return (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_INSERTITEM, 0, (LPARAM)&tvins );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -298,33 +298,33 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
|
|||
static void FillTreeView( browse_info *info, IShellFolder * lpsf,
|
||||
LPITEMIDLIST pidl, HTREEITEM hParent, IEnumIDList* lpe)
|
||||
{
|
||||
HTREEITEM hPrev = 0;
|
||||
LPITEMIDLIST pidlTemp = 0;
|
||||
ULONG ulFetched;
|
||||
HRESULT hr;
|
||||
HWND hwnd = GetParent( info->hwndTreeView );
|
||||
HTREEITEM hPrev = 0;
|
||||
LPITEMIDLIST pidlTemp = 0;
|
||||
ULONG ulFetched;
|
||||
HRESULT hr;
|
||||
HWND hwnd = GetParent( info->hwndTreeView );
|
||||
|
||||
TRACE("%p %p %p %p\n",lpsf, pidl, hParent, lpe);
|
||||
TRACE("%p %p %p %p\n",lpsf, pidl, hParent, lpe);
|
||||
|
||||
/* No IEnumIDList -> No children */
|
||||
if (!lpe) return;
|
||||
/* No IEnumIDList -> No children */
|
||||
if (!lpe) return;
|
||||
|
||||
SetCapture( hwnd );
|
||||
SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) );
|
||||
SetCapture( hwnd );
|
||||
SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) );
|
||||
|
||||
while (NOERROR == lpe->Next(1,&pidlTemp,&ulFetched))
|
||||
{
|
||||
ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
|
||||
IEnumIDList* pEnumIL = NULL;
|
||||
IShellFolder* pSFChild = NULL;
|
||||
lpsf->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
|
||||
if (ulAttrs & SFGAO_FOLDER)
|
||||
{
|
||||
hr = lpsf->BindToObject(pidlTemp, NULL, IID_IShellFolder, (LPVOID *)&pSFChild);
|
||||
if (SUCCEEDED(hr))
|
||||
while (NOERROR == lpe->Next(1,&pidlTemp,&ulFetched))
|
||||
{
|
||||
ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
|
||||
IEnumIDList* pEnumIL = NULL;
|
||||
IShellFolder* pSFChild = NULL;
|
||||
lpsf->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
|
||||
if (ulAttrs & SFGAO_FOLDER)
|
||||
{
|
||||
hr = lpsf->BindToObject(pidlTemp, NULL, IID_IShellFolder, (LPVOID *)&pSFChild);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
|
||||
hr = pSFChild->EnumObjects(hwnd, flags, &pEnumIL);
|
||||
DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
|
||||
hr = pSFChild->EnumObjects(hwnd, flags, &pEnumIL);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
if ((pEnumIL->Skip(1) != S_OK) ||
|
||||
|
@ -336,17 +336,17 @@ static void FillTreeView( browse_info *info, IShellFolder * lpsf,
|
|||
}
|
||||
pSFChild->Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(hPrev = InsertTreeViewItem(info, lpsf, pidlTemp, pidl, pEnumIL, hParent)))
|
||||
goto done;
|
||||
SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */
|
||||
pidlTemp=NULL;
|
||||
}
|
||||
if (!(hPrev = InsertTreeViewItem(info, lpsf, pidlTemp, pidl, pEnumIL, hParent)))
|
||||
goto done;
|
||||
SHFree(pidlTemp); /* Finally, free the pidl that the shell gave us... */
|
||||
pidlTemp=NULL;
|
||||
}
|
||||
|
||||
done:
|
||||
ReleaseCapture();
|
||||
SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW));
|
||||
ReleaseCapture();
|
||||
SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW));
|
||||
SHFree(pidlTemp);
|
||||
}
|
||||
|
||||
|
@ -491,16 +491,16 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info )
|
|||
if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
|
||||
FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n");
|
||||
if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
|
||||
FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
|
||||
FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
|
||||
|
||||
if (lpBrowseInfo->lpszTitle)
|
||||
SetWindowTextW( GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle );
|
||||
SetWindowTextW( GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle );
|
||||
else
|
||||
ShowWindow( GetDlgItem(hWnd, IDD_TITLE), SW_HIDE );
|
||||
ShowWindow( GetDlgItem(hWnd, IDD_TITLE), SW_HIDE );
|
||||
|
||||
if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT)
|
||||
|| (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
|
||||
ShowWindow( GetDlgItem(hWnd, IDD_STATUS), SW_HIDE );
|
||||
ShowWindow( GetDlgItem(hWnd, IDD_STATUS), SW_HIDE );
|
||||
|
||||
/* Hide "Make New Folder" Button? */
|
||||
if ((lpBrowseInfo->ulFlags & BIF_NONEWFOLDERBUTTON)
|
||||
|
@ -675,7 +675,7 @@ static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL
|
|||
* BrsFolderDlgProc32 (not an exported API function)
|
||||
*/
|
||||
static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
|
||||
LPARAM lParam )
|
||||
LPARAM lParam )
|
||||
{
|
||||
browse_info *info;
|
||||
|
||||
|
@ -806,7 +806,7 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
|
|||
else
|
||||
templateName = swBrowseTemplateName;
|
||||
r = DialogBoxParamW( shell32_hInstance, templateName, lpbi->hwndOwner,
|
||||
BrsFolderDlgProc, (LPARAM)&info );
|
||||
BrsFolderDlgProc, (LPARAM)&info );
|
||||
if (SUCCEEDED(hr))
|
||||
OleUninitialize();
|
||||
if (!r)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* shell change notification
|
||||
* shell change notification
|
||||
*
|
||||
* Copyright 2000 Juergen Schmied
|
||||
*
|
||||
|
@ -25,14 +25,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
|||
|
||||
namespace
|
||||
{
|
||||
extern CRITICAL_SECTION SHELL32_ChangenotifyCS;
|
||||
CRITICAL_SECTION_DEBUG critsect_debug =
|
||||
{
|
||||
0, 0, &SHELL32_ChangenotifyCS,
|
||||
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
||||
0, 0, { (DWORD_PTR)(__FILE__ ": SHELL32_ChangenotifyCS") }
|
||||
};
|
||||
CRITICAL_SECTION SHELL32_ChangenotifyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
extern CRITICAL_SECTION SHELL32_ChangenotifyCS;
|
||||
CRITICAL_SECTION_DEBUG critsect_debug =
|
||||
{
|
||||
0, 0, &SHELL32_ChangenotifyCS,
|
||||
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
||||
0, 0, { (DWORD_PTR)(__FILE__ ": SHELL32_ChangenotifyCS") }
|
||||
};
|
||||
CRITICAL_SECTION SHELL32_ChangenotifyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
}
|
||||
|
||||
typedef SHChangeNotifyEntry *LPNOTIFYREGISTER;
|
||||
|
@ -40,16 +40,16 @@ typedef SHChangeNotifyEntry *LPNOTIFYREGISTER;
|
|||
/* internal list of notification clients (internal) */
|
||||
typedef struct _NOTIFICATIONLIST
|
||||
{
|
||||
struct _NOTIFICATIONLIST *next;
|
||||
struct _NOTIFICATIONLIST *prev;
|
||||
HWND hwnd; /* window to notify */
|
||||
DWORD uMsg; /* message to send */
|
||||
LPNOTIFYREGISTER apidl; /* array of entries to watch*/
|
||||
UINT cidl; /* number of pidls in array */
|
||||
LONG wEventMask; /* subscribed events */
|
||||
LONG wSignalledEvent; /* event that occurred */
|
||||
DWORD dwFlags; /* client flags */
|
||||
LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/
|
||||
struct _NOTIFICATIONLIST *next;
|
||||
struct _NOTIFICATIONLIST *prev;
|
||||
HWND hwnd; /* window to notify */
|
||||
DWORD uMsg; /* message to send */
|
||||
LPNOTIFYREGISTER apidl; /* array of entries to watch*/
|
||||
UINT cidl; /* number of pidls in array */
|
||||
LONG wEventMask; /* subscribed events */
|
||||
LONG wSignalledEvent; /* event that occurred */
|
||||
DWORD dwFlags; /* client flags */
|
||||
LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/
|
||||
|
||||
} NOTIFICATIONLIST, *LPNOTIFICATIONLIST;
|
||||
|
||||
|
@ -178,7 +178,7 @@ void FreeChangeNotifications(void)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHChangeNotifyRegister [SHELL32.2]
|
||||
* SHChangeNotifyRegister [SHELL32.2]
|
||||
*
|
||||
*/
|
||||
ULONG WINAPI
|
||||
|
@ -196,7 +196,7 @@ SHChangeNotifyRegister(
|
|||
item = (NOTIFICATIONLIST *)SHAlloc(sizeof(NOTIFICATIONLIST));
|
||||
|
||||
TRACE("(%p,0x%08x,0x%08x,0x%08x,%d,%p) item=%p\n",
|
||||
hwnd, fSources, wEventMask, uMsg, cItems, lpItems, item);
|
||||
hwnd, fSources, wEventMask, uMsg, cItems, lpItems, item);
|
||||
|
||||
item->next = NULL;
|
||||
item->prev = NULL;
|
||||
|
@ -225,7 +225,7 @@ SHChangeNotifyRegister(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHChangeNotifyDeregister [SHELL32.4]
|
||||
* SHChangeNotifyDeregister [SHELL32.4]
|
||||
*/
|
||||
BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
|
||||
{
|
||||
|
@ -245,10 +245,10 @@ BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHChangeNotifyUpdateEntryList [SHELL32.5]
|
||||
* SHChangeNotifyUpdateEntryList [SHELL32.5]
|
||||
*/
|
||||
EXTERN_C BOOL WINAPI SHChangeNotifyUpdateEntryList(DWORD unknown1, DWORD unknown2,
|
||||
DWORD unknown3, DWORD unknown4)
|
||||
DWORD unknown3, DWORD unknown4)
|
||||
{
|
||||
FIXME("(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
|
||||
unknown1, unknown2, unknown3, unknown4);
|
||||
|
@ -269,7 +269,7 @@ static BOOL should_notify( LPCITEMIDLIST changed, LPCITEMIDLIST watched, BOOL su
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHChangeNotify [SHELL32.@]
|
||||
* SHChangeNotify [SHELL32.@]
|
||||
*/
|
||||
void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
|
||||
{
|
||||
|
@ -403,7 +403,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* NTSHChangeNotifyRegister [SHELL32.640]
|
||||
* NTSHChangeNotifyRegister [SHELL32.640]
|
||||
* NOTES
|
||||
* Idlist is an array of structures and Count specifies how many items in the array.
|
||||
* count should always be one when calling SHChangeNotifyRegister, or
|
||||
|
@ -422,13 +422,13 @@ EXTERN_C ULONG WINAPI NTSHChangeNotifyRegister(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHChangeNotification_Lock [SHELL32.644]
|
||||
* SHChangeNotification_Lock [SHELL32.644]
|
||||
*/
|
||||
HANDLE WINAPI SHChangeNotification_Lock(
|
||||
HANDLE hChange,
|
||||
DWORD dwProcessId,
|
||||
LPITEMIDLIST **lppidls,
|
||||
LPLONG lpwEventId)
|
||||
HANDLE hChange,
|
||||
DWORD dwProcessId,
|
||||
LPITEMIDLIST **lppidls,
|
||||
LPLONG lpwEventId)
|
||||
{
|
||||
DWORD i;
|
||||
LPNOTIFICATIONLIST node;
|
||||
|
@ -457,7 +457,7 @@ HANDLE WINAPI SHChangeNotification_Lock(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHChangeNotification_Unlock [SHELL32.645]
|
||||
* SHChangeNotification_Unlock [SHELL32.645]
|
||||
*/
|
||||
BOOL WINAPI SHChangeNotification_Unlock ( HANDLE hLock)
|
||||
{
|
||||
|
@ -466,7 +466,7 @@ BOOL WINAPI SHChangeNotification_Unlock ( HANDLE hLock)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* NTSHChangeNotifyDeregister [SHELL32.641]
|
||||
* NTSHChangeNotifyDeregister [SHELL32.641]
|
||||
*/
|
||||
EXTERN_C DWORD WINAPI NTSHChangeNotifyDeregister(ULONG x1)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* clipboard helper functions
|
||||
* clipboard helper functions
|
||||
*
|
||||
* Copyright 2000 Juergen Schmied <juergen.schmied@debitel.de>
|
||||
* Copyright 2000 Juergen Schmied <juergen.schmied@debitel.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -25,13 +25,13 @@
|
|||
*
|
||||
* - a right mousebutton-copy sets the following formats:
|
||||
* classic:
|
||||
* Shell IDList Array
|
||||
* Preferred Drop Effect
|
||||
* Shell Object Offsets
|
||||
* HDROP
|
||||
* FileName
|
||||
* Shell IDList Array
|
||||
* Preferred Drop Effect
|
||||
* Shell Object Offsets
|
||||
* HDROP
|
||||
* FileName
|
||||
* ole:
|
||||
* OlePrivateData (ClipboardDataObjectInterface)
|
||||
* OlePrivateData (ClipboardDataObjectInterface)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -46,195 +46,195 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
|||
*/
|
||||
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
UINT i;
|
||||
int size = 0;
|
||||
WCHAR wszFileName[MAX_PATH];
|
||||
HGLOBAL hGlobal = NULL;
|
||||
DROPFILES *pDropFiles;
|
||||
int offset;
|
||||
LPITEMIDLIST *pidls;
|
||||
UINT i;
|
||||
int size = 0;
|
||||
WCHAR wszFileName[MAX_PATH];
|
||||
HGLOBAL hGlobal = NULL;
|
||||
DROPFILES *pDropFiles;
|
||||
int offset;
|
||||
LPITEMIDLIST *pidls;
|
||||
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
|
||||
pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
|
||||
if (!pidls)
|
||||
goto cleanup;
|
||||
pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
|
||||
if (!pidls)
|
||||
goto cleanup;
|
||||
|
||||
/* get the size needed */
|
||||
size = sizeof(DROPFILES);
|
||||
/* get the size needed */
|
||||
size = sizeof(DROPFILES);
|
||||
|
||||
for (i=0; i<cidl;i++)
|
||||
{
|
||||
pidls[i] = ILCombine(pidlRoot, apidl[i]);
|
||||
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||
size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
||||
}
|
||||
for (i=0; i<cidl;i++)
|
||||
{
|
||||
pidls[i] = ILCombine(pidlRoot, apidl[i]);
|
||||
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||
size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
||||
}
|
||||
|
||||
size += sizeof(WCHAR);
|
||||
size += sizeof(WCHAR);
|
||||
|
||||
/* Fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal)
|
||||
goto cleanup;
|
||||
/* Fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal)
|
||||
goto cleanup;
|
||||
|
||||
pDropFiles = (DROPFILES *)GlobalLock(hGlobal);
|
||||
offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
|
||||
offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
|
||||
pDropFiles->pFiles = offset * sizeof(WCHAR);
|
||||
pDropFiles->fWide = TRUE;
|
||||
|
||||
for (i=0; i<cidl;i++)
|
||||
{
|
||||
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
||||
offset += wcslen(wszFileName) + 1;
|
||||
ILFree(pidls[i]);
|
||||
}
|
||||
for (i=0; i<cidl;i++)
|
||||
{
|
||||
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
||||
offset += wcslen(wszFileName) + 1;
|
||||
ILFree(pidls[i]);
|
||||
}
|
||||
|
||||
((WCHAR*)pDropFiles)[offset] = 0;
|
||||
GlobalUnlock(hGlobal);
|
||||
((WCHAR*)pDropFiles)[offset] = 0;
|
||||
GlobalUnlock(hGlobal);
|
||||
|
||||
cleanup:
|
||||
if(pidls)
|
||||
HeapFree(GetProcessHeap(), 0, pidls);
|
||||
if(pidls)
|
||||
HeapFree(GetProcessHeap(), 0, pidls);
|
||||
|
||||
return hGlobal;
|
||||
return hGlobal;
|
||||
}
|
||||
|
||||
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
UINT i;
|
||||
int offset = 0, sizePidl, size;
|
||||
HGLOBAL hGlobal;
|
||||
LPIDA pcida;
|
||||
UINT i;
|
||||
int offset = 0, sizePidl, size;
|
||||
HGLOBAL hGlobal;
|
||||
LPIDA pcida;
|
||||
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
|
||||
/* get the size needed */
|
||||
size = sizeof(CIDA) + sizeof (UINT)*(cidl); /* header */
|
||||
size += ILGetSize (pidlRoot); /* root pidl */
|
||||
for(i=0; i<cidl; i++)
|
||||
{
|
||||
size += ILGetSize(apidl[i]); /* child pidls */
|
||||
}
|
||||
/* get the size needed */
|
||||
size = sizeof(CIDA) + sizeof (UINT)*(cidl); /* header */
|
||||
size += ILGetSize (pidlRoot); /* root pidl */
|
||||
for(i=0; i<cidl; i++)
|
||||
{
|
||||
size += ILGetSize(apidl[i]); /* child pidls */
|
||||
}
|
||||
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal) return hGlobal;
|
||||
pcida = (LPIDA)GlobalLock (hGlobal);
|
||||
pcida->cidl = cidl;
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal) return hGlobal;
|
||||
pcida = (LPIDA)GlobalLock (hGlobal);
|
||||
pcida->cidl = cidl;
|
||||
|
||||
/* root pidl */
|
||||
offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
|
||||
pcida->aoffset[0] = offset; /* first element */
|
||||
sizePidl = ILGetSize (pidlRoot);
|
||||
memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
|
||||
offset += sizePidl;
|
||||
/* root pidl */
|
||||
offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
|
||||
pcida->aoffset[0] = offset; /* first element */
|
||||
sizePidl = ILGetSize (pidlRoot);
|
||||
memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
|
||||
offset += sizePidl;
|
||||
|
||||
for(i=0; i<cidl; i++) /* child pidls */
|
||||
{
|
||||
pcida->aoffset[i+1] = offset;
|
||||
sizePidl = ILGetSize(apidl[i]);
|
||||
memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
|
||||
offset += sizePidl;
|
||||
}
|
||||
for(i=0; i<cidl; i++) /* child pidls */
|
||||
{
|
||||
pcida->aoffset[i+1] = offset;
|
||||
sizePidl = ILGetSize(apidl[i]);
|
||||
memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
|
||||
offset += sizePidl;
|
||||
}
|
||||
|
||||
GlobalUnlock(hGlobal);
|
||||
return hGlobal;
|
||||
GlobalUnlock(hGlobal);
|
||||
return hGlobal;
|
||||
}
|
||||
|
||||
HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
FIXME("\n");
|
||||
return 0;
|
||||
FIXME("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
FIXME("\n");
|
||||
return 0;
|
||||
FIXME("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
FIXME("\n");
|
||||
return 0;
|
||||
FIXME("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
int size = 0;
|
||||
char szTemp[MAX_PATH], *szFileName;
|
||||
LPITEMIDLIST pidl;
|
||||
HGLOBAL hGlobal;
|
||||
BOOL bSuccess;
|
||||
int size = 0;
|
||||
char szTemp[MAX_PATH], *szFileName;
|
||||
LPITEMIDLIST pidl;
|
||||
HGLOBAL hGlobal;
|
||||
BOOL bSuccess;
|
||||
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
|
||||
/* get path of combined pidl */
|
||||
pidl = ILCombine(pidlRoot, apidl[0]);
|
||||
if (!pidl)
|
||||
return 0;
|
||||
/* get path of combined pidl */
|
||||
pidl = ILCombine(pidlRoot, apidl[0]);
|
||||
if (!pidl)
|
||||
return 0;
|
||||
|
||||
bSuccess = SHGetPathFromIDListA(pidl, szTemp);
|
||||
SHFree(pidl);
|
||||
if (!bSuccess)
|
||||
return 0;
|
||||
bSuccess = SHGetPathFromIDListA(pidl, szTemp);
|
||||
SHFree(pidl);
|
||||
if (!bSuccess)
|
||||
return 0;
|
||||
|
||||
size = strlen(szTemp) + 1;
|
||||
size = strlen(szTemp) + 1;
|
||||
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal) return hGlobal;
|
||||
szFileName = (char *)GlobalLock(hGlobal);
|
||||
memcpy(szFileName, szTemp, size);
|
||||
GlobalUnlock(hGlobal);
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal) return hGlobal;
|
||||
szFileName = (char *)GlobalLock(hGlobal);
|
||||
memcpy(szFileName, szTemp, size);
|
||||
GlobalUnlock(hGlobal);
|
||||
|
||||
return hGlobal;
|
||||
return hGlobal;
|
||||
}
|
||||
|
||||
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||
{
|
||||
int size = 0;
|
||||
WCHAR szTemp[MAX_PATH], *szFileName;
|
||||
LPITEMIDLIST pidl;
|
||||
HGLOBAL hGlobal;
|
||||
BOOL bSuccess;
|
||||
int size = 0;
|
||||
WCHAR szTemp[MAX_PATH], *szFileName;
|
||||
LPITEMIDLIST pidl;
|
||||
HGLOBAL hGlobal;
|
||||
BOOL bSuccess;
|
||||
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||
|
||||
/* get path of combined pidl */
|
||||
pidl = ILCombine(pidlRoot, apidl[0]);
|
||||
if (!pidl)
|
||||
return 0;
|
||||
/* get path of combined pidl */
|
||||
pidl = ILCombine(pidlRoot, apidl[0]);
|
||||
if (!pidl)
|
||||
return 0;
|
||||
|
||||
bSuccess = SHGetPathFromIDListW(pidl, szTemp);
|
||||
SHFree(pidl);
|
||||
if (!bSuccess)
|
||||
return 0;
|
||||
bSuccess = SHGetPathFromIDListW(pidl, szTemp);
|
||||
SHFree(pidl);
|
||||
if (!bSuccess)
|
||||
return 0;
|
||||
|
||||
size = (wcslen(szTemp)+1) * sizeof(WCHAR);
|
||||
size = (wcslen(szTemp)+1) * sizeof(WCHAR);
|
||||
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal) return hGlobal;
|
||||
szFileName = (WCHAR *)GlobalLock(hGlobal);
|
||||
memcpy(szFileName, szTemp, size);
|
||||
GlobalUnlock(hGlobal);
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
if(!hGlobal) return hGlobal;
|
||||
szFileName = (WCHAR *)GlobalLock(hGlobal);
|
||||
memcpy(szFileName, szTemp, size);
|
||||
GlobalUnlock(hGlobal);
|
||||
|
||||
return hGlobal;
|
||||
return hGlobal;
|
||||
}
|
||||
|
||||
HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
|
||||
{
|
||||
DWORD * pdwFlag;
|
||||
HGLOBAL hGlobal;
|
||||
DWORD * pdwFlag;
|
||||
HGLOBAL hGlobal;
|
||||
|
||||
TRACE("(0x%08x)\n", dwFlags);
|
||||
TRACE("(0x%08x)\n", dwFlags);
|
||||
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
|
||||
if(!hGlobal) return hGlobal;
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
|
||||
if(!hGlobal) return hGlobal;
|
||||
pdwFlag = (DWORD*)GlobalLock(hGlobal);
|
||||
*pdwFlag = dwFlags;
|
||||
GlobalUnlock(hGlobal);
|
||||
return hGlobal;
|
||||
*pdwFlag = dwFlags;
|
||||
GlobalUnlock(hGlobal);
|
||||
return hGlobal;
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shlctrl);
|
||||
|
||||
CPlApplet* Control_UnloadApplet(CPlApplet* applet)
|
||||
CPlApplet* Control_UnloadApplet(CPlApplet* applet)
|
||||
{
|
||||
unsigned i;
|
||||
CPlApplet* next;
|
||||
unsigned i;
|
||||
CPlApplet* next;
|
||||
|
||||
for (i = 0; i < applet->count; i++) {
|
||||
if (!applet->info[i].dwSize) continue;
|
||||
|
@ -38,11 +38,11 @@ CPlApplet* Control_UnloadApplet(CPlApplet* applet)
|
|||
return next;
|
||||
}
|
||||
|
||||
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
||||
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
||||
{
|
||||
CPlApplet* applet;
|
||||
unsigned i;
|
||||
CPLINFO info;
|
||||
CPlApplet* applet;
|
||||
unsigned i;
|
||||
CPLINFO info;
|
||||
NEWCPLINFOW newinfo;
|
||||
|
||||
if (!(applet = (CPlApplet *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet))))
|
||||
|
@ -52,62 +52,62 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
|||
|
||||
if (!(applet->hModule = LoadLibraryW(cmd))) {
|
||||
WARN("Cannot load control panel applet %s\n", debugstr_w(cmd));
|
||||
goto theError;
|
||||
goto theError;
|
||||
}
|
||||
if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) {
|
||||
WARN("Not a valid control panel applet %s\n", debugstr_w(cmd));
|
||||
goto theError;
|
||||
goto theError;
|
||||
}
|
||||
if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) {
|
||||
WARN("Init of applet has failed\n");
|
||||
goto theError;
|
||||
goto theError;
|
||||
}
|
||||
if ((applet->count = applet->proc(hWnd, CPL_GETCOUNT, 0L, 0L)) == 0) {
|
||||
WARN("No subprogram in applet\n");
|
||||
goto theError;
|
||||
goto theError;
|
||||
}
|
||||
|
||||
applet = (CPlApplet *)HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet,
|
||||
sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOW));
|
||||
sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOW));
|
||||
|
||||
for (i = 0; i < applet->count; i++) {
|
||||
ZeroMemory(&newinfo, sizeof(newinfo));
|
||||
newinfo.dwSize = sizeof(NEWCPLINFOW);
|
||||
applet->info[i].dwSize = sizeof(NEWCPLINFOW);
|
||||
/* proc is supposed to return a null value upon success for
|
||||
* CPL_INQUIRE and CPL_NEWINQUIRE
|
||||
* However, real drivers don't seem to behave like this
|
||||
* So, use introspection rather than return value
|
||||
*/
|
||||
* CPL_INQUIRE and CPL_NEWINQUIRE
|
||||
* However, real drivers don't seem to behave like this
|
||||
* So, use introspection rather than return value
|
||||
*/
|
||||
applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo);
|
||||
if (newinfo.hIcon == 0) {
|
||||
applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
|
||||
if (info.idIcon == 0 || info.idName == 0) {
|
||||
WARN("Couldn't get info from sp %u\n", i);
|
||||
applet->info[i].dwSize = 0;
|
||||
} else {
|
||||
/* convert the old data into the new structure */
|
||||
applet->info[i].dwFlags = 0;
|
||||
applet->info[i].dwHelpContext = 0;
|
||||
applet->info[i].lData = info.lData;
|
||||
applet->info[i].hIcon = LoadIconW(applet->hModule,
|
||||
MAKEINTRESOURCEW(info.idIcon));
|
||||
LoadStringW(applet->hModule, info.idName,
|
||||
applet->info[i].szName, sizeof(applet->info[i].szName) / sizeof(WCHAR));
|
||||
LoadStringW(applet->hModule, info.idInfo,
|
||||
applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
|
||||
applet->info[i].szHelpFile[0] = '\0';
|
||||
}
|
||||
applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
|
||||
if (info.idIcon == 0 || info.idName == 0) {
|
||||
WARN("Couldn't get info from sp %u\n", i);
|
||||
applet->info[i].dwSize = 0;
|
||||
} else {
|
||||
/* convert the old data into the new structure */
|
||||
applet->info[i].dwFlags = 0;
|
||||
applet->info[i].dwHelpContext = 0;
|
||||
applet->info[i].lData = info.lData;
|
||||
applet->info[i].hIcon = LoadIconW(applet->hModule,
|
||||
MAKEINTRESOURCEW(info.idIcon));
|
||||
LoadStringW(applet->hModule, info.idName,
|
||||
applet->info[i].szName, sizeof(applet->info[i].szName) / sizeof(WCHAR));
|
||||
LoadStringW(applet->hModule, info.idInfo,
|
||||
applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
|
||||
applet->info[i].szHelpFile[0] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CopyMemory(&applet->info[i], &newinfo, newinfo.dwSize);
|
||||
if (newinfo.dwSize != sizeof(NEWCPLINFOW))
|
||||
if (newinfo.dwSize != sizeof(NEWCPLINFOW))
|
||||
{
|
||||
applet->info[i].dwSize = sizeof(NEWCPLINFOW);
|
||||
lstrcpyW(applet->info[i].szName, newinfo.szName);
|
||||
lstrcpyW(applet->info[i].szInfo, newinfo.szInfo);
|
||||
lstrcpyW(applet->info[i].szHelpFile, newinfo.szHelpFile);
|
||||
applet->info[i].dwSize = sizeof(NEWCPLINFOW);
|
||||
lstrcpyW(applet->info[i].szName, newinfo.szName);
|
||||
lstrcpyW(applet->info[i].szInfo, newinfo.szInfo);
|
||||
lstrcpyW(applet->info[i].szHelpFile, newinfo.szHelpFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -124,74 +124,74 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
|||
|
||||
static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs)
|
||||
{
|
||||
CPanel* panel = (CPanel*)cs->lpCreateParams;
|
||||
CPanel* panel = (CPanel*)cs->lpCreateParams;
|
||||
|
||||
SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel);
|
||||
panel->status = 0;
|
||||
panel->hWnd = hWnd;
|
||||
}
|
||||
|
||||
#define XICON 32
|
||||
#define XSTEP 128
|
||||
#define YICON 32
|
||||
#define YSTEP 64
|
||||
#define XICON 32
|
||||
#define XSTEP 128
|
||||
#define YICON 32
|
||||
#define YSTEP 64
|
||||
|
||||
static BOOL Control_Localize(const CPanel* panel, int cx, int cy,
|
||||
CPlApplet** papplet, unsigned* psp)
|
||||
static BOOL Control_Localize(const CPanel* panel, int cx, int cy,
|
||||
CPlApplet** papplet, unsigned* psp)
|
||||
{
|
||||
unsigned int i;
|
||||
int x = (XSTEP-XICON)/2, y = 0;
|
||||
CPlApplet* applet;
|
||||
RECT rc;
|
||||
unsigned int i;
|
||||
int x = (XSTEP-XICON)/2, y = 0;
|
||||
CPlApplet* applet;
|
||||
RECT rc;
|
||||
|
||||
GetClientRect(panel->hWnd, &rc);
|
||||
for (applet = panel->first; applet; applet = applet->next) {
|
||||
for (i = 0; i < applet->count; i++) {
|
||||
if (!applet->info[i].dwSize) continue;
|
||||
if (x + XSTEP >= rc.right - rc.left) {
|
||||
x = (XSTEP-XICON)/2;
|
||||
y += YSTEP;
|
||||
}
|
||||
if (cx >= x && cx < x + XICON && cy >= y && cy < y + YSTEP) {
|
||||
*papplet = applet;
|
||||
*psp = i;
|
||||
return TRUE;
|
||||
}
|
||||
x += XSTEP;
|
||||
}
|
||||
if (!applet->info[i].dwSize) continue;
|
||||
if (x + XSTEP >= rc.right - rc.left) {
|
||||
x = (XSTEP-XICON)/2;
|
||||
y += YSTEP;
|
||||
}
|
||||
if (cx >= x && cx < x + XICON && cy >= y && cy < y + YSTEP) {
|
||||
*papplet = applet;
|
||||
*psp = i;
|
||||
return TRUE;
|
||||
}
|
||||
x += XSTEP;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam)
|
||||
{
|
||||
HDC hdc;
|
||||
PAINTSTRUCT ps;
|
||||
RECT rc, txtRect;
|
||||
unsigned int i;
|
||||
int x = 0, y = 0;
|
||||
CPlApplet* applet;
|
||||
HGDIOBJ hOldFont;
|
||||
HDC hdc;
|
||||
PAINTSTRUCT ps;
|
||||
RECT rc, txtRect;
|
||||
unsigned int i;
|
||||
int x = 0, y = 0;
|
||||
CPlApplet* applet;
|
||||
HGDIOBJ hOldFont;
|
||||
|
||||
hdc = (wParam) ? (HDC)wParam : BeginPaint(panel->hWnd, &ps);
|
||||
hOldFont = SelectObject(hdc, GetStockObject(ANSI_VAR_FONT));
|
||||
GetClientRect(panel->hWnd, &rc);
|
||||
for (applet = panel->first; applet; applet = applet->next) {
|
||||
for (i = 0; i < applet->count; i++) {
|
||||
if (x + XSTEP >= rc.right - rc.left) {
|
||||
x = 0;
|
||||
y += YSTEP;
|
||||
}
|
||||
if (!applet->info[i].dwSize) continue;
|
||||
DrawIcon(hdc, x + (XSTEP-XICON)/2, y, applet->info[i].hIcon);
|
||||
txtRect.left = x;
|
||||
txtRect.right = x + XSTEP;
|
||||
txtRect.top = y + YICON;
|
||||
txtRect.bottom = y + YSTEP;
|
||||
DrawTextW(hdc, applet->info[i].szName, -1, &txtRect,
|
||||
DT_CENTER | DT_VCENTER);
|
||||
x += XSTEP;
|
||||
}
|
||||
if (x + XSTEP >= rc.right - rc.left) {
|
||||
x = 0;
|
||||
y += YSTEP;
|
||||
}
|
||||
if (!applet->info[i].dwSize) continue;
|
||||
DrawIcon(hdc, x + (XSTEP-XICON)/2, y, applet->info[i].hIcon);
|
||||
txtRect.left = x;
|
||||
txtRect.right = x + XSTEP;
|
||||
txtRect.top = y + YICON;
|
||||
txtRect.bottom = y + YSTEP;
|
||||
DrawTextW(hdc, applet->info[i].szName, -1, &txtRect,
|
||||
DT_CENTER | DT_VCENTER);
|
||||
x += XSTEP;
|
||||
}
|
||||
}
|
||||
SelectObject(hdc, hOldFont);
|
||||
if (!wParam) EndPaint(panel->hWnd, &ps);
|
||||
|
@ -200,48 +200,48 @@ static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam)
|
|||
|
||||
static LRESULT Control_WndProc_LButton(CPanel* panel, LPARAM lParam, BOOL up)
|
||||
{
|
||||
unsigned i;
|
||||
CPlApplet* applet;
|
||||
unsigned i;
|
||||
CPlApplet* applet;
|
||||
|
||||
if (Control_Localize(panel, (short)LOWORD(lParam), (short)HIWORD(lParam), &applet, &i)) {
|
||||
if (up) {
|
||||
if (panel->clkApplet == applet && panel->clkSP == i) {
|
||||
applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData);
|
||||
}
|
||||
if (panel->clkApplet == applet && panel->clkSP == i) {
|
||||
applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData);
|
||||
}
|
||||
} else {
|
||||
panel->clkApplet = applet;
|
||||
panel->clkSP = i;
|
||||
panel->clkApplet = applet;
|
||||
panel->clkSP = i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
|
||||
WPARAM lParam1, LPARAM lParam2)
|
||||
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
|
||||
WPARAM lParam1, LPARAM lParam2)
|
||||
{
|
||||
CPanel* panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
|
||||
CPanel* panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
|
||||
|
||||
if (panel || wMsg == WM_CREATE) {
|
||||
switch (wMsg) {
|
||||
case WM_CREATE:
|
||||
Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2);
|
||||
return 0;
|
||||
Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2);
|
||||
return 0;
|
||||
case WM_DESTROY:
|
||||
{
|
||||
CPlApplet* applet = panel->first;
|
||||
while (applet)
|
||||
applet = Control_UnloadApplet(applet);
|
||||
CPlApplet* applet = panel->first;
|
||||
while (applet)
|
||||
applet = Control_UnloadApplet(applet);
|
||||
}
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
break;
|
||||
case WM_PAINT:
|
||||
return Control_WndProc_Paint(panel, lParam1);
|
||||
return Control_WndProc_Paint(panel, lParam1);
|
||||
case WM_LBUTTONUP:
|
||||
return Control_WndProc_LButton(panel, lParam2, TRUE);
|
||||
return Control_WndProc_LButton(panel, lParam2, TRUE);
|
||||
case WM_LBUTTONDOWN:
|
||||
return Control_WndProc_LButton(panel, lParam2, FALSE);
|
||||
return Control_WndProc_LButton(panel, lParam2, FALSE);
|
||||
/* EPP case WM_COMMAND: */
|
||||
/* EPP return Control_WndProc_Command(mwi, lParam1, lParam2); */
|
||||
/* EPP return Control_WndProc_Command(mwi, lParam1, lParam2); */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,8 +250,8 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
|
|||
|
||||
static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
|
||||
{
|
||||
WNDCLASSW wc;
|
||||
MSG msg;
|
||||
WNDCLASSW wc;
|
||||
MSG msg;
|
||||
const WCHAR* appName = L"ReactOS Control Panel";
|
||||
wc.style = CS_HREDRAW|CS_VREDRAW;
|
||||
wc.lpfnWndProc = Control_WndProc;
|
||||
|
@ -267,16 +267,16 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
|
|||
if (!RegisterClassW(&wc)) return;
|
||||
|
||||
CreateWindowExW(0, wc.lpszClassName, appName,
|
||||
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
hWnd, NULL, hInst, panel);
|
||||
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
hWnd, NULL, hInst, panel);
|
||||
if (!panel->hWnd) return;
|
||||
|
||||
if (!panel->first) {
|
||||
/* FIXME appName & message should be localized */
|
||||
MessageBoxW(panel->hWnd, L"Cannot load any applets", appName, MB_OK);
|
||||
return;
|
||||
/* FIXME appName & message should be localized */
|
||||
MessageBoxW(panel->hWnd, L"Cannot load any applets", appName, MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
while (GetMessageW(&msg, panel->hWnd, 0, 0)) {
|
||||
|
@ -287,9 +287,9 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
|
|||
|
||||
static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
|
||||
{
|
||||
HANDLE h;
|
||||
WIN32_FIND_DATAW fd;
|
||||
WCHAR buffer[MAX_PATH];
|
||||
HANDLE h;
|
||||
WIN32_FIND_DATAW fd;
|
||||
WCHAR buffer[MAX_PATH];
|
||||
static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0};
|
||||
WCHAR *p;
|
||||
|
||||
|
@ -300,35 +300,35 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
|
|||
|
||||
if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
wcscpy(p, fd.cFileName);
|
||||
Control_LoadApplet(hWnd, buffer, panel);
|
||||
} while (FindNextFileW(h, &fd));
|
||||
FindClose(h);
|
||||
wcscpy(p, fd.cFileName);
|
||||
Control_LoadApplet(hWnd, buffer, panel);
|
||||
} while (FindNextFileW(h, &fd));
|
||||
FindClose(h);
|
||||
}
|
||||
|
||||
Control_DoInterface(panel, hWnd, hInst);
|
||||
}
|
||||
|
||||
static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
||||
static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
||||
/* forms to parse:
|
||||
* foo.cpl,@sp,str
|
||||
* foo.cpl,@sp
|
||||
* foo.cpl,,str
|
||||
* foo.cpl @sp
|
||||
* foo.cpl str
|
||||
* foo.cpl,@sp,str
|
||||
* foo.cpl,@sp
|
||||
* foo.cpl,,str
|
||||
* foo.cpl @sp
|
||||
* foo.cpl str
|
||||
* "a path\foo.cpl"
|
||||
*/
|
||||
{
|
||||
LPWSTR buffer;
|
||||
LPWSTR beg = NULL;
|
||||
LPWSTR end;
|
||||
WCHAR ch;
|
||||
LPWSTR buffer;
|
||||
LPWSTR beg = NULL;
|
||||
LPWSTR end;
|
||||
WCHAR ch;
|
||||
LPCWSTR ptr, ptr2;
|
||||
WCHAR szName[MAX_PATH];
|
||||
unsigned sp = 0;
|
||||
LPWSTR extraPmts = NULL;
|
||||
unsigned sp = 0;
|
||||
LPWSTR extraPmts = NULL;
|
||||
int quoted = 0;
|
||||
BOOL spSet = FALSE;
|
||||
BOOL spSet = FALSE;
|
||||
HANDLE hMutex;
|
||||
UINT Length;
|
||||
|
||||
|
@ -352,7 +352,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
szName[Length] = L'\0';
|
||||
hMutex = CreateMutexW(NULL, TRUE, szName);
|
||||
|
||||
if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
|
||||
if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
|
||||
return;
|
||||
buffer = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (wcslen(wszCmd) + 1) * sizeof(*wszCmd));
|
||||
if (!buffer)
|
||||
|
@ -362,32 +362,32 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
}
|
||||
end = wcscpy(buffer, wszCmd);
|
||||
for (;;) {
|
||||
ch = *end;
|
||||
ch = *end;
|
||||
if (ch == '"') quoted = !quoted;
|
||||
if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
|
||||
*end = '\0';
|
||||
if (beg) {
|
||||
if (*beg == '@') {
|
||||
sp = atoiW(beg + 1);
|
||||
spSet = TRUE;
|
||||
} else if (*beg == '\0') {
|
||||
sp = 0;
|
||||
spSet = TRUE;
|
||||
} else {
|
||||
extraPmts = beg;
|
||||
}
|
||||
}
|
||||
if (ch == '\0') break;
|
||||
beg = end + 1;
|
||||
if (ch == ' ') while (end[1] == ' ') end++;
|
||||
}
|
||||
end++;
|
||||
if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
|
||||
*end = '\0';
|
||||
if (beg) {
|
||||
if (*beg == '@') {
|
||||
sp = atoiW(beg + 1);
|
||||
spSet = TRUE;
|
||||
} else if (*beg == '\0') {
|
||||
sp = 0;
|
||||
spSet = TRUE;
|
||||
} else {
|
||||
extraPmts = beg;
|
||||
}
|
||||
}
|
||||
if (ch == '\0') break;
|
||||
beg = end + 1;
|
||||
if (ch == ' ') while (end[1] == ' ') end++;
|
||||
}
|
||||
end++;
|
||||
}
|
||||
while ((ptr = StrChrW(buffer, '"')))
|
||||
memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
|
||||
memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
|
||||
|
||||
while ((ptr = StrChrW(extraPmts, '"')))
|
||||
memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
|
||||
memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
|
||||
|
||||
TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp);
|
||||
|
||||
|
@ -398,8 +398,8 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
|
||||
assert(applet && applet->next == NULL);
|
||||
if (sp >= applet->count) {
|
||||
WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
|
||||
sp = 0;
|
||||
WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
|
||||
sp = 0;
|
||||
}
|
||||
|
||||
if ((extraPmts) && extraPmts[0] &&(!spSet))
|
||||
|
@ -422,21 +422,21 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
}
|
||||
Control_UnloadApplet(applet);
|
||||
}
|
||||
ReleaseMutex(hMutex);
|
||||
CloseHandle(hMutex);
|
||||
ReleaseMutex(hMutex);
|
||||
CloseHandle(hMutex);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Control_RunDLLW [SHELL32.@]
|
||||
* Control_RunDLLW [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
|
||||
{
|
||||
CPanel panel;
|
||||
CPanel panel;
|
||||
|
||||
TRACE("(%p, %p, %s, 0x%08x)\n",
|
||||
hWnd, hInst, debugstr_w(cmd), nCmdShow);
|
||||
hWnd, hInst, debugstr_w(cmd), nCmdShow);
|
||||
|
||||
memset(&panel, 0, sizeof(panel));
|
||||
|
||||
|
@ -448,7 +448,7 @@ EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DW
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Control_RunDLLA [SHELL32.@]
|
||||
* Control_RunDLLA [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
EXTERN_C void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
|
||||
|
@ -463,7 +463,7 @@ EXTERN_C void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWO
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Control_FillCache_RunDLLW [SHELL32.@]
|
||||
* Control_FillCache_RunDLLW [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
|
||||
|
@ -473,7 +473,7 @@ EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWO
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Control_FillCache_RunDLLA [SHELL32.@]
|
||||
* Control_FillCache_RunDLLA [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
|
||||
|
@ -483,7 +483,7 @@ EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWO
|
|||
|
||||
|
||||
/*************************************************************************
|
||||
* RunDLL_CallEntry16 [SHELL32.122]
|
||||
* RunDLL_CallEntry16 [SHELL32.122]
|
||||
* the name is probably wrong
|
||||
*/
|
||||
EXTERN_C void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
|
||||
|
@ -511,7 +511,7 @@ EXTERN_C void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* CallCPLEntry16 [SHELL32.166]
|
||||
* CallCPLEntry16 [SHELL32.166]
|
||||
*
|
||||
* called by desk.cpl on "Advanced" with:
|
||||
* hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* IEnumFORMATETC, IDataObject
|
||||
* IEnumFORMATETC, IDataObject
|
||||
*
|
||||
* selecting and droping objects within the shell and/or common dialogs
|
||||
*
|
||||
* Copyright 1998, 1999 <juergen.schmied@metronet.de>
|
||||
* Copyright 1998, 1999 <juergen.schmied@metronet.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -29,34 +29,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
|||
*/
|
||||
|
||||
class IEnumFORMATETCImpl :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IEnumFORMATETC
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IEnumFORMATETC
|
||||
{
|
||||
private:
|
||||
UINT posFmt;
|
||||
UINT countFmt;
|
||||
LPFORMATETC pFmt;
|
||||
UINT posFmt;
|
||||
UINT countFmt;
|
||||
LPFORMATETC pFmt;
|
||||
public:
|
||||
IEnumFORMATETCImpl();
|
||||
~IEnumFORMATETCImpl();
|
||||
HRESULT WINAPI Initialize(UINT cfmt, const FORMATETC afmt[]);
|
||||
IEnumFORMATETCImpl();
|
||||
~IEnumFORMATETCImpl();
|
||||
HRESULT WINAPI Initialize(UINT cfmt, const FORMATETC afmt[]);
|
||||
|
||||
// *****************
|
||||
virtual HRESULT WINAPI Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed);
|
||||
virtual HRESULT WINAPI Skip(ULONG celt);
|
||||
virtual HRESULT WINAPI Reset();
|
||||
virtual HRESULT WINAPI Clone(LPENUMFORMATETC* ppenum);
|
||||
// *****************
|
||||
virtual HRESULT WINAPI Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed);
|
||||
virtual HRESULT WINAPI Skip(ULONG celt);
|
||||
virtual HRESULT WINAPI Reset();
|
||||
virtual HRESULT WINAPI Clone(LPENUMFORMATETC* ppenum);
|
||||
|
||||
BEGIN_COM_MAP(IEnumFORMATETCImpl)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumFORMATETC, IEnumFORMATETC)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumFORMATETC, IEnumFORMATETC)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
IEnumFORMATETCImpl::IEnumFORMATETCImpl()
|
||||
{
|
||||
posFmt = 0;
|
||||
countFmt = 0;
|
||||
pFmt = NULL;
|
||||
posFmt = 0;
|
||||
countFmt = 0;
|
||||
pFmt = NULL;
|
||||
}
|
||||
|
||||
IEnumFORMATETCImpl::~IEnumFORMATETCImpl()
|
||||
|
@ -65,50 +65,50 @@ IEnumFORMATETCImpl::~IEnumFORMATETCImpl()
|
|||
|
||||
HRESULT WINAPI IEnumFORMATETCImpl::Initialize(UINT cfmt, const FORMATETC afmt[])
|
||||
{
|
||||
DWORD size;
|
||||
DWORD size;
|
||||
|
||||
size = cfmt * sizeof(FORMATETC);
|
||||
countFmt = cfmt;
|
||||
pFmt = (LPFORMATETC)SHAlloc(size);
|
||||
if (pFmt == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
size = cfmt * sizeof(FORMATETC);
|
||||
countFmt = cfmt;
|
||||
pFmt = (LPFORMATETC)SHAlloc(size);
|
||||
if (pFmt == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
memcpy(pFmt, afmt, size);
|
||||
return S_OK;
|
||||
memcpy(pFmt, afmt, size);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IEnumFORMATETCImpl::Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed)
|
||||
{
|
||||
UINT i;
|
||||
UINT i;
|
||||
|
||||
TRACE("(%p)->(%u,%p)\n", this, celt, rgelt);
|
||||
TRACE("(%p)->(%u,%p)\n", this, celt, rgelt);
|
||||
|
||||
if(!pFmt)return S_FALSE;
|
||||
if(!rgelt) return E_INVALIDARG;
|
||||
if (pceltFethed) *pceltFethed = 0;
|
||||
if(!pFmt)return S_FALSE;
|
||||
if(!rgelt) return E_INVALIDARG;
|
||||
if (pceltFethed) *pceltFethed = 0;
|
||||
|
||||
for(i = 0; posFmt < countFmt && celt > i; i++)
|
||||
for(i = 0; posFmt < countFmt && celt > i; i++)
|
||||
{
|
||||
*rgelt++ = pFmt[posFmt++];
|
||||
}
|
||||
*rgelt++ = pFmt[posFmt++];
|
||||
}
|
||||
|
||||
if (pceltFethed) *pceltFethed = i;
|
||||
if (pceltFethed) *pceltFethed = i;
|
||||
|
||||
return ((i == celt) ? S_OK : S_FALSE);
|
||||
return ((i == celt) ? S_OK : S_FALSE);
|
||||
}
|
||||
|
||||
HRESULT WINAPI IEnumFORMATETCImpl::Skip(ULONG celt)
|
||||
{
|
||||
TRACE("(%p)->(num=%u)\n", this, celt);
|
||||
TRACE("(%p)->(num=%u)\n", this, celt);
|
||||
|
||||
if (posFmt + celt >= countFmt) return S_FALSE;
|
||||
posFmt += celt;
|
||||
return S_OK;
|
||||
if (posFmt + celt >= countFmt) return S_FALSE;
|
||||
posFmt += celt;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IEnumFORMATETCImpl::Reset()
|
||||
{
|
||||
TRACE("(%p)->()\n", this);
|
||||
TRACE("(%p)->()\n", this);
|
||||
|
||||
posFmt = 0;
|
||||
return S_OK;
|
||||
|
@ -116,41 +116,41 @@ HRESULT WINAPI IEnumFORMATETCImpl::Reset()
|
|||
|
||||
HRESULT WINAPI IEnumFORMATETCImpl::Clone(LPENUMFORMATETC* ppenum)
|
||||
{
|
||||
HRESULT hResult;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE("(%p)->(ppenum=%p)\n", this, ppenum);
|
||||
TRACE("(%p)->(ppenum=%p)\n", this, ppenum);
|
||||
|
||||
if (!ppenum) return E_INVALIDARG;
|
||||
hResult = IEnumFORMATETC_Constructor(countFmt, pFmt, ppenum);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
return (*ppenum)->Skip(posFmt);
|
||||
if (!ppenum) return E_INVALIDARG;
|
||||
hResult = IEnumFORMATETC_Constructor(countFmt, pFmt, ppenum);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
return (*ppenum)->Skip(posFmt);
|
||||
}
|
||||
|
||||
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator)
|
||||
{
|
||||
CComObject<IEnumFORMATETCImpl> *theEnumerator;
|
||||
CComPtr<IEnumFORMATETC> result;
|
||||
HRESULT hResult;
|
||||
CComObject<IEnumFORMATETCImpl> *theEnumerator;
|
||||
CComPtr<IEnumFORMATETC> result;
|
||||
HRESULT hResult;
|
||||
|
||||
if (enumerator == NULL)
|
||||
return E_POINTER;
|
||||
*enumerator = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<IEnumFORMATETCImpl>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumFORMATETC, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize (cfmt, afmt);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*enumerator = result.Detach ();
|
||||
if (enumerator == NULL)
|
||||
return E_POINTER;
|
||||
*enumerator = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<IEnumFORMATETCImpl>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumFORMATETC, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize (cfmt, afmt);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*enumerator = result.Detach ();
|
||||
TRACE("(%p)->(%u,%p)\n", *enumerator, cfmt, afmt);
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,72 +162,72 @@ HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMA
|
|||
#define MAX_FORMATS 4
|
||||
|
||||
class IDataObjectImpl :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IDataObject
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IDataObject
|
||||
{
|
||||
private:
|
||||
LPITEMIDLIST pidl;
|
||||
LPITEMIDLIST * apidl;
|
||||
UINT cidl;
|
||||
LPITEMIDLIST pidl;
|
||||
LPITEMIDLIST * apidl;
|
||||
UINT cidl;
|
||||
|
||||
FORMATETC pFormatEtc[MAX_FORMATS];
|
||||
UINT cfShellIDList;
|
||||
UINT cfFileNameA;
|
||||
UINT cfFileNameW;
|
||||
FORMATETC pFormatEtc[MAX_FORMATS];
|
||||
UINT cfShellIDList;
|
||||
UINT cfFileNameA;
|
||||
UINT cfFileNameW;
|
||||
public:
|
||||
IDataObjectImpl();
|
||||
~IDataObjectImpl();
|
||||
HRESULT WINAPI Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx);
|
||||
IDataObjectImpl();
|
||||
~IDataObjectImpl();
|
||||
HRESULT WINAPI Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx);
|
||||
|
||||
///////////
|
||||
virtual HRESULT WINAPI GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium);
|
||||
virtual HRESULT WINAPI GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium);
|
||||
virtual HRESULT WINAPI QueryGetData(LPFORMATETC pformatetc);
|
||||
virtual HRESULT WINAPI GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut);
|
||||
virtual HRESULT WINAPI SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease);
|
||||
virtual HRESULT WINAPI EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc);
|
||||
virtual HRESULT WINAPI DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
|
||||
virtual HRESULT WINAPI DUnadvise(DWORD dwConnection);
|
||||
virtual HRESULT WINAPI EnumDAdvise(IEnumSTATDATA **ppenumAdvise);
|
||||
///////////
|
||||
virtual HRESULT WINAPI GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium);
|
||||
virtual HRESULT WINAPI GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium);
|
||||
virtual HRESULT WINAPI QueryGetData(LPFORMATETC pformatetc);
|
||||
virtual HRESULT WINAPI GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut);
|
||||
virtual HRESULT WINAPI SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease);
|
||||
virtual HRESULT WINAPI EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc);
|
||||
virtual HRESULT WINAPI DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
|
||||
virtual HRESULT WINAPI DUnadvise(DWORD dwConnection);
|
||||
virtual HRESULT WINAPI EnumDAdvise(IEnumSTATDATA **ppenumAdvise);
|
||||
|
||||
BEGIN_COM_MAP(IDataObjectImpl)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IDataObject, IDataObject)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IDataObject, IDataObject)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
IDataObjectImpl::IDataObjectImpl()
|
||||
{
|
||||
pidl = NULL;
|
||||
apidl = NULL;
|
||||
cidl = 0;
|
||||
cfShellIDList = 0;
|
||||
cfFileNameA = 0;
|
||||
cfFileNameW = 0;
|
||||
pidl = NULL;
|
||||
apidl = NULL;
|
||||
cidl = 0;
|
||||
cfShellIDList = 0;
|
||||
cfFileNameA = 0;
|
||||
cfFileNameW = 0;
|
||||
}
|
||||
|
||||
IDataObjectImpl::~IDataObjectImpl()
|
||||
{
|
||||
TRACE(" destroying IDataObject(%p)\n",this);
|
||||
_ILFreeaPidl(apidl, cidl);
|
||||
ILFree(pidl);
|
||||
TRACE(" destroying IDataObject(%p)\n",this);
|
||||
_ILFreeaPidl(apidl, cidl);
|
||||
ILFree(pidl);
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx)
|
||||
{
|
||||
pidl = ILClone(pMyPidl);
|
||||
apidl = _ILCopyaPidl(apidlx, cidlx);
|
||||
if (pidl == NULL || apidl == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
cidl = cidlx;
|
||||
pidl = ILClone(pMyPidl);
|
||||
apidl = _ILCopyaPidl(apidlx, cidlx);
|
||||
if (pidl == NULL || apidl == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
cidl = cidlx;
|
||||
|
||||
cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
|
||||
cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
|
||||
cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW);
|
||||
InitFormatEtc(pFormatEtc[0], cfShellIDList, TYMED_HGLOBAL);
|
||||
InitFormatEtc(pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
|
||||
InitFormatEtc(pFormatEtc[2], cfFileNameA, TYMED_HGLOBAL);
|
||||
InitFormatEtc(pFormatEtc[3], cfFileNameW, TYMED_HGLOBAL);
|
||||
return S_OK;
|
||||
cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
|
||||
cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
|
||||
cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW);
|
||||
InitFormatEtc(pFormatEtc[0], cfShellIDList, TYMED_HGLOBAL);
|
||||
InitFormatEtc(pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
|
||||
InitFormatEtc(pFormatEtc[2], cfFileNameA, TYMED_HGLOBAL);
|
||||
InitFormatEtc(pFormatEtc[3], cfFileNameW, TYMED_HGLOBAL);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -235,116 +235,116 @@ HRESULT WINAPI IDataObjectImpl::Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl
|
|||
*/
|
||||
HRESULT WINAPI IDataObjectImpl::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
|
||||
{
|
||||
char szTemp[256];
|
||||
char szTemp[256];
|
||||
|
||||
szTemp[0] = 0;
|
||||
GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
|
||||
TRACE("(%p)->(%p %p format=%s)\n", this, pformatetcIn, pmedium, szTemp);
|
||||
szTemp[0] = 0;
|
||||
GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
|
||||
TRACE("(%p)->(%p %p format=%s)\n", this, pformatetcIn, pmedium, szTemp);
|
||||
|
||||
if (pformatetcIn->cfFormat == cfShellIDList)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == CF_HDROP)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == cfFileNameA)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == cfFileNameW)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl);
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("-- expected clipformat not implemented\n");
|
||||
return (E_INVALIDARG);
|
||||
}
|
||||
if (pmedium->hGlobal)
|
||||
{
|
||||
pmedium->tymed = TYMED_HGLOBAL;
|
||||
pmedium->pUnkForRelease = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
return E_OUTOFMEMORY;
|
||||
if (pformatetcIn->cfFormat == cfShellIDList)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == CF_HDROP)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == cfFileNameA)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == cfFileNameW)
|
||||
{
|
||||
if (cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl);
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("-- expected clipformat not implemented\n");
|
||||
return (E_INVALIDARG);
|
||||
}
|
||||
if (pmedium->hGlobal)
|
||||
{
|
||||
pmedium->tymed = TYMED_HGLOBAL;
|
||||
pmedium->pUnkForRelease = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium)
|
||||
{
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::QueryGetData(LPFORMATETC pformatetc)
|
||||
{
|
||||
UINT i;
|
||||
UINT i;
|
||||
|
||||
TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", this, pformatetc->cfFormat, pformatetc->tymed);
|
||||
TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", this, pformatetc->cfFormat, pformatetc->tymed);
|
||||
|
||||
if(!(DVASPECT_CONTENT & pformatetc->dwAspect))
|
||||
return DV_E_DVASPECT;
|
||||
if(!(DVASPECT_CONTENT & pformatetc->dwAspect))
|
||||
return DV_E_DVASPECT;
|
||||
|
||||
/* check our formats table what we have */
|
||||
for (i=0; i<MAX_FORMATS; i++)
|
||||
{
|
||||
if ((pFormatEtc[i].cfFormat == pformatetc->cfFormat)
|
||||
&& (pFormatEtc[i].tymed == pformatetc->tymed))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
/* check our formats table what we have */
|
||||
for (i=0; i<MAX_FORMATS; i++)
|
||||
{
|
||||
if ((pFormatEtc[i].cfFormat == pformatetc->cfFormat)
|
||||
&& (pFormatEtc[i].tymed == pformatetc->tymed))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return DV_E_TYMED;
|
||||
return DV_E_TYMED;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
|
||||
{
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
|
||||
{
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
|
||||
{
|
||||
TRACE("(%p)->()\n", this);
|
||||
*ppenumFormatEtc = NULL;
|
||||
TRACE("(%p)->()\n", this);
|
||||
*ppenumFormatEtc = NULL;
|
||||
|
||||
/* only get data */
|
||||
if (DATADIR_GET == dwDirection)
|
||||
{
|
||||
return IEnumFORMATETC_Constructor(MAX_FORMATS, pFormatEtc, ppenumFormatEtc);
|
||||
}
|
||||
/* only get data */
|
||||
if (DATADIR_GET == dwDirection)
|
||||
{
|
||||
return IEnumFORMATETC_Constructor(MAX_FORMATS, pFormatEtc, ppenumFormatEtc);
|
||||
}
|
||||
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
|
||||
{
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::DUnadvise(DWORD dwConnection)
|
||||
{
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDataObjectImpl::EnumDAdvise(IEnumSTATDATA **ppenumAdvise)
|
||||
{
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
FIXME("(%p)->()\n", this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -352,32 +352,32 @@ HRESULT WINAPI IDataObjectImpl::EnumDAdvise(IEnumSTATDATA **ppenumAdvise)
|
|||
*/
|
||||
HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl, IDataObject **dataObject)
|
||||
{
|
||||
CComObject<IDataObjectImpl> *theDataObject;
|
||||
CComPtr<IDataObject> result;
|
||||
HRESULT hResult;
|
||||
CComObject<IDataObjectImpl> *theDataObject;
|
||||
CComPtr<IDataObject> result;
|
||||
HRESULT hResult;
|
||||
|
||||
if (dataObject == NULL)
|
||||
return E_POINTER;
|
||||
*dataObject = NULL;
|
||||
ATLTRY (theDataObject = new CComObject<IDataObjectImpl>);
|
||||
if (theDataObject == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theDataObject->QueryInterface (IID_IDataObject, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theDataObject;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theDataObject->Initialize (hwndOwner, pMyPidl, apidl, cidl);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*dataObject = result.Detach ();
|
||||
TRACE("(%p)->(apidl=%p cidl=%u)\n", *dataObject, apidl, cidl);
|
||||
return S_OK;
|
||||
if (dataObject == NULL)
|
||||
return E_POINTER;
|
||||
*dataObject = NULL;
|
||||
ATLTRY (theDataObject = new CComObject<IDataObjectImpl>);
|
||||
if (theDataObject == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theDataObject->QueryInterface (IID_IDataObject, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theDataObject;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theDataObject->Initialize (hwndOwner, pMyPidl, apidl, cidl);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*dataObject = result.Detach ();
|
||||
TRACE("(%p)->(apidl=%p cidl=%u)\n", *dataObject, apidl, cidl);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHCreateDataObject [SHELL32.@]
|
||||
* SHCreateDataObject [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -32,10 +32,10 @@ static const WCHAR szProgmanWindowName[] = {
|
|||
};
|
||||
|
||||
class CDesktopBrowser :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IShellBrowser,
|
||||
public ICommDlgBrowser,
|
||||
public IServiceProvider
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IShellBrowser,
|
||||
public ICommDlgBrowser,
|
||||
public IServiceProvider
|
||||
{
|
||||
public:
|
||||
DWORD Tag;
|
||||
|
@ -43,26 +43,26 @@ private:
|
|||
HWND hWnd;
|
||||
HWND hWndShellView;
|
||||
HWND hWndDesktopListView;
|
||||
CComPtr<IShellDesktopTray> ShellDesk;
|
||||
CComPtr<IShellView> DesktopView;
|
||||
CComPtr<IShellDesktopTray> ShellDesk;
|
||||
CComPtr<IShellView> DesktopView;
|
||||
IShellBrowser *DefaultShellBrowser;
|
||||
LPITEMIDLIST pidlDesktopDirectory;
|
||||
LPITEMIDLIST pidlDesktop;
|
||||
public:
|
||||
CDesktopBrowser();
|
||||
~CDesktopBrowser();
|
||||
HRESULT Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx);
|
||||
HWND FindDesktopListView ();
|
||||
BOOL CreateDeskWnd();
|
||||
HWND DesktopGetWindowControl(IN UINT id);
|
||||
static LRESULT CALLBACK ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam);
|
||||
static BOOL MessageLoop();
|
||||
CDesktopBrowser();
|
||||
~CDesktopBrowser();
|
||||
HRESULT Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx);
|
||||
HWND FindDesktopListView ();
|
||||
BOOL CreateDeskWnd();
|
||||
HWND DesktopGetWindowControl(IN UINT id);
|
||||
static LRESULT CALLBACK ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam);
|
||||
static BOOL MessageLoop();
|
||||
|
||||
// *** IOleWindow methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
|
||||
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
|
||||
// *** IOleWindow methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
|
||||
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
|
||||
|
||||
// *** IShellBrowser methods ***
|
||||
// *** IShellBrowser methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject);
|
||||
virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB(HMENU hmenuShared);
|
||||
|
@ -77,31 +77,31 @@ public:
|
|||
virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive(struct IShellView *ppshv);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags);
|
||||
|
||||
// *** ICommDlgBrowser methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand (struct IShellView *ppshv);
|
||||
virtual HRESULT STDMETHODCALLTYPE OnStateChange (struct IShellView *ppshv, ULONG uChange);
|
||||
virtual HRESULT STDMETHODCALLTYPE IncludeObject (struct IShellView *ppshv, LPCITEMIDLIST pidl);
|
||||
// *** ICommDlgBrowser methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand (struct IShellView *ppshv);
|
||||
virtual HRESULT STDMETHODCALLTYPE OnStateChange (struct IShellView *ppshv, ULONG uChange);
|
||||
virtual HRESULT STDMETHODCALLTYPE IncludeObject (struct IShellView *ppshv, LPCITEMIDLIST pidl);
|
||||
|
||||
// *** IServiceProvider methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
|
||||
// *** IServiceProvider methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
|
||||
|
||||
BEGIN_COM_MAP(CDesktopBrowser)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IShellBrowser, IShellBrowser)
|
||||
COM_INTERFACE_ENTRY_IID(IID_ICommDlgBrowser, ICommDlgBrowser)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IShellBrowser, IShellBrowser)
|
||||
COM_INTERFACE_ENTRY_IID(IID_ICommDlgBrowser, ICommDlgBrowser)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
CDesktopBrowser::CDesktopBrowser()
|
||||
{
|
||||
Tag = SHDESK_TAG;
|
||||
hWnd = NULL;
|
||||
hWndShellView = NULL;
|
||||
hWndDesktopListView = NULL;
|
||||
DefaultShellBrowser = NULL;
|
||||
pidlDesktopDirectory = NULL;
|
||||
pidlDesktop = NULL;
|
||||
Tag = SHDESK_TAG;
|
||||
hWnd = NULL;
|
||||
hWndShellView = NULL;
|
||||
hWndDesktopListView = NULL;
|
||||
DefaultShellBrowser = NULL;
|
||||
pidlDesktopDirectory = NULL;
|
||||
pidlDesktop = NULL;
|
||||
}
|
||||
|
||||
CDesktopBrowser::~CDesktopBrowser()
|
||||
|
@ -130,9 +130,9 @@ CDesktopBrowser::~CDesktopBrowser()
|
|||
|
||||
HRESULT CDesktopBrowser::Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx)
|
||||
{
|
||||
CComPtr<IShellFolder> psfDesktopFolder;
|
||||
CSFV csfv;
|
||||
HRESULT hRet;
|
||||
CComPtr<IShellFolder> psfDesktopFolder;
|
||||
CSFV csfv;
|
||||
HRESULT hRet;
|
||||
|
||||
hWnd = hWndx;
|
||||
ShellDesk = ShellDeskx;
|
||||
|
@ -154,14 +154,14 @@ HRESULT CDesktopBrowser::Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx)
|
|||
|
||||
hRet = SHCreateShellFolderViewEx(&csfv, &DesktopView);
|
||||
|
||||
return hRet;
|
||||
return hRet;
|
||||
}
|
||||
|
||||
static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
IShellDesktopTray *ShellDesk;
|
||||
CComObject<CDesktopBrowser> *pThis;
|
||||
HRESULT hRet;
|
||||
IShellDesktopTray *ShellDesk;
|
||||
CComObject<CDesktopBrowser> *pThis;
|
||||
HRESULT hRet;
|
||||
|
||||
ShellDesk = (IShellDesktopTray *)lpCreateStruct->lpCreateParams;
|
||||
if (ShellDesk == NULL)
|
||||
|
@ -170,19 +170,19 @@ static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
pThis = new CComObject<CDesktopBrowser>;
|
||||
if (pThis == NULL)
|
||||
return NULL;
|
||||
pThis->AddRef();
|
||||
pThis = new CComObject<CDesktopBrowser>;
|
||||
if (pThis == NULL)
|
||||
return NULL;
|
||||
pThis->AddRef();
|
||||
|
||||
hRet = pThis->Initialize(hWnd, ShellDesk);
|
||||
if (FAILED(hRet))
|
||||
{
|
||||
pThis->Release();
|
||||
return NULL;
|
||||
}
|
||||
hRet = pThis->Initialize(hWnd, ShellDesk);
|
||||
if (FAILED(hRet))
|
||||
{
|
||||
pThis->Release();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pThis;
|
||||
return pThis;
|
||||
}
|
||||
|
||||
HWND CDesktopBrowser::FindDesktopListView ()
|
||||
|
@ -302,7 +302,7 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetControlWindow(UINT id, HWND *lphwn
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CDesktopBrowser::SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)
|
||||
{
|
||||
HWND hWnd;
|
||||
HWND hWnd;
|
||||
|
||||
if (pret == NULL)
|
||||
return E_POINTER;
|
||||
|
@ -323,8 +323,8 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::SendControlMsg(UINT id, UINT uMsg, WP
|
|||
HRESULT STDMETHODCALLTYPE CDesktopBrowser::QueryActiveShellView(IShellView **ppshv)
|
||||
{
|
||||
*ppshv = DesktopView;
|
||||
if (DesktopView != NULL)
|
||||
DesktopView->AddRef();
|
||||
if (DesktopView != NULL)
|
||||
DesktopView->AddRef();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ RegisterProgmanWindowClass(VOID)
|
|||
WNDCLASSW wcProgman;
|
||||
|
||||
wcProgman.style = CS_DBLCLKS;
|
||||
wcProgman.lpfnWndProc = CDesktopBrowser::ProgmanWindowProc;
|
||||
wcProgman.lpfnWndProc = CDesktopBrowser::ProgmanWindowProc;
|
||||
wcProgman.cbClsExtra = 0;
|
||||
wcProgman.cbWndExtra = sizeof(CDesktopBrowser *);
|
||||
wcProgman.hInstance = shell32_hInstance;
|
||||
|
@ -501,7 +501,7 @@ RegisterProgmanWindowClass(VOID)
|
|||
|
||||
|
||||
/*************************************************************************
|
||||
* SHCreateDesktop [SHELL32.200]
|
||||
* SHCreateDesktop [SHELL32.200]
|
||||
*
|
||||
*/
|
||||
HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
|
||||
|
@ -544,7 +544,7 @@ HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHCreateDesktop [SHELL32.201]
|
||||
* SHCreateDesktop [SHELL32.201]
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* file system folder
|
||||
* file system folder
|
||||
*
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998, 1999, 2002 Juergen Schmied
|
||||
* Copyright 2009 Andrew Hill
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998, 1999, 2002 Juergen Schmied
|
||||
* Copyright 2009 Andrew Hill
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -34,50 +34,50 @@ typedef enum
|
|||
typedef
|
||||
BOOLEAN
|
||||
(NTAPI *INITIALIZE_FMIFS)(
|
||||
IN PVOID hinstDll,
|
||||
IN DWORD dwReason,
|
||||
IN PVOID reserved
|
||||
IN PVOID hinstDll,
|
||||
IN DWORD dwReason,
|
||||
IN PVOID reserved
|
||||
);
|
||||
typedef
|
||||
BOOLEAN
|
||||
(NTAPI *QUERY_AVAILABLEFSFORMAT)(
|
||||
IN DWORD Index,
|
||||
IN OUT PWCHAR FileSystem,
|
||||
OUT UCHAR* Major,
|
||||
OUT UCHAR* Minor,
|
||||
OUT BOOLEAN* LastestVersion
|
||||
IN DWORD Index,
|
||||
IN OUT PWCHAR FileSystem,
|
||||
OUT UCHAR* Major,
|
||||
OUT UCHAR* Minor,
|
||||
OUT BOOLEAN* LastestVersion
|
||||
);
|
||||
typedef
|
||||
BOOLEAN
|
||||
(NTAPI *ENABLEVOLUMECOMPRESSION)(
|
||||
IN PWCHAR DriveRoot,
|
||||
IN USHORT Compression
|
||||
IN PWCHAR DriveRoot,
|
||||
IN USHORT Compression
|
||||
);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(NTAPI *FORMAT_EX)(
|
||||
IN PWCHAR DriveRoot,
|
||||
IN FMIFS_MEDIA_FLAG MediaFlag,
|
||||
IN PWCHAR Format,
|
||||
IN PWCHAR Label,
|
||||
IN BOOLEAN QuickFormat,
|
||||
IN ULONG ClusterSize,
|
||||
IN PFMIFSCALLBACK Callback
|
||||
IN PWCHAR DriveRoot,
|
||||
IN FMIFS_MEDIA_FLAG MediaFlag,
|
||||
IN PWCHAR Format,
|
||||
IN PWCHAR Label,
|
||||
IN BOOLEAN QuickFormat,
|
||||
IN ULONG ClusterSize,
|
||||
IN PFMIFSCALLBACK Callback
|
||||
);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(NTAPI *CHKDSK)(
|
||||
IN PWCHAR DriveRoot,
|
||||
IN PWCHAR Format,
|
||||
IN BOOLEAN CorrectErrors,
|
||||
IN BOOLEAN Verbose,
|
||||
IN BOOLEAN CheckOnlyIfDirty,
|
||||
IN BOOLEAN ScanDrive,
|
||||
IN PVOID Unused2,
|
||||
IN PVOID Unused3,
|
||||
IN PFMIFSCALLBACK Callback
|
||||
IN PWCHAR DriveRoot,
|
||||
IN PWCHAR Format,
|
||||
IN BOOLEAN CorrectErrors,
|
||||
IN BOOLEAN Verbose,
|
||||
IN BOOLEAN CheckOnlyIfDirty,
|
||||
IN BOOLEAN ScanDrive,
|
||||
IN PVOID Unused2,
|
||||
IN PVOID Unused3,
|
||||
IN PFMIFSCALLBACK Callback
|
||||
);
|
||||
|
||||
|
||||
|
@ -163,9 +163,9 @@ BOOLEAN bChkdskSuccess = FALSE;
|
|||
BOOLEAN
|
||||
NTAPI
|
||||
ChkdskCallback(
|
||||
IN CALLBACKCOMMAND Command,
|
||||
IN ULONG SubAction,
|
||||
IN PVOID ActionInfo)
|
||||
IN CALLBACKCOMMAND Command,
|
||||
IN ULONG SubAction,
|
||||
IN PVOID ActionInfo)
|
||||
{
|
||||
PDWORD Progress;
|
||||
PBOOLEAN pSuccess;
|
||||
|
@ -674,7 +674,7 @@ SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *
|
|||
UINT i;
|
||||
WCHAR szName[MAX_PATH+6];
|
||||
DWORD dwMaxComponent, dwFileSysFlags;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
UINT DriveType;
|
||||
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
||||
|
@ -1018,9 +1018,9 @@ BOOLEAN bSuccess = FALSE;
|
|||
BOOLEAN
|
||||
NTAPI
|
||||
FormatExCB(
|
||||
IN CALLBACKCOMMAND Command,
|
||||
IN ULONG SubAction,
|
||||
IN PVOID ActionInfo)
|
||||
IN CALLBACKCOMMAND Command,
|
||||
IN ULONG SubAction,
|
||||
IN PVOID ActionInfo)
|
||||
{
|
||||
PDWORD Progress;
|
||||
PBOOLEAN pSuccess;
|
||||
|
@ -1057,7 +1057,7 @@ FormatExCB(
|
|||
VOID
|
||||
FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||
{
|
||||
WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
|
||||
WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
|
||||
WCHAR szFileSys[40] = {0};
|
||||
WCHAR szLabel[40] = {0};
|
||||
INT iSelIndex;
|
||||
|
|
|
@ -18,11 +18,11 @@ struct IconLocation
|
|||
};
|
||||
|
||||
class IconExtraction :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IDefaultExtractIconInit,
|
||||
public IExtractIconW,
|
||||
public IExtractIconA,
|
||||
public IPersistFile
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IDefaultExtractIconInit,
|
||||
public IExtractIconW,
|
||||
public IExtractIconA,
|
||||
public IPersistFile
|
||||
{
|
||||
private:
|
||||
UINT flags;
|
||||
|
@ -31,41 +31,41 @@ private:
|
|||
struct IconLocation openIcon;
|
||||
struct IconLocation shortcutIcon;
|
||||
public:
|
||||
IconExtraction();
|
||||
~IconExtraction();
|
||||
IconExtraction();
|
||||
~IconExtraction();
|
||||
|
||||
// IDefaultExtractIconInit
|
||||
virtual HRESULT STDMETHODCALLTYPE SetDefaultIcon(LPCWSTR pszFile, int iIcon);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetFlags(UINT uFlags);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetKey(HKEY hkey);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetNormalIcon(LPCWSTR pszFile, int iIcon);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetOpenIcon(LPCWSTR pszFile, int iIcon);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetShortcutIcon(LPCWSTR pszFile, int iIcon);
|
||||
// IDefaultExtractIconInit
|
||||
virtual HRESULT STDMETHODCALLTYPE SetDefaultIcon(LPCWSTR pszFile, int iIcon);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetFlags(UINT uFlags);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetKey(HKEY hkey);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetNormalIcon(LPCWSTR pszFile, int iIcon);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetOpenIcon(LPCWSTR pszFile, int iIcon);
|
||||
virtual HRESULT STDMETHODCALLTYPE SetShortcutIcon(LPCWSTR pszFile, int iIcon);
|
||||
|
||||
// IExtractIconW
|
||||
virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
|
||||
virtual HRESULT STDMETHODCALLTYPE Extract(LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
|
||||
// IExtractIconW
|
||||
virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
|
||||
virtual HRESULT STDMETHODCALLTYPE Extract(LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
|
||||
|
||||
// IExtractIconA
|
||||
virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
|
||||
virtual HRESULT STDMETHODCALLTYPE Extract(LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
|
||||
// IExtractIconA
|
||||
virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
|
||||
virtual HRESULT STDMETHODCALLTYPE Extract(LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
|
||||
|
||||
// IPersist
|
||||
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
|
||||
virtual HRESULT STDMETHODCALLTYPE IsDirty();
|
||||
// IPersist
|
||||
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
|
||||
virtual HRESULT STDMETHODCALLTYPE IsDirty();
|
||||
|
||||
// IPersistFile
|
||||
virtual HRESULT STDMETHODCALLTYPE Load(LPCOLESTR pszFileName, DWORD dwMode);
|
||||
virtual HRESULT STDMETHODCALLTYPE Save(LPCOLESTR pszFileName, BOOL fRemember);
|
||||
virtual HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pszFileName);
|
||||
virtual HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppszFileName);
|
||||
// IPersistFile
|
||||
virtual HRESULT STDMETHODCALLTYPE Load(LPCOLESTR pszFileName, DWORD dwMode);
|
||||
virtual HRESULT STDMETHODCALLTYPE Save(LPCOLESTR pszFileName, BOOL fRemember);
|
||||
virtual HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pszFileName);
|
||||
virtual HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppszFileName);
|
||||
|
||||
BEGIN_COM_MAP(IconExtraction)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IDefaultExtractIconInit, IDefaultExtractIconInit)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IDefaultExtractIconInit, IDefaultExtractIconInit)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
|
@ -87,11 +87,11 @@ VOID DuplicateString(
|
|||
|
||||
IconExtraction::IconExtraction()
|
||||
{
|
||||
flags = 0;
|
||||
memset(&defaultIcon, 0, sizeof(defaultIcon));
|
||||
memset(&normalIcon, 0, sizeof(normalIcon));
|
||||
memset(&openIcon, 0, sizeof(openIcon));
|
||||
memset(&shortcutIcon, 0, sizeof(shortcutIcon));
|
||||
flags = 0;
|
||||
memset(&defaultIcon, 0, sizeof(defaultIcon));
|
||||
memset(&normalIcon, 0, sizeof(normalIcon));
|
||||
memset(&openIcon, 0, sizeof(openIcon));
|
||||
memset(&shortcutIcon, 0, sizeof(shortcutIcon));
|
||||
}
|
||||
|
||||
IconExtraction::~IconExtraction()
|
||||
|
@ -337,22 +337,22 @@ HRESULT STDMETHODCALLTYPE IconExtraction::GetCurFile(
|
|||
|
||||
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
|
||||
{
|
||||
CComObject<IconExtraction> *theExtractor;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
CComObject<IconExtraction> *theExtractor;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY (theExtractor = new CComObject<IconExtraction>);
|
||||
if (theExtractor == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theExtractor->QueryInterface (riid, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theExtractor;
|
||||
return hResult;
|
||||
}
|
||||
*ppv = result.Detach ();
|
||||
return S_OK;
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY (theExtractor = new CComObject<IconExtraction>);
|
||||
if (theExtractor == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theExtractor->QueryInterface (riid, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theExtractor;
|
||||
return hResult;
|
||||
}
|
||||
*ppv = result.Detach ();
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Open With Context Menu extension
|
||||
* Open With Context Menu extension
|
||||
*
|
||||
* Copyright 2007 Johannes Anderwald <janderwald@reactos.org>
|
||||
*
|
||||
|
@ -50,8 +50,8 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
LPCWSTR szKeyName;
|
||||
UINT ResourceID;
|
||||
LPCWSTR szKeyName;
|
||||
UINT ResourceID;
|
||||
}FOLDER_VIEW_ENTRY, PFOLDER_VIEW_ENTRY;
|
||||
/*
|
||||
static FOLDER_VIEW_ENTRY s_Options[] =
|
||||
|
@ -116,7 +116,7 @@ InitializeFolderOptionsListCtrl(HWND hwndDlg)
|
|||
WCHAR szName[50];
|
||||
HWND hDlgCtrl;
|
||||
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14003);
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14003);
|
||||
|
||||
if (!LoadStringW(shell32_hInstance, IDS_COLUMN_EXTENSION, szName, sizeof(szName) / sizeof(WCHAR)))
|
||||
szName[0] = 0;
|
||||
|
@ -589,7 +589,7 @@ CountFolderAndFiles(LPVOID lParam)
|
|||
pContext->cFiles++;
|
||||
pContext->bSize.u.LowPart += FindData.nFileSizeLow;
|
||||
pContext->bSize.u.HighPart += FindData.nFileSizeHigh;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (GetLastError() == ERROR_NO_MORE_FILES)
|
||||
{
|
||||
|
@ -777,7 +777,7 @@ SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDL
|
|||
WCHAR szName[MAX_PATH] = {0};
|
||||
HPSXA hpsx = NULL;
|
||||
LPWSTR pFolderName;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
|
||||
if (!PathIsDirectoryW(pwszFolder))
|
||||
return FALSE;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998 Juergen Schmied
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998 Juergen Schmied
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -187,7 +187,7 @@ GetIconOverlay(LPCITEMIDLIST pidl, WCHAR * wTemp, int* pIndex)
|
|||
*/
|
||||
IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
||||
{
|
||||
CComPtr<IDefaultExtractIconInit> initIcon;
|
||||
CComPtr<IDefaultExtractIconInit> initIcon;
|
||||
IExtractIconW *extractIcon;
|
||||
GUID const * riid;
|
||||
int icon_idx;
|
||||
|
@ -330,8 +330,8 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
|||
else if (!lstrcmpiA(sTemp, "lnkfile"))
|
||||
{
|
||||
/* extract icon from shell shortcut */
|
||||
CComPtr<IShellFolder> dsf;
|
||||
CComPtr<IShellLinkW> psl;
|
||||
CComPtr<IShellFolder> dsf;
|
||||
CComPtr<IShellLinkW> psl;
|
||||
|
||||
if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
|
||||
{
|
||||
|
|
|
@ -388,7 +388,7 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR *lpfilename, PULARGE_INTEGER l
|
|||
}
|
||||
|
||||
if (SHFileGeneralGetFileTimeString(&accessed_time, resultstr))
|
||||
{
|
||||
{
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14019);
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)resultstr);
|
||||
}
|
||||
|
@ -844,7 +844,7 @@ SH_ShowPropertiesDialog(WCHAR *lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *api
|
|||
WCHAR *pFileName;
|
||||
HPSXA hpsxa[3];
|
||||
INT_PTR res;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE("SH_ShowPropertiesDialog entered filename %s\n", debugstr_w(lpf));
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -70,8 +70,8 @@ static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR pat
|
|||
|
||||
BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
|
||||
{
|
||||
CComPtr<IShellFolder> psfParent;
|
||||
LPSHELLFOLDER lsf = psf;
|
||||
CComPtr<IShellFolder> psfParent;
|
||||
LPSHELLFOLDER lsf = psf;
|
||||
HRESULT ret = NO_ERROR;
|
||||
LPCITEMIDLIST pidllast;
|
||||
STRRET strret;
|
||||
|
@ -373,7 +373,7 @@ HRESULT WINAPI SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST * ppidl, DWORD * at
|
|||
|
||||
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * attributes)
|
||||
{
|
||||
CComPtr<IShellFolder> sf;
|
||||
CComPtr<IShellFolder> sf;
|
||||
DWORD pchEaten;
|
||||
HRESULT ret = E_FAIL;
|
||||
|
||||
|
@ -683,7 +683,7 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
|||
*/
|
||||
HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST *pidlReal)
|
||||
{
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
CComPtr<IDataObject> pDataObj;
|
||||
HRESULT hr;
|
||||
|
||||
hr = lpsf->GetUIObjectOf(0, 1, &pidlSimple,
|
||||
|
@ -967,8 +967,8 @@ EXTERN_C LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
|
|||
static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile,
|
||||
BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
|
||||
{
|
||||
CComPtr<IShellFolder> pSF;
|
||||
CComPtr<IBindCtx> pBC;
|
||||
CComPtr<IShellFolder> pSF;
|
||||
CComPtr<IBindCtx> pBC;
|
||||
HRESULT ret;
|
||||
|
||||
TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile, bBindCtx,
|
||||
|
@ -1210,7 +1210,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
|
|||
{
|
||||
HRESULT hr;
|
||||
LPCITEMIDLIST pidlLast;
|
||||
CComPtr<IShellFolder> psfFolder;
|
||||
CComPtr<IShellFolder> psfFolder;
|
||||
DWORD dwAttributes;
|
||||
STRRET strret;
|
||||
|
||||
|
@ -1244,7 +1244,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
|
|||
*/
|
||||
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
|
||||
{
|
||||
CComPtr<IShellFolder> psfDesktop;
|
||||
CComPtr<IShellFolder> psfDesktop;
|
||||
HRESULT hr=E_FAIL;
|
||||
|
||||
TRACE_(shell)("pidl=%p\n", pidl);
|
||||
|
|
|
@ -23,51 +23,51 @@
|
|||
|
||||
/* copy data structure for tray notifications */
|
||||
typedef struct TrayNotifyCDS_Dummy {
|
||||
DWORD cookie;
|
||||
DWORD notify_code;
|
||||
DWORD nicon_data[1]; // placeholder for NOTIFYICONDATA structure
|
||||
DWORD cookie;
|
||||
DWORD notify_code;
|
||||
DWORD nicon_data[1]; // placeholder for NOTIFYICONDATA structure
|
||||
} TrayNotifyCDS_Dummy;
|
||||
|
||||
/* The only difference between Shell_NotifyIconA and Shell_NotifyIconW is the call to SendMessageA/W. */
|
||||
static BOOL SHELL_NotifyIcon(DWORD dwMessage, void* pnid, HWND nid_hwnd, int nid_size, BOOL unicode)
|
||||
{
|
||||
HWND hwnd;
|
||||
COPYDATASTRUCT data;
|
||||
HWND hwnd;
|
||||
COPYDATASTRUCT data;
|
||||
|
||||
BOOL ret = FALSE;
|
||||
int len = sizeof(TrayNotifyCDS_Dummy)-sizeof(DWORD)+nid_size;
|
||||
BOOL ret = FALSE;
|
||||
int len = sizeof(TrayNotifyCDS_Dummy)-sizeof(DWORD)+nid_size;
|
||||
|
||||
TrayNotifyCDS_Dummy* pnotify_data = (TrayNotifyCDS_Dummy*) alloca(len);
|
||||
TrayNotifyCDS_Dummy* pnotify_data = (TrayNotifyCDS_Dummy*) alloca(len);
|
||||
|
||||
pnotify_data->cookie = 1;
|
||||
pnotify_data->notify_code = dwMessage;
|
||||
memcpy(&pnotify_data->nicon_data, pnid, nid_size);
|
||||
pnotify_data->cookie = 1;
|
||||
pnotify_data->notify_code = dwMessage;
|
||||
memcpy(&pnotify_data->nicon_data, pnid, nid_size);
|
||||
|
||||
data.dwData = 1;
|
||||
data.cbData = len;
|
||||
data.lpData = pnotify_data;
|
||||
data.dwData = 1;
|
||||
data.cbData = len;
|
||||
data.lpData = pnotify_data;
|
||||
|
||||
for(hwnd=0; (hwnd=FindWindowExW(0, hwnd, L"Shell_TrayWnd", NULL)); )
|
||||
if ((unicode?SendMessageW:SendMessageA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data))
|
||||
ret = TRUE;
|
||||
for(hwnd=0; (hwnd=FindWindowExW(0, hwnd, L"Shell_TrayWnd", NULL)); )
|
||||
if ((unicode?SendMessageW:SendMessageA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data))
|
||||
ret = TRUE;
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Shell_NotifyIcon [SHELL32.296]
|
||||
* Shell_NotifyIconA [SHELL32.297]
|
||||
* Shell_NotifyIcon [SHELL32.296]
|
||||
* Shell_NotifyIconA [SHELL32.297]
|
||||
*/
|
||||
BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid)
|
||||
{
|
||||
return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, FALSE);
|
||||
return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Shell_NotifyIconW [SHELL32.298]
|
||||
* Shell_NotifyIconW [SHELL32.298]
|
||||
*/
|
||||
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
|
||||
{
|
||||
return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, TRUE);
|
||||
return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, TRUE);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Open With Context Menu extension
|
||||
* Open With Context Menu extension
|
||||
*
|
||||
* Copyright 2007 Johannes Anderwald <janderwald@reactos.org>
|
||||
* Copyright 2009 Andrew Hill
|
||||
|
@ -73,7 +73,7 @@ COpenWithMenu::COpenWithMenu()
|
|||
|
||||
COpenWithMenu::~COpenWithMenu()
|
||||
{
|
||||
TRACE(" destroying IContextMenu(%p)\n", this);
|
||||
TRACE(" destroying IContextMenu(%p)\n", this);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -141,11 +141,11 @@ LoadOWItems(POPEN_WITH_CONTEXT pContext, LPCWSTR szName)
|
|||
|
||||
|
||||
HRESULT WINAPI COpenWithMenu::QueryContextMenu(
|
||||
HMENU hmenu,
|
||||
UINT indexMenu,
|
||||
UINT idCmdFirst,
|
||||
UINT idCmdLast,
|
||||
UINT uFlags)
|
||||
HMENU hmenu,
|
||||
UINT indexMenu,
|
||||
UINT idCmdFirst,
|
||||
UINT idCmdLast,
|
||||
UINT uFlags)
|
||||
{
|
||||
MENUITEMINFOW mii;
|
||||
WCHAR szBuffer[100] = {0};
|
||||
|
@ -717,9 +717,9 @@ COpenWithMenu::GetCommandString(UINT_PTR idCmd, UINT uType,
|
|||
}
|
||||
|
||||
HRESULT WINAPI COpenWithMenu::HandleMenuMsg(
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
TRACE("This %p uMsg %x\n",this, uMsg);
|
||||
|
||||
|
@ -737,7 +737,7 @@ GetManufacturer(WCHAR * szAppName, POPEN_ITEM_CONTEXT pContext)
|
|||
LPLANGANDCODEPAGE lplangcode;
|
||||
WCHAR szBuffer[100];
|
||||
WCHAR * pResult;
|
||||
BOOL bResult;
|
||||
BOOL bResult;
|
||||
|
||||
static const WCHAR wFormat[] = L"\\StringFileInfo\\%04x%04x\\CompanyName";
|
||||
static const WCHAR wTranslation[] = L"VarFileInfo\\Translation";
|
||||
|
@ -1098,8 +1098,8 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
|
|||
{
|
||||
TRACE("This %p\n", this);
|
||||
|
||||
if (pdtobj == NULL)
|
||||
return E_INVALIDARG;
|
||||
if (pdtobj == NULL)
|
||||
return E_INVALIDARG;
|
||||
return SHEOW_LoadOpenWithItems(pdtobj);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,12 +28,12 @@ EXTERN_C HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
|||
|
||||
ShellItem::ShellItem()
|
||||
{
|
||||
pidl = NULL;
|
||||
pidl = NULL;
|
||||
}
|
||||
|
||||
ShellItem::~ShellItem()
|
||||
{
|
||||
ILFree(pidl);
|
||||
ILFree(pidl);
|
||||
}
|
||||
|
||||
HRESULT ShellItem::get_parent_pidl(LPITEMIDLIST *parent_pidl)
|
||||
|
@ -60,7 +60,7 @@ HRESULT ShellItem::get_parent_pidl(LPITEMIDLIST *parent_pidl)
|
|||
HRESULT ShellItem::get_parent_shellfolder(IShellFolder **ppsf)
|
||||
{
|
||||
LPITEMIDLIST parent_pidl;
|
||||
CComPtr<IShellFolder> desktop;
|
||||
CComPtr<IShellFolder> desktop;
|
||||
HRESULT ret;
|
||||
|
||||
ret = get_parent_pidl(&parent_pidl);
|
||||
|
@ -112,7 +112,7 @@ HRESULT WINAPI ShellItem::GetDisplayName(SIGDN sigdnName, LPWSTR *ppszName)
|
|||
|
||||
HRESULT WINAPI ShellItem::GetAttributes(SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs)
|
||||
{
|
||||
CComPtr<IShellFolder> parent_folder;
|
||||
CComPtr<IShellFolder> parent_folder;
|
||||
LPITEMIDLIST child_pidl;
|
||||
HRESULT ret;
|
||||
|
||||
|
@ -179,7 +179,7 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
|||
{
|
||||
IShellItem *newShellItem;
|
||||
LPITEMIDLIST new_pidl;
|
||||
CComPtr<IPersistIDList> newPersistIDList;
|
||||
CComPtr<IPersistIDList> newPersistIDList;
|
||||
HRESULT ret;
|
||||
|
||||
TRACE("(%p,%p,%p,%p)\n", pidlParent, psfParent, pidl, ppsi);
|
||||
|
@ -193,7 +193,7 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
|||
LPITEMIDLIST temp_parent=NULL;
|
||||
if (!pidlParent)
|
||||
{
|
||||
CComPtr<IPersistFolder2> ppf2Parent;
|
||||
CComPtr<IPersistFolder2> ppf2Parent;
|
||||
|
||||
if (FAILED(psfParent->QueryInterface(IID_IPersistFolder2, (void**)&ppf2Parent)))
|
||||
{
|
||||
|
@ -223,26 +223,26 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
ret = ShellItem::_CreatorClass::CreateInstance(NULL, IID_IShellItem, (void**)&newShellItem);
|
||||
ret = ShellItem::_CreatorClass::CreateInstance(NULL, IID_IShellItem, (void**)&newShellItem);
|
||||
if (FAILED(ret))
|
||||
{
|
||||
*ppsi = NULL;
|
||||
ILFree(new_pidl);
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
ret = newShellItem->QueryInterface(IID_IPersistIDList, (void **)&newPersistIDList);
|
||||
ret = newShellItem->QueryInterface(IID_IPersistIDList, (void **)&newPersistIDList);
|
||||
if (FAILED(ret))
|
||||
{
|
||||
{
|
||||
ILFree(new_pidl);
|
||||
return ret;
|
||||
}
|
||||
ret = newPersistIDList->SetIDList(new_pidl);
|
||||
return ret;
|
||||
}
|
||||
ret = newPersistIDList->SetIDList(new_pidl);
|
||||
if (FAILED(ret))
|
||||
{
|
||||
{
|
||||
ILFree(new_pidl);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
ILFree(new_pidl);
|
||||
*ppsi = newShellItem;
|
||||
*ppsi = newShellItem;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* handling of SHELL32.DLL OLE-Objects
|
||||
* handling of SHELL32.DLL OLE-Objects
|
||||
*
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -38,11 +38,11 @@ HRESULT IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const I
|
|||
DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
|
||||
{
|
||||
WCHAR sFormat[52] = {'{','%','0','8','l','x','-','%','0','4',
|
||||
'x','-','%','0','4','x','-','%','0','2',
|
||||
'x','-','%','0','4','x','-','%','0','2',
|
||||
'x','%','0','2','x','-','%','0','2','x',
|
||||
'%','0','2','x','%','0','2','x','%','0',
|
||||
'2','x','%','0','2','x','%','0','2','x',
|
||||
'}','\0'};
|
||||
'%','0','2','x','%','0','2','x','%','0',
|
||||
'2','x','%','0','2','x','%','0','2','x',
|
||||
'}','\0'};
|
||||
|
||||
return swprintf ( str, sFormat,
|
||||
guid.Data1, guid.Data2, guid.Data3,
|
||||
|
@ -68,116 +68,116 @@ DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
|
|||
* CoCreateInstace, SHLoadOLE
|
||||
*/
|
||||
HRESULT WINAPI SHCoCreateInstance(
|
||||
LPCWSTR aclsid,
|
||||
const CLSID *clsid,
|
||||
LPUNKNOWN pUnkOuter,
|
||||
REFIID refiid,
|
||||
LPVOID *ppv)
|
||||
LPCWSTR aclsid,
|
||||
const CLSID *clsid,
|
||||
LPUNKNOWN pUnkOuter,
|
||||
REFIID refiid,
|
||||
LPVOID *ppv)
|
||||
{
|
||||
DWORD hres;
|
||||
CLSID iid;
|
||||
const CLSID * myclsid = clsid;
|
||||
WCHAR sKeyName[MAX_PATH];
|
||||
const WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'};
|
||||
WCHAR sClassID[60];
|
||||
const WCHAR sInProcServer32[16] ={'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
|
||||
const WCHAR sLoadWithoutCOM[15] ={'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
|
||||
WCHAR sDllPath[MAX_PATH];
|
||||
HKEY hKey;
|
||||
DWORD dwSize;
|
||||
BOOLEAN bLoadFromShell32 = FALSE;
|
||||
BOOLEAN bLoadWithoutCOM = FALSE;
|
||||
CComPtr<IClassFactory> pcf;
|
||||
DWORD hres;
|
||||
CLSID iid;
|
||||
const CLSID * myclsid = clsid;
|
||||
WCHAR sKeyName[MAX_PATH];
|
||||
const WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'};
|
||||
WCHAR sClassID[60];
|
||||
const WCHAR sInProcServer32[16] ={'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
|
||||
const WCHAR sLoadWithoutCOM[15] ={'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
|
||||
WCHAR sDllPath[MAX_PATH];
|
||||
HKEY hKey;
|
||||
DWORD dwSize;
|
||||
BOOLEAN bLoadFromShell32 = FALSE;
|
||||
BOOLEAN bLoadWithoutCOM = FALSE;
|
||||
CComPtr<IClassFactory> pcf;
|
||||
|
||||
if(!ppv) return E_POINTER;
|
||||
*ppv=NULL;
|
||||
if(!ppv) return E_POINTER;
|
||||
*ppv=NULL;
|
||||
|
||||
/* if the clsid is a string, convert it */
|
||||
if (!clsid)
|
||||
{
|
||||
if (!aclsid) return REGDB_E_CLASSNOTREG;
|
||||
CLSIDFromString((LPOLESTR)aclsid, &iid);
|
||||
myclsid = &iid;
|
||||
}
|
||||
/* if the clsid is a string, convert it */
|
||||
if (!clsid)
|
||||
{
|
||||
if (!aclsid) return REGDB_E_CLASSNOTREG;
|
||||
CLSIDFromString((LPOLESTR)aclsid, &iid);
|
||||
myclsid = &iid;
|
||||
}
|
||||
|
||||
TRACE("(%p,%s,unk:%p,%s,%p)\n",
|
||||
aclsid, shdebugstr_guid(myclsid), pUnkOuter, shdebugstr_guid(&refiid), ppv);
|
||||
TRACE("(%p,%s,unk:%p,%s,%p)\n",
|
||||
aclsid, shdebugstr_guid(myclsid), pUnkOuter, shdebugstr_guid(&refiid), ppv);
|
||||
|
||||
/* we look up the dll path in the registry */
|
||||
/* we look up the dll path in the registry */
|
||||
__SHGUIDToStringW(*myclsid, sClassID);
|
||||
wcscpy(sKeyName, sCLSID);
|
||||
wcscat(sKeyName, sClassID);
|
||||
wcscat(sKeyName, sInProcServer32);
|
||||
wcscpy(sKeyName, sCLSID);
|
||||
wcscat(sKeyName, sClassID);
|
||||
wcscat(sKeyName, sInProcServer32);
|
||||
|
||||
if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) {
|
||||
dwSize = sizeof(sDllPath);
|
||||
SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
|
||||
if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) {
|
||||
dwSize = sizeof(sDllPath);
|
||||
SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
|
||||
|
||||
/* if a special registry key is set, we load a shell extension without help of OLE32 */
|
||||
bLoadWithoutCOM = (ERROR_SUCCESS == SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0));
|
||||
/* if a special registry key is set, we load a shell extension without help of OLE32 */
|
||||
bLoadWithoutCOM = (ERROR_SUCCESS == SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0));
|
||||
|
||||
/* if the com object is inside shell32, omit use of ole32 */
|
||||
bLoadFromShell32 = (0==lstrcmpiW( PathFindFileNameW(sDllPath), sShell32));
|
||||
/* if the com object is inside shell32, omit use of ole32 */
|
||||
bLoadFromShell32 = (0==lstrcmpiW( PathFindFileNameW(sDllPath), sShell32));
|
||||
|
||||
RegCloseKey (hKey);
|
||||
} else {
|
||||
/* since we can't find it in the registry we try internally */
|
||||
bLoadFromShell32 = TRUE;
|
||||
}
|
||||
RegCloseKey (hKey);
|
||||
} else {
|
||||
/* since we can't find it in the registry we try internally */
|
||||
bLoadFromShell32 = TRUE;
|
||||
}
|
||||
|
||||
TRACE("WithoutCom=%u FromShell=%u\n", bLoadWithoutCOM, bLoadFromShell32);
|
||||
TRACE("WithoutCom=%u FromShell=%u\n", bLoadWithoutCOM, bLoadFromShell32);
|
||||
|
||||
/* now we create an instance */
|
||||
if (bLoadFromShell32) {
|
||||
if (! SUCCEEDED(DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
|
||||
ERR("LoadFromShell failed for CLSID=%s\n", shdebugstr_guid(myclsid));
|
||||
}
|
||||
} else if (bLoadWithoutCOM) {
|
||||
/* now we create an instance */
|
||||
if (bLoadFromShell32) {
|
||||
if (! SUCCEEDED(DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
|
||||
ERR("LoadFromShell failed for CLSID=%s\n", shdebugstr_guid(myclsid));
|
||||
}
|
||||
} else if (bLoadWithoutCOM) {
|
||||
|
||||
/* load an external dll without ole32 */
|
||||
HINSTANCE hLibrary;
|
||||
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
|
||||
DllGetClassObjectFunc DllGetClassObject;
|
||||
/* load an external dll without ole32 */
|
||||
HINSTANCE hLibrary;
|
||||
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
|
||||
DllGetClassObjectFunc DllGetClassObject;
|
||||
|
||||
if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
|
||||
ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
|
||||
hres = E_ACCESSDENIED;
|
||||
goto end;
|
||||
} else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
|
||||
ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
|
||||
FreeLibrary( hLibrary );
|
||||
hres = E_ACCESSDENIED;
|
||||
goto end;
|
||||
} else if (! SUCCEEDED(hres = DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
|
||||
TRACE("GetClassObject failed 0x%08x\n", hres);
|
||||
goto end;
|
||||
}
|
||||
if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
|
||||
ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
|
||||
hres = E_ACCESSDENIED;
|
||||
goto end;
|
||||
} else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
|
||||
ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
|
||||
FreeLibrary( hLibrary );
|
||||
hres = E_ACCESSDENIED;
|
||||
goto end;
|
||||
} else if (! SUCCEEDED(hres = DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
|
||||
TRACE("GetClassObject failed 0x%08x\n", hres);
|
||||
goto end;
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
/* load an external dll in the usual way */
|
||||
hres = CoCreateInstance(*myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
|
||||
goto end;
|
||||
}
|
||||
/* load an external dll in the usual way */
|
||||
hres = CoCreateInstance(*myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* here we should have a ClassFactory */
|
||||
if (!pcf) return E_ACCESSDENIED;
|
||||
/* here we should have a ClassFactory */
|
||||
if (!pcf) return E_ACCESSDENIED;
|
||||
|
||||
hres = pcf->CreateInstance(pUnkOuter, refiid, ppv);
|
||||
hres = pcf->CreateInstance(pUnkOuter, refiid, ppv);
|
||||
end:
|
||||
if(hres!=S_OK)
|
||||
{
|
||||
ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
|
||||
if(hres!=S_OK)
|
||||
{
|
||||
ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
|
||||
hres, shdebugstr_guid(myclsid), shdebugstr_guid(&refiid));
|
||||
ERR("class not found in registry\n");
|
||||
}
|
||||
ERR("class not found in registry\n");
|
||||
}
|
||||
|
||||
TRACE("-- instance: %p\n",*ppv);
|
||||
return hres;
|
||||
TRACE("-- instance: %p\n",*ppv);
|
||||
return hres;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHCLSIDFromString [SHELL32.147]
|
||||
* SHCLSIDFromString [SHELL32.147]
|
||||
*
|
||||
* Under Windows 9x this was an ANSI version of CLSIDFromString. It also allowed
|
||||
* to avoid dependency on ole32.dll (see SHLoadOLE for details).
|
||||
|
@ -201,19 +201,19 @@ DWORD WINAPI SHCLSIDFromStringA (LPCSTR clsid, CLSID *id)
|
|||
|
||||
DWORD WINAPI SHCLSIDFromStringW (LPCWSTR clsid, CLSID *id)
|
||||
{
|
||||
TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
|
||||
return CLSIDFromString((LPWSTR)clsid, id);
|
||||
TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
|
||||
return CLSIDFromString((LPWSTR)clsid, id);
|
||||
}
|
||||
|
||||
EXTERN_C DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return SHCLSIDFromStringW ((LPCWSTR)clsid, id);
|
||||
return SHCLSIDFromStringA ((LPCSTR)clsid, id);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return SHCLSIDFromStringW ((LPCWSTR)clsid, id);
|
||||
return SHCLSIDFromStringA ((LPCSTR)clsid, id);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetMalloc [SHELL32.@]
|
||||
* SHGetMalloc [SHELL32.@]
|
||||
*
|
||||
* Equivalent to CoGetMalloc(MEMCTX_TASK, ...). Under Windows 9x this function
|
||||
* could use the shell32 built-in "mini-COM" without the need to load ole32.dll -
|
||||
|
@ -231,12 +231,12 @@ EXTERN_C DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id)
|
|||
*/
|
||||
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
|
||||
{
|
||||
TRACE("(%p)\n", lpmal);
|
||||
return CoGetMalloc(MEMCTX_TASK, lpmal);
|
||||
TRACE("(%p)\n", lpmal);
|
||||
return CoGetMalloc(MEMCTX_TASK, lpmal);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHAlloc [SHELL32.196]
|
||||
* SHAlloc [SHELL32.196]
|
||||
*
|
||||
* Equivalent to CoTaskMemAlloc. Under Windows 9x this function could use
|
||||
* the shell32 built-in "mini-COM" without the need to load ole32.dll -
|
||||
|
@ -250,15 +250,15 @@ HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
|
|||
*/
|
||||
LPVOID WINAPI SHAlloc(DWORD len)
|
||||
{
|
||||
LPVOID ret;
|
||||
LPVOID ret;
|
||||
|
||||
ret = CoTaskMemAlloc(len);
|
||||
TRACE("%u bytes at %p\n",len, ret);
|
||||
return ret;
|
||||
ret = CoTaskMemAlloc(len);
|
||||
TRACE("%u bytes at %p\n",len, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHFree [SHELL32.195]
|
||||
* SHFree [SHELL32.195]
|
||||
*
|
||||
* Equivalent to CoTaskMemFree. Under Windows 9x this function could use
|
||||
* the shell32 built-in "mini-COM" without the need to load ole32.dll -
|
||||
|
@ -272,24 +272,24 @@ LPVOID WINAPI SHAlloc(DWORD len)
|
|||
*/
|
||||
void WINAPI SHFree(LPVOID pv)
|
||||
{
|
||||
TRACE("%p\n",pv);
|
||||
CoTaskMemFree(pv);
|
||||
TRACE("%p\n",pv);
|
||||
CoTaskMemFree(pv);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetDesktopFolder [SHELL32.@]
|
||||
* SHGetDesktopFolder [SHELL32.@]
|
||||
*/
|
||||
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
|
||||
{
|
||||
HRESULT hres = S_OK;
|
||||
TRACE("\n");
|
||||
HRESULT hres = S_OK;
|
||||
TRACE("\n");
|
||||
|
||||
if(!psf) return E_INVALIDARG;
|
||||
*psf = NULL;
|
||||
hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_IShellFolder, (void**)psf);
|
||||
if(!psf) return E_INVALIDARG;
|
||||
*psf = NULL;
|
||||
hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_IShellFolder, (void**)psf);
|
||||
|
||||
TRACE("-- %p->(%p)\n",psf, *psf);
|
||||
return hres;
|
||||
TRACE("-- %p->(%p)\n",psf, *psf);
|
||||
return hres;
|
||||
}
|
||||
/**************************************************************************
|
||||
* Default ClassFactory Implementation
|
||||
|
@ -303,46 +303,46 @@ HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
|
|||
*/
|
||||
|
||||
class IDefClFImpl :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IClassFactory
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IClassFactory
|
||||
{
|
||||
private:
|
||||
CLSID *rclsid;
|
||||
LPFNCREATEINSTANCE lpfnCI;
|
||||
const IID *riidInst;
|
||||
LONG *pcRefDll; /* pointer to refcounter in external dll (ugrrr...) */
|
||||
CLSID *rclsid;
|
||||
LPFNCREATEINSTANCE lpfnCI;
|
||||
const IID *riidInst;
|
||||
LONG *pcRefDll; /* pointer to refcounter in external dll (ugrrr...) */
|
||||
public:
|
||||
IDefClFImpl();
|
||||
HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
|
||||
IDefClFImpl();
|
||||
HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
|
||||
|
||||
// IClassFactory
|
||||
virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
|
||||
virtual HRESULT WINAPI LockServer(BOOL fLock);
|
||||
// IClassFactory
|
||||
virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
|
||||
virtual HRESULT WINAPI LockServer(BOOL fLock);
|
||||
|
||||
BEGIN_COM_MAP(IDefClFImpl)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IClassFactory, IClassFactory)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IClassFactory, IClassFactory)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
IDefClFImpl::IDefClFImpl()
|
||||
{
|
||||
lpfnCI = NULL;
|
||||
riidInst = NULL;
|
||||
pcRefDll = NULL;
|
||||
lpfnCI = NULL;
|
||||
riidInst = NULL;
|
||||
pcRefDll = NULL;
|
||||
rclsid = NULL;
|
||||
}
|
||||
|
||||
HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, const IID *riidInstx)
|
||||
{
|
||||
lpfnCI = lpfnCIx;
|
||||
riidInst = riidInstx;
|
||||
pcRefDll = pcRefDllx;
|
||||
lpfnCI = lpfnCIx;
|
||||
riidInst = riidInstx;
|
||||
pcRefDll = pcRefDllx;
|
||||
|
||||
if (pcRefDll)
|
||||
InterlockedIncrement(pcRefDll);
|
||||
if (pcRefDll)
|
||||
InterlockedIncrement(pcRefDll);
|
||||
|
||||
TRACE("(%p)%s\n", this, shdebugstr_guid(riidInst));
|
||||
return S_OK;
|
||||
TRACE("(%p)%s\n", this, shdebugstr_guid(riidInst));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -350,17 +350,17 @@ HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, con
|
|||
*/
|
||||
HRESULT WINAPI IDefClFImpl::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
|
||||
{
|
||||
TRACE("%p->(%p,%s,%p)\n", this, pUnkOuter, shdebugstr_guid(&riid), ppvObject);
|
||||
TRACE("%p->(%p,%s,%p)\n", this, pUnkOuter, shdebugstr_guid(&riid), ppvObject);
|
||||
|
||||
*ppvObject = NULL;
|
||||
*ppvObject = NULL;
|
||||
|
||||
if (riidInst == NULL || IsEqualCLSID(riid, *riidInst) || IsEqualCLSID(riid, IID_IUnknown))
|
||||
{
|
||||
return lpfnCI(pUnkOuter, riid, ppvObject);
|
||||
}
|
||||
if (riidInst == NULL || IsEqualCLSID(riid, *riidInst) || IsEqualCLSID(riid, IID_IUnknown))
|
||||
{
|
||||
return lpfnCI(pUnkOuter, riid, ppvObject);
|
||||
}
|
||||
|
||||
ERR("unknown IID requested %s\n", shdebugstr_guid(&riid));
|
||||
return E_NOINTERFACE;
|
||||
ERR("unknown IID requested %s\n", shdebugstr_guid(&riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -368,8 +368,8 @@ HRESULT WINAPI IDefClFImpl::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPV
|
|||
*/
|
||||
HRESULT WINAPI IDefClFImpl::LockServer(BOOL fLock)
|
||||
{
|
||||
TRACE("%p->(0x%x), not implemented\n", this, fLock);
|
||||
return E_NOTIMPL;
|
||||
TRACE("%p->(0x%x), not implemented\n", this, fLock);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -378,116 +378,116 @@ HRESULT WINAPI IDefClFImpl::LockServer(BOOL fLock)
|
|||
|
||||
HRESULT IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInst, IClassFactory **theFactory)
|
||||
{
|
||||
CComObject<IDefClFImpl> *theClassObject;
|
||||
CComPtr<IClassFactory> result;
|
||||
HRESULT hResult;
|
||||
CComObject<IDefClFImpl> *theClassObject;
|
||||
CComPtr<IClassFactory> result;
|
||||
HRESULT hResult;
|
||||
|
||||
if (theFactory == NULL)
|
||||
return E_POINTER;
|
||||
*theFactory = NULL;
|
||||
ATLTRY (theClassObject = new CComObject<IDefClFImpl>);
|
||||
if (theClassObject == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theClassObject->QueryInterface (IID_IClassFactory, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theClassObject;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theClassObject->Initialize (lpfnCI, pcRefDll, riidInst);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*theFactory = result.Detach ();
|
||||
return S_OK;
|
||||
if (theFactory == NULL)
|
||||
return E_POINTER;
|
||||
*theFactory = NULL;
|
||||
ATLTRY (theClassObject = new CComObject<IDefClFImpl>);
|
||||
if (theClassObject == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theClassObject->QueryInterface (IID_IClassFactory, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theClassObject;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theClassObject->Initialize (lpfnCI, pcRefDll, riidInst);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*theFactory = result.Detach ();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* SHCreateDefClassObject [SHELL32.70]
|
||||
* SHCreateDefClassObject [SHELL32.70]
|
||||
*/
|
||||
HRESULT WINAPI SHCreateDefClassObject(
|
||||
REFIID riid,
|
||||
LPVOID* ppv,
|
||||
LPFNCREATEINSTANCE lpfnCI, /* [in] create instance callback entry */
|
||||
LPDWORD pcRefDll, /* [in/out] ref count of the dll */
|
||||
REFIID riidInst) /* [in] optional interface to the instance */
|
||||
REFIID riid,
|
||||
LPVOID* ppv,
|
||||
LPFNCREATEINSTANCE lpfnCI, /* [in] create instance callback entry */
|
||||
LPDWORD pcRefDll, /* [in/out] ref count of the dll */
|
||||
REFIID riidInst) /* [in] optional interface to the instance */
|
||||
{
|
||||
IClassFactory *pcf;
|
||||
HRESULT hResult;
|
||||
IClassFactory *pcf;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE("%s %p %p %p %s\n", shdebugstr_guid(&riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(&riidInst));
|
||||
TRACE("%s %p %p %p %s\n", shdebugstr_guid(&riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(&riidInst));
|
||||
|
||||
if (!IsEqualCLSID(riid, IID_IClassFactory))
|
||||
return E_NOINTERFACE;
|
||||
hResult = IDefClF_fnConstructor(lpfnCI, (PLONG)pcRefDll, &riidInst, &pcf);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
*ppv = pcf;
|
||||
return NOERROR;
|
||||
if (!IsEqualCLSID(riid, IID_IClassFactory))
|
||||
return E_NOINTERFACE;
|
||||
hResult = IDefClF_fnConstructor(lpfnCI, (PLONG)pcRefDll, &riidInst, &pcf);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
*ppv = pcf;
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragAcceptFiles [SHELL32.@]
|
||||
* DragAcceptFiles [SHELL32.@]
|
||||
*/
|
||||
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
|
||||
{
|
||||
LONG exstyle;
|
||||
LONG exstyle;
|
||||
|
||||
if( !IsWindow(hWnd) ) return;
|
||||
exstyle = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
|
||||
if (b)
|
||||
exstyle |= WS_EX_ACCEPTFILES;
|
||||
else
|
||||
exstyle &= ~WS_EX_ACCEPTFILES;
|
||||
SetWindowLongPtrA(hWnd,GWL_EXSTYLE,exstyle);
|
||||
if( !IsWindow(hWnd) ) return;
|
||||
exstyle = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
|
||||
if (b)
|
||||
exstyle |= WS_EX_ACCEPTFILES;
|
||||
else
|
||||
exstyle &= ~WS_EX_ACCEPTFILES;
|
||||
SetWindowLongPtrA(hWnd,GWL_EXSTYLE,exstyle);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragFinish [SHELL32.@]
|
||||
* DragFinish [SHELL32.@]
|
||||
*/
|
||||
void WINAPI DragFinish(HDROP h)
|
||||
{
|
||||
TRACE("\n");
|
||||
GlobalFree((HGLOBAL)h);
|
||||
TRACE("\n");
|
||||
GlobalFree((HGLOBAL)h);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragQueryPoint [SHELL32.@]
|
||||
* DragQueryPoint [SHELL32.@]
|
||||
*/
|
||||
BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
|
||||
{
|
||||
DROPFILES *lpDropFileStruct;
|
||||
BOOL bRet;
|
||||
BOOL bRet;
|
||||
|
||||
TRACE("\n");
|
||||
TRACE("\n");
|
||||
|
||||
lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
|
||||
lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
|
||||
|
||||
*p = lpDropFileStruct->pt;
|
||||
bRet = lpDropFileStruct->fNC;
|
||||
bRet = lpDropFileStruct->fNC;
|
||||
|
||||
GlobalUnlock(hDrop);
|
||||
return bRet;
|
||||
GlobalUnlock(hDrop);
|
||||
return bRet;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragQueryFileA [SHELL32.@]
|
||||
* DragQueryFile [SHELL32.@]
|
||||
* DragQueryFileA [SHELL32.@]
|
||||
* DragQueryFile [SHELL32.@]
|
||||
*/
|
||||
UINT WINAPI DragQueryFileA(
|
||||
HDROP hDrop,
|
||||
UINT lFile,
|
||||
LPSTR lpszFile,
|
||||
UINT lLength)
|
||||
HDROP hDrop,
|
||||
UINT lFile,
|
||||
LPSTR lpszFile,
|
||||
UINT lLength)
|
||||
{
|
||||
LPSTR lpDrop;
|
||||
UINT i = 0;
|
||||
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
|
||||
LPSTR lpDrop;
|
||||
UINT i = 0;
|
||||
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
|
||||
|
||||
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
|
||||
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
|
||||
|
||||
if(!lpDropFileStruct) goto end;
|
||||
if(!lpDropFileStruct) goto end;
|
||||
|
||||
lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
|
||||
lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
|
||||
|
||||
if(lpDropFileStruct->fWide) {
|
||||
LPWSTR lpszFileW = NULL;
|
||||
|
@ -507,42 +507,42 @@ UINT WINAPI DragQueryFileA(
|
|||
goto end;
|
||||
}
|
||||
|
||||
while (i++ < lFile)
|
||||
{
|
||||
while (*lpDrop++); /* skip filename */
|
||||
if (!*lpDrop)
|
||||
{
|
||||
i = (lFile == 0xFFFFFFFF) ? i : 0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
while (i++ < lFile)
|
||||
{
|
||||
while (*lpDrop++); /* skip filename */
|
||||
if (!*lpDrop)
|
||||
{
|
||||
i = (lFile == 0xFFFFFFFF) ? i : 0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
i = strlen(lpDrop);
|
||||
if (!lpszFile ) goto end; /* needed buffer size */
|
||||
lstrcpynA (lpszFile, lpDrop, lLength);
|
||||
i = strlen(lpDrop);
|
||||
if (!lpszFile ) goto end; /* needed buffer size */
|
||||
lstrcpynA (lpszFile, lpDrop, lLength);
|
||||
end:
|
||||
GlobalUnlock(hDrop);
|
||||
return i;
|
||||
GlobalUnlock(hDrop);
|
||||
return i;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragQueryFileW [SHELL32.@]
|
||||
* DragQueryFileW [SHELL32.@]
|
||||
*/
|
||||
UINT WINAPI DragQueryFileW(
|
||||
HDROP hDrop,
|
||||
UINT lFile,
|
||||
LPWSTR lpszwFile,
|
||||
UINT lLength)
|
||||
HDROP hDrop,
|
||||
UINT lFile,
|
||||
LPWSTR lpszwFile,
|
||||
UINT lLength)
|
||||
{
|
||||
LPWSTR lpwDrop;
|
||||
UINT i = 0;
|
||||
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
|
||||
LPWSTR lpwDrop;
|
||||
UINT i = 0;
|
||||
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
|
||||
|
||||
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
|
||||
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
|
||||
|
||||
if(!lpDropFileStruct) goto end;
|
||||
if(!lpDropFileStruct) goto end;
|
||||
|
||||
lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
|
||||
lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
|
||||
|
||||
if(lpDropFileStruct->fWide == FALSE) {
|
||||
LPSTR lpszFileA = NULL;
|
||||
|
@ -562,21 +562,21 @@ UINT WINAPI DragQueryFileW(
|
|||
goto end;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (i++ < lFile)
|
||||
{
|
||||
while (*lpwDrop++); /* skip filename */
|
||||
if (!*lpwDrop)
|
||||
{
|
||||
i = (lFile == 0xFFFFFFFF) ? i : 0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
while (i++ < lFile)
|
||||
{
|
||||
while (*lpwDrop++); /* skip filename */
|
||||
if (!*lpwDrop)
|
||||
{
|
||||
i = (lFile == 0xFFFFFFFF) ? i : 0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
i = wcslen(lpwDrop);
|
||||
if ( !lpszwFile) goto end; /* needed buffer size */
|
||||
lstrcpynW (lpszwFile, lpwDrop, lLength);
|
||||
i = wcslen(lpwDrop);
|
||||
if ( !lpszwFile) goto end; /* needed buffer size */
|
||||
lstrcpynW (lpszwFile, lpwDrop, lLength);
|
||||
end:
|
||||
GlobalUnlock(hDrop);
|
||||
return i;
|
||||
GlobalUnlock(hDrop);
|
||||
return i;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,33 +29,33 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
/*
|
||||
########## Combining and Constructing paths ##########
|
||||
########## Combining and Constructing paths ##########
|
||||
*/
|
||||
|
||||
/*************************************************************************
|
||||
* PathAppend [SHELL32.36]
|
||||
* PathAppend [SHELL32.36]
|
||||
*/
|
||||
BOOL WINAPI PathAppendAW(
|
||||
LPVOID lpszPath1,
|
||||
LPCVOID lpszPath2)
|
||||
LPVOID lpszPath1,
|
||||
LPCVOID lpszPath2)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathAppendW((LPWSTR)lpszPath1, (LPCWSTR)lpszPath2);
|
||||
return PathAppendA((LPSTR)lpszPath1, (LPCSTR)lpszPath2);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathAppendW((LPWSTR)lpszPath1, (LPCWSTR)lpszPath2);
|
||||
return PathAppendA((LPSTR)lpszPath1, (LPCSTR)lpszPath2);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathBuildRoot [SHELL32.30]
|
||||
* PathBuildRoot [SHELL32.30]
|
||||
*/
|
||||
LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
|
||||
{
|
||||
if(SHELL_OsIsUnicode())
|
||||
return PathBuildRootW((LPWSTR)lpszPath, drive);
|
||||
return PathBuildRootA((LPSTR)lpszPath, drive);
|
||||
if(SHELL_OsIsUnicode())
|
||||
return PathBuildRootW((LPWSTR)lpszPath, drive);
|
||||
return PathBuildRootA((LPSTR)lpszPath, drive);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathGetExtensionA [internal]
|
||||
* PathGetExtensionA [internal]
|
||||
*
|
||||
* NOTES
|
||||
* exported by ordinal
|
||||
|
@ -63,29 +63,29 @@ LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
|
|||
*/
|
||||
static LPSTR PathGetExtensionA(LPCSTR lpszPath)
|
||||
{
|
||||
TRACE("(%s)\n",lpszPath);
|
||||
TRACE("(%s)\n",lpszPath);
|
||||
|
||||
lpszPath = PathFindExtensionA(lpszPath);
|
||||
return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
|
||||
lpszPath = PathFindExtensionA(lpszPath);
|
||||
return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathGetExtensionW [internal]
|
||||
* PathGetExtensionW [internal]
|
||||
*/
|
||||
LPWSTR PathGetExtensionW(LPCWSTR lpszPath)
|
||||
{
|
||||
TRACE("(%s)\n",debugstr_w(lpszPath));
|
||||
TRACE("(%s)\n",debugstr_w(lpszPath));
|
||||
|
||||
lpszPath = PathFindExtensionW(lpszPath);
|
||||
return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
|
||||
lpszPath = PathFindExtensionW(lpszPath);
|
||||
return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHPathGetExtension [SHELL32.158]
|
||||
* SHPathGetExtension [SHELL32.158]
|
||||
*/
|
||||
EXTERN_C LPVOID WINAPI SHPathGetExtensionW(LPCWSTR lpszPath, DWORD void1, DWORD void2)
|
||||
{
|
||||
return PathGetExtensionW(lpszPath);
|
||||
return PathGetExtensionW(lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -93,13 +93,13 @@ EXTERN_C LPVOID WINAPI SHPathGetExtensionW(LPCWSTR lpszPath, DWORD void1, DWORD
|
|||
*/
|
||||
BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathRemoveFileSpecW((LPWSTR)lpszPath);
|
||||
return PathRemoveFileSpecA((LPSTR)lpszPath);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathRemoveFileSpecW((LPWSTR)lpszPath);
|
||||
return PathRemoveFileSpecA((LPSTR)lpszPath);
|
||||
}
|
||||
|
||||
/*
|
||||
Path Manipulations
|
||||
Path Manipulations
|
||||
*/
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -107,14 +107,14 @@ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
|
|||
*/
|
||||
static void PathGetShortPathA(LPSTR pszPath)
|
||||
{
|
||||
CHAR path[MAX_PATH];
|
||||
CHAR path[MAX_PATH];
|
||||
|
||||
TRACE("%s\n", pszPath);
|
||||
TRACE("%s\n", pszPath);
|
||||
|
||||
if (GetShortPathNameA(pszPath, path, MAX_PATH))
|
||||
{
|
||||
lstrcpyA(pszPath, path);
|
||||
}
|
||||
if (GetShortPathNameA(pszPath, path, MAX_PATH))
|
||||
{
|
||||
lstrcpyA(pszPath, path);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -122,14 +122,14 @@ static void PathGetShortPathA(LPSTR pszPath)
|
|||
*/
|
||||
static void PathGetShortPathW(LPWSTR pszPath)
|
||||
{
|
||||
WCHAR path[MAX_PATH];
|
||||
WCHAR path[MAX_PATH];
|
||||
|
||||
TRACE("%s\n", debugstr_w(pszPath));
|
||||
TRACE("%s\n", debugstr_w(pszPath));
|
||||
|
||||
if (GetShortPathNameW(pszPath, path, MAX_PATH))
|
||||
{
|
||||
wcscpy(pszPath, path);
|
||||
}
|
||||
if (GetShortPathNameW(pszPath, path, MAX_PATH))
|
||||
{
|
||||
wcscpy(pszPath, path);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -137,175 +137,175 @@ static void PathGetShortPathW(LPWSTR pszPath)
|
|||
*/
|
||||
EXTERN_C VOID WINAPI PathGetShortPathAW(LPVOID pszPath)
|
||||
{
|
||||
if(SHELL_OsIsUnicode())
|
||||
PathGetShortPathW((LPWSTR)pszPath);
|
||||
PathGetShortPathA((LPSTR)pszPath);
|
||||
if(SHELL_OsIsUnicode())
|
||||
PathGetShortPathW((LPWSTR)pszPath);
|
||||
PathGetShortPathA((LPSTR)pszPath);
|
||||
}
|
||||
|
||||
/*
|
||||
########## Path Testing ##########
|
||||
########## Path Testing ##########
|
||||
*/
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsRoot [SHELL32.29]
|
||||
* PathIsRoot [SHELL32.29]
|
||||
*/
|
||||
BOOL WINAPI PathIsRootAW(LPCVOID lpszPath)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathIsRootW((LPWSTR)lpszPath);
|
||||
return PathIsRootA((LPSTR)lpszPath);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathIsRootW((LPWSTR)lpszPath);
|
||||
return PathIsRootA((LPSTR)lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsExeA [internal]
|
||||
* PathIsExeA [internal]
|
||||
*/
|
||||
static BOOL PathIsExeA (LPCSTR lpszPath)
|
||||
{
|
||||
LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
|
||||
LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
|
||||
int i;
|
||||
static const char * const lpszExtensions[] =
|
||||
{"exe", "com", "pif", "cmd", "bat", "scf", "scr", NULL };
|
||||
|
||||
TRACE("path=%s\n",lpszPath);
|
||||
TRACE("path=%s\n",lpszPath);
|
||||
|
||||
for(i=0; lpszExtensions[i]; i++)
|
||||
if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE;
|
||||
for(i=0; lpszExtensions[i]; i++)
|
||||
if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsExeW [internal]
|
||||
* PathIsExeW [internal]
|
||||
*/
|
||||
static BOOL PathIsExeW (LPCWSTR lpszPath)
|
||||
{
|
||||
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
|
||||
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
|
||||
int i;
|
||||
static const WCHAR lpszExtensions[][4] =
|
||||
{{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'},
|
||||
{'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'},
|
||||
{'s','c','r','\0'}, {'\0'} };
|
||||
|
||||
TRACE("path=%s\n",debugstr_w(lpszPath));
|
||||
TRACE("path=%s\n",debugstr_w(lpszPath));
|
||||
|
||||
for(i=0; lpszExtensions[i][0]; i++)
|
||||
if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
|
||||
for(i=0; lpszExtensions[i][0]; i++)
|
||||
if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsExe [SHELL32.43]
|
||||
* PathIsExe [SHELL32.43]
|
||||
*/
|
||||
BOOL WINAPI PathIsExeAW (LPCVOID path)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathIsExeW ((LPWSTR)path);
|
||||
return PathIsExeA((LPSTR)path);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathIsExeW ((LPWSTR)path);
|
||||
return PathIsExeA((LPSTR)path);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathFileExists [SHELL32.45]
|
||||
* PathFileExists [SHELL32.45]
|
||||
*/
|
||||
BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathFileExistsW ((LPWSTR)lpszPath);
|
||||
return PathFileExistsA ((LPSTR)lpszPath);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathFileExistsW ((LPWSTR)lpszPath);
|
||||
return PathFileExistsA ((LPSTR)lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathIsSameRoot [SHELL32.650]
|
||||
* PathIsSameRoot [SHELL32.650]
|
||||
*/
|
||||
BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathIsSameRootW((LPCWSTR)lpszPath1, (LPCWSTR)lpszPath2);
|
||||
return PathIsSameRootA((LPCSTR)lpszPath1, (LPCSTR)lpszPath2);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathIsSameRootW((LPCWSTR)lpszPath1, (LPCWSTR)lpszPath2);
|
||||
return PathIsSameRootA((LPCSTR)lpszPath1, (LPCSTR)lpszPath2);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* IsLFNDriveA [SHELL32.41]
|
||||
* IsLFNDriveA [SHELL32.41]
|
||||
*/
|
||||
EXTERN_C BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath)
|
||||
{
|
||||
DWORD fnlen;
|
||||
DWORD fnlen;
|
||||
|
||||
if (!GetVolumeInformationA(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
return fnlen > 12;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* IsLFNDriveW [SHELL32.42]
|
||||
* IsLFNDriveW [SHELL32.42]
|
||||
*/
|
||||
EXTERN_C BOOL WINAPI IsLFNDriveW(LPCWSTR lpszPath)
|
||||
{
|
||||
DWORD fnlen;
|
||||
DWORD fnlen;
|
||||
|
||||
if (!GetVolumeInformationW(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
return fnlen > 12;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* IsLFNDrive [SHELL32.119]
|
||||
* IsLFNDrive [SHELL32.119]
|
||||
*/
|
||||
EXTERN_C BOOL WINAPI IsLFNDriveAW(LPCVOID lpszPath)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return IsLFNDriveW((LPCWSTR)lpszPath);
|
||||
return IsLFNDriveA((LPCSTR)lpszPath);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return IsLFNDriveW((LPCWSTR)lpszPath);
|
||||
return IsLFNDriveA((LPCSTR)lpszPath);
|
||||
}
|
||||
|
||||
/*
|
||||
########## Creating Something Unique ##########
|
||||
########## Creating Something Unique ##########
|
||||
*/
|
||||
/*************************************************************************
|
||||
* PathMakeUniqueNameA [internal]
|
||||
* PathMakeUniqueNameA [internal]
|
||||
*/
|
||||
BOOL WINAPI PathMakeUniqueNameA(
|
||||
LPSTR lpszBuffer,
|
||||
DWORD dwBuffSize,
|
||||
LPCSTR lpszShortName,
|
||||
LPCSTR lpszLongName,
|
||||
LPCSTR lpszPathName)
|
||||
LPSTR lpszBuffer,
|
||||
DWORD dwBuffSize,
|
||||
LPCSTR lpszShortName,
|
||||
LPCSTR lpszLongName,
|
||||
LPCSTR lpszPathName)
|
||||
{
|
||||
FIXME("%p %u %s %s %s stub\n",
|
||||
lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
|
||||
debugstr_a(lpszLongName), debugstr_a(lpszPathName));
|
||||
return TRUE;
|
||||
FIXME("%p %u %s %s %s stub\n",
|
||||
lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
|
||||
debugstr_a(lpszLongName), debugstr_a(lpszPathName));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathMakeUniqueNameW [internal]
|
||||
* PathMakeUniqueNameW [internal]
|
||||
*/
|
||||
BOOL WINAPI PathMakeUniqueNameW(
|
||||
LPWSTR lpszBuffer,
|
||||
DWORD dwBuffSize,
|
||||
LPCWSTR lpszShortName,
|
||||
LPCWSTR lpszLongName,
|
||||
LPCWSTR lpszPathName)
|
||||
LPWSTR lpszBuffer,
|
||||
DWORD dwBuffSize,
|
||||
LPCWSTR lpszShortName,
|
||||
LPCWSTR lpszLongName,
|
||||
LPCWSTR lpszPathName)
|
||||
{
|
||||
FIXME("%p %u %s %s %s stub\n",
|
||||
lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
|
||||
debugstr_w(lpszLongName), debugstr_w(lpszPathName));
|
||||
return TRUE;
|
||||
FIXME("%p %u %s %s %s stub\n",
|
||||
lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
|
||||
debugstr_w(lpszLongName), debugstr_w(lpszPathName));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathMakeUniqueName [SHELL32.47]
|
||||
* PathMakeUniqueName [SHELL32.47]
|
||||
*/
|
||||
BOOL WINAPI PathMakeUniqueNameAW(
|
||||
LPVOID lpszBuffer,
|
||||
DWORD dwBuffSize,
|
||||
LPCVOID lpszShortName,
|
||||
LPCVOID lpszLongName,
|
||||
LPCVOID lpszPathName)
|
||||
LPVOID lpszBuffer,
|
||||
DWORD dwBuffSize,
|
||||
LPCVOID lpszShortName,
|
||||
LPCVOID lpszLongName,
|
||||
LPCVOID lpszPathName)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathMakeUniqueNameW((LPWSTR)lpszBuffer, dwBuffSize, (LPCWSTR)lpszShortName, (LPCWSTR)lpszLongName, (LPCWSTR)lpszPathName);
|
||||
return PathMakeUniqueNameA((LPSTR)lpszBuffer, dwBuffSize, (LPCSTR)lpszShortName, (LPCSTR)lpszLongName, (LPCSTR)lpszPathName);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathMakeUniqueNameW((LPWSTR)lpszBuffer, dwBuffSize, (LPCWSTR)lpszShortName, (LPCWSTR)lpszLongName, (LPCWSTR)lpszPathName);
|
||||
return PathMakeUniqueNameA((LPSTR)lpszBuffer, dwBuffSize, (LPCSTR)lpszShortName, (LPCSTR)lpszLongName, (LPCSTR)lpszPathName);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -315,10 +315,10 @@ BOOL WINAPI PathMakeUniqueNameAW(
|
|||
* exported by ordinal
|
||||
*/
|
||||
BOOL WINAPI PathYetAnotherMakeUniqueName(
|
||||
LPWSTR lpszBuffer,
|
||||
LPCWSTR lpszPathName,
|
||||
LPCWSTR lpszShortName,
|
||||
LPCWSTR lpszLongName)
|
||||
LPWSTR lpszBuffer,
|
||||
LPCWSTR lpszPathName,
|
||||
LPCWSTR lpszShortName,
|
||||
LPCWSTR lpszLongName)
|
||||
{
|
||||
FIXME("(%p, %s, %s ,%s):stub.\n",
|
||||
lpszBuffer, debugstr_w(lpszPathName), debugstr_w(lpszShortName), debugstr_w(lpszLongName));
|
||||
|
@ -327,11 +327,11 @@ BOOL WINAPI PathYetAnotherMakeUniqueName(
|
|||
|
||||
|
||||
/*
|
||||
########## cleaning and resolving paths ##########
|
||||
########## cleaning and resolving paths ##########
|
||||
*/
|
||||
|
||||
/*************************************************************************
|
||||
* PathCleanupSpec [SHELL32.171]
|
||||
* PathCleanupSpec [SHELL32.171]
|
||||
*
|
||||
* lpszFile is changed in place.
|
||||
*/
|
||||
|
@ -405,120 +405,120 @@ int WINAPI PathCleanupSpec( LPCWSTR lpszPathW, LPWSTR lpszFileW )
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathQualifyA [SHELL32]
|
||||
* PathQualifyA [SHELL32]
|
||||
*/
|
||||
BOOL WINAPI PathQualifyA(LPCSTR pszPath)
|
||||
{
|
||||
FIXME("%s\n",pszPath);
|
||||
return 0;
|
||||
FIXME("%s\n",pszPath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathQualifyW [SHELL32]
|
||||
* PathQualifyW [SHELL32]
|
||||
*/
|
||||
BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
|
||||
{
|
||||
FIXME("%s\n",debugstr_w(pszPath));
|
||||
return 0;
|
||||
FIXME("%s\n",debugstr_w(pszPath));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathQualify [SHELL32.49]
|
||||
* PathQualify [SHELL32.49]
|
||||
*/
|
||||
BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathQualifyW((LPCWSTR)pszPath);
|
||||
return PathQualifyA((LPCSTR)pszPath);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathQualifyW((LPCWSTR)pszPath);
|
||||
return PathQualifyA((LPCSTR)pszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathResolveA [SHELL32.51]
|
||||
*/
|
||||
BOOL WINAPI PathResolveA(
|
||||
LPSTR lpszPath,
|
||||
LPCSTR *alpszPaths,
|
||||
DWORD dwFlags)
|
||||
LPSTR lpszPath,
|
||||
LPCSTR *alpszPaths,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s,%p,0x%08x),stub!\n",
|
||||
lpszPath, *alpszPaths, dwFlags);
|
||||
return 0;
|
||||
FIXME("(%s,%p,0x%08x),stub!\n",
|
||||
lpszPath, *alpszPaths, dwFlags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathResolveW [SHELL32]
|
||||
*/
|
||||
BOOL WINAPI PathResolveW(
|
||||
LPWSTR lpszPath,
|
||||
LPCWSTR *alpszPaths,
|
||||
DWORD dwFlags)
|
||||
LPWSTR lpszPath,
|
||||
LPCWSTR *alpszPaths,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s,%p,0x%08x),stub!\n",
|
||||
debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
|
||||
return 0;
|
||||
FIXME("(%s,%p,0x%08x),stub!\n",
|
||||
debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathResolve [SHELL32.51]
|
||||
*/
|
||||
BOOL WINAPI PathResolveAW(
|
||||
LPVOID lpszPath,
|
||||
LPCVOID *alpszPaths,
|
||||
DWORD dwFlags)
|
||||
LPVOID lpszPath,
|
||||
LPCVOID *alpszPaths,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathResolveW((LPWSTR)lpszPath, (LPCWSTR *)alpszPaths, dwFlags);
|
||||
return PathResolveA((LPSTR)lpszPath, (LPCSTR *)alpszPaths, dwFlags);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathResolveW((LPWSTR)lpszPath, (LPCWSTR *)alpszPaths, dwFlags);
|
||||
return PathResolveA((LPSTR)lpszPath, (LPCSTR *)alpszPaths, dwFlags);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathProcessCommandA [SHELL32.653]
|
||||
* PathProcessCommandA [SHELL32.653]
|
||||
*/
|
||||
LONG WINAPI PathProcessCommandA (
|
||||
LPCSTR lpszPath,
|
||||
LPSTR lpszBuff,
|
||||
DWORD dwBuffSize,
|
||||
DWORD dwFlags)
|
||||
LPCSTR lpszPath,
|
||||
LPSTR lpszBuff,
|
||||
DWORD dwBuffSize,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("%s %p 0x%04x 0x%04x stub\n",
|
||||
lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
||||
if(!lpszPath) return -1;
|
||||
if(lpszBuff) strcpy(lpszBuff, lpszPath);
|
||||
return strlen(lpszPath);
|
||||
FIXME("%s %p 0x%04x 0x%04x stub\n",
|
||||
lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
||||
if(!lpszPath) return -1;
|
||||
if(lpszBuff) strcpy(lpszBuff, lpszPath);
|
||||
return strlen(lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathProcessCommandW
|
||||
* PathProcessCommandW
|
||||
*/
|
||||
LONG WINAPI PathProcessCommandW (
|
||||
LPCWSTR lpszPath,
|
||||
LPWSTR lpszBuff,
|
||||
DWORD dwBuffSize,
|
||||
DWORD dwFlags)
|
||||
LPCWSTR lpszPath,
|
||||
LPWSTR lpszBuff,
|
||||
DWORD dwBuffSize,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n",
|
||||
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
|
||||
if(!lpszPath) return -1;
|
||||
if(lpszBuff) wcscpy(lpszBuff, lpszPath);
|
||||
return wcslen(lpszPath);
|
||||
FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n",
|
||||
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
|
||||
if(!lpszPath) return -1;
|
||||
if(lpszBuff) wcscpy(lpszBuff, lpszPath);
|
||||
return wcslen(lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* PathProcessCommand (SHELL32.653)
|
||||
* PathProcessCommand (SHELL32.653)
|
||||
*/
|
||||
LONG WINAPI PathProcessCommandAW (
|
||||
LPCVOID lpszPath,
|
||||
LPVOID lpszBuff,
|
||||
DWORD dwBuffSize,
|
||||
DWORD dwFlags)
|
||||
LPCVOID lpszPath,
|
||||
LPVOID lpszBuff,
|
||||
DWORD dwBuffSize,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathProcessCommandW((LPCWSTR)lpszPath, (LPWSTR)lpszBuff, dwBuffSize, dwFlags);
|
||||
return PathProcessCommandA((LPCSTR)lpszPath, (LPSTR)lpszBuff, dwBuffSize, dwFlags);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return PathProcessCommandW((LPCWSTR)lpszPath, (LPWSTR)lpszBuff, dwBuffSize, dwFlags);
|
||||
return PathProcessCommandA((LPCSTR)lpszPath, (LPSTR)lpszBuff, dwBuffSize, dwFlags);
|
||||
}
|
||||
|
||||
/*
|
||||
########## special ##########
|
||||
########## special ##########
|
||||
*/
|
||||
|
||||
static const WCHAR szCurrentVersion[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0'};
|
||||
|
@ -1011,9 +1011,9 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
|
|||
*/
|
||||
static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwSize;
|
||||
HRESULT hr;
|
||||
HKEY hKey;
|
||||
HKEY hKey;
|
||||
WCHAR resourcePath[MAX_PATH];
|
||||
LPCWSTR pDefaultPath = NULL;
|
||||
|
||||
|
@ -1262,7 +1262,7 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetFolderPathW [SHELL32.@]
|
||||
* SHGetFolderPathW [SHELL32.@]
|
||||
*
|
||||
* Convert nFolder to path.
|
||||
*
|
||||
|
@ -1282,11 +1282,11 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
|
|||
* Furthermore, the HKCU paths take precedence over the HKLM paths.
|
||||
*/
|
||||
HRESULT WINAPI SHGetFolderPathW(
|
||||
HWND hwndOwner, /* [I] owner window */
|
||||
int nFolder, /* [I] CSIDL identifying the folder */
|
||||
HANDLE hToken, /* [I] access token */
|
||||
DWORD dwFlags, /* [I] which path to return */
|
||||
LPWSTR pszPath) /* [O] converted path */
|
||||
HWND hwndOwner, /* [I] owner window */
|
||||
int nFolder, /* [I] CSIDL identifying the folder */
|
||||
HANDLE hToken, /* [I] access token */
|
||||
DWORD dwFlags, /* [I] which path to return */
|
||||
LPWSTR pszPath) /* [O] converted path */
|
||||
{
|
||||
HRESULT hr = SHGetFolderPathAndSubDirW(hwndOwner, nFolder, hToken, dwFlags, NULL, pszPath);
|
||||
if(HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == hr)
|
||||
|
@ -1295,12 +1295,12 @@ HRESULT WINAPI SHGetFolderPathW(
|
|||
}
|
||||
|
||||
HRESULT WINAPI SHGetFolderPathAndSubDirA(
|
||||
HWND hwndOwner, /* [I] owner window */
|
||||
int nFolder, /* [I] CSIDL identifying the folder */
|
||||
HANDLE hToken, /* [I] access token */
|
||||
DWORD dwFlags, /* [I] which path to return */
|
||||
LPCSTR pszSubPath, /* [I] sub directory of the specified folder */
|
||||
LPSTR pszPath) /* [O] converted path */
|
||||
HWND hwndOwner, /* [I] owner window */
|
||||
int nFolder, /* [I] CSIDL identifying the folder */
|
||||
HANDLE hToken, /* [I] access token */
|
||||
DWORD dwFlags, /* [I] which path to return */
|
||||
LPCSTR pszSubPath, /* [I] sub directory of the specified folder */
|
||||
LPSTR pszPath) /* [O] converted path */
|
||||
{
|
||||
int length;
|
||||
HRESULT hr = S_OK;
|
||||
|
@ -1343,12 +1343,12 @@ cleanup:
|
|||
}
|
||||
|
||||
HRESULT WINAPI SHGetFolderPathAndSubDirW(
|
||||
HWND hwndOwner, /* [I] owner window */
|
||||
int nFolder, /* [I] CSIDL identifying the folder */
|
||||
HANDLE hToken, /* [I] access token */
|
||||
DWORD dwFlags, /* [I] which path to return */
|
||||
LPCWSTR pszSubPath,/* [I] sub directory of the specified folder */
|
||||
LPWSTR pszPath) /* [O] converted path */
|
||||
HWND hwndOwner, /* [I] owner window */
|
||||
int nFolder, /* [I] CSIDL identifying the folder */
|
||||
HANDLE hToken, /* [I] access token */
|
||||
DWORD dwFlags, /* [I] which path to return */
|
||||
LPCWSTR pszSubPath,/* [I] sub directory of the specified folder */
|
||||
LPWSTR pszPath) /* [O] converted path */
|
||||
{
|
||||
HRESULT hr;
|
||||
WCHAR szBuildPath[MAX_PATH], szTemp[MAX_PATH];
|
||||
|
@ -1478,16 +1478,16 @@ end:
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetFolderPathA [SHELL32.@]
|
||||
* SHGetFolderPathA [SHELL32.@]
|
||||
*
|
||||
* See SHGetFolderPathW.
|
||||
*/
|
||||
HRESULT WINAPI SHGetFolderPathA(
|
||||
HWND hwndOwner,
|
||||
int nFolder,
|
||||
HANDLE hToken,
|
||||
DWORD dwFlags,
|
||||
LPSTR pszPath)
|
||||
HWND hwndOwner,
|
||||
int nFolder,
|
||||
HANDLE hToken,
|
||||
DWORD dwFlags,
|
||||
LPSTR pszPath)
|
||||
{
|
||||
WCHAR szTemp[MAX_PATH];
|
||||
HRESULT hr;
|
||||
|
@ -1872,34 +1872,34 @@ HRESULT SHELL_RegisterShellFolders(void)
|
|||
* SHGetSpecialFolderPathA [SHELL32.@]
|
||||
*/
|
||||
BOOL WINAPI SHGetSpecialFolderPathA (
|
||||
HWND hwndOwner,
|
||||
LPSTR szPath,
|
||||
int nFolder,
|
||||
BOOL bCreate)
|
||||
HWND hwndOwner,
|
||||
LPSTR szPath,
|
||||
int nFolder,
|
||||
BOOL bCreate)
|
||||
{
|
||||
return (SHGetFolderPathA(
|
||||
hwndOwner,
|
||||
nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
|
||||
NULL,
|
||||
0,
|
||||
szPath)) == S_OK ? TRUE : FALSE;
|
||||
return (SHGetFolderPathA(
|
||||
hwndOwner,
|
||||
nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
|
||||
NULL,
|
||||
0,
|
||||
szPath)) == S_OK ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetSpecialFolderPathW
|
||||
*/
|
||||
BOOL WINAPI SHGetSpecialFolderPathW (
|
||||
HWND hwndOwner,
|
||||
LPWSTR szPath,
|
||||
int nFolder,
|
||||
BOOL bCreate)
|
||||
HWND hwndOwner,
|
||||
LPWSTR szPath,
|
||||
int nFolder,
|
||||
BOOL bCreate)
|
||||
{
|
||||
return (SHGetFolderPathW(
|
||||
hwndOwner,
|
||||
nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
|
||||
NULL,
|
||||
0,
|
||||
szPath)) == S_OK ? TRUE : FALSE;
|
||||
return (SHGetFolderPathW(
|
||||
hwndOwner,
|
||||
nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
|
||||
NULL,
|
||||
0,
|
||||
szPath)) == S_OK ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1925,11 +1925,11 @@ BOOL WINAPI SHGetSpecialFolderPathW (
|
|||
* virtual folders that are handled here.
|
||||
*/
|
||||
HRESULT WINAPI SHGetFolderLocation(
|
||||
HWND hwndOwner,
|
||||
int nFolder,
|
||||
HANDLE hToken,
|
||||
DWORD dwReserved,
|
||||
LPITEMIDLIST *ppidl)
|
||||
HWND hwndOwner,
|
||||
int nFolder,
|
||||
HANDLE hToken,
|
||||
DWORD dwReserved,
|
||||
LPITEMIDLIST *ppidl)
|
||||
{
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
|
@ -2007,16 +2007,16 @@ HRESULT WINAPI SHGetFolderLocation(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetSpecialFolderLocation [SHELL32.@]
|
||||
* SHGetSpecialFolderLocation [SHELL32.@]
|
||||
*
|
||||
* NOTES
|
||||
* In NT5, SHGetSpecialFolderLocation needs the <winntdir>/Recent
|
||||
* directory.
|
||||
*/
|
||||
HRESULT WINAPI SHGetSpecialFolderLocation(
|
||||
HWND hwndOwner,
|
||||
INT nFolder,
|
||||
LPITEMIDLIST * ppidl)
|
||||
HWND hwndOwner,
|
||||
INT nFolder,
|
||||
LPITEMIDLIST * ppidl)
|
||||
{
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
|
|
|
@ -23,29 +23,29 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegOpenKeyA [SHELL32.506]
|
||||
* SHRegOpenKeyA [SHELL32.506]
|
||||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegOpenKeyA(
|
||||
HKEY hKey,
|
||||
LPSTR lpSubKey,
|
||||
PHKEY phkResult)
|
||||
HKEY hKey,
|
||||
LPSTR lpSubKey,
|
||||
PHKEY phkResult)
|
||||
{
|
||||
TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
|
||||
return RegOpenKeyA(hKey, lpSubKey, phkResult);
|
||||
TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
|
||||
return RegOpenKeyA(hKey, lpSubKey, phkResult);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegOpenKeyW [SHELL32.507] NT 4.0
|
||||
* SHRegOpenKeyW [SHELL32.507] NT 4.0
|
||||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegOpenKeyW (
|
||||
HKEY hkey,
|
||||
LPCWSTR lpszSubKey,
|
||||
PHKEY retkey)
|
||||
HKEY hkey,
|
||||
LPCWSTR lpszSubKey,
|
||||
PHKEY retkey)
|
||||
{
|
||||
WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
|
||||
return RegOpenKeyW( hkey, lpszSubKey, retkey );
|
||||
WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
|
||||
return RegOpenKeyW( hkey, lpszSubKey, retkey );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -54,8 +54,8 @@ EXTERN_C HRESULT WINAPI SHRegOpenKeyW (
|
|||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegQueryValueA(HKEY hkey, LPSTR lpSubKey, LPSTR lpValue, LPDWORD lpcbValue)
|
||||
{
|
||||
TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
|
||||
return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
|
||||
TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
|
||||
return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -63,82 +63,82 @@ EXTERN_C HRESULT WINAPI SHRegQueryValueA(HKEY hkey, LPSTR lpSubKey, LPSTR lpValu
|
|||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegQueryValueExA(
|
||||
HKEY hkey,
|
||||
LPSTR lpValueName,
|
||||
LPDWORD lpReserved,
|
||||
LPDWORD lpType,
|
||||
LPBYTE lpData,
|
||||
LPDWORD lpcbData)
|
||||
HKEY hkey,
|
||||
LPSTR lpValueName,
|
||||
LPDWORD lpReserved,
|
||||
LPDWORD lpType,
|
||||
LPBYTE lpData,
|
||||
LPDWORD lpcbData)
|
||||
{
|
||||
TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegQueryValueW [SHELL32.510] NT4.0
|
||||
* SHRegQueryValueW [SHELL32.510] NT4.0
|
||||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegQueryValueW(
|
||||
HKEY hkey,
|
||||
LPWSTR lpszSubKey,
|
||||
LPWSTR lpszData,
|
||||
LPDWORD lpcbData )
|
||||
HKEY hkey,
|
||||
LPWSTR lpszSubKey,
|
||||
LPWSTR lpszData,
|
||||
LPDWORD lpcbData )
|
||||
{
|
||||
WARN("%p %s %p %p semi-stub\n",
|
||||
hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
|
||||
return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
|
||||
WARN("%p %s %p %p semi-stub\n",
|
||||
hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
|
||||
return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegQueryValueExW [SHELL32.511] NT4.0
|
||||
* SHRegQueryValueExW [SHELL32.511] NT4.0
|
||||
*
|
||||
* FIXME
|
||||
* if the datatype REG_EXPAND_SZ then expand the string and change
|
||||
* *pdwType to REG_SZ.
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegQueryValueExW (
|
||||
HKEY hkey,
|
||||
LPWSTR pszValue,
|
||||
LPDWORD pdwReserved,
|
||||
LPDWORD pdwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pcbData)
|
||||
HKEY hkey,
|
||||
LPWSTR pszValue,
|
||||
LPDWORD pdwReserved,
|
||||
LPDWORD pdwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pcbData)
|
||||
{
|
||||
DWORD ret;
|
||||
WARN("%p %s %p %p %p %p semi-stub\n",
|
||||
hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
|
||||
ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, (LPBYTE)pvData, pcbData);
|
||||
return ret;
|
||||
DWORD ret;
|
||||
WARN("%p %s %p %p %p %p semi-stub\n",
|
||||
hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
|
||||
ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, (LPBYTE)pvData, pcbData);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegDeleteKeyA [SHELL32.?]
|
||||
*/
|
||||
HRESULT WINAPI SHRegDeleteKeyA(
|
||||
HKEY hkey,
|
||||
LPCSTR pszSubKey)
|
||||
HKEY hkey,
|
||||
LPCSTR pszSubKey)
|
||||
{
|
||||
FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey));
|
||||
return 0;
|
||||
FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegDeleteKeyW [SHELL32.512]
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegDeleteKeyW(
|
||||
HKEY hkey,
|
||||
LPCWSTR pszSubKey)
|
||||
HKEY hkey,
|
||||
LPCWSTR pszSubKey)
|
||||
{
|
||||
FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
|
||||
return 0;
|
||||
FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegCloseKey [SHELL32.505] NT 4.0
|
||||
* SHRegCloseKey [SHELL32.505] NT 4.0
|
||||
*
|
||||
*/
|
||||
EXTERN_C HRESULT WINAPI SHRegCloseKey (HKEY hkey)
|
||||
{
|
||||
TRACE("%p\n",hkey);
|
||||
return RegCloseKey( hkey );
|
||||
TRACE("%p\n",hkey);
|
||||
return RegCloseKey( hkey );
|
||||
}
|
||||
|
|
|
@ -24,82 +24,82 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
|||
|
||||
BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
|
||||
{
|
||||
TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
|
||||
dest,len,src,
|
||||
(src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
|
||||
(src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
|
||||
(src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
|
||||
pidl);
|
||||
TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
|
||||
dest,len,src,
|
||||
(src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
|
||||
(src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
|
||||
(src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
|
||||
pidl);
|
||||
|
||||
if (!dest)
|
||||
return FALSE;
|
||||
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
WideCharToMultiByte(CP_ACP, 0, src->pOleStr, -1, dest, len, NULL, NULL);
|
||||
CoTaskMemFree(src->pOleStr);
|
||||
break;
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
WideCharToMultiByte(CP_ACP, 0, src->pOleStr, -1, dest, len, NULL, NULL);
|
||||
CoTaskMemFree(src->pOleStr);
|
||||
break;
|
||||
|
||||
case STRRET_CSTR:
|
||||
lstrcpynA(dest, src->cStr, len);
|
||||
break;
|
||||
case STRRET_CSTR:
|
||||
lstrcpynA(dest, src->cStr, len);
|
||||
break;
|
||||
|
||||
case STRRET_OFFSET:
|
||||
lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->uOffset, len);
|
||||
break;
|
||||
case STRRET_OFFSET:
|
||||
lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->uOffset, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len) *dest = '\0';
|
||||
return FALSE;
|
||||
}
|
||||
TRACE("-- %s\n", debugstr_a(dest) );
|
||||
return TRUE;
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len) *dest = '\0';
|
||||
return FALSE;
|
||||
}
|
||||
TRACE("-- %s\n", debugstr_a(dest) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
|
||||
{
|
||||
TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
|
||||
dest,len,src,
|
||||
(src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
|
||||
(src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
|
||||
(src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
|
||||
pidl);
|
||||
TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
|
||||
dest,len,src,
|
||||
(src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
|
||||
(src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
|
||||
(src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
|
||||
pidl);
|
||||
|
||||
if (!dest)
|
||||
return FALSE;
|
||||
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
lstrcpynW(dest, src->pOleStr, len);
|
||||
CoTaskMemFree(src->pOleStr);
|
||||
break;
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
lstrcpynW(dest, src->pOleStr, len);
|
||||
CoTaskMemFree(src->pOleStr);
|
||||
break;
|
||||
|
||||
case STRRET_CSTR:
|
||||
case STRRET_CSTR:
|
||||
if (!MultiByteToWideChar( CP_ACP, 0, src->cStr, -1, dest, len ) && len)
|
||||
dest[len-1] = 0;
|
||||
break;
|
||||
break;
|
||||
|
||||
case STRRET_OFFSET:
|
||||
case STRRET_OFFSET:
|
||||
if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset, -1, dest, len ) && len)
|
||||
dest[len-1] = 0;
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len) *dest = '\0';
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len) *dest = '\0';
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* StrRetToStrN [SHELL32.96]
|
||||
* StrRetToStrN [SHELL32.96]
|
||||
*
|
||||
* converts a STRRET to a normal string
|
||||
*
|
||||
|
@ -108,7 +108,7 @@ BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
|
|||
*/
|
||||
EXTERN_C BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
|
||||
{
|
||||
if(SHELL_OsIsUnicode())
|
||||
if(SHELL_OsIsUnicode())
|
||||
return StrRetToStrNW((LPWSTR)dest, len, src, pidl);
|
||||
else
|
||||
return StrRetToStrNA((LPSTR)dest, len, src, pidl);
|
||||
|
@ -117,84 +117,84 @@ EXTERN_C BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const
|
|||
/************************* OLESTR functions ****************************/
|
||||
|
||||
/************************************************************************
|
||||
* StrToOleStr [SHELL32.163]
|
||||
* StrToOleStr [SHELL32.163]
|
||||
*
|
||||
*/
|
||||
int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
|
||||
{
|
||||
TRACE("(%p, %p %s)\n",
|
||||
lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
|
||||
TRACE("(%p, %p %s)\n",
|
||||
lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
|
||||
|
||||
return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
|
||||
return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
|
||||
|
||||
}
|
||||
int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
|
||||
{
|
||||
TRACE("(%p, %p %s)\n",
|
||||
lpWideCharStr, lpWString, debugstr_w(lpWString));
|
||||
TRACE("(%p, %p %s)\n",
|
||||
lpWideCharStr, lpWString, debugstr_w(lpWString));
|
||||
|
||||
wcscpy (lpWideCharStr, lpWString );
|
||||
return wcslen(lpWideCharStr);
|
||||
wcscpy (lpWideCharStr, lpWString );
|
||||
return wcslen(lpWideCharStr);
|
||||
}
|
||||
|
||||
EXTERN_C BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString);
|
||||
return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString);
|
||||
return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrToOleStrN [SHELL32.79]
|
||||
* StrToOleStrN [SHELL32.79]
|
||||
* lpMulti, nMulti, nWide [IN]
|
||||
* lpWide [OUT]
|
||||
*/
|
||||
BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr)
|
||||
{
|
||||
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
|
||||
return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
|
||||
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
|
||||
return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
|
||||
}
|
||||
BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
|
||||
{
|
||||
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
|
||||
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
|
||||
|
||||
if (lstrcpynW (lpWide, lpStrW, nWide))
|
||||
{ return wcslen (lpWide);
|
||||
}
|
||||
return 0;
|
||||
if (lstrcpynW (lpWide, lpStrW, nWide))
|
||||
{ return wcslen (lpWide);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXTERN_C BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr);
|
||||
return StrToOleStrNA (lpWide, nWide, (LPCSTR)lpStr, nStr);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr);
|
||||
return StrToOleStrNA (lpWide, nWide, (LPCSTR)lpStr, nStr);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* OleStrToStrN [SHELL32.78]
|
||||
* OleStrToStrN [SHELL32.78]
|
||||
*/
|
||||
BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle)
|
||||
{
|
||||
TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
|
||||
return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
|
||||
TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
|
||||
return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
|
||||
}
|
||||
|
||||
BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
|
||||
{
|
||||
TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
|
||||
TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
|
||||
|
||||
if (lstrcpynW ( lpwStr, lpOle, nwStr))
|
||||
{ return wcslen (lpwStr);
|
||||
}
|
||||
return 0;
|
||||
if (lstrcpynW ( lpwStr, lpOle, nwStr))
|
||||
{ return wcslen (lpwStr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXTERN_C BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
|
||||
return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
|
||||
if (SHELL_OsIsUnicode())
|
||||
return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
|
||||
return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
|
||||
}
|
||||
|
||||
|
||||
|
@ -215,22 +215,22 @@ EXTERN_C BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT n
|
|||
* Not really sure if this function returns actually a value at all.
|
||||
*/
|
||||
DWORD WINAPI CheckEscapesA(
|
||||
LPSTR string, /* [I/O] string to check ??*/
|
||||
DWORD len) /* [I] is 0 */
|
||||
LPSTR string, /* [I/O] string to check ??*/
|
||||
DWORD len) /* [I] is 0 */
|
||||
{
|
||||
LPWSTR wString;
|
||||
DWORD ret = 0;
|
||||
LPWSTR wString;
|
||||
DWORD ret = 0;
|
||||
|
||||
TRACE("(%s %d)\n", debugstr_a(string), len);
|
||||
wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
|
||||
if (wString)
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);
|
||||
ret = CheckEscapesW(wString, len);
|
||||
WideCharToMultiByte(CP_ACP, 0, wString, len, string, len, NULL, NULL);
|
||||
LocalFree(wString);
|
||||
}
|
||||
return ret;
|
||||
TRACE("(%s %d)\n", debugstr_a(string), len);
|
||||
wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
|
||||
if (wString)
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);
|
||||
ret = CheckEscapesW(wString, len);
|
||||
WideCharToMultiByte(CP_ACP, 0, wString, len, string, len, NULL, NULL);
|
||||
LocalFree(wString);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0};
|
||||
|
@ -241,24 +241,24 @@ static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0};
|
|||
* See CheckEscapesA.
|
||||
*/
|
||||
DWORD WINAPI CheckEscapesW(
|
||||
LPWSTR string,
|
||||
DWORD len)
|
||||
LPWSTR string,
|
||||
DWORD len)
|
||||
{
|
||||
DWORD size = wcslen(string);
|
||||
LPWSTR s, d;
|
||||
DWORD size = wcslen(string);
|
||||
LPWSTR s, d;
|
||||
|
||||
TRACE("(%s %d) stub\n", debugstr_w(string), len);
|
||||
TRACE("(%s %d) stub\n", debugstr_w(string), len);
|
||||
|
||||
if (StrPBrkW(string, strEscapedChars) && size + 2 <= len)
|
||||
{
|
||||
s = &string[size - 1];
|
||||
d = &string[size + 2];
|
||||
*d-- = 0;
|
||||
*d-- = '"';
|
||||
for (;d > string;)
|
||||
*d-- = *s--;
|
||||
*d = '"';
|
||||
return size + 2;
|
||||
}
|
||||
return size;
|
||||
if (StrPBrkW(string, strEscapedChars) && size + 2 <= len)
|
||||
{
|
||||
s = &string[size - 1];
|
||||
d = &string[size + 2];
|
||||
*d-- = 0;
|
||||
*d-- = '"';
|
||||
for (;d > string;)
|
||||
*d-- = *s--;
|
||||
*d = '"';
|
||||
return size + 2;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -38,16 +38,16 @@ This folder should not exist. It is just a file system folder...
|
|||
*/
|
||||
|
||||
class CDesktopFolderEnumY :
|
||||
public IEnumIDListImpl
|
||||
public IEnumIDListImpl
|
||||
{
|
||||
private:
|
||||
public:
|
||||
CDesktopFolderEnumY();
|
||||
~CDesktopFolderEnumY();
|
||||
HRESULT WINAPI Initialize(LPWSTR szTarget, DWORD dwFlags);
|
||||
CDesktopFolderEnumY();
|
||||
~CDesktopFolderEnumY();
|
||||
HRESULT WINAPI Initialize(LPWSTR szTarget, DWORD dwFlags);
|
||||
|
||||
BEGIN_COM_MAP(CDesktopFolderEnumY)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
|
@ -82,34 +82,34 @@ HRESULT WINAPI CDesktopFolderEnumY::Initialize(LPWSTR szTarget, DWORD dwFlags)
|
|||
|
||||
CAdminToolsFolder::CAdminToolsFolder()
|
||||
{
|
||||
pclsid = NULL;
|
||||
pclsid = NULL;
|
||||
|
||||
pidlRoot = NULL; /* absolute pidl */
|
||||
szTarget = NULL;
|
||||
pidlRoot = NULL; /* absolute pidl */
|
||||
szTarget = NULL;
|
||||
|
||||
dwAttributes = 0; /* attributes returned by GetAttributesOf FIXME: use it */
|
||||
dwAttributes = 0; /* attributes returned by GetAttributesOf FIXME: use it */
|
||||
}
|
||||
|
||||
CAdminToolsFolder::~CAdminToolsFolder()
|
||||
{
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", this);
|
||||
if (pidlRoot)
|
||||
SHFree(pidlRoot);
|
||||
HeapFree(GetProcessHeap(), 0, szTarget);
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", this);
|
||||
if (pidlRoot)
|
||||
SHFree(pidlRoot);
|
||||
HeapFree(GetProcessHeap(), 0, szTarget);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CAdminToolsFolder::FinalConstruct()
|
||||
{
|
||||
szTarget = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
|
||||
if (szTarget == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
if (!SHGetSpecialFolderPathW(NULL, szTarget, CSIDL_COMMON_ADMINTOOLS, FALSE))
|
||||
return E_FAIL;
|
||||
szTarget = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
|
||||
if (szTarget == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
if (!SHGetSpecialFolderPathW(NULL, szTarget, CSIDL_COMMON_ADMINTOOLS, FALSE))
|
||||
return E_FAIL;
|
||||
|
||||
pidlRoot = _ILCreateAdminTools(); /* my qualified pidl */
|
||||
if (pidlRoot == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
pidlRoot = _ILCreateAdminTools(); /* my qualified pidl */
|
||||
if (pidlRoot == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -127,7 +127,7 @@ HRESULT WINAPI CAdminToolsFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LP
|
|||
if (pchEaten)
|
||||
*pchEaten = 0;
|
||||
|
||||
MessageBoxW(NULL, lpszDisplayName, L"ParseDisplayName", MB_OK);
|
||||
MessageBoxW(NULL, lpszDisplayName, L"ParseDisplayName", MB_OK);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
@ -137,32 +137,32 @@ HRESULT WINAPI CAdminToolsFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LP
|
|||
*/
|
||||
HRESULT WINAPI CAdminToolsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
|
||||
{
|
||||
CComObject<CDesktopFolderEnumY> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
CComObject<CDesktopFolderEnumY> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumY>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize (szTarget, dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach ();
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumY>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize (szTarget, dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach ();
|
||||
|
||||
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -206,8 +206,8 @@ HRESULT WINAPI CAdminToolsFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1,
|
|||
*/
|
||||
HRESULT WINAPI CAdminToolsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
|
||||
{
|
||||
CComPtr<IShellView> pShellView;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
CComPtr<IShellView> pShellView;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this,
|
||||
hwndOwner, shdebugstr_guid (&riid), ppvOut);
|
||||
|
@ -291,7 +291,7 @@ HRESULT WINAPI CAdminToolsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCIT
|
|||
REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
|
||||
{
|
||||
LPITEMIDLIST pidl;
|
||||
CComPtr<IUnknown> pObj;
|
||||
CComPtr<IUnknown> pObj;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
|
||||
|
|
|
@ -36,16 +36,16 @@ be inserted in a removable drive.
|
|||
*/
|
||||
|
||||
class CFileSysEnum :
|
||||
public IEnumIDListImpl
|
||||
public IEnumIDListImpl
|
||||
{
|
||||
private:
|
||||
public:
|
||||
CFileSysEnum();
|
||||
~CFileSysEnum();
|
||||
HRESULT WINAPI Initialize(LPWSTR sPathTarget, DWORD dwFlags);
|
||||
CFileSysEnum();
|
||||
~CFileSysEnum();
|
||||
HRESULT WINAPI Initialize(LPWSTR sPathTarget, DWORD dwFlags);
|
||||
|
||||
BEGIN_COM_MAP(CFileSysEnum)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
|
@ -59,7 +59,7 @@ CFileSysEnum::~CFileSysEnum()
|
|||
|
||||
HRESULT WINAPI CFileSysEnum::Initialize(LPWSTR sPathTarget, DWORD dwFlags)
|
||||
{
|
||||
return CreateFolderEnumList(sPathTarget, dwFlags);
|
||||
return CreateFolderEnumList(sPathTarget, dwFlags);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -76,11 +76,11 @@ void CFSFolder::SF_RegisterClipFmt()
|
|||
|
||||
CFSFolder::CFSFolder()
|
||||
{
|
||||
pclsid = (CLSID *)&CLSID_ShellFSFolder;
|
||||
sPathTarget = NULL;
|
||||
pidlRoot = NULL;
|
||||
cfShellIDList = 0;
|
||||
fAcceptFmt = FALSE;
|
||||
pclsid = (CLSID *)&CLSID_ShellFSFolder;
|
||||
sPathTarget = NULL;
|
||||
pidlRoot = NULL;
|
||||
cfShellIDList = 0;
|
||||
fAcceptFmt = FALSE;
|
||||
}
|
||||
|
||||
CFSFolder::~CFSFolder()
|
||||
|
@ -252,32 +252,32 @@ HRESULT WINAPI CFSFolder::ParseDisplayName(HWND hwndOwner,
|
|||
HRESULT WINAPI CFSFolder::EnumObjects (HWND hwndOwner,
|
||||
DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
||||
{
|
||||
CComObject<CFileSysEnum> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
CComObject<CFileSysEnum> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CFileSysEnum>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize (sPathTarget, dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach ();
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CFileSysEnum>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize (sPathTarget, dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach ();
|
||||
|
||||
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -454,13 +454,13 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner,
|
|||
if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1)) {
|
||||
hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)this, NULL, 0, NULL, (IContextMenu**)&pObj);
|
||||
} else if (IsEqualIID (riid, IID_IDataObject)){
|
||||
if (cidl >= 1) {
|
||||
if (cidl >= 1) {
|
||||
hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IDataObject_Constructor (hwndOwner, pidlRoot, (LPCITEMIDLIST*)&pidlRoot, 1, (IDataObject **)&pObj);
|
||||
}
|
||||
}
|
||||
} else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1)) {
|
||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
||||
|
|
|
@ -40,17 +40,17 @@ CDrivesFolderEnum is only responsible for returning the physical items.
|
|||
*/
|
||||
|
||||
class CDrivesFolderEnum :
|
||||
public IEnumIDListImpl
|
||||
public IEnumIDListImpl
|
||||
{
|
||||
private:
|
||||
public:
|
||||
CDrivesFolderEnum();
|
||||
~CDrivesFolderEnum();
|
||||
HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags);
|
||||
BOOL CreateMyCompEnumList(DWORD dwFlags);
|
||||
CDrivesFolderEnum();
|
||||
~CDrivesFolderEnum();
|
||||
HRESULT WINAPI Initialize(HWND hwndOwner, DWORD dwFlags);
|
||||
BOOL CreateMyCompEnumList(DWORD dwFlags);
|
||||
|
||||
BEGIN_COM_MAP(CDrivesFolderEnum)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
|
@ -79,9 +79,9 @@ HRESULT WINAPI CDrivesFolderEnum::Initialize(HWND hwndOwner, DWORD dwFlags)
|
|||
{
|
||||
DbgPrint("[shell32, CDrivesFolderEnum::Initialize] Called with flags = %d\n", dwFlags);
|
||||
|
||||
if (CreateMyCompEnumList(dwFlags) == FALSE)
|
||||
return E_FAIL;
|
||||
return S_OK;
|
||||
if (CreateMyCompEnumList(dwFlags) == FALSE)
|
||||
return E_FAIL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -137,9 +137,9 @@ BOOL CDrivesFolderEnum::CreateMyCompEnumList(DWORD dwFlags)
|
|||
{
|
||||
/* FIXME: shell extensions, shouldn't the type be
|
||||
* PT_SHELLEXT? */
|
||||
LPITEMIDLIST pidl = _ILCreateGuidFromStrW(iid);
|
||||
if (pidl != NULL)
|
||||
ret = AddToEnumList(pidl);
|
||||
LPITEMIDLIST pidl = _ILCreateGuidFromStrW(iid);
|
||||
if (pidl != NULL)
|
||||
ret = AddToEnumList(pidl);
|
||||
i++;
|
||||
}
|
||||
else if (ERROR_NO_MORE_ITEMS == r)
|
||||
|
@ -162,8 +162,8 @@ CDrivesFolder::CDrivesFolder()
|
|||
|
||||
CDrivesFolder::~CDrivesFolder()
|
||||
{
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", this);
|
||||
SHFree(pidlRoot);
|
||||
TRACE ("-- destroying IShellFolder(%p)\n", this);
|
||||
SHFree(pidlRoot);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CDrivesFolder::FinalConstruct()
|
||||
|
@ -172,8 +172,8 @@ HRESULT WINAPI CDrivesFolder::FinalConstruct()
|
|||
WCHAR szName[MAX_PATH];
|
||||
|
||||
pidlRoot = _ILCreateMyComputer(); /* my qualified pidl */
|
||||
if (pidlRoot == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
if (pidlRoot == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
dwSize = sizeof(szName);
|
||||
if (RegGetValueW(HKEY_CURRENT_USER,
|
||||
|
@ -188,7 +188,7 @@ HRESULT WINAPI CDrivesFolder::FinalConstruct()
|
|||
}
|
||||
TRACE("sName %s\n", debugstr_w(sName));
|
||||
}
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -254,40 +254,40 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLES
|
|||
*/
|
||||
HRESULT WINAPI CDrivesFolder::EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
|
||||
{
|
||||
CComObject<CDrivesFolderEnum> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
CComObject<CDrivesFolderEnum> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
|
||||
DbgPrint("[shell32, CDrivesFolder::EnumObjects] Called with flags = %d\n", dwFlags);
|
||||
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CDrivesFolderEnum>);
|
||||
|
||||
ATLTRY (theEnumerator = new CComObject<CDrivesFolderEnum>);
|
||||
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
|
||||
DbgPrint("[shell32, CDrivesFolder::EnumObjects] Calling theEnumerator->Initialize\n");
|
||||
DbgPrint("[shell32, CDrivesFolder::EnumObjects] Calling theEnumerator->Initialize\n");
|
||||
|
||||
hResult = theEnumerator->Initialize (hwndOwner, dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach ();
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach ();
|
||||
|
||||
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* Network Places (Neighbourhood) folder
|
||||
* Network Places (Neighbourhood) folder
|
||||
*
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998, 1999, 2002 Juergen Schmied
|
||||
* Copyright 2003 Mike McCormack for Codeweavers
|
||||
* Copyright 2009 Andrew Hill
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998, 1999, 2002 Juergen Schmied
|
||||
* Copyright 2003 Mike McCormack for Codeweavers
|
||||
* Copyright 2009 Andrew Hill
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -33,7 +33,7 @@ static shvheader NetworkPlacesSFHeader[] = {
|
|||
{IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
|
||||
{IDS_SHV_COLUMN13, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
|
||||
{IDS_SHV_COLUMN_WORKGROUP, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
|
||||
{IDS_SHV_NETWORKLOCATION, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}
|
||||
{IDS_SHV_NETWORKLOCATION, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}
|
||||
};
|
||||
|
||||
#define COLUMN_NAME 0
|
||||
|
@ -50,20 +50,20 @@ CNetFolder::CNetFolder()
|
|||
|
||||
CNetFolder::~CNetFolder()
|
||||
{
|
||||
TRACE("-- destroying IShellFolder(%p)\n", this);
|
||||
SHFree(pidlRoot);
|
||||
TRACE("-- destroying IShellFolder(%p)\n", this);
|
||||
SHFree(pidlRoot);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CNetFolder::FinalConstruct()
|
||||
{
|
||||
pidlRoot = _ILCreateNetHood(); /* my qualified pidl */
|
||||
if (pidlRoot == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
pidlRoot = _ILCreateNetHood(); /* my qualified pidl */
|
||||
if (pidlRoot == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnParseDisplayName
|
||||
* ISF_NetworkPlaces_fnParseDisplayName
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName,
|
||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||
|
@ -76,7 +76,7 @@ HRESULT WINAPI CNetFolder::ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LP
|
|||
|
||||
*ppidl = 0;
|
||||
if (pchEaten)
|
||||
*pchEaten = 0; /* strange but like the original */
|
||||
*pchEaten = 0; /* strange but like the original */
|
||||
|
||||
TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
|
||||
|
||||
|
@ -84,7 +84,7 @@ HRESULT WINAPI CNetFolder::ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LP
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnEnumObjects
|
||||
* ISF_NetworkPlaces_fnEnumObjects
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ HRESULT WINAPI CNetFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLI
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnBindToObject
|
||||
* ISF_NetworkPlaces_fnBindToObject
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ HRESULT WINAPI CNetFolder::BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, RE
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnBindToStorage
|
||||
* ISF_NetworkPlaces_fnBindToStorage
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ HRESULT WINAPI CNetFolder::BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, R
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnCompareIDs
|
||||
* ISF_NetworkPlaces_fnCompareIDs
|
||||
*/
|
||||
|
||||
HRESULT WINAPI CNetFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
|
@ -136,7 +136,7 @@ HRESULT WINAPI CNetFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITE
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnCreateViewObject
|
||||
* ISF_NetworkPlaces_fnCreateViewObject
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
|
||||
{
|
||||
|
@ -149,26 +149,26 @@ HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID
|
|||
if (!ppvOut)
|
||||
return hr;
|
||||
|
||||
*ppvOut = NULL;
|
||||
*ppvOut = NULL;
|
||||
|
||||
if (IsEqualIID (riid, IID_IDropTarget))
|
||||
if (IsEqualIID (riid, IID_IDropTarget))
|
||||
{
|
||||
WARN ("IDropTarget not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
}
|
||||
WARN ("IDropTarget not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IContextMenu))
|
||||
{
|
||||
WARN ("IContextMenu not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
}
|
||||
WARN ("IContextMenu not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IShellView))
|
||||
{
|
||||
hr = IShellView_Constructor ((IShellFolder *)this, &pShellView);
|
||||
if (pShellView)
|
||||
hr = IShellView_Constructor ((IShellFolder *)this, &pShellView);
|
||||
if (pShellView)
|
||||
{
|
||||
hr = pShellView->QueryInterface(riid, ppvOut);
|
||||
pShellView->Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
|
||||
return hr;
|
||||
|
@ -217,7 +217,7 @@ HRESULT WINAPI CNetFolder::GetAttributesOf(UINT cidl, LPCITEMIDLIST *apidl, DWOR
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnGetUIObjectOf
|
||||
* ISF_NetworkPlaces_fnGetUIObjectOf
|
||||
*
|
||||
* PARAMETERS
|
||||
* hwndOwner [in] Parent window for any output
|
||||
|
@ -241,47 +241,47 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLIS
|
|||
if (!ppvOut)
|
||||
return hr;
|
||||
|
||||
*ppvOut = NULL;
|
||||
*ppvOut = NULL;
|
||||
|
||||
if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
|
||||
if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
|
||||
{
|
||||
hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)this, NULL, 0, NULL, (IContextMenu**)&pObj);
|
||||
}
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
|
||||
{
|
||||
hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
|
||||
}
|
||||
hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
|
||||
{
|
||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
||||
SHFree (pidl);
|
||||
hr = S_OK;
|
||||
}
|
||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
|
||||
SHFree (pidl);
|
||||
hr = S_OK;
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IExtractIconW) && (cidl == 1))
|
||||
{
|
||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
||||
SHFree (pidl);
|
||||
hr = S_OK;
|
||||
}
|
||||
pidl = ILCombine (pidlRoot, apidl[0]);
|
||||
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
|
||||
SHFree (pidl);
|
||||
hr = S_OK;
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
|
||||
{
|
||||
hr = this->QueryInterface(IID_IDropTarget, (LPVOID *) & pObj);
|
||||
}
|
||||
hr = this->QueryInterface(IID_IDropTarget, (LPVOID *) & pObj);
|
||||
}
|
||||
else
|
||||
hr = E_NOINTERFACE;
|
||||
hr = E_NOINTERFACE;
|
||||
|
||||
if (SUCCEEDED(hr) && !pObj)
|
||||
hr = E_OUTOFMEMORY;
|
||||
if (SUCCEEDED(hr) && !pObj)
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
*ppvOut = pObj;
|
||||
*ppvOut = pObj;
|
||||
TRACE ("(%p)->hr=0x%08x\n", this, hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_NetworkPlaces_fnGetDisplayNameOf
|
||||
* ISF_NetworkPlaces_fnGetDisplayNameOf
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||
|
@ -307,7 +307,7 @@ HRESULT WINAPI CNetFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, L
|
|||
* dwFlags [in] SHGNO formatting flags
|
||||
* ppidlOut [out] simple pidl returned
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::SetNameOf (HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
||||
HRESULT WINAPI CNetFolder::SetNameOf (HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
||||
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
|
||||
{
|
||||
FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this,
|
||||
|
@ -390,7 +390,7 @@ HRESULT WINAPI CNetFolder::MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
|
|||
}
|
||||
|
||||
/************************************************************************
|
||||
* INPFldr_PersistFolder2_GetClassID
|
||||
* INPFldr_PersistFolder2_GetClassID
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::GetClassID(CLSID *lpClassId)
|
||||
{
|
||||
|
@ -405,7 +405,7 @@ HRESULT WINAPI CNetFolder::GetClassID(CLSID *lpClassId)
|
|||
}
|
||||
|
||||
/************************************************************************
|
||||
* INPFldr_PersistFolder2_Initialize
|
||||
* INPFldr_PersistFolder2_Initialize
|
||||
*
|
||||
* NOTES: it makes no sense to change the pidl
|
||||
*/
|
||||
|
@ -417,7 +417,7 @@ HRESULT WINAPI CNetFolder::Initialize(LPCITEMIDLIST pidl)
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* IPersistFolder2_fnGetCurFolder
|
||||
* IPersistFolder2_fnGetCurFolder
|
||||
*/
|
||||
HRESULT WINAPI CNetFolder::GetCurFolder(LPITEMIDLIST *pidl)
|
||||
{
|
||||
|
|
|
@ -61,67 +61,67 @@ static const columninfo CBitBucketColumns[] =
|
|||
*/
|
||||
|
||||
class CBitBucketEnum :
|
||||
public IEnumIDListImpl
|
||||
public IEnumIDListImpl
|
||||
{
|
||||
private:
|
||||
public:
|
||||
CBitBucketEnum();
|
||||
~CBitBucketEnum();
|
||||
HRESULT WINAPI Initialize(DWORD dwFlags);
|
||||
static BOOL WINAPI CBEnumBitBucket(IN PVOID Context, IN HANDLE hDeletedFile);
|
||||
BOOL WINAPI CBEnumBitBucket(IN HANDLE hDeletedFile);
|
||||
CBitBucketEnum();
|
||||
~CBitBucketEnum();
|
||||
HRESULT WINAPI Initialize(DWORD dwFlags);
|
||||
static BOOL WINAPI CBEnumBitBucket(IN PVOID Context, IN HANDLE hDeletedFile);
|
||||
BOOL WINAPI CBEnumBitBucket(IN HANDLE hDeletedFile);
|
||||
|
||||
BEGIN_COM_MAP(CBitBucketEnum)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
class CCBitBucketBackgroundContextMenu :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IContextMenu2
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IContextMenu2
|
||||
{
|
||||
private:
|
||||
INT iIdEmpty;
|
||||
INT iIdEmpty;
|
||||
public:
|
||||
CCBitBucketBackgroundContextMenu();
|
||||
~CCBitBucketBackgroundContextMenu();
|
||||
CCBitBucketBackgroundContextMenu();
|
||||
~CCBitBucketBackgroundContextMenu();
|
||||
|
||||
// IContextMenu
|
||||
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
||||
// IContextMenu
|
||||
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
||||
|
||||
// IContextMenu2
|
||||
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
// IContextMenu2
|
||||
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
BEGIN_COM_MAP(CCBitBucketBackgroundContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
class CCBitBucketItemContextMenu :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IContextMenu2
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IContextMenu2
|
||||
{
|
||||
private:
|
||||
LPITEMIDLIST apidl;
|
||||
LPITEMIDLIST apidl;
|
||||
public:
|
||||
CCBitBucketItemContextMenu();
|
||||
~CCBitBucketItemContextMenu();
|
||||
HRESULT WINAPI Initialize(LPCITEMIDLIST pidl);
|
||||
CCBitBucketItemContextMenu();
|
||||
~CCBitBucketItemContextMenu();
|
||||
HRESULT WINAPI Initialize(LPCITEMIDLIST pidl);
|
||||
|
||||
// IContextMenu
|
||||
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
||||
// IContextMenu
|
||||
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
||||
|
||||
// IContextMenu2
|
||||
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
// IContextMenu2
|
||||
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
BEGIN_COM_MAP(CCBitBucketItemContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
|
@ -209,21 +209,21 @@ HRESULT WINAPI CBitBucketEnum::Initialize(DWORD dwFlags)
|
|||
{
|
||||
static LPCWSTR szDrive = L"C:\\";
|
||||
|
||||
if (dwFlags & SHCONTF_NONFOLDERS)
|
||||
{
|
||||
TRACE("Starting Enumeration\n");
|
||||
if (dwFlags & SHCONTF_NONFOLDERS)
|
||||
{
|
||||
TRACE("Starting Enumeration\n");
|
||||
|
||||
if (!EnumerateRecycleBinW(szDrive /* FIXME */ , CBEnumBitBucket, (PVOID)this))
|
||||
{
|
||||
WARN("Error: EnumerateCBitBucketW failed\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
return S_OK;
|
||||
if (!EnumerateRecycleBinW(szDrive /* FIXME */ , CBEnumBitBucket, (PVOID)this))
|
||||
{
|
||||
WARN("Error: EnumerateCBitBucketW failed\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static LPITEMIDLIST _ILCreateRecycleItem(PDELETED_FILE_DETAILS_W pFileDetails)
|
||||
|
@ -253,7 +253,7 @@ static LPITEMIDLIST _ILCreateRecycleItem(PDELETED_FILE_DETAILS_W pFileDetails)
|
|||
|
||||
BOOL WINAPI CBitBucketEnum::CBEnumBitBucket(IN PVOID Context, IN HANDLE hDeletedFile)
|
||||
{
|
||||
return ((CBitBucketEnum *)Context)->CBEnumBitBucket(hDeletedFile);
|
||||
return ((CBitBucketEnum *)Context)->CBEnumBitBucket(hDeletedFile);
|
||||
}
|
||||
|
||||
BOOL WINAPI CBitBucketEnum::CBEnumBitBucket(IN HANDLE hDeletedFile)
|
||||
|
@ -314,7 +314,7 @@ BOOL WINAPI CBitBucketEnum::CBEnumBitBucket(IN HANDLE hDeletedFile)
|
|||
|
||||
CCBitBucketBackgroundContextMenu::CCBitBucketBackgroundContextMenu()
|
||||
{
|
||||
iIdEmpty = 0;
|
||||
iIdEmpty = 0;
|
||||
}
|
||||
|
||||
CCBitBucketBackgroundContextMenu::~CCBitBucketBackgroundContextMenu()
|
||||
|
@ -323,95 +323,95 @@ CCBitBucketBackgroundContextMenu::~CCBitBucketBackgroundContextMenu()
|
|||
|
||||
HRESULT WINAPI CCBitBucketBackgroundContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
|
||||
{
|
||||
WCHAR szBuffer[100];
|
||||
MENUITEMINFOW mii;
|
||||
int id = 1;
|
||||
WCHAR szBuffer[100];
|
||||
MENUITEMINFOW mii;
|
||||
int id = 1;
|
||||
|
||||
TRACE("%p %p %u %u %u %u\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags );
|
||||
TRACE("%p %p %u %u %u %u\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags );
|
||||
|
||||
if (!hMenu)
|
||||
return E_INVALIDARG;
|
||||
if (!hMenu)
|
||||
return E_INVALIDARG;
|
||||
|
||||
memset(&mii, 0, sizeof(mii));
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
|
||||
mii.fState = MFS_ENABLED;
|
||||
szBuffer[0] = L'\0';
|
||||
LoadStringW(shell32_hInstance, IDS_EMPTY_BITBUCKET, szBuffer, sizeof(szBuffer)/sizeof(WCHAR));
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = wcslen( mii.dwTypeData );
|
||||
mii.wID = idCmdFirst + id++;
|
||||
mii.fType = MFT_STRING;
|
||||
iIdEmpty = 1;
|
||||
memset(&mii, 0, sizeof(mii));
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
|
||||
mii.fState = MFS_ENABLED;
|
||||
szBuffer[0] = L'\0';
|
||||
LoadStringW(shell32_hInstance, IDS_EMPTY_BITBUCKET, szBuffer, sizeof(szBuffer)/sizeof(WCHAR));
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = wcslen( mii.dwTypeData );
|
||||
mii.wID = idCmdFirst + id++;
|
||||
mii.fType = MFT_STRING;
|
||||
iIdEmpty = 1;
|
||||
|
||||
if (!InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
|
||||
return E_FAIL;
|
||||
if (!InsertMenuItemW(hMenu, indexMenu, TRUE, &mii))
|
||||
return E_FAIL;
|
||||
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, id);
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, id);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketBackgroundContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
HRESULT hr;
|
||||
LPSHELLBROWSER lpSB;
|
||||
LPSHELLVIEW lpSV = NULL;
|
||||
HRESULT hr;
|
||||
LPSHELLBROWSER lpSB;
|
||||
LPSHELLVIEW lpSV = NULL;
|
||||
|
||||
TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
|
||||
TRACE("%p %p verb %p\n", this, lpcmi, lpcmi->lpVerb);
|
||||
|
||||
if (LOWORD(lpcmi->lpVerb) == iIdEmpty)
|
||||
{
|
||||
// FIXME
|
||||
// path & flags
|
||||
hr = SHEmptyRecycleBinW(lpcmi->hwnd, L"C:\\", 0);
|
||||
TRACE("result %x\n", hr);
|
||||
if (hr != S_OK)
|
||||
return hr;
|
||||
if (LOWORD(lpcmi->lpVerb) == iIdEmpty)
|
||||
{
|
||||
// FIXME
|
||||
// path & flags
|
||||
hr = SHEmptyRecycleBinW(lpcmi->hwnd, L"C:\\", 0);
|
||||
TRACE("result %x\n", hr);
|
||||
if (hr != S_OK)
|
||||
return hr;
|
||||
|
||||
lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER, 0, 0);
|
||||
if (lpSB && SUCCEEDED(lpSB->QueryActiveShellView(&lpSV)))
|
||||
lpSV->Refresh();
|
||||
}
|
||||
return S_OK;
|
||||
lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER, 0, 0);
|
||||
if (lpSB && SUCCEEDED(lpSB->QueryActiveShellView(&lpSV)))
|
||||
lpSV->Refresh();
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketBackgroundContextMenu::GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
|
||||
{
|
||||
FIXME("%p %lu %u %p %p %u\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
|
||||
FIXME("%p %lu %u %p %p %u\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
|
||||
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketBackgroundContextMenu::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
TRACE("CBitBucket_IContextMenu2Item_IContextMenu2Folder_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n", this, uMsg, wParam, lParam);
|
||||
TRACE("CBitBucket_IContextMenu2Item_IContextMenu2Folder_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n", this, uMsg, wParam, lParam);
|
||||
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI CBitBucketBackgroundContextMenuConstructor(REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
CComObject<CCBitBucketBackgroundContextMenu> *theMenu;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
CComObject<CCBitBucketBackgroundContextMenu> *theMenu;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE("%s\n", shdebugstr_guid(&riid));
|
||||
TRACE("%s\n", shdebugstr_guid(&riid));
|
||||
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY(theMenu = new CComObject<CCBitBucketBackgroundContextMenu>);
|
||||
if (theMenu == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenu->QueryInterface(riid, (void **)&result);
|
||||
if (FAILED(hResult))
|
||||
{
|
||||
delete theMenu;
|
||||
return hResult;
|
||||
}
|
||||
*ppv = result.Detach();
|
||||
TRACE ("--(%p)\n", *ppv);
|
||||
return S_OK;
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY(theMenu = new CComObject<CCBitBucketBackgroundContextMenu>);
|
||||
if (theMenu == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenu->QueryInterface(riid, (void **)&result);
|
||||
if (FAILED(hResult))
|
||||
{
|
||||
delete theMenu;
|
||||
return hResult;
|
||||
}
|
||||
*ppv = result.Detach();
|
||||
TRACE ("--(%p)\n", *ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -420,144 +420,144 @@ static HRESULT WINAPI CBitBucketBackgroundContextMenuConstructor(REFIID riid, LP
|
|||
|
||||
CCBitBucketItemContextMenu::CCBitBucketItemContextMenu()
|
||||
{
|
||||
apidl = NULL;
|
||||
apidl = NULL;
|
||||
}
|
||||
|
||||
CCBitBucketItemContextMenu::~CCBitBucketItemContextMenu()
|
||||
{
|
||||
ILFree(apidl);
|
||||
ILFree(apidl);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketItemContextMenu::Initialize(LPCITEMIDLIST pidl)
|
||||
{
|
||||
apidl = ILClone(pidl);
|
||||
if (apidl == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
apidl = ILClone(pidl);
|
||||
if (apidl == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketItemContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
|
||||
{
|
||||
WCHAR szBuffer[30] = {0};
|
||||
ULONG Count = 1;
|
||||
WCHAR szBuffer[30] = {0};
|
||||
ULONG Count = 1;
|
||||
|
||||
TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
|
||||
TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
|
||||
|
||||
if (LoadStringW(shell32_hInstance, IDS_RESTORE, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED);
|
||||
Count++;
|
||||
}
|
||||
if (LoadStringW(shell32_hInstance, IDS_RESTORE, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED);
|
||||
Count++;
|
||||
}
|
||||
|
||||
if (LoadStringW(shell32_hInstance, IDS_CUT, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
|
||||
}
|
||||
if (LoadStringW(shell32_hInstance, IDS_CUT, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
|
||||
}
|
||||
|
||||
if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
|
||||
}
|
||||
if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
|
||||
}
|
||||
|
||||
if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT);
|
||||
}
|
||||
if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
|
||||
_InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT);
|
||||
}
|
||||
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count);
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketItemContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
SEARCH_CONTEXT Context;
|
||||
static LPCWSTR szDrive = L"C:\\";
|
||||
SEARCH_CONTEXT Context;
|
||||
static LPCWSTR szDrive = L"C:\\";
|
||||
|
||||
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",this,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
|
||||
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",this,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
|
||||
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(5))
|
||||
{
|
||||
Context.pFileDetails = _ILGetRecycleStruct(apidl);
|
||||
Context.bFound = FALSE;
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(5))
|
||||
{
|
||||
Context.pFileDetails = _ILGetRecycleStruct(apidl);
|
||||
Context.bFound = FALSE;
|
||||
|
||||
EnumerateRecycleBinW(szDrive, CBSearchBitBucket, (PVOID)&Context);
|
||||
if (!Context.bFound)
|
||||
return E_FAIL;
|
||||
EnumerateRecycleBinW(szDrive, CBSearchBitBucket, (PVOID)&Context);
|
||||
if (!Context.bFound)
|
||||
return E_FAIL;
|
||||
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
|
||||
{
|
||||
/* restore file */
|
||||
if (RestoreFile(Context.hDeletedFile))
|
||||
return S_OK;
|
||||
else
|
||||
return E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteFileHandleToRecycleBin(Context.hDeletedFile);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(3))
|
||||
{
|
||||
FIXME("implement cut\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7))
|
||||
{
|
||||
FIXME("implement properties\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
|
||||
{
|
||||
/* restore file */
|
||||
if (RestoreFile(Context.hDeletedFile))
|
||||
return S_OK;
|
||||
else
|
||||
return E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteFileHandleToRecycleBin(Context.hDeletedFile);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(3))
|
||||
{
|
||||
FIXME("implement cut\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7))
|
||||
{
|
||||
FIXME("implement properties\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketItemContextMenu::GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
|
||||
{
|
||||
TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
|
||||
TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
|
||||
|
||||
return E_FAIL;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CCBitBucketItemContextMenu::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
TRACE("CBitBucket_IContextMenu2Item_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",this, uMsg, wParam, lParam);
|
||||
TRACE("CBitBucket_IContextMenu2Item_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",this, uMsg, wParam, lParam);
|
||||
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI CBitBucketItemContextMenuConstructor(REFIID riid, LPCITEMIDLIST pidl, LPVOID *ppv)
|
||||
{
|
||||
CComObject<CCBitBucketItemContextMenu> *theMenu;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
CComObject<CCBitBucketItemContextMenu> *theMenu;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE("%s\n", shdebugstr_guid(&riid));
|
||||
TRACE("%s\n", shdebugstr_guid(&riid));
|
||||
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY(theMenu = new CComObject<CCBitBucketItemContextMenu>);
|
||||
if (theMenu == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenu->QueryInterface(riid, (void **)&result);
|
||||
if (FAILED(hResult))
|
||||
{
|
||||
delete theMenu;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theMenu->Initialize(pidl);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
*ppv = result.Detach();
|
||||
TRACE ("--(%p)\n", *ppv);
|
||||
return S_OK;
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY(theMenu = new CComObject<CCBitBucketItemContextMenu>);
|
||||
if (theMenu == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenu->QueryInterface(riid, (void **)&result);
|
||||
if (FAILED(hResult))
|
||||
{
|
||||
delete theMenu;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theMenu->Initialize(pidl);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
*ppv = result.Detach();
|
||||
TRACE ("--(%p)\n", *ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CBitBucket::CBitBucket()
|
||||
|
@ -568,7 +568,7 @@ CBitBucket::CBitBucket()
|
|||
CBitBucket::~CBitBucket()
|
||||
{
|
||||
/* InterlockedDecrement(&objCount);*/
|
||||
SHFree(pidl);
|
||||
SHFree(pidl);
|
||||
}
|
||||
|
||||
HRESULT WINAPI CBitBucket::ParseDisplayName(HWND hwnd, LPBC pbc,
|
||||
|
@ -588,32 +588,32 @@ UnpackDetailsFromPidl(LPCITEMIDLIST pidl)
|
|||
|
||||
HRESULT WINAPI CBitBucket::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
|
||||
{
|
||||
CComObject<CBitBucketEnum> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
CComObject<CBitBucketEnum> *theEnumerator;
|
||||
CComPtr<IEnumIDList> result;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CBitBucketEnum>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface(IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize(dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach();
|
||||
if (ppEnumIDList == NULL)
|
||||
return E_POINTER;
|
||||
*ppEnumIDList = NULL;
|
||||
ATLTRY (theEnumerator = new CComObject<CBitBucketEnum>);
|
||||
if (theEnumerator == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theEnumerator->QueryInterface(IID_IEnumIDList, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theEnumerator;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theEnumerator->Initialize(dwFlags);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppEnumIDList = result.Detach();
|
||||
|
||||
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
|
||||
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CBitBucket::BindToObject(LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv)
|
||||
|
@ -656,7 +656,7 @@ HRESULT WINAPI CBitBucket::CreateViewObject(HWND hwndOwner, REFIID riid, void **
|
|||
}
|
||||
else if (IsEqualIID (riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2))
|
||||
{
|
||||
hr = CBitBucketBackgroundContextMenuConstructor(riid, ppv);
|
||||
hr = CBitBucketBackgroundContextMenuConstructor(riid, ppv);
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IShellView))
|
||||
{
|
||||
|
@ -677,8 +677,8 @@ HRESULT WINAPI CBitBucket::CreateViewObject(HWND hwndOwner, REFIID riid, void **
|
|||
HRESULT WINAPI CBitBucket::GetAttributesOf(UINT cidl, LPCITEMIDLIST *apidl,
|
||||
SFGAOF *rgfInOut)
|
||||
{
|
||||
TRACE("(%p, %d, {%p, ...}, {%x})\n", this, cidl, apidl ? apidl[0] : NULL, (unsigned int)*rgfInOut);
|
||||
*rgfInOut &= SFGAO_CANMOVE|SFGAO_CANDELETE|SFGAO_HASPROPSHEET|SFGAO_FILESYSTEM | SFGAO_FOLDER;
|
||||
TRACE("(%p, %d, {%p, ...}, {%x})\n", this, cidl, apidl ? apidl[0] : NULL, (unsigned int)*rgfInOut);
|
||||
*rgfInOut &= SFGAO_CANMOVE|SFGAO_CANDELETE|SFGAO_HASPROPSHEET|SFGAO_FILESYSTEM | SFGAO_FOLDER;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -698,7 +698,7 @@ HRESULT WINAPI CBitBucket::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLIS
|
|||
|
||||
if ((IsEqualIID (riid, IID_IContextMenu) || IsEqualIID(riid, IID_IContextMenu2)) && (cidl >= 1))
|
||||
{
|
||||
hr = CBitBucketItemContextMenuConstructor(riid, apidl[0], (void **)&pObj);
|
||||
hr = CBitBucketItemContextMenuConstructor(riid, apidl[0], (void **)&pObj);
|
||||
}
|
||||
else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
|
||||
{
|
||||
|
@ -1189,7 +1189,7 @@ BitBucketDlg(
|
|||
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
case WM_INITDIALOG:
|
||||
page = (PROPSHEETPAGE*)lParam;
|
||||
InitializeBitBucketDlg(hwndDlg, (WCHAR)page->lParam);
|
||||
dwStyle = (DWORD) SendDlgItemMessage(hwndDlg, 14000, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* Shell Folder stuff
|
||||
* Shell Folder stuff
|
||||
*
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998, 1999, 2002 Juergen Schmied
|
||||
* Copyright 1997 Marcus Meissner
|
||||
* Copyright 1998, 1999, 2002 Juergen Schmied
|
||||
*
|
||||
* IShellFolder2 and related interfaces
|
||||
* IShellFolder2 and related interfaces
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -105,25 +105,25 @@ LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut)
|
|||
*pszOut = 0x0000;
|
||||
|
||||
if (!pszNext || !*pszNext)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
while (*pszTail && (*pszTail != (WCHAR) '\\'))
|
||||
pszTail++;
|
||||
pszTail++;
|
||||
|
||||
dwCopy = pszTail - pszNext + 1;
|
||||
lstrcpynW (pszOut, pszNext, (dwOut < dwCopy) ? dwOut : dwCopy);
|
||||
|
||||
if (*pszTail)
|
||||
pszTail++;
|
||||
pszTail++;
|
||||
else
|
||||
pszTail = NULL;
|
||||
pszTail = NULL;
|
||||
|
||||
TRACE ("--(%s %s 0x%08x %p)\n", debugstr_w (pszNext), debugstr_w (pszOut), dwOut, pszTail);
|
||||
return pszTail;
|
||||
}
|
||||
|
||||
HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
|
||||
LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes)
|
||||
LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes)
|
||||
{
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
LPITEMIDLIST pidlOut = NULL,
|
||||
|
@ -136,18 +136,18 @@ HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
|
|||
hr = psf->BindToObject(*pidlInOut, pbc, IID_IShellFolder, (LPVOID *)&psfChild);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = psfChild->ParseDisplayName(hwndOwner, pbc, szNext, pEaten, &pidlOut, pdwAttributes);
|
||||
psfChild->Release();
|
||||
hr = psfChild->ParseDisplayName(hwndOwner, pbc, szNext, pEaten, &pidlOut, pdwAttributes);
|
||||
psfChild->Release();
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
pidlTemp = ILCombine (*pidlInOut, pidlOut);
|
||||
if (SUCCEEDED(hr)) {
|
||||
pidlTemp = ILCombine (*pidlInOut, pidlOut);
|
||||
|
||||
if (!pidlTemp)
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
if (!pidlTemp)
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if (pidlOut)
|
||||
ILFree (pidlOut);
|
||||
if (pidlOut)
|
||||
ILFree (pidlOut);
|
||||
}
|
||||
|
||||
ILFree (*pidlInOut);
|
||||
|
@ -158,7 +158,7 @@ HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SHELL32_CoCreateInitSF
|
||||
* SHELL32_CoCreateInitSF
|
||||
*
|
||||
* Creates a shell folder and initializes it with a pidl and a root folder
|
||||
* via IPersistFolder3 or IPersistFolder.
|
||||
|
@ -177,52 +177,52 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
|
|||
hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_IShellFolder, ppvOut);
|
||||
if (SUCCEEDED (hr))
|
||||
{
|
||||
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
||||
IPersistFolder *pPF;
|
||||
IPersistFolder3 *ppf;
|
||||
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
||||
IPersistFolder *pPF;
|
||||
IPersistFolder3 *ppf;
|
||||
|
||||
if (_ILIsFolder(pidlChild) &&
|
||||
SUCCEEDED (((IUnknown *)(*ppvOut))->QueryInterface(IID_IPersistFolder3, (LPVOID *) & ppf)))
|
||||
{
|
||||
PERSIST_FOLDER_TARGET_INFO ppfti;
|
||||
PERSIST_FOLDER_TARGET_INFO ppfti;
|
||||
|
||||
ZeroMemory (&ppfti, sizeof (ppfti));
|
||||
ZeroMemory (&ppfti, sizeof (ppfti));
|
||||
|
||||
/* fill the PERSIST_FOLDER_TARGET_INFO */
|
||||
ppfti.dwAttributes = -1;
|
||||
ppfti.csidl = -1;
|
||||
/* fill the PERSIST_FOLDER_TARGET_INFO */
|
||||
ppfti.dwAttributes = -1;
|
||||
ppfti.csidl = -1;
|
||||
|
||||
/* build path */
|
||||
if (pathRoot)
|
||||
/* build path */
|
||||
if (pathRoot)
|
||||
{
|
||||
lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
|
||||
PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
|
||||
}
|
||||
lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
|
||||
PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
|
||||
}
|
||||
|
||||
if (pidlChild)
|
||||
if (pidlChild)
|
||||
{
|
||||
int len = wcslen(ppfti.szTargetParsingName);
|
||||
|
||||
if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
|
||||
hr = E_INVALIDARG;
|
||||
}
|
||||
if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
|
||||
hr = E_INVALIDARG;
|
||||
}
|
||||
|
||||
ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
|
||||
ppf->Release();
|
||||
}
|
||||
else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface (IID_IPersistFolder, (LPVOID *) & pPF))))
|
||||
ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
|
||||
ppf->Release();
|
||||
}
|
||||
else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface (IID_IPersistFolder, (LPVOID *) & pPF))))
|
||||
{
|
||||
pPF->Initialize(pidlAbsolute);
|
||||
pPF->Release();
|
||||
}
|
||||
ILFree (pidlAbsolute);
|
||||
pPF->Initialize(pidlAbsolute);
|
||||
pPF->Release();
|
||||
}
|
||||
ILFree (pidlAbsolute);
|
||||
}
|
||||
TRACE ("-- (%p) ret=0x%08x\n", *ppvOut, hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SHELL32_BindToChild [Internal]
|
||||
* SHELL32_BindToChild [Internal]
|
||||
*
|
||||
* Common code for IShellFolder_BindToObject.
|
||||
*
|
||||
|
@ -296,7 +296,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SHELL32_GetDisplayNameOfChild
|
||||
* SHELL32_GetDisplayNameOfChild
|
||||
*
|
||||
* Retrieves the display name of a child object of a shellfolder.
|
||||
*
|
||||
|
@ -310,7 +310,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
|||
* virtual folders with the registry key WantsFORPARSING set.
|
||||
*/
|
||||
HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
|
||||
LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut, DWORD dwOutLen)
|
||||
LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut, DWORD dwOutLen)
|
||||
{
|
||||
LPITEMIDLIST pidlFirst;
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
|
@ -320,23 +320,23 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
|
|||
|
||||
pidlFirst = ILCloneFirst (pidl);
|
||||
if (pidlFirst) {
|
||||
IShellFolder2 *psfChild;
|
||||
IShellFolder2 *psfChild;
|
||||
|
||||
hr = psf->BindToObject(pidlFirst, NULL, IID_IShellFolder, (LPVOID *) & psfChild);
|
||||
if (SUCCEEDED (hr)) {
|
||||
STRRET strTemp;
|
||||
LPITEMIDLIST pidlNext = ILGetNext (pidl);
|
||||
hr = psf->BindToObject(pidlFirst, NULL, IID_IShellFolder, (LPVOID *) & psfChild);
|
||||
if (SUCCEEDED (hr)) {
|
||||
STRRET strTemp;
|
||||
LPITEMIDLIST pidlNext = ILGetNext (pidl);
|
||||
|
||||
hr = psfChild->GetDisplayNameOf(pidlNext, dwFlags, &strTemp);
|
||||
if (SUCCEEDED (hr)) {
|
||||
if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
|
||||
hr = psfChild->GetDisplayNameOf(pidlNext, dwFlags, &strTemp);
|
||||
if (SUCCEEDED (hr)) {
|
||||
if(!StrRetToStrNW (szOut, dwOutLen, &strTemp, pidlNext))
|
||||
hr = E_FAIL;
|
||||
}
|
||||
psfChild->Release();
|
||||
}
|
||||
ILFree (pidlFirst);
|
||||
}
|
||||
psfChild->Release();
|
||||
}
|
||||
ILFree (pidlFirst);
|
||||
} else
|
||||
hr = E_OUTOFMEMORY;
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
TRACE ("-- ret=0x%08x %s\n", hr, debugstr_w(szOut));
|
||||
|
||||
|
@ -348,10 +348,10 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
|
|||
*
|
||||
* NOTES
|
||||
* Observed values:
|
||||
* folder: 0xE0000177 FILESYSTEM | HASSUBFOLDER | FOLDER
|
||||
* file: 0x40000177 FILESYSTEM
|
||||
* drive: 0xf0000144 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR
|
||||
* mycomputer: 0xb0000154 HASSUBFOLDER | FOLDER | FILESYSANCESTOR
|
||||
* folder: 0xE0000177 FILESYSTEM | HASSUBFOLDER | FOLDER
|
||||
* file: 0x40000177 FILESYSTEM
|
||||
* drive: 0xf0000144 FILESYSTEM | HASSUBFOLDER | FOLDER | FILESYSANCESTOR
|
||||
* mycomputer: 0xb0000154 HASSUBFOLDER | FOLDER | FILESYSANCESTOR
|
||||
* (seems to be default for shell extensions if no registry entry exists)
|
||||
*
|
||||
* win2k:
|
||||
|
@ -396,75 +396,75 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
|
|||
|
||||
if (_ILIsDrive (pidl)) {
|
||||
*pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|
|
||||
SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME;
|
||||
SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME;
|
||||
} else if (has_guid && HCR_GetFolderAttributes(pidl, &dwAttributes)) {
|
||||
*pdwAttributes = dwAttributes;
|
||||
*pdwAttributes = dwAttributes;
|
||||
} else if (_ILGetDataPointer (pidl)) {
|
||||
dwAttributes = _ILGetFileAttributes (pidl, NULL, 0);
|
||||
dwAttributes = _ILGetFileAttributes (pidl, NULL, 0);
|
||||
|
||||
if (!dwAttributes && has_guid) {
|
||||
WCHAR path[MAX_PATH];
|
||||
STRRET strret;
|
||||
WCHAR path[MAX_PATH];
|
||||
STRRET strret;
|
||||
|
||||
/* File attributes are not present in the internal PIDL structure, so get them from the file system. */
|
||||
/* File attributes are not present in the internal PIDL structure, so get them from the file system. */
|
||||
|
||||
HRESULT hr = psf->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strret);
|
||||
HRESULT hr = psf->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strret);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = StrRetToBufW(&strret, pidl, path, MAX_PATH);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = StrRetToBufW(&strret, pidl, path, MAX_PATH);
|
||||
|
||||
/* call GetFileAttributes() only for file system paths, not for parsing names like "::{...}" */
|
||||
if (SUCCEEDED(hr) && path[0]!=':')
|
||||
dwAttributes = GetFileAttributesW(path);
|
||||
}
|
||||
}
|
||||
/* call GetFileAttributes() only for file system paths, not for parsing names like "::{...}" */
|
||||
if (SUCCEEDED(hr) && path[0]!=':')
|
||||
dwAttributes = GetFileAttributesW(path);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set common attributes */
|
||||
*pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE |
|
||||
SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY;
|
||||
|
||||
if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
*pdwAttributes |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
*pdwAttributes &= ~SFGAO_CANLINK;
|
||||
}
|
||||
else
|
||||
*pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
*pdwAttributes |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
*pdwAttributes &= ~SFGAO_CANLINK;
|
||||
}
|
||||
else
|
||||
*pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
|
||||
if (dwAttributes & FILE_ATTRIBUTE_HIDDEN)
|
||||
*pdwAttributes |= SFGAO_HIDDEN;
|
||||
else
|
||||
*pdwAttributes &= ~SFGAO_HIDDEN;
|
||||
if (dwAttributes & FILE_ATTRIBUTE_HIDDEN)
|
||||
*pdwAttributes |= SFGAO_HIDDEN;
|
||||
else
|
||||
*pdwAttributes &= ~SFGAO_HIDDEN;
|
||||
|
||||
if (dwAttributes & FILE_ATTRIBUTE_READONLY)
|
||||
*pdwAttributes |= SFGAO_READONLY;
|
||||
else
|
||||
*pdwAttributes &= ~SFGAO_READONLY;
|
||||
if (dwAttributes & FILE_ATTRIBUTE_READONLY)
|
||||
*pdwAttributes |= SFGAO_READONLY;
|
||||
else
|
||||
*pdwAttributes &= ~SFGAO_READONLY;
|
||||
|
||||
if (SFGAO_LINK & *pdwAttributes) {
|
||||
char ext[MAX_PATH];
|
||||
if (SFGAO_LINK & *pdwAttributes) {
|
||||
char ext[MAX_PATH];
|
||||
|
||||
if (!_ILGetExtension(pidl, ext, MAX_PATH) || lstrcmpiA(ext, "lnk"))
|
||||
*pdwAttributes &= ~SFGAO_LINK;
|
||||
}
|
||||
if (!_ILGetExtension(pidl, ext, MAX_PATH) || lstrcmpiA(ext, "lnk"))
|
||||
*pdwAttributes &= ~SFGAO_LINK;
|
||||
}
|
||||
|
||||
if (SFGAO_HASSUBFOLDER & *pdwAttributes)
|
||||
{
|
||||
IShellFolder *psf2;
|
||||
if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID *)&psf2)))
|
||||
{
|
||||
IEnumIDList *pEnumIL = NULL;
|
||||
if (SUCCEEDED(psf2->EnumObjects(0, SHCONTF_FOLDERS, &pEnumIL)))
|
||||
{
|
||||
if (pEnumIL->Skip(1) != S_OK)
|
||||
*pdwAttributes &= ~SFGAO_HASSUBFOLDER;
|
||||
pEnumIL->Release();
|
||||
}
|
||||
psf2->Release();
|
||||
}
|
||||
}
|
||||
if (SFGAO_HASSUBFOLDER & *pdwAttributes)
|
||||
{
|
||||
IShellFolder *psf2;
|
||||
if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID *)&psf2)))
|
||||
{
|
||||
IEnumIDList *pEnumIL = NULL;
|
||||
if (SUCCEEDED(psf2->EnumObjects(0, SHCONTF_FOLDERS, &pEnumIL)))
|
||||
{
|
||||
if (pEnumIL->Skip(1) != S_OK)
|
||||
*pdwAttributes &= ~SFGAO_HASSUBFOLDER;
|
||||
pEnumIL->Release();
|
||||
}
|
||||
psf2->Release();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
*pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK;
|
||||
*pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK;
|
||||
}
|
||||
TRACE ("-- 0x%08x\n", *pdwAttributes);
|
||||
return S_OK;
|
||||
|
@ -531,8 +531,8 @@ HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST p
|
|||
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
|
||||
/* optimizing end */
|
||||
} else if (SUCCEEDED (iface->BindToObject(firstpidl, NULL, IID_IShellFolder, (LPVOID *)&psf))) {
|
||||
nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
|
||||
psf->Release();
|
||||
nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
|
||||
psf->Release();
|
||||
}
|
||||
ILFree (firstpidl);
|
||||
return nReturn;
|
||||
|
|
|
@ -28,14 +28,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(pidl);
|
|||
* IFileSystemBindData implementation
|
||||
*/
|
||||
class IFileSystemBindDataImpl :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IFileSystemBindData
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IFileSystemBindData
|
||||
{
|
||||
private:
|
||||
WIN32_FIND_DATAW findFile;
|
||||
public:
|
||||
IFileSystemBindDataImpl();
|
||||
~IFileSystemBindDataImpl();
|
||||
IFileSystemBindDataImpl();
|
||||
~IFileSystemBindDataImpl();
|
||||
|
||||
// *** IFileSystemBindData methods ***
|
||||
virtual HRESULT STDMETHODCALLTYPE SetFindData(const WIN32_FIND_DATAW *pfd);
|
||||
|
@ -45,7 +45,7 @@ DECLARE_NOT_AGGREGATABLE(IFileSystemBindDataImpl)
|
|||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(IFileSystemBindDataImpl)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IFileSystemBindData, IFileSystemBindData)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IFileSystemBindData, IFileSystemBindData)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
|
@ -54,10 +54,10 @@ static const WCHAR wFileSystemBindData[] = {
|
|||
|
||||
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
|
||||
{
|
||||
CComPtr<IFileSystemBindData> fileSystemBindData;
|
||||
CComPtr<IBindCtx> bindContext;
|
||||
BIND_OPTS bindOpts;
|
||||
HRESULT hResult;
|
||||
CComPtr<IFileSystemBindData> fileSystemBindData;
|
||||
CComPtr<IBindCtx> bindContext;
|
||||
BIND_OPTS bindOpts;
|
||||
HRESULT hResult;
|
||||
|
||||
TRACE("%p, %p\n", pfd, ppV);
|
||||
|
||||
|
@ -66,37 +66,37 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
|
|||
|
||||
*ppV = NULL;
|
||||
|
||||
hResult = IFileSystemBindDataImpl::_CreatorClass::CreateInstance(NULL, IID_IFileSystemBindData, (void **)&fileSystemBindData);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
hResult = IFileSystemBindDataImpl::_CreatorClass::CreateInstance(NULL, IID_IFileSystemBindData, (void **)&fileSystemBindData);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
hResult = fileSystemBindData->SetFindData(pfd);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = CreateBindCtx(0, &bindContext);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
hResult = CreateBindCtx(0, &bindContext);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
bindOpts.cbStruct = sizeof(BIND_OPTS);
|
||||
bindOpts.grfFlags = 0;
|
||||
bindOpts.grfMode = STGM_CREATE;
|
||||
bindOpts.dwTickCountDeadline = 0;
|
||||
hResult = bindContext->SetBindOptions(&bindOpts);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
hResult = bindContext->RegisterObjectParam((LPOLESTR)wFileSystemBindData, fileSystemBindData);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
|
||||
*ppV = bindContext.Detach();
|
||||
*ppV = bindContext.Detach();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI FileSystemBindData_GetFindData(LPBC pbc, WIN32_FIND_DATAW *pfd)
|
||||
{
|
||||
CComPtr<IUnknown> pUnk;
|
||||
CComPtr<IFileSystemBindData> pfsbd;
|
||||
HRESULT ret;
|
||||
CComPtr<IUnknown> pUnk;
|
||||
CComPtr<IFileSystemBindData> pfsbd;
|
||||
HRESULT ret;
|
||||
|
||||
TRACE("%p, %p\n", pbc, pfd);
|
||||
|
||||
|
@ -115,9 +115,9 @@ HRESULT WINAPI FileSystemBindData_GetFindData(LPBC pbc, WIN32_FIND_DATAW *pfd)
|
|||
|
||||
HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *pfd)
|
||||
{
|
||||
CComPtr<IUnknown> pUnk;
|
||||
CComPtr<IFileSystemBindData> pfsbd;
|
||||
HRESULT ret;
|
||||
CComPtr<IUnknown> pUnk;
|
||||
CComPtr<IFileSystemBindData> pfsbd;
|
||||
HRESULT ret;
|
||||
|
||||
TRACE("%p, %p\n", pbc, pfd);
|
||||
|
||||
|
@ -133,12 +133,12 @@ HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *
|
|||
|
||||
IFileSystemBindDataImpl::IFileSystemBindDataImpl()
|
||||
{
|
||||
memset(&findFile, 0, sizeof(WIN32_FIND_DATAW));
|
||||
memset(&findFile, 0, sizeof(WIN32_FIND_DATAW));
|
||||
}
|
||||
|
||||
IFileSystemBindDataImpl::~IFileSystemBindDataImpl()
|
||||
{
|
||||
TRACE(" destroying ISFBindPidl(%p)\n", this);
|
||||
TRACE(" destroying ISFBindPidl(%p)\n", this);
|
||||
}
|
||||
|
||||
HRESULT WINAPI IFileSystemBindDataImpl::GetFindData(WIN32_FIND_DATAW *pfd)
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -790,7 +790,7 @@ static POLICYDATA sh32_policy_table[] =
|
|||
};
|
||||
|
||||
/*************************************************************************
|
||||
* SHRestricted [SHELL32.100]
|
||||
* SHRestricted [SHELL32.100]
|
||||
*
|
||||
* Get the value associated with a policy Id.
|
||||
*
|
||||
|
@ -812,51 +812,51 @@ static POLICYDATA sh32_policy_table[] =
|
|||
*/
|
||||
DWORD WINAPI SHRestricted (RESTRICTIONS policy)
|
||||
{
|
||||
char regstr[256];
|
||||
HKEY xhkey;
|
||||
DWORD retval, datsize = 4;
|
||||
LPPOLICYDATA p;
|
||||
char regstr[256];
|
||||
HKEY xhkey;
|
||||
DWORD retval, datsize = 4;
|
||||
LPPOLICYDATA p;
|
||||
|
||||
TRACE("(%08x)\n", policy);
|
||||
TRACE("(%08x)\n", policy);
|
||||
|
||||
/* scan to see if we know this policy ID */
|
||||
for (p = sh32_policy_table; p->policy; p++)
|
||||
{
|
||||
if (policy == p->policy)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* scan to see if we know this policy ID */
|
||||
for (p = sh32_policy_table; p->policy; p++)
|
||||
{
|
||||
if (policy == p->policy)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (p->policy == 0)
|
||||
{
|
||||
/* we don't know this policy, return 0 */
|
||||
TRACE("unknown policy: (%08x)\n", policy);
|
||||
return 0;
|
||||
}
|
||||
if (p->policy == 0)
|
||||
{
|
||||
/* we don't know this policy, return 0 */
|
||||
TRACE("unknown policy: (%08x)\n", policy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* we have a known policy */
|
||||
/* we have a known policy */
|
||||
|
||||
/* first check if this policy has been cached, return it if so */
|
||||
if (p->cache != SHELL_NO_POLICY)
|
||||
{
|
||||
return p->cache;
|
||||
}
|
||||
/* first check if this policy has been cached, return it if so */
|
||||
if (p->cache != SHELL_NO_POLICY)
|
||||
{
|
||||
return p->cache;
|
||||
}
|
||||
|
||||
lstrcpyA(regstr, strRegistryPolicyA);
|
||||
lstrcatA(regstr, p->appstr);
|
||||
lstrcpyA(regstr, strRegistryPolicyA);
|
||||
lstrcatA(regstr, p->appstr);
|
||||
|
||||
/* return 0 and don't set the cache if any registry errors occur */
|
||||
retval = 0;
|
||||
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
|
||||
{
|
||||
p->cache = retval;
|
||||
}
|
||||
RegCloseKey(xhkey);
|
||||
}
|
||||
return retval;
|
||||
/* return 0 and don't set the cache if any registry errors occur */
|
||||
retval = 0;
|
||||
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
|
||||
{
|
||||
p->cache = retval;
|
||||
}
|
||||
RegCloseKey(xhkey);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -878,28 +878,28 @@ DWORD WINAPI SHRestricted (RESTRICTIONS policy)
|
|||
*/
|
||||
BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey)
|
||||
{
|
||||
TRACE("(%p, %p)\n", unused, inpRegKey);
|
||||
TRACE("(%p, %p)\n", unused, inpRegKey);
|
||||
|
||||
/* first check - if input is non-NULL and points to the secret
|
||||
key string, then pass. Otherwise return 0.
|
||||
*/
|
||||
if (inpRegKey != NULL)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
{
|
||||
if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) &&
|
||||
lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW))
|
||||
/* doesn't match, fail */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) &&
|
||||
lstrcmpiA((LPCSTR)inpRegKey, strPolicyA))
|
||||
/* doesn't match, fail */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* first check - if input is non-NULL and points to the secret
|
||||
key string, then pass. Otherwise return 0.
|
||||
*/
|
||||
if (inpRegKey != NULL)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
{
|
||||
if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) &&
|
||||
lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW))
|
||||
/* doesn't match, fail */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) &&
|
||||
lstrcmpiA((LPCSTR)inpRegKey, strPolicyA))
|
||||
/* doesn't match, fail */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
/*
|
||||
TODO:
|
||||
1. In DoStaticShellExtensions, check for "Explore" and "Open" verbs, and for BrowserFlags or
|
||||
ExplorerFlags under those entries. These flags indicate if we should browse to the new item
|
||||
instead of attempting to open it.
|
||||
ExplorerFlags under those entries. These flags indicate if we should browse to the new item
|
||||
instead of attempting to open it.
|
||||
2. The code in NotifyShellViewWindow to deliver commands to the view is broken. It is an excellent
|
||||
example of the wrong way to do it.
|
||||
example of the wrong way to do it.
|
||||
*/
|
||||
|
||||
#include <precomp.h>
|
||||
|
@ -38,8 +38,8 @@ typedef struct _StaticShellEntry_
|
|||
WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls);
|
||||
|
||||
class IDefaultContextMenuImpl :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IContextMenu2
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IContextMenu2
|
||||
{
|
||||
private:
|
||||
DEFCONTEXTMENU dcm;
|
||||
|
@ -52,55 +52,55 @@ private:
|
|||
UINT iIdSCMFirst; /* first static used id */
|
||||
UINT iIdSCMLast; /* last static used id */
|
||||
public:
|
||||
IDefaultContextMenuImpl();
|
||||
~IDefaultContextMenuImpl();
|
||||
HRESULT WINAPI Initialize(const DEFCONTEXTMENU *pdcm);
|
||||
void SH_AddStaticEntry(const WCHAR *szVerb, const WCHAR *szClass);
|
||||
void SH_AddStaticEntryForKey(HKEY hKey, const WCHAR *szClass);
|
||||
void SH_AddStaticEntryForFileClass(const WCHAR *szExt);
|
||||
BOOL IsShellExtensionAlreadyLoaded(const CLSID *szClass);
|
||||
HRESULT SH_LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *szClass, BOOL bExternalInit);
|
||||
UINT EnumerateDynamicContextHandlerForKey(HKEY hRootKey);
|
||||
UINT InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast);
|
||||
UINT BuildBackgroundContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags);
|
||||
UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT indexMenu);
|
||||
UINT BuildShellItemContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags);
|
||||
HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoDelete(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoCopyOrCut(LPCMINVOKECOMMANDINFO lpcmi, BOOL bCopy);
|
||||
HRESULT DoRename(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoProperties(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoFormat(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoDynamicShellExtensions(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoStaticShellExtensions(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
IDefaultContextMenuImpl();
|
||||
~IDefaultContextMenuImpl();
|
||||
HRESULT WINAPI Initialize(const DEFCONTEXTMENU *pdcm);
|
||||
void SH_AddStaticEntry(const WCHAR *szVerb, const WCHAR *szClass);
|
||||
void SH_AddStaticEntryForKey(HKEY hKey, const WCHAR *szClass);
|
||||
void SH_AddStaticEntryForFileClass(const WCHAR *szExt);
|
||||
BOOL IsShellExtensionAlreadyLoaded(const CLSID *szClass);
|
||||
HRESULT SH_LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *szClass, BOOL bExternalInit);
|
||||
UINT EnumerateDynamicContextHandlerForKey(HKEY hRootKey);
|
||||
UINT InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast);
|
||||
UINT BuildBackgroundContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags);
|
||||
UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT indexMenu);
|
||||
UINT BuildShellItemContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags);
|
||||
HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoDelete(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoCopyOrCut(LPCMINVOKECOMMANDINFO lpcmi, BOOL bCopy);
|
||||
HRESULT DoRename(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoProperties(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoFormat(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoDynamicShellExtensions(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
HRESULT DoStaticShellExtensions(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
|
||||
// IContextMenu
|
||||
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
||||
// IContextMenu
|
||||
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
||||
|
||||
// IContextMenu2
|
||||
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
// IContextMenu2
|
||||
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
BEGIN_COM_MAP(IDefaultContextMenuImpl)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
||||
COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
|
||||
END_COM_MAP()
|
||||
};
|
||||
|
||||
IDefaultContextMenuImpl::IDefaultContextMenuImpl()
|
||||
{
|
||||
memset (&dcm, 0, sizeof(dcm));
|
||||
pDataObj = NULL;
|
||||
bGroupPolicyActive = 0;
|
||||
dhead = NULL;
|
||||
iIdSHEFirst = 0;
|
||||
iIdSHELast = 0;
|
||||
shead = NULL;
|
||||
iIdSCMFirst = 0;
|
||||
iIdSCMLast = 0;
|
||||
memset (&dcm, 0, sizeof(dcm));
|
||||
pDataObj = NULL;
|
||||
bGroupPolicyActive = 0;
|
||||
dhead = NULL;
|
||||
iIdSHEFirst = 0;
|
||||
iIdSHELast = 0;
|
||||
shead = NULL;
|
||||
iIdSCMFirst = 0;
|
||||
iIdSCMLast = 0;
|
||||
}
|
||||
|
||||
IDefaultContextMenuImpl::~IDefaultContextMenuImpl()
|
||||
|
@ -108,7 +108,7 @@ IDefaultContextMenuImpl::~IDefaultContextMenuImpl()
|
|||
PDynamicShellEntry dEntry, dNext;
|
||||
PStaticShellEntry sEntry, sNext;
|
||||
|
||||
/* free dynamic shell extension entries */
|
||||
/* free dynamic shell extension entries */
|
||||
dEntry = dhead;
|
||||
while (dEntry)
|
||||
{
|
||||
|
@ -262,23 +262,23 @@ IDefaultContextMenuImpl::SH_AddStaticEntryForFileClass(const WCHAR * szExt)
|
|||
}
|
||||
}
|
||||
|
||||
wcscpy(szBuffer, szShellAssoc);
|
||||
dwBuffer = sizeof(szBuffer) - sizeof(szShellAssoc) - sizeof(WCHAR);
|
||||
result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, L"PerceivedType", RRF_RT_REG_SZ, NULL, (LPBYTE)&szBuffer[_countof(szShellAssoc) - 1], &dwBuffer);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
Length = wcslen(&szBuffer[_countof(szShellAssoc)]) + _countof(szShellAssoc);
|
||||
wcscat(szBuffer, L"\\shell");
|
||||
TRACE("szBuffer %s\n", debugstr_w(szBuffer));
|
||||
wcscpy(szBuffer, szShellAssoc);
|
||||
dwBuffer = sizeof(szBuffer) - sizeof(szShellAssoc) - sizeof(WCHAR);
|
||||
result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, L"PerceivedType", RRF_RT_REG_SZ, NULL, (LPBYTE)&szBuffer[_countof(szShellAssoc) - 1], &dwBuffer);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
Length = wcslen(&szBuffer[_countof(szShellAssoc)]) + _countof(szShellAssoc);
|
||||
wcscat(szBuffer, L"\\shell");
|
||||
TRACE("szBuffer %s\n", debugstr_w(szBuffer));
|
||||
|
||||
result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
szBuffer[Length] = 0;
|
||||
SH_AddStaticEntryForKey(hKey, szBuffer);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
szBuffer[Length] = 0;
|
||||
SH_AddStaticEntryForKey(hKey, szBuffer);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
|
@ -300,7 +300,7 @@ HasClipboardData()
|
|||
if(SUCCEEDED(pda->GetData(&formatetc,&medium)))
|
||||
{
|
||||
ret = TRUE;
|
||||
ReleaseStgMedium(&medium);
|
||||
ReleaseStgMedium(&medium);
|
||||
}
|
||||
|
||||
pda->Release();
|
||||
|
@ -643,10 +643,10 @@ IDefaultContextMenuImpl::AddStaticContextMenusToMenu(
|
|||
else if (!wcsicmp(curEntry->szVerb, L"print"))
|
||||
idResource = IDS_PRINT_VERB;
|
||||
else if (!wcsicmp(curEntry->szVerb, L"printto"))
|
||||
{
|
||||
curEntry = curEntry->Next;
|
||||
continue;
|
||||
}
|
||||
{
|
||||
curEntry = curEntry->Next;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
idResource = 0;
|
||||
|
||||
|
@ -943,11 +943,11 @@ IDefaultContextMenuImpl::BuildShellItemContextMenu(
|
|||
HRESULT
|
||||
WINAPI
|
||||
IDefaultContextMenuImpl::QueryContextMenu(
|
||||
HMENU hmenu,
|
||||
UINT indexMenu,
|
||||
UINT idCmdFirst,
|
||||
UINT idCmdLast,
|
||||
UINT uFlags)
|
||||
HMENU hmenu,
|
||||
UINT indexMenu,
|
||||
UINT idCmdFirst,
|
||||
UINT idCmdLast,
|
||||
UINT uFlags)
|
||||
{
|
||||
if (dcm.cidl)
|
||||
{
|
||||
|
@ -1154,7 +1154,7 @@ IDefaultContextMenuImpl::DoPaste(
|
|||
|
||||
HRESULT
|
||||
IDefaultContextMenuImpl::DoOpenOrExplore(
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ IDefaultContextMenuImpl::DoCreateLink(
|
|||
if (!GetUniqueFileName(szPath, szLnk, szTarget, TRUE))
|
||||
return E_FAIL;
|
||||
|
||||
hr = ShellLink::_CreatorClass::CreateInstance(NULL, IID_IShellLinkW, (void**)&nLink);
|
||||
hr = ShellLink::_CreatorClass::CreateInstance(NULL, IID_IShellLinkW, (void**)&nLink);
|
||||
if (hr != S_OK)
|
||||
{
|
||||
return E_FAIL;
|
||||
|
@ -1425,7 +1425,7 @@ IDefaultContextMenuImpl::DoRename(
|
|||
|
||||
HRESULT
|
||||
IDefaultContextMenuImpl::DoProperties(
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
WCHAR szDrive[MAX_PATH];
|
||||
STRRET strFile;
|
||||
|
@ -1569,7 +1569,7 @@ IDefaultContextMenuImpl::DoStaticShellExtensions(
|
|||
HRESULT
|
||||
WINAPI
|
||||
IDefaultContextMenuImpl::InvokeCommand(
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
switch(LOWORD(lpcmi->lpVerb))
|
||||
{
|
||||
|
@ -1629,11 +1629,11 @@ IDefaultContextMenuImpl::InvokeCommand(
|
|||
HRESULT
|
||||
WINAPI
|
||||
IDefaultContextMenuImpl::GetCommandString(
|
||||
UINT_PTR idCommand,
|
||||
UINT uFlags,
|
||||
UINT* lpReserved,
|
||||
LPSTR lpszName,
|
||||
UINT uMaxNameLen)
|
||||
UINT_PTR idCommand,
|
||||
UINT uFlags,
|
||||
UINT* lpReserved,
|
||||
LPSTR lpszName,
|
||||
UINT uMaxNameLen)
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
|
@ -1642,9 +1642,9 @@ IDefaultContextMenuImpl::GetCommandString(
|
|||
HRESULT
|
||||
WINAPI
|
||||
IDefaultContextMenuImpl::HandleMenuMsg(
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
|
@ -1653,45 +1653,45 @@ IDefaultContextMenuImpl::HandleMenuMsg(
|
|||
static
|
||||
HRESULT
|
||||
IDefaultContextMenu_Constructor(
|
||||
const DEFCONTEXTMENU *pdcm,
|
||||
REFIID riid,
|
||||
void **ppv)
|
||||
const DEFCONTEXTMENU *pdcm,
|
||||
REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
CComObject<IDefaultContextMenuImpl> *theContextMenu;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
CComObject<IDefaultContextMenuImpl> *theContextMenu;
|
||||
CComPtr<IUnknown> result;
|
||||
HRESULT hResult;
|
||||
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY (theContextMenu = new CComObject<IDefaultContextMenuImpl>);
|
||||
if (theContextMenu == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theContextMenu->QueryInterface (riid, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theContextMenu;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theContextMenu->Initialize (pdcm);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppv = result.Detach ();
|
||||
TRACE("This(%p)(%x) cidl %u\n", *ppv, hResult, pdcm->cidl);
|
||||
return S_OK;
|
||||
if (ppv == NULL)
|
||||
return E_POINTER;
|
||||
*ppv = NULL;
|
||||
ATLTRY (theContextMenu = new CComObject<IDefaultContextMenuImpl>);
|
||||
if (theContextMenu == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theContextMenu->QueryInterface (riid, (void **)&result);
|
||||
if (FAILED (hResult))
|
||||
{
|
||||
delete theContextMenu;
|
||||
return hResult;
|
||||
}
|
||||
hResult = theContextMenu->Initialize (pdcm);
|
||||
if (FAILED (hResult))
|
||||
return hResult;
|
||||
*ppv = result.Detach ();
|
||||
TRACE("This(%p)(%x) cidl %u\n", *ppv, hResult, pdcm->cidl);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHCreateDefaultContextMenu [SHELL32.325] Vista API
|
||||
* SHCreateDefaultContextMenu [SHELL32.325] Vista API
|
||||
*
|
||||
*/
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
SHCreateDefaultContextMenu(
|
||||
const DEFCONTEXTMENU *pdcm,
|
||||
REFIID riid,
|
||||
void **ppv)
|
||||
const DEFCONTEXTMENU *pdcm,
|
||||
REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
HRESULT hr = E_FAIL;
|
||||
|
||||
|
@ -1703,22 +1703,22 @@ SHCreateDefaultContextMenu(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* CDefFolderMenu_Create2 [SHELL32.701]
|
||||
* CDefFolderMenu_Create2 [SHELL32.701]
|
||||
*
|
||||
*/
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CDefFolderMenu_Create2(
|
||||
LPCITEMIDLIST pidlFolder,
|
||||
HWND hwnd,
|
||||
UINT cidl,
|
||||
LPCITEMIDLIST *apidl,
|
||||
IShellFolder *psf,
|
||||
LPFNDFMCALLBACK lpfn,
|
||||
UINT nKeys,
|
||||
const HKEY *ahkeyClsKeys,
|
||||
IContextMenu **ppcm)
|
||||
LPCITEMIDLIST pidlFolder,
|
||||
HWND hwnd,
|
||||
UINT cidl,
|
||||
LPCITEMIDLIST *apidl,
|
||||
IShellFolder *psf,
|
||||
LPFNDFMCALLBACK lpfn,
|
||||
UINT nKeys,
|
||||
const HKEY *ahkeyClsKeys,
|
||||
IContextMenu **ppcm)
|
||||
{
|
||||
DEFCONTEXTMENU pdcm;
|
||||
HRESULT hr;
|
||||
|
|
|
@ -27,7 +27,7 @@ static WCHAR szNew[MAX_PATH];
|
|||
|
||||
CNewMenu::CNewMenu()
|
||||
{
|
||||
s_SnHead = NULL;
|
||||
s_SnHead = NULL;
|
||||
szPath = NULL;
|
||||
}
|
||||
|
||||
|
@ -331,9 +331,9 @@ CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi)
|
|||
UINT i, target;
|
||||
HANDLE hFile;
|
||||
DWORD dwWritten, dwError;
|
||||
CComPtr<IFolderView> folderView;
|
||||
CComPtr<IShellFolder> parentFolder;
|
||||
HRESULT hResult;
|
||||
CComPtr<IFolderView> folderView;
|
||||
CComPtr<IShellFolder> parentFolder;
|
||||
HRESULT hResult;
|
||||
|
||||
static const WCHAR szP1[] = { '%', '1', 0 };
|
||||
static const WCHAR szFormat[] = {'%','s',' ','(','%','d',')','%','s',0 };
|
||||
|
@ -353,14 +353,14 @@ CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi)
|
|||
if (!pCurItem)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
if (fSite == NULL)
|
||||
return E_FAIL;
|
||||
hResult = IUnknown_QueryService(fSite, SID_IFolderView, IID_IFolderView, (void **)&folderView);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
hResult = folderView->GetFolder(IID_IShellFolder, (void **)&parentFolder);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
if (fSite == NULL)
|
||||
return E_FAIL;
|
||||
hResult = IUnknown_QueryService(fSite, SID_IFolderView, IID_IFolderView, (void **)&folderView);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
hResult = folderView->GetFolder(IID_IShellFolder, (void **)&parentFolder);
|
||||
if (FAILED(hResult))
|
||||
return hResult;
|
||||
|
||||
if (parentFolder->QueryInterface(IID_IPersistFolder2, (LPVOID*)&psf) != S_OK)
|
||||
{
|
||||
|
@ -462,8 +462,8 @@ CNewMenu::DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi)
|
|||
TRACE("Notifying fs %s\n", debugstr_w(szBuffer));
|
||||
SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, (LPCVOID)szBuffer, NULL);
|
||||
break;
|
||||
case SHELLNEW_TYPE_INVALID:
|
||||
break;
|
||||
case SHELLNEW_TYPE_INVALID:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
|
@ -548,71 +548,71 @@ CNewMenu::DoDrawItem(HWND hWnd, DRAWITEMSTRUCT * drawItem)
|
|||
* DoNewFolder
|
||||
*/
|
||||
void CNewMenu::DoNewFolder(
|
||||
IShellView *psv)
|
||||
IShellView *psv)
|
||||
{
|
||||
ISFHelper * psfhlp;
|
||||
WCHAR wszName[MAX_PATH];
|
||||
CComPtr<IFolderView> folderView;
|
||||
CComPtr<IShellFolder> parentFolder;
|
||||
HRESULT hResult;
|
||||
ISFHelper * psfhlp;
|
||||
WCHAR wszName[MAX_PATH];
|
||||
CComPtr<IFolderView> folderView;
|
||||
CComPtr<IShellFolder> parentFolder;
|
||||
HRESULT hResult;
|
||||
|
||||
if (fSite == NULL)
|
||||
return;
|
||||
hResult = IUnknown_QueryService(fSite, SID_IFolderView, IID_IFolderView, (void **)&folderView);
|
||||
if (FAILED(hResult))
|
||||
return;
|
||||
hResult = folderView->GetFolder(IID_IShellFolder, (void **)&parentFolder);
|
||||
if (FAILED(hResult))
|
||||
return;
|
||||
if (fSite == NULL)
|
||||
return;
|
||||
hResult = IUnknown_QueryService(fSite, SID_IFolderView, IID_IFolderView, (void **)&folderView);
|
||||
if (FAILED(hResult))
|
||||
return;
|
||||
hResult = folderView->GetFolder(IID_IShellFolder, (void **)&parentFolder);
|
||||
if (FAILED(hResult))
|
||||
return;
|
||||
|
||||
parentFolder->QueryInterface(IID_ISFHelper, (LPVOID*)&psfhlp);
|
||||
if (psfhlp)
|
||||
{
|
||||
LPITEMIDLIST pidl;
|
||||
parentFolder->QueryInterface(IID_ISFHelper, (LPVOID*)&psfhlp);
|
||||
if (psfhlp)
|
||||
{
|
||||
LPITEMIDLIST pidl;
|
||||
|
||||
if (psfhlp->GetUniqueName(wszName, MAX_PATH) != S_OK)
|
||||
return;
|
||||
if (psfhlp->AddFolder(0, wszName, &pidl) != S_OK)
|
||||
return;
|
||||
if (psfhlp->GetUniqueName(wszName, MAX_PATH) != S_OK)
|
||||
return;
|
||||
if (psfhlp->AddFolder(0, wszName, &pidl) != S_OK)
|
||||
return;
|
||||
|
||||
if(psv)
|
||||
{
|
||||
if(psv)
|
||||
{
|
||||
psv->Refresh();
|
||||
/* if we are in a shellview do labeledit */
|
||||
psv->SelectItem(
|
||||
/* if we are in a shellview do labeledit */
|
||||
psv->SelectItem(
|
||||
pidl,(SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE
|
||||
|SVSI_FOCUSED|SVSI_SELECT));
|
||||
psv->Refresh();
|
||||
}
|
||||
SHFree(pidl);
|
||||
}
|
||||
SHFree(pidl);
|
||||
|
||||
psfhlp->Release();
|
||||
}
|
||||
psfhlp->Release();
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CNewMenu::SetSite(IUnknown *pUnkSite)
|
||||
{
|
||||
fSite = pUnkSite;
|
||||
return S_OK;
|
||||
fSite = pUnkSite;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CNewMenu::GetSite(REFIID riid, void **ppvSite)
|
||||
{
|
||||
if (ppvSite == NULL)
|
||||
return E_POINTER;
|
||||
*ppvSite = fSite;
|
||||
if (fSite.p != NULL)
|
||||
fSite.p->AddRef();
|
||||
return S_OK;
|
||||
if (ppvSite == NULL)
|
||||
return E_POINTER;
|
||||
*ppvSite = fSite;
|
||||
if (fSite.p != NULL)
|
||||
fSite.p->AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CNewMenu::QueryContextMenu(HMENU hmenu,
|
||||
UINT indexMenu,
|
||||
UINT idCmdFirst,
|
||||
UINT idCmdLast,
|
||||
UINT uFlags)
|
||||
UINT indexMenu,
|
||||
UINT idCmdFirst,
|
||||
UINT idCmdLast,
|
||||
UINT uFlags)
|
||||
{
|
||||
WCHAR szBuffer[200];
|
||||
MENUITEMINFOW mii;
|
||||
|
@ -656,13 +656,13 @@ HRESULT
|
|||
WINAPI
|
||||
CNewMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
|
||||
{
|
||||
LPSHELLBROWSER lpSB;
|
||||
LPSHELLVIEW lpSV = NULL;
|
||||
LPSHELLBROWSER lpSB;
|
||||
LPSHELLVIEW lpSV = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
if((lpSB = (LPSHELLBROWSER)SendMessageA(lpici->hwnd, CWM_GETISHELLBROWSER,0,0)))
|
||||
{
|
||||
lpSB->QueryActiveShellView(&lpSV);
|
||||
if((lpSB = (LPSHELLBROWSER)SendMessageA(lpici->hwnd, CWM_GETISHELLBROWSER,0,0)))
|
||||
{
|
||||
lpSB->QueryActiveShellView(&lpSV);
|
||||
}
|
||||
|
||||
if (LOWORD(lpici->lpVerb) == 0)
|
||||
|
@ -698,8 +698,8 @@ CNewMenu::GetCommandString(UINT_PTR idCmd,
|
|||
HRESULT
|
||||
WINAPI
|
||||
CNewMenu::HandleMenuMsg(UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
DRAWITEMSTRUCT * lpids = (DRAWITEMSTRUCT*) lParam;
|
||||
MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) lParam;
|
||||
|
@ -718,7 +718,7 @@ CNewMenu::HandleMenuMsg(UINT uMsg,
|
|||
}
|
||||
return S_OK;
|
||||
|
||||
return E_UNEXPECTED;
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Start menu object
|
||||
* Start menu object
|
||||
*
|
||||
* Copyright 2009 Andrew Hill
|
||||
* Copyright 2009 Andrew Hill
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -32,17 +32,17 @@ CStartMenuCallback::~CStartMenuCallback()
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CStartMenuCallback::SetSite(IUnknown *pUnkSite)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CStartMenuCallback::GetSite(REFIID riid, void **ppvSite)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CStartMenuCallback::CallbackSM(LPSMDATA psmd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
CMenuBandSite::CMenuBandSite()
|
||||
|
@ -55,115 +55,115 @@ CMenuBandSite::~CMenuBandSite()
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::GetWindow(HWND *phwnd)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::ContextSensitiveHelp(BOOL fEnterMode)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::SetDeskBarSite(IUnknown *punkSite)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::SetModeDBC(DWORD dwMode)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::UIActivateDBC(DWORD dwState)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::GetSize(DWORD dwWhich, LPRECT prc)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::HasFocusIO()
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::TranslateAcceleratorIO(LPMSG lpMsg)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::OnFocusChangeIS(IUnknown *punkObj, BOOL fSetFocus)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::OnWinEvent(HWND paramC, UINT param10, WPARAM param14, LPARAM param18, LRESULT *param1C)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::IsWindowOwner(HWND paramC)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::AddBand(IUnknown *punk)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::EnumBands(UINT uBand, DWORD *pdwBandID)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::QueryBand(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::RemoveBand(DWORD dwBandID)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::GetBandObject(DWORD dwBandID, REFIID riid, VOID **ppv)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::SetBandSiteInfo(const BANDSITEINFO *pbsinfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuBandSite::GetBandSiteInfo(BANDSITEINFO *pbsinfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue