mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
shell32 update (1/2)
- Use precompiled headers for shell32 - Use __inline for MSVC compability - Fix api definitions of SHCreateStdEnumFmtEtc, GetFileNameFromBrowse, SHCreateDirectory, SHCreateDirectoryExA, SHCreateDirectoryExW, Dad_AutoScroll, CDefFolderMenu_Create2, SHChangeNotifyRegister - msvc now compiles nearly all of shell32 (with WDK headers) svn path=/trunk/; revision=35674
This commit is contained in:
parent
050ca45f90
commit
07d2758056
59 changed files with 829 additions and 2280 deletions
|
@ -33,29 +33,9 @@
|
|||
- implement ACO_RTLREADING style
|
||||
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#define COBJMACROS
|
||||
#include <precomp.h>
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlwapi.h"
|
||||
#include "winerror.h"
|
||||
#include "objbase.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "shlobj.h"
|
||||
#include "shldisp.h"
|
||||
#include "debughlp.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -281,8 +261,8 @@ static HRESULT WINAPI IAutoComplete_fnInit(
|
|||
LONG len;
|
||||
|
||||
/* pwszRegKeyPath contains the key as well as the value, so we split */
|
||||
key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
|
||||
strcpyW(key, pwzsRegKeyPath);
|
||||
key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwzsRegKeyPath)+1)*sizeof(WCHAR));
|
||||
wcscpy(key, pwzsRegKeyPath);
|
||||
value = strrchrW(key, '\\');
|
||||
*value = 0;
|
||||
value++;
|
||||
|
@ -296,7 +276,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
|
|||
res = RegQueryValueW(hKey, value, result, &len);
|
||||
if (res == ERROR_SUCCESS) {
|
||||
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
|
||||
strcpyW(This->quickComplete, result);
|
||||
wcscpy(This->quickComplete, result);
|
||||
}
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
@ -304,8 +284,8 @@ static HRESULT WINAPI IAutoComplete_fnInit(
|
|||
}
|
||||
|
||||
if ((pwszQuickComplete) && (!This->quickComplete)) {
|
||||
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
|
||||
lstrcpyW(This->quickComplete, pwszQuickComplete);
|
||||
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwszQuickComplete)+1)*sizeof(WCHAR));
|
||||
wcscpy(This->quickComplete, pwszQuickComplete);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
@ -484,8 +464,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
|||
control = GetKeyState(VK_CONTROL) & 0x8000;
|
||||
if (control && This->quickComplete) {
|
||||
hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
|
||||
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
|
||||
(wcslen(This->quickComplete)+wcslen(hwndText))*sizeof(WCHAR));
|
||||
sel = swprintf(hwndQCText, This->quickComplete, hwndText);
|
||||
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
|
||||
SendMessageW(hwnd, EM_SETSEL, 0, sel);
|
||||
HeapFree(GetProcessHeap(), 0, hwndQCText);
|
||||
|
@ -529,11 +509,11 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
|||
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
|
||||
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
|
||||
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
|
||||
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
|
||||
SendMessageW(hwnd, EM_SETSEL, wcslen(msg), wcslen(msg));
|
||||
HeapFree(GetProcessHeap(), 0, msg);
|
||||
} else {
|
||||
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)This->txtbackup);
|
||||
SendMessageW(hwnd, EM_SETSEL, lstrlenW(This->txtbackup), lstrlenW(This->txtbackup));
|
||||
SendMessageW(hwnd, EM_SETSEL, wcslen(This->txtbackup), wcslen(This->txtbackup));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -564,8 +544,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
|||
|
||||
HeapFree(GetProcessHeap(), 0, This->txtbackup);
|
||||
This->txtbackup = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
|
||||
lstrcpyW(This->txtbackup, hwndText);
|
||||
HEAP_ZERO_MEMORY, (wcslen(hwndText)+1)*sizeof(WCHAR));
|
||||
wcscpy(This->txtbackup, hwndText);
|
||||
|
||||
/* Returns if there is no text to search and we doesn't want to display all the entries */
|
||||
if ((!displayall) && (! *hwndText) )
|
||||
|
@ -582,7 +562,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
|||
|
||||
if (This->options & ACO_AUTOAPPEND) {
|
||||
SetWindowTextW(hwnd, strs);
|
||||
SendMessageW(hwnd, EM_SETSEL, lstrlenW(hwndText), lstrlenW(strs));
|
||||
SendMessageW(hwnd, EM_SETSEL, wcslen(hwndText), wcslen(strs));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -638,7 +618,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
|||
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
|
||||
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
|
||||
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
|
||||
SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg));
|
||||
SendMessageW(This->hwndEdit, EM_SETSEL, 0, wcslen(msg));
|
||||
ShowWindow(hwnd, SW_HIDE);
|
||||
HeapFree(GetProcessHeap(), 0, msg);
|
||||
break;
|
||||
|
|
|
@ -23,19 +23,8 @@
|
|||
* - implement new dialog style resizing
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <precomp.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "undocshell.h"
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shellapi.h"
|
||||
#include "shresdef.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -74,7 +63,7 @@ static const WCHAR szBrowseFolderInfo[] = {
|
|||
'I','N','F','O',0
|
||||
};
|
||||
|
||||
static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
|
||||
static DWORD __inline BrowseFlagsToSHCONTF(UINT ulFlags)
|
||||
{
|
||||
return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0);
|
||||
}
|
||||
|
@ -290,7 +279,7 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
|
|||
tvins.hInsertAfter = NULL;
|
||||
tvins.hParent = hParent;
|
||||
|
||||
return (HTREEITEM)TreeView_InsertItemW( info->hwndTreeView, &tvins );
|
||||
return (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_INSERTITEM, 0, (LPARAM)&tvins );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -361,7 +350,7 @@ done:
|
|||
SHFree(pidlTemp);
|
||||
}
|
||||
|
||||
static inline BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
|
||||
static BOOL __inline PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
|
||||
{
|
||||
LPPIDLDATA data = _ILGetDataPointer(pidl);
|
||||
if (!data)
|
||||
|
|
|
@ -18,15 +18,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <precomp.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wine/debug.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -192,7 +185,7 @@ SHChangeNotifyRegister(
|
|||
LONG wEventMask,
|
||||
UINT uMsg,
|
||||
int cItems,
|
||||
SHChangeNotifyEntry *lpItems)
|
||||
const SHChangeNotifyEntry *lpItems)
|
||||
{
|
||||
LPNOTIFICATIONLIST item;
|
||||
int i;
|
||||
|
@ -315,8 +308,8 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
|
|||
switch (typeFlag)
|
||||
{
|
||||
case SHCNF_PATHA:
|
||||
if (dwItem1) Pidls[0] = SHSimpleIDListFromPathA((LPCSTR)dwItem1);
|
||||
if (dwItem2) Pidls[1] = SHSimpleIDListFromPathA((LPCSTR)dwItem2);
|
||||
if (dwItem1) Pidls[0] = SHSimpleIDListFromPathA((LPCSTR)dwItem1); //FIXME
|
||||
if (dwItem2) Pidls[1] = SHSimpleIDListFromPathA((LPCSTR)dwItem2); //FIXME
|
||||
break;
|
||||
case SHCNF_PATHW:
|
||||
if (dwItem1) Pidls[0] = SHSimpleIDListFromPathW((LPCWSTR)dwItem1);
|
||||
|
|
|
@ -19,31 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "shlobj.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shlguid.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "pidl.h"
|
||||
#include "wine/unicode.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -146,9 +122,9 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l
|
|||
if (!RegQueryValueW(hkeyClass, L"shell", szDest, &size) && *szDest)
|
||||
{
|
||||
/* The MSDN says to first try the default verb */
|
||||
lstrcpyW(sTemp, swShell);
|
||||
lstrcatW(sTemp, szDest);
|
||||
lstrcatW(sTemp, swCommand);
|
||||
wcscpy(sTemp, swShell);
|
||||
wcscat(sTemp, szDest);
|
||||
wcscat(sTemp, swCommand);
|
||||
if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
|
||||
{
|
||||
RegCloseKey(hkey);
|
||||
|
@ -158,9 +134,9 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l
|
|||
}
|
||||
|
||||
/* then fallback to 'open' */
|
||||
lstrcpyW(sTemp, swShell);
|
||||
lstrcatW(sTemp, swOpen);
|
||||
lstrcatW(sTemp, swCommand);
|
||||
wcscpy(sTemp, swShell);
|
||||
wcscat(sTemp, swOpen);
|
||||
wcscat(sTemp, swCommand);
|
||||
if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
|
||||
{
|
||||
RegCloseKey(hkey);
|
||||
|
@ -202,9 +178,9 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP
|
|||
if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)))
|
||||
{
|
||||
WCHAR sTemp[MAX_PATH];
|
||||
lstrcpyW(sTemp, swShell);
|
||||
lstrcatW(sTemp, sTempVerb);
|
||||
lstrcatW(sTemp, swCommand);
|
||||
wcscpy(sTemp, swShell);
|
||||
wcscat(sTemp, sTempVerb);
|
||||
wcscat(sTemp, swCommand);
|
||||
ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
|
||||
}
|
||||
if (szClass)
|
||||
|
@ -290,7 +266,7 @@ BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_i
|
|||
TRACE("%s\n",debugstr_w(szClass) );
|
||||
|
||||
lstrcpynW(sTemp, szClass, MAX_PATH);
|
||||
lstrcatW(sTemp, swDefaultIcon);
|
||||
wcscat(sTemp, swDefaultIcon);
|
||||
|
||||
if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
|
||||
{
|
||||
|
|
|
@ -35,20 +35,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -74,12 +61,12 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
|||
|
||||
SHGetPathFromIDListW(pidlRoot, wszRootPath);
|
||||
PathAddBackslashW(wszRootPath);
|
||||
rootlen = strlenW(wszRootPath);
|
||||
rootlen = wcslen(wszRootPath);
|
||||
|
||||
for (i=0; i<cidl;i++)
|
||||
{
|
||||
_ILSimpleGetTextW(apidl[i], wszFileName, MAX_PATH);
|
||||
size += (rootlen + strlenW(wszFileName) + 1) * sizeof(WCHAR);
|
||||
size += (rootlen + wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
||||
}
|
||||
|
||||
size += sizeof(WCHAR);
|
||||
|
@ -93,14 +80,14 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
|||
pDropFiles->pFiles = offset * sizeof(WCHAR);
|
||||
pDropFiles->fWide = TRUE;
|
||||
|
||||
strcpyW(wszFileName, wszRootPath);
|
||||
wcscpy(wszFileName, wszRootPath);
|
||||
|
||||
for (i=0; i<cidl;i++)
|
||||
{
|
||||
|
||||
_ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
|
||||
strcpyW(((WCHAR*)pDropFiles)+offset, wszFileName);
|
||||
offset += strlenW(wszFileName) + 1;
|
||||
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
||||
offset += wcslen(wszFileName) + 1;
|
||||
}
|
||||
|
||||
((WCHAR*)pDropFiles)[offset] = 0;
|
||||
|
@ -221,7 +208,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
|||
if (!bSuccess)
|
||||
return 0;
|
||||
|
||||
size = (strlenW(szTemp)+1) * sizeof(WCHAR);
|
||||
size = (wcslen(szTemp)+1) * sizeof(WCHAR);
|
||||
|
||||
/* fill the structure */
|
||||
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
|
||||
|
|
|
@ -17,26 +17,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "wine/winbase16.h"
|
||||
#include "wownt32.h"
|
||||
#include "wine/debug.h"
|
||||
#include "cpl.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#define NO_SHLWAPI_REG
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "cpanel.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shlctrl);
|
||||
|
||||
|
@ -319,13 +301,13 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
|
|||
WCHAR *p;
|
||||
|
||||
GetSystemDirectoryW( buffer, MAX_PATH );
|
||||
p = buffer + strlenW(buffer);
|
||||
p = buffer + wcslen(buffer);
|
||||
*p++ = '\\';
|
||||
lstrcpyW(p, wszAllCpl);
|
||||
wcscpy(p, wszAllCpl);
|
||||
|
||||
if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
lstrcpyW(p, fd.cFileName);
|
||||
wcscpy(p, fd.cFileName);
|
||||
Control_LoadApplet(hWnd, buffer, panel);
|
||||
} while (FindNextFileW(h, &fd));
|
||||
FindClose(h);
|
||||
|
@ -379,13 +361,13 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
|
||||
if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
|
||||
return;
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd));
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, (wcslen(wszCmd) + 1) * sizeof(*wszCmd));
|
||||
if (!buffer)
|
||||
{
|
||||
CloseHandle(hMutex);
|
||||
return;
|
||||
}
|
||||
end = lstrcpyW(buffer, wszCmd);
|
||||
end = wcscpy(buffer, wszCmd);
|
||||
for (;;) {
|
||||
ch = *end;
|
||||
if (ch == '"') quoted = !quoted;
|
||||
|
@ -409,10 +391,10 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
end++;
|
||||
}
|
||||
while ((ptr = StrChrW(buffer, '"')))
|
||||
memmove((LPVOID)ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR));
|
||||
memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
|
||||
|
||||
while ((ptr = StrChrW(extraPmts, '"')))
|
||||
memmove((LPVOID)ptr, ptr+1, lstrlenW(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);
|
||||
|
||||
|
|
|
@ -18,38 +18,9 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "wine/config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <precomp.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "cpanel.h"
|
||||
#include "enumidlist.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -71,7 +42,7 @@ typedef struct {
|
|||
int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
|
||||
LPCITEMIDLIST *apidl;
|
||||
UINT cidl;
|
||||
} ICPanelImpl;
|
||||
} ICPanelImpl, *LPICPanelImpl;
|
||||
|
||||
static const IShellFolder2Vtbl vt_ShellFolder2;
|
||||
static const IPersistFolder2Vtbl vt_PersistFolder2;
|
||||
|
@ -79,25 +50,25 @@ static const IShellExecuteHookWVtbl vt_ShellExecuteHookW;
|
|||
static const IShellExecuteHookAVtbl vt_ShellExecuteHookA;
|
||||
static const IContextMenu2Vtbl vt_ContextMenu;
|
||||
|
||||
static inline ICPanelImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
static LPICPanelImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
{
|
||||
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2));
|
||||
return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2));
|
||||
}
|
||||
|
||||
static inline ICPanelImpl *impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
static LPICPanelImpl __inline impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
{
|
||||
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblContextMenu));
|
||||
return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblContextMenu));
|
||||
}
|
||||
|
||||
|
||||
static inline ICPanelImpl *impl_from_IShellExecuteHookW( IShellExecuteHookW *iface )
|
||||
static LPICPanelImpl __inline impl_from_IShellExecuteHookW( IShellExecuteHookW *iface )
|
||||
{
|
||||
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW));
|
||||
return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW));
|
||||
}
|
||||
|
||||
static inline ICPanelImpl *impl_from_IShellExecuteHookA( IShellExecuteHookA *iface )
|
||||
static LPICPanelImpl __inline impl_from_IShellExecuteHookA( IShellExecuteHookA *iface )
|
||||
{
|
||||
return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA));
|
||||
return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA));
|
||||
}
|
||||
|
||||
|
||||
|
@ -700,7 +671,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface,
|
|||
int len = 0;
|
||||
|
||||
PathAddBackslashW(wszPath);
|
||||
len = lstrlenW(wszPath);
|
||||
len = wcslen(wszPath);
|
||||
|
||||
if (!SUCCEEDED
|
||||
(SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags, wszPath + len, MAX_PATH + 1 - len)))
|
||||
|
@ -1275,7 +1246,7 @@ static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand(
|
|||
|
||||
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
|
||||
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCE(1))
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
|
||||
{
|
||||
ZeroMemory(&sei, sizeof(sei));
|
||||
sei.cbSize = sizeof(sei);
|
||||
|
@ -1288,7 +1259,7 @@ static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand(
|
|||
if (sei.hInstApp <= (HINSTANCE)32)
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(2))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2))
|
||||
{
|
||||
if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_DESKTOPDIRECTORY, FALSE))
|
||||
return E_FAIL;
|
||||
|
|
|
@ -19,19 +19,8 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "winerror.h"
|
||||
#include "shell32_main.h"
|
||||
#include "wine/debug.h"
|
||||
#include "undocshell.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
|
|
@ -18,14 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "ddeml.h"
|
||||
#include "shellapi.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -40,7 +33,7 @@ static HSZ hszFolders;
|
|||
static DWORD dwDDEInst;
|
||||
|
||||
|
||||
static inline BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService)
|
||||
static BOOL __inline Dde_OnConnect(HSZ hszTopic, HSZ hszService)
|
||||
{
|
||||
if ((hszTopic == hszProgmanTopic) && (hszService == hszProgmanService))
|
||||
return TRUE;
|
||||
|
@ -53,25 +46,25 @@ static inline BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static inline void Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService)
|
||||
static void __inline Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService)
|
||||
{
|
||||
FIXME("stub\n");
|
||||
}
|
||||
|
||||
static inline BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService)
|
||||
static BOOL __inline Dde_OnWildConnect(HSZ hszTopic, HSZ hszService)
|
||||
{
|
||||
FIXME("stub\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic,
|
||||
static HDDEDATA __inline Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic,
|
||||
HSZ hszItem)
|
||||
{
|
||||
FIXME("stub\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
|
||||
static DWORD __inline Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
|
||||
{
|
||||
BYTE * pszCommand;
|
||||
|
||||
|
@ -86,7 +79,7 @@ static inline DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
|
|||
return DDE_FNOTPROCESSED;
|
||||
}
|
||||
|
||||
static inline void Dde_OnDisconnect(HCONV hconv)
|
||||
static void __inline Dde_OnDisconnect(HCONV hconv)
|
||||
{
|
||||
FIXME("stub\n");
|
||||
}
|
||||
|
|
|
@ -18,19 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "shldisp.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "docobj.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(pidl);
|
||||
|
||||
|
@ -190,7 +178,7 @@ LPWSTR _dbg_ILGetSTextPointerW(LPCITEMIDLIST pidl)
|
|||
return NULL;
|
||||
|
||||
case PT_VALUEW:
|
||||
return (LPWSTR)(pdata->u.file.szNames + lstrlenW ((LPWSTR)pdata->u.file.szNames) + 1);
|
||||
return (LPWSTR)(pdata->u.file.szNames + wcslen ((LPWSTR)pdata->u.file.szNames) + 1);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -18,23 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winnls.h"
|
||||
#include "winuser.h"
|
||||
#include "shellapi.h"
|
||||
#include "shlobj.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(desktop);
|
||||
|
||||
|
|
|
@ -18,27 +18,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
#include <precomp.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "commdlg.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "shellapi.h"
|
||||
#include "shlobj.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -19,27 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "objbase.h"
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
#include "shlobj.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
#define LARGEINT_PROTOS
|
||||
#define LargeIntegerDivide RtlLargeIntegerDivide
|
||||
#define ExtendedIntegerMultiply RtlExtendedIntegerMultiply
|
||||
|
@ -34,20 +32,10 @@
|
|||
#define COBJMACROS
|
||||
#include <windows.h>
|
||||
#include <ndk/ntndk.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "wine/debug.h"
|
||||
#include "shresdef.h"
|
||||
|
||||
#include <shlwapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <prsht.h>
|
||||
#include <initguid.h>
|
||||
#include <devguid.h>
|
||||
#include <largeint.h>
|
||||
#include <fmifs/fmifs.h>
|
||||
#include <largeint.h>
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -133,7 +121,8 @@ HPROPSHEETPAGE SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM
|
|||
|
||||
#define DRIVE_PROPERTY_PAGES (3)
|
||||
|
||||
extern HINSTANCE shell32_hInstance;
|
||||
static const GUID GUID_DEVCLASS_DISKDRIVE = {0x4d36e967L, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}};
|
||||
|
||||
|
||||
VOID
|
||||
GetDriveNameWithLetter(LPWSTR szText, UINT Length, WCHAR Drive)
|
||||
|
@ -410,7 +399,7 @@ InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR * szDrive)
|
|||
HANDLE hVolume;
|
||||
DWORD BytesReturned = 0;
|
||||
|
||||
sprintfW(szResult, L"\\\\.\\%c:", towupper(szDrive[0]));
|
||||
swprintf(szResult, L"\\\\.\\%c:", towupper(szDrive[0]));
|
||||
hVolume = CreateFileW(szResult, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (hVolume != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
|
|
@ -18,21 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "enumidlist.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -143,9 +129,9 @@ BOOL CreateFolderEnumList(
|
|||
|
||||
if(!lpszPath || !lpszPath[0]) return FALSE;
|
||||
|
||||
strcpyW(szPath, lpszPath);
|
||||
wcscpy(szPath, lpszPath);
|
||||
PathAddBackslashW(szPath);
|
||||
strcatW(szPath,stars);
|
||||
wcscat(szPath,stars);
|
||||
|
||||
hFile = FindFirstFileW(szPath,&stffile);
|
||||
if ( hFile != INVALID_HANDLE_VALUE )
|
||||
|
|
|
@ -7,10 +7,9 @@
|
|||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#include <precomp.h>
|
||||
|
||||
#define CONST_VTABLE
|
||||
#include <shlobj.h>
|
||||
#include <debug.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -536,10 +535,10 @@ SHCreateDefaultExtractIcon(
|
|||
if (!s)
|
||||
return E_OUTOFMEMORY;
|
||||
memset(s, 0, sizeof(struct IconExtraction));
|
||||
s->defaultExtractIconInitImpl.lpVtbl = &IconExtractionDefaultExtractIconInitVtbl;
|
||||
s->extractIconAImpl.lpVtbl = &IconExtractionExtractIconAVtbl;
|
||||
s->extractIconWImpl.lpVtbl = &IconExtractionExtractIconWVtbl;
|
||||
s->persistFileImpl.lpVtbl = &IconExtractionPersistFileVtbl;
|
||||
s->defaultExtractIconInitImpl.lpVtbl = (IDefaultExtractIconInitVtbl*)&IconExtractionDefaultExtractIconInitVtbl;
|
||||
s->extractIconAImpl.lpVtbl = (IExtractIconAVtbl*)&IconExtractionExtractIconAVtbl;
|
||||
s->extractIconWImpl.lpVtbl = (IExtractIconWVtbl*)&IconExtractionExtractIconWVtbl;
|
||||
s->persistFileImpl.lpVtbl = (IPersistFileVtbl*)&IconExtractionPersistFileVtbl;
|
||||
s->ref = 1;
|
||||
*ppv = &s->defaultExtractIconInitImpl;
|
||||
|
||||
|
|
|
@ -18,27 +18,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <precomp.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "winerror.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlobj.h"
|
||||
#include "objbase.h"
|
||||
#include "commdlg.h"
|
||||
|
||||
#include "shell32_main.h"
|
||||
#include "shellfolder.h"
|
||||
#include "shresdef.h"
|
||||
#include "stdio.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (fprop);
|
||||
#define MAX_PROPERTY_SHEET_PAGE (32)
|
||||
|
@ -140,7 +121,7 @@ InitializeFolderOptionsListCtrl(HWND hwndDlg)
|
|||
col.pszText = szName;
|
||||
col.fmt = LVCFMT_LEFT;
|
||||
col.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL);
|
||||
(void)ListView_InsertColumnW(hDlgCtrl, 0, &col);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMN, 0, (LPARAM)&col);
|
||||
|
||||
|
||||
|
||||
|
@ -185,7 +166,7 @@ InitializeFileTypesListCtrlColumns(HWND hDlgCtrl)
|
|||
col.pszText = szName;
|
||||
col.fmt = LVCFMT_LEFT;
|
||||
col.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL);
|
||||
(void)ListView_InsertColumnW(hDlgCtrl, 0, &col);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&col);
|
||||
}
|
||||
INT
|
||||
FindItem(HWND hDlgCtrl, WCHAR * ItemName)
|
||||
|
@ -235,7 +216,7 @@ InsertFileType(HWND hDlgCtrl, WCHAR * szName, DWORD Size, INT iItem)
|
|||
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szPath, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
lvItem.lParam = 0;
|
||||
(void)ListView_InsertItemW(hDlgCtrl, &lvItem);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +446,7 @@ InitializeFolderGeneralDlg(PFOLDER_PROPERTIES_CONTEXT pContext)
|
|||
if (FileTimeToLocalFileTime(&FolderAttribute.ftCreationTime, &ft))
|
||||
{
|
||||
FileTimeToSystemTime(&ft, &dt);
|
||||
sprintfW (szBuffer, wFormat, dt.wDay, dt.wMonth, dt.wYear, dt.wHour, dt.wMinute);
|
||||
swprintf (szBuffer, wFormat, dt.wDay, dt.wMonth, dt.wYear, dt.wHour, dt.wMinute);
|
||||
SendDlgItemMessageW(pContext->hwndDlg, 14015, WM_SETTEXT, 0, (LPARAM) szBuffer);
|
||||
}
|
||||
}
|
||||
|
@ -476,7 +457,7 @@ InitializeFolderGeneralDlg(PFOLDER_PROPERTIES_CONTEXT pContext)
|
|||
/* set folder details */
|
||||
LoadStringW(shell32_hInstance, IDS_FILE_FOLDER, szFormat, sizeof(szFormat)/sizeof(WCHAR));
|
||||
szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0';
|
||||
sprintfW(szBuffer, szFormat, pContext->cFiles, pContext->cFolder);
|
||||
swprintf(szBuffer, szFormat, pContext->cFiles, pContext->cFolder);
|
||||
SendDlgItemMessageW(pContext->hwndDlg, 14011, WM_SETTEXT, 0, (LPARAM) szBuffer);
|
||||
|
||||
if (StrFormatByteSizeW(pContext->bSize.QuadPart, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
|
||||
|
|
|
@ -17,29 +17,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
#include "objbase.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shfldr.h"
|
||||
#include "shresdef.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -63,7 +41,7 @@ static HRESULT getIconLocationForFolder(LPCITEMIDLIST pidl, UINT uFlags,
|
|||
WCHAR wszIconIndex[10];
|
||||
SHELL32_GetCustomFolderAttribute(pidl, shellClassInfo, iconIndex,
|
||||
wszIconIndex, 10);
|
||||
*piIndex = atoiW(wszIconIndex);
|
||||
*piIndex = _wtoi(wszIconIndex);
|
||||
}
|
||||
else if (SHELL32_GetCustomFolderAttribute(pidl, shellClassInfo, clsid,
|
||||
wszCLSIDValue, CHARS_IN_GUID) &&
|
||||
|
@ -133,7 +111,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
|
|||
'%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0 };
|
||||
WCHAR xriid[50];
|
||||
|
||||
sprintfW(xriid, fmt,
|
||||
swprintf(xriid, fmt,
|
||||
riid->Data1, riid->Data2, riid->Data3,
|
||||
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
|
||||
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]);
|
||||
|
@ -291,8 +269,9 @@ IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl)
|
|||
extractIconW = IExtractIconW_Constructor(pidl);
|
||||
if (!extractIconW)
|
||||
return NULL;
|
||||
hr = IExtractIconW_QueryInterface(extractIconW, &IID_IExtractIconA, (void **)&extractIconA);
|
||||
IExtractIconW_Release(extractIconW);
|
||||
|
||||
hr = extractIconW->lpVtbl->QueryInterface(extractIconW, &IID_IExtractIconA, (void **)&extractIconA);
|
||||
extractIconW->lpVtbl->Release(extractIconW);
|
||||
if (!SUCCEEDED(hr))
|
||||
return NULL;
|
||||
return extractIconA;
|
||||
|
|
|
@ -18,30 +18,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "commdlg.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "shellapi.h"
|
||||
#include <shlwapi.h>
|
||||
#include "shlobj.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "undocshell.h"
|
||||
#include "prsht.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -138,7 +115,7 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
{
|
||||
/* the fileextension is unknown, so default to string "FileExtension File" */
|
||||
SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)value);
|
||||
sprintfW(name, value, &filext[1]);
|
||||
swprintf(name, value, &filext[1]);
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)name);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -230,7 +207,7 @@ SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult)
|
|||
|
||||
wYear = dt.wYear;
|
||||
/* ddmmyy */
|
||||
sprintfW (lpResult, wFormat, dt.wDay, dt.wMonth, wYear, dt.wHour, dt.wMinute);
|
||||
swprintf (lpResult, wFormat, dt.wDay, dt.wMonth, wYear, dt.wHour, dt.wMinute);
|
||||
|
||||
TRACE("result %s\n",debugstr_w(lpResult));
|
||||
return TRUE;
|
||||
|
@ -256,15 +233,15 @@ SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr)
|
|||
if (lpstr == NULL)
|
||||
return FALSE;
|
||||
|
||||
lpdir = strrchrW(lpstr, '\\'); /* find the last occurence of '\\' */
|
||||
lpdir = wcschr(lpstr, '\\'); /* find the last occurence of '\\' */
|
||||
|
||||
plength = strlenW(lpstr);
|
||||
flength = strlenW(lpdir);
|
||||
plength = wcslen(lpstr);
|
||||
flength = wcslen(lpdir);
|
||||
|
||||
if (lpdir)
|
||||
{
|
||||
/* location text field */
|
||||
strncpyW(buff, lpstr, plength - flength);
|
||||
wcsncpy(buff, lpstr, plength - flength);
|
||||
buff[plength - flength] = UNICODE_NULL;
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14009);
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)buff);
|
||||
|
@ -273,7 +250,7 @@ SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr)
|
|||
if(flength > 1)
|
||||
{
|
||||
/* text filename field */
|
||||
strncpyW(buff, &lpdir[1], flength);
|
||||
wcsncpy(buff, &lpdir[1], flength);
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14001);
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)buff);
|
||||
}
|
||||
|
@ -412,7 +389,7 @@ SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR * text, W
|
|||
if(hwndDlg == NULL || resptr == NULL || text == NULL)
|
||||
return FALSE;
|
||||
|
||||
sprintfW(buff, wFormat, lang, code, text);
|
||||
swprintf(buff, wFormat, lang, code, text);
|
||||
if(VerQueryValueW(pInfo, buff, (LPVOID *)resptr, &reslen))
|
||||
{
|
||||
/* listbox name property */
|
||||
|
@ -483,7 +460,7 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
if(VerQueryValueW(pBuf, wSlash, &info, &infolen))
|
||||
{
|
||||
VS_FIXEDFILEINFO * inf = (VS_FIXEDFILEINFO *)info;
|
||||
sprintfW(buff, wVersionFormat, HIWORD(inf->dwFileVersionMS),
|
||||
swprintf(buff, wVersionFormat, HIWORD(inf->dwFileVersionMS),
|
||||
LOWORD(inf->dwFileVersionMS),
|
||||
HIWORD(inf->dwFileVersionLS),
|
||||
LOWORD(inf->dwFileVersionLS));
|
||||
|
@ -502,10 +479,10 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
code = lplangcode->code;
|
||||
}
|
||||
|
||||
sprintfW(buff, wFileDescriptionFormat, lang, code);
|
||||
swprintf(buff, wFileDescriptionFormat, lang, code);
|
||||
SH_FileVersionQuerySetText(hwndDlg, 14003, pBuf, buff, &str);
|
||||
|
||||
sprintfW(buff, wLegalCopyrightFormat, lang, code);
|
||||
swprintf(buff, wLegalCopyrightFormat, lang, code);
|
||||
SH_FileVersionQuerySetText(hwndDlg, 14005, pBuf, buff, &str);
|
||||
|
||||
/* listbox properties */
|
||||
|
@ -638,7 +615,7 @@ SH_FileGeneralDlgProc(
|
|||
/* set general text properties filename filelocation and icon */
|
||||
SH_FileGeneralSetText(hwndDlg, lpstr);
|
||||
/* enumerate file extension from registry and application which opens it*/
|
||||
SH_FileGeneralSetFileType(hwndDlg, strrchrW(lpstr, '.'));
|
||||
SH_FileGeneralSetFileType(hwndDlg, wcsrchr(lpstr, '.'));
|
||||
/* set file time create/modfied/accessed */
|
||||
SH_FileGeneralSetFileSizeTime(hwndDlg, lpstr, NULL);
|
||||
return TRUE;
|
||||
|
@ -747,7 +724,7 @@ SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * a
|
|||
if (lpf== NULL)
|
||||
return FALSE;
|
||||
|
||||
if ( !strlenW(lpf) )
|
||||
if ( !wcslen(lpf) )
|
||||
return FALSE;
|
||||
|
||||
memset(hppages, 0x0, sizeof(HPROPSHEETPAGE) * MAX_PROPERTY_SHEET_PAGE);
|
||||
|
@ -764,7 +741,7 @@ SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * a
|
|||
}
|
||||
else
|
||||
{
|
||||
strcpyW(wFileName, lpf);
|
||||
wcscpy(wFileName, lpf);
|
||||
}
|
||||
|
||||
if (PathIsDirectoryW(wFileName))
|
||||
|
|
|
@ -18,31 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winreg.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "shellapi.h"
|
||||
#include "objbase.h"
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
#include "undocshell.h"
|
||||
#include "shresdef.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -89,7 +65,7 @@ static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam)
|
|||
(e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
|
||||
return 1;
|
||||
|
||||
if (strcmpiW(e1->sSourceFile,e2->sSourceFile))
|
||||
if (wcsicmp(e1->sSourceFile,e2->sSourceFile))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
@ -263,8 +239,8 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
|
|||
lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
|
||||
|
||||
GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
|
||||
lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) );
|
||||
strcpyW( lpsice->sSourceFile, path );
|
||||
lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (wcslen(path)+1)*sizeof(WCHAR) );
|
||||
wcscpy( lpsice->sSourceFile, path );
|
||||
|
||||
lpsice->dwSourceIndex = dwSourceIndex;
|
||||
lpsice->dwFlags = dwFlags;
|
||||
|
@ -501,18 +477,18 @@ static int SIC_LoadOverlayIcon(int icon_idx)
|
|||
{
|
||||
DWORD count = sizeof(buffer);
|
||||
|
||||
sprintfW(wszIdx, wszNumFmt, icon_idx);
|
||||
swprintf(wszIdx, wszNumFmt, icon_idx);
|
||||
|
||||
/* read icon path and index */
|
||||
if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
|
||||
{
|
||||
LPWSTR p = strchrW(buffer, ',');
|
||||
LPWSTR p = wcschr(buffer, ',');
|
||||
|
||||
if (p)
|
||||
*p++ = 0;
|
||||
|
||||
iconPath = buffer;
|
||||
iconIdx = atoiW(p);
|
||||
iconIdx = _wtoi(p);
|
||||
}
|
||||
|
||||
RegCloseKey(hKeyShellIcons);
|
||||
|
@ -568,12 +544,12 @@ BOOL PidlToSicIndex (
|
|||
|
||||
if (SUCCEEDED (IShellFolder_GetUIObjectOf(sh, 0, 1, &pidl, &IID_IExtractIconW, 0, (void **)&ei)))
|
||||
{
|
||||
if (SUCCEEDED(IExtractIconW_GetIconLocation(ei, uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
|
||||
if (SUCCEEDED(ei->lpVtbl->GetIconLocation(ei, uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
|
||||
{
|
||||
*pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags);
|
||||
ret = TRUE;
|
||||
}
|
||||
IExtractIconW_Release(ei);
|
||||
ei->lpVtbl->Release(ei);
|
||||
}
|
||||
|
||||
if (INVALID_INDEX == *pIndex) /* default icon when failed */
|
||||
|
@ -646,7 +622,7 @@ HRESULT WINAPI SHMapIDListToImageListIndexAsync(IUnknown *pts, IShellFolder *psf
|
|||
* Shell_GetCachedImageIndex [SHELL32.72]
|
||||
*
|
||||
*/
|
||||
INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc)
|
||||
INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, UINT bSimulateDoc)
|
||||
{
|
||||
INT ret, len;
|
||||
LPWSTR szTemp;
|
||||
|
@ -664,7 +640,7 @@ INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateD
|
|||
return ret;
|
||||
}
|
||||
|
||||
INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc)
|
||||
INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
|
||||
{
|
||||
WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc);
|
||||
|
||||
|
@ -777,7 +753,7 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l
|
|||
HINSTANCE uRet = FindExecutableW(lpIconPath,NULL,tempPath);
|
||||
|
||||
if( uRet > (HINSTANCE)32 && tempPath[0] )
|
||||
{ lstrcpyW(lpIconPath,tempPath);
|
||||
{ wcscpy(lpIconPath,tempPath);
|
||||
hIcon = ExtractIconW(hInst, lpIconPath, *lpiIcon);
|
||||
if( hIcon > (HICON)2 )
|
||||
return hIcon;
|
||||
|
|
|
@ -22,32 +22,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "objbase.h"
|
||||
#include "shlguid.h"
|
||||
#include "winerror.h"
|
||||
#include "winnls.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shresdef.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(pidl);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(shell);
|
||||
|
@ -110,7 +85,7 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (type >= 0 && type <= 2)
|
||||
if (type <= 2)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
@ -509,7 +484,7 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
|||
_ILSimpleGetText(pidltemp1, szData1, MAX_PATH);
|
||||
_ILSimpleGetText(pidltemp2, szData2, MAX_PATH);
|
||||
|
||||
if (strcasecmp( szData1, szData2 ))
|
||||
if (strcmp( szData1, szData2 ))
|
||||
return FALSE;
|
||||
|
||||
pidltemp1 = ILGetNext(pidltemp1);
|
||||
|
@ -559,7 +534,7 @@ BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL b
|
|||
_ILSimpleGetText(pParent, szData1, MAX_PATH);
|
||||
_ILSimpleGetText(pChild, szData2, MAX_PATH);
|
||||
|
||||
if (strcasecmp( szData1, szData2 ))
|
||||
if (strcmp( szData1, szData2 ))
|
||||
return FALSE;
|
||||
|
||||
pParent = ILGetNext(pParent);
|
||||
|
@ -626,7 +601,7 @@ LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
|||
_ILSimpleGetText(pidltemp1, szData1, MAX_PATH);
|
||||
_ILSimpleGetText(pidltemp2, szData2, MAX_PATH);
|
||||
|
||||
if (strcasecmp(szData1,szData2))
|
||||
if (strcmp(szData1,szData2))
|
||||
break;
|
||||
|
||||
pidltemp1 = ILGetNext(pidltemp1);
|
||||
|
@ -1382,8 +1357,10 @@ LPITEMIDLIST _ILCreateIExplore(void)
|
|||
|
||||
LPITEMIDLIST _ILCreateControlPanel(void)
|
||||
{
|
||||
LPITEMIDLIST ret = NULL;
|
||||
LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
|
||||
|
||||
TRACE("()\n");
|
||||
LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
|
||||
|
||||
if (parent)
|
||||
{
|
||||
|
@ -1421,7 +1398,7 @@ LPITEMIDLIST _ILCreateBitBucket(void)
|
|||
LPITEMIDLIST _ILCreateAdminTools(void)
|
||||
{
|
||||
TRACE("()\n");
|
||||
return _ILCreateGuid(PT_GUID, &CLSID_AdminFolderShortcut);
|
||||
return _ILCreateGuid(PT_GUID, &CLSID_AdminFolderShortcut); //FIXME
|
||||
}
|
||||
|
||||
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
|
||||
|
@ -1464,7 +1441,7 @@ LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
|
|||
{
|
||||
IID iid;
|
||||
|
||||
if (!SUCCEEDED(SHCLSIDFromStringW(szGUID, &iid)))
|
||||
if (FAILED(CLSIDFromString((LPOLESTR)szGUID, &iid)))
|
||||
{
|
||||
ERR("%s is not a GUID\n", debugstr_w(szGUID));
|
||||
return NULL;
|
||||
|
@ -1491,7 +1468,7 @@ LPITEMIDLIST _ILCreateFromFindDataW( const WIN32_FIND_DATAW *wfd )
|
|||
|
||||
type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
|
||||
|
||||
wlen = lstrlenW(wfd->cFileName) + 1;
|
||||
wlen = wcslen(wfd->cFileName) + 1;
|
||||
pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
|
||||
FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
|
||||
if (pidl)
|
||||
|
@ -1554,7 +1531,7 @@ LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
|
|||
if (pszDest)
|
||||
{
|
||||
strcpy(pszDest, "x:\\");
|
||||
pszDest[0]=toupperW(lpszNew[0]);
|
||||
pszDest[0]=towupper(lpszNew[0]);
|
||||
TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
|
||||
}
|
||||
}
|
||||
|
@ -1653,7 +1630,6 @@ LPITEMIDLIST _ILCreateNetHood(void)
|
|||
|
||||
LPITEMIDLIST _ILCreateFont(void)
|
||||
{
|
||||
|
||||
return _ILCreateGuid(PT_GUID, &CLSID_FontsFolderShortcut);
|
||||
}
|
||||
|
||||
|
@ -1854,7 +1830,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
|
|||
|
||||
if (pFileStructW) {
|
||||
lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
|
||||
dwReturn = lstrlenW(pFileStructW->wszName);
|
||||
dwReturn = wcslen(pFileStructW->wszName);
|
||||
} else {
|
||||
GUID const * riid;
|
||||
WCHAR szTemp[MAX_PATH];
|
||||
|
@ -1876,7 +1852,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
|
|||
if (szOut)
|
||||
lstrcpynW(szOut, szTemp, uOutSize);
|
||||
|
||||
dwReturn = lstrlenW (szTemp);
|
||||
dwReturn = wcslen (szTemp);
|
||||
}
|
||||
}
|
||||
else if (( szSrcW = _ILGetTextPointerW(pidl) ))
|
||||
|
@ -1885,7 +1861,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
|
|||
if (szOut)
|
||||
lstrcpynW(szOut, szSrcW, uOutSize);
|
||||
|
||||
dwReturn = lstrlenW(szSrcW);
|
||||
dwReturn = wcslen(szSrcW);
|
||||
}
|
||||
else if (( szSrc = _ILGetTextPointer(pidl) ))
|
||||
{
|
||||
|
@ -1895,7 +1871,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
|
|||
if (szOut)
|
||||
lstrcpynW(szOut, szTemp, uOutSize);
|
||||
|
||||
dwReturn = lstrlenW (szTemp);
|
||||
dwReturn = wcslen (szTemp);
|
||||
}
|
||||
else if (( riid = _ILGetGUIDPointer(pidl) ))
|
||||
{
|
||||
|
@ -1905,7 +1881,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
|
|||
if (szOut)
|
||||
lstrcpynW(szOut, szTemp, uOutSize);
|
||||
|
||||
dwReturn = lstrlenW (szTemp);
|
||||
dwReturn = wcslen (szTemp);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -35,12 +35,13 @@
|
|||
#ifndef __WINE_PIDL_H
|
||||
#define __WINE_PIDL_H
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winuser.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
/*
|
||||
* the pidl does cache fileattributes to speed up SHGetAttributes when
|
||||
|
|
77
reactos/dll/win32/shell32/precomp.h
Normal file
77
reactos/dll/win32/shell32/precomp.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
#ifndef _PRECOMP_H__
|
||||
#define _PRECOMP_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#define WIN32_NO_STATUS
|
||||
#define NTOS_MODE_USER
|
||||
#define UNICODE
|
||||
#define _UNICODE
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <shlguid.h>
|
||||
#include <shlwapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <shldisp.h>
|
||||
#include <commdlg.h>
|
||||
#include <commctrl.h>
|
||||
#include <cpl.h>
|
||||
#include <objbase.h>
|
||||
#include <ole2.h>
|
||||
#include <ocidl.h>
|
||||
#include <docobj.h>
|
||||
#include <prsht.h>
|
||||
//#include <initguid.h>
|
||||
//#include <devguid.h>
|
||||
#include <shobjidl.h>
|
||||
#include <shellapi.h>
|
||||
#include <msi.h>
|
||||
#include <appmgmt.h>
|
||||
#include <ntquery.h>
|
||||
#include <recyclebin.h>
|
||||
#include <shtypes.h>
|
||||
#include <ndk/ntndk.h>
|
||||
#include <fmifs/fmifs.h>
|
||||
#include <largeint.h>
|
||||
|
||||
|
||||
#include "base/shell/explorer-new/todo.h"
|
||||
#include "dlgs.h"
|
||||
#include "pidl.h"
|
||||
#include "debughlp.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "cpanel.h"
|
||||
#include "enumidlist.h"
|
||||
#include "shfldr.h"
|
||||
#include "version.h"
|
||||
#include "shellfolder.h"
|
||||
#include "xdg.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
extern const GUID CLSID_AdminFolderShortcut;
|
||||
extern const GUID CLSID_FontsFolderShortcut;
|
||||
extern const GUID CLSID_StartMenu;
|
||||
extern const GUID CLSID_OpenWith;
|
||||
extern const GUID CLSID_UnixFolder;
|
||||
extern const GUID CLSID_UnixDosFolder;
|
||||
extern const GUID SHELL32_AdvtShortcutProduct;
|
||||
extern const GUID SHELL32_AdvtShortcutComponent;
|
||||
|
||||
|
||||
#endif
|
|
@ -17,26 +17,17 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
#include <precomp.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
const GUID CLSID_AdminFolderShortcut = {0xD20EA4E1, 0x3957, 0x11D2, {0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41, 0x53} };
|
||||
const GUID CLSID_StartMenu = {0x4622AD11, 0xFF23, 0x11D0, {0x8D, 0x34, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19}};
|
||||
const GUID CLSID_OpenWith = {0x09799AFB, 0xAD67, 0x11d1, {0xAB, 0xCD, 0x00, 0xC0, 0x4F, 0xC3, 0x09, 0x36}};
|
||||
const GUID CLSID_UnixFolder = {0xcc702eb2, 0x7dc5, 0x11d9, {0xc6, 0x87, 0x00, 0x04, 0x23, 0x8a, 0x01, 0xcd}};
|
||||
const GUID CLSID_UnixDosFolder = {0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}};
|
||||
const GUID CLSID_FontsFolderShortcut = {0xD20EA4E1, 0x3957, 0x11D2, {0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41,0x52}};
|
||||
const GUID SHELL32_AdvtShortcutProduct = {0x9db1186f, 0x40df, 0x11d1, {0xaa, 0x8c, 0x00, 0xc0, 0x4f, 0xb6, 0x78, 0x63}};
|
||||
const GUID SHELL32_AdvtShortcutComponent = {0x9db1186e, 0x40df, 0x11d1, {0xaa, 0x8c, 0x00, 0xc0, 0x4f, 0xb6, 0x78, 0x63}};
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "winreg.h"
|
||||
#include "winerror.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shldisp.h"
|
||||
#include "shlguid.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "initguid.h"
|
||||
#include "shfldr.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||
|
||||
|
@ -193,10 +184,10 @@ static HRESULT register_interfaces(struct regsvr_interface const *list)
|
|||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
|
||||
wsprintfW(buf, fmt, list->num_methods);
|
||||
swprintf(buf, fmt, list->num_methods);
|
||||
res = RegSetValueExW(key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)buf,
|
||||
(lstrlenW(buf) + 1) * sizeof(WCHAR));
|
||||
(wcslen(buf) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(key);
|
||||
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
|
@ -464,18 +455,18 @@ static WCHAR *get_namespace_key(struct regsvr_namespace const *list) {
|
|||
WCHAR *pwszKey, *pwszCLSID;
|
||||
|
||||
pwszKey = HeapAlloc(GetProcessHeap(), 0, sizeof(wszExplorerKey)+sizeof(wszNamespace)+
|
||||
sizeof(WCHAR)*(lstrlenW(list->parent)+CHARS_IN_GUID));
|
||||
sizeof(WCHAR)*(wcslen(list->parent)+CHARS_IN_GUID));
|
||||
if (!pwszKey)
|
||||
return NULL;
|
||||
|
||||
lstrcpyW(pwszKey, wszExplorerKey);
|
||||
lstrcatW(pwszKey, list->parent);
|
||||
lstrcatW(pwszKey, wszNamespace);
|
||||
wcscpy(pwszKey, wszExplorerKey);
|
||||
wcscat(pwszKey, list->parent);
|
||||
wcscat(pwszKey, wszNamespace);
|
||||
if (FAILED(StringFromCLSID(list->clsid, &pwszCLSID))) {
|
||||
HeapFree(GetProcessHeap(), 0, pwszKey);
|
||||
return NULL;
|
||||
}
|
||||
lstrcatW(pwszKey, pwszCLSID);
|
||||
wcscat(pwszKey, pwszCLSID);
|
||||
CoTaskMemFree(pwszCLSID);
|
||||
|
||||
return pwszKey;
|
||||
|
@ -492,7 +483,7 @@ static HRESULT register_namespace_extensions(struct regsvr_namespace const *list
|
|||
if (pwszKey && ERROR_SUCCESS ==
|
||||
RegCreateKeyExW(HKEY_LOCAL_MACHINE, pwszKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL))
|
||||
{
|
||||
RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE *)list->value, sizeof(WCHAR)*(lstrlenW(list->value)+1));
|
||||
RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE *)list->value, sizeof(WCHAR)*(wcslen(list->value)+1));
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
|
@ -538,7 +529,7 @@ static LONG register_key_defvalueW(
|
|||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
|
||||
(lstrlenW(value) + 1) * sizeof(WCHAR));
|
||||
(wcslen(value) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -19,14 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "shellapi.h"
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
/* copy data structure for tray notifications */
|
||||
typedef struct TrayNotifyCDS_Dummy {
|
||||
|
|
|
@ -18,31 +18,10 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "winerror.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlobj.h"
|
||||
#include "objbase.h"
|
||||
#include "commdlg.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shellfolder.h"
|
||||
#include "shresdef.h"
|
||||
#include "stdio.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
const GUID CLSID_OpenWith = { 0x09799AFB, 0xAD67, 0x11d1, {0xAB,0xCD,0x00,0xC0,0x4F,0xC3,0x09,0x36} };
|
||||
|
||||
///
|
||||
/// [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system]
|
||||
/// "NoInternetOpenWith"=dword:00000001
|
||||
|
@ -63,7 +42,7 @@ typedef struct
|
|||
UINT count;
|
||||
WCHAR szPath[MAX_PATH];
|
||||
HMENU hSubMenu;
|
||||
} SHEOWImpl;
|
||||
} SHEOWImpl, *LPSHEOWImpl;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -160,12 +139,12 @@ HRESULT WINAPI SHEOW_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv)
|
|||
return res;
|
||||
}
|
||||
|
||||
static inline SHEOWImpl *impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
static LPSHEOWImpl __inline impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
{
|
||||
return (SHEOWImpl *)((char*)iface - FIELD_OFFSET(SHEOWImpl, lpvtblShellExtInit));
|
||||
}
|
||||
|
||||
static inline SHEOWImpl *impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
static LPSHEOWImpl __inline impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
{
|
||||
return (SHEOWImpl *)((char*)iface - FIELD_OFFSET(SHEOWImpl, lpVtblContextMenu));
|
||||
}
|
||||
|
@ -248,14 +227,14 @@ AddItem(HMENU hMenu, UINT idCmdFirst)
|
|||
mii.fState = MFS_ENABLED;
|
||||
mii.wID = idCmdFirst;
|
||||
mii.dwTypeData = (LPWSTR)szBuffer;
|
||||
mii.cch = strlenW(szBuffer);
|
||||
mii.cch = wcslen(szBuffer);
|
||||
|
||||
InsertMenuItemW(hMenu, -1, TRUE, &mii);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
LoadOWItems(POPEN_WITH_CONTEXT pContext, WCHAR * szName)
|
||||
LoadOWItems(POPEN_WITH_CONTEXT pContext, LPCWSTR szName)
|
||||
{
|
||||
WCHAR * szExt;
|
||||
WCHAR szPath[100];
|
||||
|
@ -434,12 +413,12 @@ WriteStaticShellExtensionKey(HKEY hRootKey, WCHAR * pVerb, WCHAR *pFullPath)
|
|||
wcscpy(szBuffer, pFullPath);
|
||||
wcscat(szBuffer, L" %1");
|
||||
|
||||
result = RegSetValueExW(hShell, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (strlenW(szBuffer)+1)* sizeof(WCHAR));
|
||||
result = RegSetValueExW(hShell, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (wcslen(szBuffer)+1)* sizeof(WCHAR));
|
||||
RegCloseKey(hShell);
|
||||
}
|
||||
|
||||
VOID
|
||||
StoreNewSettings(WCHAR * szFileName, WCHAR *szAppName)
|
||||
StoreNewSettings(LPCWSTR szFileName, WCHAR *szAppName)
|
||||
{
|
||||
WCHAR szBuffer[100] = { L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\"};
|
||||
WCHAR * pFileExt;
|
||||
|
@ -478,7 +457,7 @@ StoreNewSettings(WCHAR * szFileName, WCHAR *szAppName)
|
|||
}
|
||||
|
||||
VOID
|
||||
SetProgrammAsDefaultHandler(WCHAR * szFileName, WCHAR * szAppName)
|
||||
SetProgrammAsDefaultHandler(LPCWSTR szFileName, WCHAR * szAppName)
|
||||
{
|
||||
HKEY hKey;
|
||||
HKEY hAppKey;
|
||||
|
@ -503,7 +482,7 @@ SetProgrammAsDefaultHandler(WCHAR * szFileName, WCHAR * szAppName)
|
|||
/* a new entry was created create the prog key id */
|
||||
wcscpy(szBuffer, &pFileExt[1]);
|
||||
wcscat(szBuffer, L"_auto_file");
|
||||
if (RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (strlenW(szBuffer)+1) * sizeof(WCHAR)) != ERROR_SUCCESS)
|
||||
if (RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (wcslen(szBuffer)+1) * sizeof(WCHAR)) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
return;
|
||||
|
@ -570,7 +549,7 @@ BrowseForApplication(HWND hwndDlg)
|
|||
{
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
ofn.lpstrTitle = szBuffer;
|
||||
ofn.nMaxFileTitle = strlenW(szBuffer);
|
||||
ofn.nMaxFileTitle = wcslen(szBuffer);
|
||||
}
|
||||
|
||||
ZeroMemory(&ofn, sizeof(OPENFILENAMEW));
|
||||
|
@ -655,6 +634,7 @@ static BOOL CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
COLORREF preColor, preBkColor;
|
||||
POPEN_ITEM_CONTEXT pItemContext;
|
||||
LONG YOffset;
|
||||
OPEN_WITH_CONTEXT Context;
|
||||
|
||||
poainfo = (OPENASINFO*) GetWindowLong(hwndDlg, DWLP_USER);
|
||||
|
||||
|
@ -672,21 +652,16 @@ static BOOL CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
if (poainfo->pcszFile)
|
||||
{
|
||||
szBuffer[0] = L'\0';
|
||||
SendDlgItemMessageA(hwndDlg, 14001, WM_GETTEXT, sizeof(szBuffer), (LPARAM)szBuffer);
|
||||
index = strlen((char*)szBuffer);
|
||||
if (index + strlen(poainfo->pcszFile) + 1 < sizeof(szBuffer))
|
||||
strcat((char*)szBuffer, poainfo->pcszFile);
|
||||
SendDlgItemMessageW(hwndDlg, 14001, WM_GETTEXT, sizeof(szBuffer), (LPARAM)szBuffer);
|
||||
index = wcslen(szBuffer);
|
||||
if (index + wcslen(poainfo->pcszFile) + 1 < sizeof(szBuffer)/sizeof(szBuffer[0]))
|
||||
wcscat(szBuffer, poainfo->pcszFile);
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
SendDlgItemMessageA(hwndDlg, 14001, WM_SETTEXT, 0, (LPARAM)szBuffer);
|
||||
}
|
||||
if (MultiByteToWideChar(CP_ACP, 0,poainfo->pcszFile, -1, szBuffer, MAX_PATH))
|
||||
{
|
||||
OPEN_WITH_CONTEXT Context;
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
ZeroMemory(&Context, sizeof(OPEN_WITH_CONTEXT));
|
||||
Context.hDlgCtrl = GetDlgItem(hwndDlg, 14002);
|
||||
LoadOWItems(&Context, szBuffer);
|
||||
SendMessage(Context.hDlgCtrl, LB_SETCURSEL, 0, 0);
|
||||
SendDlgItemMessageW(hwndDlg, 14001, WM_SETTEXT, 0, (LPARAM)szBuffer);
|
||||
ZeroMemory(&Context, sizeof(OPEN_WITH_CONTEXT));
|
||||
Context.hDlgCtrl = GetDlgItem(hwndDlg, 14002);
|
||||
LoadOWItems(&Context, poainfo->pcszFile);
|
||||
SendMessage(Context.hDlgCtrl, LB_SETCURSEL, 0, 0);
|
||||
}
|
||||
return TRUE;
|
||||
case WM_MEASUREITEM:
|
||||
|
@ -708,16 +683,12 @@ static BOOL CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
if (pItemContext)
|
||||
{
|
||||
/* store settings in HKCU path */
|
||||
if(MultiByteToWideChar(CP_ACP, 0, poainfo->pcszFile, -1, szBuffer, MAX_PATH + 30))
|
||||
{
|
||||
szBuffer[MAX_PATH+29] = 0;
|
||||
StoreNewSettings(szBuffer, pItemContext->szAppName);
|
||||
}
|
||||
StoreNewSettings(poainfo->pcszFile, pItemContext->szAppName);
|
||||
|
||||
if (SendDlgItemMessage(hwndDlg, 14003, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||
{
|
||||
/* set programm as default handler */
|
||||
SetProgrammAsDefaultHandler(szBuffer, pItemContext->szAppName);
|
||||
SetProgrammAsDefaultHandler(poainfo->pcszFile, pItemContext->szAppName);
|
||||
}
|
||||
|
||||
if (poainfo->oaifInFlags & OAIF_EXEC)
|
||||
|
@ -834,13 +805,8 @@ SHEOWCm_fnInvokeCommand( IContextMenu2* iface, LPCMINVOKECOMMANDINFO lpici )
|
|||
if (This->wId == LOWORD(lpici->lpVerb))
|
||||
{
|
||||
OPENASINFO info;
|
||||
char buffer[MAX_PATH] = {0};
|
||||
|
||||
if(WideCharToMultiByte(CP_ACP,0,This->szPath,-1,buffer,MAX_PATH,NULL,NULL))
|
||||
{
|
||||
info.pcszFile = buffer;
|
||||
}
|
||||
|
||||
info.pcszFile = This->szPath;
|
||||
info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC;
|
||||
info.pcszClass = NULL;
|
||||
FreeMenuItemContext(This->hSubMenu);
|
||||
|
@ -953,7 +919,7 @@ GetManufacturer(WCHAR * szAppName, POPEN_ITEM_CONTEXT pContext)
|
|||
code = lplangcode->code;
|
||||
}
|
||||
/* set up format */
|
||||
sprintfW(szBuffer, wFormat, lang, code);
|
||||
swprintf(szBuffer, wFormat, lang, code);
|
||||
/* query manufacturer */
|
||||
pResult = NULL;
|
||||
bResult = VerQueryValueW(pBuf, szBuffer, (LPVOID *)&pResult, &VerSize);
|
||||
|
@ -1001,7 +967,7 @@ InsertOpenWithItem(POPEN_WITH_CONTEXT pContext, WCHAR * szAppName)
|
|||
mii.fState = MFS_ENABLED;
|
||||
mii.wID = pContext->idCmdFirst;
|
||||
mii.dwTypeData = Buffer;
|
||||
mii.cch = strlenW(Buffer);
|
||||
mii.cch = wcslen(Buffer);
|
||||
mii.dwItemData = (ULONG_PTR)pItemContext;
|
||||
wcscpy(pItemContext->szManufacturer, Buffer);
|
||||
if (InsertMenuItemW(pContext->hMenu, -1, TRUE, &mii))
|
||||
|
@ -1042,10 +1008,10 @@ OpenMRUList(HKEY hKey)
|
|||
wcscat(szPath, L"comctl32.dll");
|
||||
hModule = LoadLibraryExW(szPath, NULL, 0);
|
||||
}
|
||||
CreateMRUListW = (CREATEMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCE(400));
|
||||
EnumMRUListW = (ENUMMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCE(403));
|
||||
FreeMRUList = (FREEMRULIST)GetProcAddress(hModule, MAKEINTRESOURCE(152));
|
||||
AddMRUStringW = (ADDMRUSTRINGW)GetProcAddress(hModule, MAKEINTRESOURCE(401));
|
||||
CreateMRUListW = (CREATEMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCEA(400));
|
||||
EnumMRUListW = (ENUMMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCEA(403));
|
||||
FreeMRUList = (FREEMRULIST)GetProcAddress(hModule, MAKEINTRESOURCEA(152));
|
||||
AddMRUStringW = (ADDMRUSTRINGW)GetProcAddress(hModule, MAKEINTRESOURCEA(401));
|
||||
|
||||
if (!CreateMRUListW || !EnumMRUListW || !FreeMRUList || !AddMRUStringW)
|
||||
return 0;
|
||||
|
@ -1153,7 +1119,7 @@ LoadItemFromHKCR(POPEN_WITH_CONTEXT pContext, WCHAR * szExt)
|
|||
}
|
||||
|
||||
/* load items from SystemFileAssociations\Ext key */
|
||||
sprintfW(szResult, szSysFileAssoc, szExt);
|
||||
swprintf(szResult, szSysFileAssoc, szExt);
|
||||
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szResult, 0, KEY_READ | KEY_WRITE, &hSubKey) == ERROR_SUCCESS)
|
||||
{
|
||||
AddItemFromMRUList(pContext, hSubKey);
|
||||
|
@ -1171,7 +1137,7 @@ LoadItemFromHKCR(POPEN_WITH_CONTEXT pContext, WCHAR * szExt)
|
|||
|
||||
/* terminate it explictely */
|
||||
szBuffer[29] = 0;
|
||||
sprintfW(szResult, szSysFileAssoc, szBuffer);
|
||||
swprintf(szResult, szSysFileAssoc, szBuffer);
|
||||
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szResult, 0, KEY_READ | KEY_WRITE, &hSubKey) == ERROR_SUCCESS)
|
||||
{
|
||||
AddItemFromMRUList(pContext, hSubKey);
|
||||
|
@ -1189,7 +1155,7 @@ LoadItemFromHKCU(POPEN_WITH_CONTEXT pContext, WCHAR * szExt)
|
|||
static const WCHAR szOpenWithList[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\%s";
|
||||
|
||||
/* handle first progid lists */
|
||||
sprintfW(szBuffer, szOpenWithProgIDs, szExt);
|
||||
swprintf(szBuffer, szOpenWithProgIDs, szExt);
|
||||
if (RegOpenKeyExW(HKEY_CURRENT_USER, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
AddItemFromProgIDList(pContext, hKey);
|
||||
|
@ -1197,7 +1163,7 @@ LoadItemFromHKCU(POPEN_WITH_CONTEXT pContext, WCHAR * szExt)
|
|||
}
|
||||
|
||||
/* now handle mru lists */
|
||||
sprintfW(szBuffer, szOpenWithList, szExt);
|
||||
swprintf(szBuffer, szOpenWithList, szExt);
|
||||
if (RegOpenKeyExW(HKEY_CURRENT_USER, szBuffer, 0, KEY_READ | KEY_WRITE, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
AddItemFromMRUList(pContext, hKey);
|
||||
|
|
|
@ -20,612 +20,14 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wownt32.h"
|
||||
#include "shellapi.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
#include "shlobj.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "wine/winbase16.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
||||
typedef struct { /* structure for dropped files */
|
||||
WORD wSize;
|
||||
POINT16 ptMousePos;
|
||||
BOOL16 fInNonClientArea;
|
||||
/* memory block with filenames follows */
|
||||
} DROPFILESTRUCT16, *LPDROPFILESTRUCT16;
|
||||
|
||||
static const char lpstrMsgWndCreated[] = "OTHERWINDOWCREATED";
|
||||
static const char lpstrMsgWndDestroyed[] = "OTHERWINDOWDESTROYED";
|
||||
static const char lpstrMsgShellActivate[] = "ACTIVATESHELLWINDOW";
|
||||
|
||||
static HWND SHELL_hWnd = 0;
|
||||
static HHOOK SHELL_hHook = 0;
|
||||
static UINT uMsgWndCreated = 0;
|
||||
static UINT uMsgWndDestroyed = 0;
|
||||
static UINT uMsgShellActivate = 0;
|
||||
|
||||
/***********************************************************************
|
||||
* DllEntryPoint [SHELL.101]
|
||||
*
|
||||
* Initialization code for shell.dll. Automatically loads the
|
||||
* 32-bit shell32.dll to allow thunking up to 32-bit code.
|
||||
*
|
||||
* RETURNS
|
||||
* Success: TRUE. Initialization completed successfully.
|
||||
* Failure: FALSE.
|
||||
*/
|
||||
BOOL WINAPI SHELL_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst,
|
||||
WORD ds, WORD HeapSize, DWORD res1, WORD res2)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragAcceptFiles [SHELL.9]
|
||||
*/
|
||||
void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b)
|
||||
{
|
||||
DragAcceptFiles(HWND_32(hWnd), b);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragQueryFile [SHELL.11]
|
||||
*/
|
||||
UINT16 WINAPI DragQueryFile16(
|
||||
HDROP16 hDrop,
|
||||
WORD wFile,
|
||||
LPSTR lpszFile,
|
||||
WORD wLength)
|
||||
{
|
||||
LPSTR lpDrop;
|
||||
UINT i = 0;
|
||||
LPDROPFILESTRUCT16 lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop);
|
||||
|
||||
TRACE("(%04x, %x, %p, %u)\n", hDrop,wFile,lpszFile,wLength);
|
||||
|
||||
if(!lpDropFileStruct) goto end;
|
||||
|
||||
lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->wSize;
|
||||
|
||||
while (i++ < wFile)
|
||||
{
|
||||
while (*lpDrop++); /* skip filename */
|
||||
if (!*lpDrop)
|
||||
{
|
||||
i = (wFile == 0xFFFF) ? i : 0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
i = strlen(lpDrop);
|
||||
if (!lpszFile ) goto end; /* needed buffer size */
|
||||
lstrcpynA (lpszFile, lpDrop, wLength);
|
||||
end:
|
||||
GlobalUnlock16(hDrop);
|
||||
return i;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DragFinish [SHELL.12]
|
||||
*/
|
||||
void WINAPI DragFinish16(HDROP16 h)
|
||||
{
|
||||
TRACE("\n");
|
||||
GlobalFree16((HGLOBAL16)h);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* DragQueryPoint [SHELL.13]
|
||||
*/
|
||||
BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p)
|
||||
{
|
||||
LPDROPFILESTRUCT16 lpDropFileStruct;
|
||||
BOOL16 bRet;
|
||||
TRACE("\n");
|
||||
lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop);
|
||||
|
||||
memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT16));
|
||||
bRet = lpDropFileStruct->fInNonClientArea;
|
||||
|
||||
GlobalUnlock16(hDrop);
|
||||
return bRet;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* FindExecutable (SHELL.21)
|
||||
*/
|
||||
HINSTANCE16 WINAPI FindExecutable16( LPCSTR lpFile, LPCSTR lpDirectory,
|
||||
LPSTR lpResult )
|
||||
{ return HINSTANCE_16(FindExecutableA( lpFile, lpDirectory, lpResult ));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* AboutDlgProc (SHELL.33)
|
||||
*/
|
||||
BOOL16 WINAPI AboutDlgProc16( HWND16 hWnd, UINT16 msg, WPARAM16 wParam,
|
||||
LPARAM lParam )
|
||||
{ return (BOOL16)AboutDlgProc( HWND_32(hWnd), msg, wParam, lParam );
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* ShellAbout (SHELL.22)
|
||||
*/
|
||||
BOOL16 WINAPI ShellAbout16( HWND16 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
|
||||
HICON16 hIcon )
|
||||
{ return ShellAboutA( HWND_32(hWnd), szApp, szOtherStuff, HICON_32(hIcon) );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* InternalExtractIcon [SHELL.39]
|
||||
*
|
||||
* This abortion is called directly by Progman
|
||||
*/
|
||||
HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
|
||||
LPCSTR lpszExeFileName, UINT16 nIconIndex, WORD n )
|
||||
{
|
||||
HGLOBAL16 hRet = 0;
|
||||
HICON16 *RetPtr = NULL;
|
||||
OFSTRUCT ofs;
|
||||
|
||||
TRACE("(%04x,file %s,start %d,extract %d\n",
|
||||
hInstance, lpszExeFileName, nIconIndex, n);
|
||||
|
||||
if (!n)
|
||||
return 0;
|
||||
|
||||
hRet = GlobalAlloc16(GMEM_FIXED | GMEM_ZEROINIT, sizeof(*RetPtr) * n);
|
||||
RetPtr = (HICON16*)GlobalLock16(hRet);
|
||||
|
||||
if (nIconIndex == (UINT16)-1) /* get number of icons */
|
||||
{
|
||||
RetPtr[0] = PrivateExtractIconsA(ofs.szPathName, 0, 0, 0, NULL, NULL, 0, LR_DEFAULTCOLOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT ret;
|
||||
HICON *icons;
|
||||
|
||||
icons = HeapAlloc(GetProcessHeap(), 0, n * sizeof(*icons));
|
||||
ret = PrivateExtractIconsA(ofs.szPathName, nIconIndex,
|
||||
GetSystemMetrics(SM_CXICON),
|
||||
GetSystemMetrics(SM_CYICON),
|
||||
icons, NULL, n, LR_DEFAULTCOLOR);
|
||||
if ((ret != 0xffffffff) && ret)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; i++) RetPtr[i] = HICON_16(icons[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalFree16(hRet);
|
||||
hRet = 0;
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, icons);
|
||||
}
|
||||
return hRet;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* ExtractIcon (SHELL.34)
|
||||
*/
|
||||
HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
|
||||
UINT16 nIconIndex )
|
||||
{ TRACE("\n");
|
||||
return HICON_16(ExtractIconA(HINSTANCE_32(hInstance), lpszExeFileName, nIconIndex));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* ExtractIconEx (SHELL.40)
|
||||
*/
|
||||
HICON16 WINAPI ExtractIconEx16(
|
||||
LPCSTR lpszFile, INT16 nIconIndex, HICON16 *phiconLarge,
|
||||
HICON16 *phiconSmall, UINT16 nIcons
|
||||
) {
|
||||
HICON *ilarge,*ismall;
|
||||
UINT16 ret;
|
||||
int i;
|
||||
|
||||
if (phiconLarge)
|
||||
ilarge = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
|
||||
else
|
||||
ilarge = NULL;
|
||||
if (phiconSmall)
|
||||
ismall = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
|
||||
else
|
||||
ismall = NULL;
|
||||
ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
|
||||
if (ilarge) {
|
||||
for (i=0;i<nIcons;i++)
|
||||
phiconLarge[i]=HICON_16(ilarge[i]);
|
||||
HeapFree(GetProcessHeap(),0,ilarge);
|
||||
}
|
||||
if (ismall) {
|
||||
for (i=0;i<nIcons;i++)
|
||||
phiconSmall[i]=HICON_16(ismall[i]);
|
||||
HeapFree(GetProcessHeap(),0,ismall);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* ExtractAssociatedIcon [SHELL.36]
|
||||
*
|
||||
* Return icon for given file (either from file itself or from associated
|
||||
* executable) and patch parameters if needed.
|
||||
*/
|
||||
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWORD lpiIcon)
|
||||
{
|
||||
return HICON_16(ExtractAssociatedIconA(HINSTANCE_32(hInst), lpIconPath,
|
||||
lpiIcon));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* FindEnvironmentString [SHELL.38]
|
||||
*
|
||||
* Returns a pointer into the DOS environment... Ugh.
|
||||
*/
|
||||
static LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
|
||||
{ UINT16 l;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
l = strlen(entry);
|
||||
for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
|
||||
{ if( strncasecmp(lpEnv, entry, l) )
|
||||
continue;
|
||||
if( !*(lpEnv+l) )
|
||||
return (lpEnv + l); /* empty entry */
|
||||
else if ( *(lpEnv+l)== '=' )
|
||||
return (lpEnv + l + 1);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
SEGPTR WINAPI FindEnvironmentString16(LPCSTR str)
|
||||
{ SEGPTR spEnv;
|
||||
LPSTR lpEnv,lpString;
|
||||
TRACE("\n");
|
||||
|
||||
spEnv = GetDOSEnvironment16();
|
||||
|
||||
lpEnv = MapSL(spEnv);
|
||||
lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL;
|
||||
|
||||
if( lpString ) /* offset should be small enough */
|
||||
return spEnv + (lpString - lpEnv);
|
||||
return (SEGPTR)NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DoEnvironmentSubst [SHELL.37]
|
||||
*
|
||||
* Replace %KEYWORD% in the str with the value of variable KEYWORD
|
||||
* from "DOS" environment. If it is not found the %KEYWORD% is left
|
||||
* intact. If the buffer is too small, str is not modified.
|
||||
*
|
||||
* PARAMS
|
||||
* str [I] '\0' terminated string with %keyword%.
|
||||
* [O] '\0' terminated string with %keyword% substituted.
|
||||
* length [I] size of str.
|
||||
*
|
||||
* RETURNS
|
||||
* str length in the LOWORD and 1 in HIWORD if subst was successful.
|
||||
*/
|
||||
DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length)
|
||||
{
|
||||
LPSTR lpEnv = MapSL(GetDOSEnvironment16());
|
||||
LPSTR lpstr = str;
|
||||
LPSTR lpend;
|
||||
LPSTR lpBuffer = HeapAlloc( GetProcessHeap(), 0, length);
|
||||
WORD bufCnt = 0;
|
||||
WORD envKeyLen;
|
||||
LPSTR lpKey;
|
||||
WORD retStatus = 0;
|
||||
WORD retLength = length;
|
||||
|
||||
CharToOemA(str,str);
|
||||
|
||||
TRACE("accept %s\n", str);
|
||||
|
||||
while( *lpstr && bufCnt <= length - 1 ) {
|
||||
if ( *lpstr != '%' ) {
|
||||
lpBuffer[bufCnt++] = *lpstr++;
|
||||
continue;
|
||||
}
|
||||
|
||||
for( lpend = lpstr + 1; *lpend && *lpend != '%'; lpend++) /**/;
|
||||
|
||||
envKeyLen = lpend - lpstr - 1;
|
||||
if( *lpend != '%' || envKeyLen == 0)
|
||||
goto err; /* "%\0" or "%%" found; back off and whine */
|
||||
|
||||
*lpend = '\0';
|
||||
lpKey = SHELL_FindString(lpEnv, lpstr+1);
|
||||
*lpend = '%';
|
||||
if( lpKey ) {
|
||||
int l = strlen(lpKey);
|
||||
|
||||
if( bufCnt + l > length - 1 )
|
||||
goto err;
|
||||
|
||||
memcpy(lpBuffer + bufCnt, lpKey, l);
|
||||
bufCnt += l;
|
||||
} else { /* Keyword not found; Leave the %KEYWORD% intact */
|
||||
if( bufCnt + envKeyLen + 2 > length - 1 )
|
||||
goto err;
|
||||
|
||||
memcpy(lpBuffer + bufCnt, lpstr, envKeyLen + 2);
|
||||
bufCnt += envKeyLen + 2;
|
||||
}
|
||||
|
||||
lpstr = lpend + 1;
|
||||
}
|
||||
|
||||
if (!*lpstr && bufCnt <= length - 1) {
|
||||
memcpy(str,lpBuffer, bufCnt);
|
||||
str[bufCnt] = '\0';
|
||||
retLength = bufCnt + 1;
|
||||
retStatus = 1;
|
||||
}
|
||||
|
||||
err:
|
||||
if (!retStatus)
|
||||
WARN("-- Env subst aborted - string too short or invalid input\n");
|
||||
TRACE("-- return %s\n", str);
|
||||
|
||||
OemToCharA(str,str);
|
||||
HeapFree( GetProcessHeap(), 0, lpBuffer);
|
||||
|
||||
return (DWORD)MAKELONG(retLength, retStatus);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHELL_HookProc
|
||||
*
|
||||
* 32-bit version of the system-wide WH_SHELL hook.
|
||||
*/
|
||||
static LRESULT WINAPI SHELL_HookProc(INT code, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
TRACE("%i, %lx, %08lx\n", code, wParam, lParam );
|
||||
|
||||
if (SHELL_hWnd)
|
||||
{
|
||||
switch( code )
|
||||
{
|
||||
case HSHELL_WINDOWCREATED:
|
||||
PostMessageA( SHELL_hWnd, uMsgWndCreated, wParam, 0 );
|
||||
break;
|
||||
case HSHELL_WINDOWDESTROYED:
|
||||
PostMessageA( SHELL_hWnd, uMsgWndDestroyed, wParam, 0 );
|
||||
break;
|
||||
case HSHELL_ACTIVATESHELLWINDOW:
|
||||
PostMessageA( SHELL_hWnd, uMsgShellActivate, wParam, 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CallNextHookEx( SHELL_hHook, code, wParam, lParam );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* ShellHookProc [SHELL.103]
|
||||
* System-wide WH_SHELL hook.
|
||||
*/
|
||||
LRESULT WINAPI ShellHookProc16(INT16 code, WPARAM16 wParam, LPARAM lParam)
|
||||
{
|
||||
return SHELL_HookProc( code, wParam, lParam );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* RegisterShellHook [SHELL.102]
|
||||
*/
|
||||
BOOL WINAPI RegisterShellHook16(HWND16 hWnd, UINT16 uAction)
|
||||
{
|
||||
TRACE("%04x [%u]\n", hWnd, uAction );
|
||||
|
||||
switch( uAction )
|
||||
{
|
||||
case 2: /* register hWnd as a shell window */
|
||||
if( !SHELL_hHook )
|
||||
{
|
||||
SHELL_hHook = SetWindowsHookExA( WH_SHELL, SHELL_HookProc,
|
||||
GetModuleHandleA("shell32.dll"), 0 );
|
||||
if ( SHELL_hHook )
|
||||
{
|
||||
uMsgWndCreated = RegisterWindowMessageA( lpstrMsgWndCreated );
|
||||
uMsgWndDestroyed = RegisterWindowMessageA( lpstrMsgWndDestroyed );
|
||||
uMsgShellActivate = RegisterWindowMessageA( lpstrMsgShellActivate );
|
||||
}
|
||||
else
|
||||
WARN("-- unable to install ShellHookProc()!\n");
|
||||
}
|
||||
|
||||
if ( SHELL_hHook )
|
||||
return ((SHELL_hWnd = HWND_32(hWnd)) != 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
WARN("-- unknown code %i\n", uAction );
|
||||
SHELL_hWnd = 0; /* just in case */
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* DriveType (SHELL.262)
|
||||
*/
|
||||
UINT16 WINAPI DriveType16( UINT16 drive )
|
||||
{
|
||||
UINT ret;
|
||||
char path[] = "A:\\";
|
||||
path[0] += drive;
|
||||
ret = GetDriveTypeA(path);
|
||||
switch(ret) /* some values are not supported in Win16 */
|
||||
{
|
||||
case DRIVE_CDROM:
|
||||
ret = DRIVE_REMOTE;
|
||||
break;
|
||||
case DRIVE_NO_ROOT_DIR:
|
||||
ret = DRIVE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* 0 and 1 are valid rootkeys in win16 shell.dll and are used by
|
||||
* some programs. Do not remove those cases. -MM
|
||||
*/
|
||||
static inline void fix_win16_hkey( HKEY *hkey )
|
||||
{
|
||||
if (*hkey == 0 || *hkey == (HKEY)1) *hkey = HKEY_CLASSES_ROOT;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegOpenKey [SHELL.1]
|
||||
*/
|
||||
DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, PHKEY retkey )
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
return RegOpenKeyA( hkey, name, retkey );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegCreateKey [SHELL.2]
|
||||
*/
|
||||
DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, PHKEY retkey )
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
return RegCreateKeyA( hkey, name, retkey );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegCloseKey [SHELL.3]
|
||||
*/
|
||||
DWORD WINAPI RegCloseKey16( HKEY hkey )
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
return RegCloseKey( hkey );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegDeleteKey [SHELL.4]
|
||||
*/
|
||||
DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name )
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
return RegDeleteKeyA( hkey, name );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegSetValue [SHELL.5]
|
||||
*/
|
||||
DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count )
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
return RegSetValueA( hkey, name, type, data, count );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegQueryValue [SHELL.6]
|
||||
*
|
||||
* NOTES
|
||||
* Is this HACK still applicable?
|
||||
*
|
||||
* HACK
|
||||
* The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just
|
||||
* mask out the high 16 bit. This (not so much incidently) hopefully fixes
|
||||
* Aldus FH4)
|
||||
*/
|
||||
DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count
|
||||
)
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
if (count) *count &= 0xffff;
|
||||
return RegQueryValueA( hkey, name, data, (LONG*) count );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RegEnumKey [SHELL.7]
|
||||
*/
|
||||
DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
|
||||
{
|
||||
fix_win16_hkey( &hkey );
|
||||
return RegEnumKeyA( hkey, index, name, name_len );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHELL_Execute16 [Internal]
|
||||
*/
|
||||
static UINT_PTR SHELL_Execute16(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
|
||||
LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out)
|
||||
{
|
||||
UINT ret;
|
||||
char sCmd[MAX_PATH];
|
||||
WideCharToMultiByte(CP_ACP, 0, lpCmd, -1, sCmd, MAX_PATH, NULL, NULL);
|
||||
ret = WinExec16(sCmd, (UINT16)psei->nShow);
|
||||
psei_out->hInstApp = HINSTANCE_32(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* ShellExecute [SHELL.20]
|
||||
*/
|
||||
HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
|
||||
LPCSTR lpFile, LPCSTR lpParameters,
|
||||
LPCSTR lpDirectory, INT16 iShowCmd )
|
||||
{
|
||||
SHELLEXECUTEINFOW seiW;
|
||||
WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL;
|
||||
HANDLE hProcess = 0;
|
||||
|
||||
seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL;
|
||||
seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL;
|
||||
seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL;
|
||||
seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL;
|
||||
|
||||
seiW.cbSize = sizeof(seiW);
|
||||
seiW.fMask = 0;
|
||||
seiW.hwnd = HWND_32(hWnd);
|
||||
seiW.nShow = iShowCmd;
|
||||
seiW.lpIDList = 0;
|
||||
seiW.lpClass = 0;
|
||||
seiW.hkeyClass = 0;
|
||||
seiW.dwHotKey = 0;
|
||||
seiW.hProcess = hProcess;
|
||||
|
||||
SHELL_execute( &seiW, SHELL_Execute16 );
|
||||
|
||||
SHFree(wVerb);
|
||||
SHFree(wFile);
|
||||
SHFree(wParameters);
|
||||
SHFree(wDirectory);
|
||||
|
||||
return HINSTANCE_16(seiW.hInstApp);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<library>devmgr</library>
|
||||
<library>winspool</library>
|
||||
<library>winmm</library>
|
||||
<pch>precomp.h</pch>
|
||||
<file>authors.c</file>
|
||||
<file>autocomplete.c</file>
|
||||
<file>brsfolder.c</file>
|
||||
|
@ -68,7 +69,6 @@
|
|||
<file>shv_def_cmenu.c</file>
|
||||
<file>startmenu.c</file>
|
||||
<file>ros-systray.c</file>
|
||||
<file>shell32.rc</file>
|
||||
<file>shell32.spec</file>
|
||||
<file>fprop.c</file>
|
||||
<file>drive.c</file>
|
||||
|
@ -78,4 +78,5 @@
|
|||
<file>folder_options.c</file>
|
||||
<file>shfldr_netplaces.c</file>
|
||||
<file>shfldr_fonts.c</file>
|
||||
<file>shell32.rc</file>
|
||||
</module>
|
||||
|
|
|
@ -19,34 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
#include "winreg.h"
|
||||
#include "dlgs.h"
|
||||
#include "shellapi.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
#include "shlobj.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "undocshell.h"
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
#include "version.h"
|
||||
#include "shresdef.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -157,11 +130,11 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
/* Allocate in a single lump, the string array, and the strings that go with it.
|
||||
* This way the caller can make a single GlobalFree call to free both, as per MSDN.
|
||||
*/
|
||||
argv=LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR));
|
||||
argv=LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(wcslen(lpCmdline)+1)*sizeof(WCHAR));
|
||||
if (!argv)
|
||||
return NULL;
|
||||
cmdline=(LPWSTR)(argv+argc);
|
||||
strcpyW(cmdline, lpCmdline);
|
||||
wcscpy(cmdline, lpCmdline);
|
||||
|
||||
argc=0;
|
||||
bcount=0;
|
||||
|
@ -439,7 +412,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
{
|
||||
if (flags & SHGFI_USEFILEATTRIBUTES)
|
||||
{
|
||||
lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath));
|
||||
wcscpy (psfi->szDisplayName, PathFindFileNameW(szFullPath));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -466,17 +439,17 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
strcatW (psfi->szTypeName, szFile);
|
||||
wcscat (psfi->szTypeName, szFile);
|
||||
else
|
||||
{
|
||||
WCHAR sTemp[64];
|
||||
|
||||
lstrcpyW(sTemp,PathFindExtensionW(szFullPath));
|
||||
wcscpy(sTemp,PathFindExtensionW(szFullPath));
|
||||
if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) &&
|
||||
HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
|
||||
{
|
||||
lstrcpynW (psfi->szTypeName, sTemp, 64);
|
||||
strcatW (psfi->szTypeName, szDashFile);
|
||||
wcscat (psfi->szTypeName, szDashFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -513,7 +486,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
{
|
||||
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
lstrcpyW(psfi->szDisplayName, swShell32Name);
|
||||
wcscpy(psfi->szDisplayName, swShell32Name);
|
||||
psfi->iIcon = -IDI_SHELL_FOLDER;
|
||||
}
|
||||
else
|
||||
|
@ -529,11 +502,11 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon))
|
||||
{
|
||||
if (lstrcmpW(p1W, sTemp))
|
||||
strcpyW(psfi->szDisplayName, sTemp);
|
||||
wcscpy(psfi->szDisplayName, sTemp);
|
||||
else
|
||||
{
|
||||
/* the icon is in the file */
|
||||
strcpyW(psfi->szDisplayName, szFullPath);
|
||||
wcscpy(psfi->szDisplayName, szFullPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -547,17 +520,17 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
&uDummy, (LPVOID*)&pei);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IExtractIconW_GetIconLocation(pei, uGilFlags,
|
||||
hr = pei->lpVtbl->GetIconLocation(pei, uGilFlags,
|
||||
szLocation, MAX_PATH, &iIndex, &uFlags);
|
||||
|
||||
if (uFlags & GIL_NOTFILENAME)
|
||||
ret = FALSE;
|
||||
else
|
||||
{
|
||||
lstrcpyW (psfi->szDisplayName, szLocation);
|
||||
wcscpy (psfi->szDisplayName, szLocation);
|
||||
psfi->iIcon = iIndex;
|
||||
}
|
||||
IExtractIconW_Release(pei);
|
||||
pei->lpVtbl->Release(pei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -586,7 +559,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx))
|
||||
{
|
||||
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
|
||||
strcpyW(sTemp, szFullPath);
|
||||
wcscpy(sTemp, szFullPath);
|
||||
|
||||
if (flags & SHGFI_SYSICONINDEX)
|
||||
{
|
||||
|
@ -1043,7 +1016,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
|||
SendDlgItemMessageW(hWnd, IDC_SHELL_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0);
|
||||
|
||||
GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) );
|
||||
wsprintfW( szAppTitle, szAppTitleTemplate, info->szApp );
|
||||
swprintf( szAppTitle, szAppTitleTemplate, info->szApp );
|
||||
SetWindowTextW( hWnd, szAppTitle );
|
||||
|
||||
SetDlgItemTextW( hWnd, IDC_SHELL_ABOUT_APPNAME, info->szApp );
|
||||
|
@ -1108,13 +1081,13 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
|||
uDecimals = (UCHAR)((UINT)(dTotalPhys * 100) - uIntegral * 100);
|
||||
|
||||
// Display the RAM size with 2 decimals
|
||||
wsprintfW(szBuf, L"%u%s%02u %s", uIntegral, szDecimalSeparator, uDecimals, szUnits);
|
||||
swprintf(szBuf, L"%u%s%02u %s", uIntegral, szDecimalSeparator, uDecimals, szUnits);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're dealing with MBs, don't show any decimals
|
||||
wsprintfW( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 );
|
||||
swprintf( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 );
|
||||
}
|
||||
|
||||
SetDlgItemTextW( hWnd, IDC_SHELL_ABOUT_PHYSMEM, szBuf);
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
#define __WINE_SHELL_MAIN_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
/*
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
|
@ -38,6 +40,7 @@
|
|||
#include "wine/windef16.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
*/
|
||||
/*******************************************
|
||||
* global SHELL32.DLL variables
|
||||
*/
|
||||
|
@ -162,24 +165,10 @@ void FreeChangeNotifications(void);
|
|||
BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI);
|
||||
BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir);
|
||||
|
||||
/* 16-bit functions */
|
||||
void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b);
|
||||
UINT16 WINAPI DragQueryFile16(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, WORD wLength);
|
||||
void WINAPI DragFinish16(HDROP16 h);
|
||||
BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p);
|
||||
HINSTANCE16 WINAPI ShellExecute16(HWND16,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT16);
|
||||
HICON16 WINAPI ExtractIcon16(HINSTANCE16,LPCSTR,UINT16);
|
||||
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16,LPSTR,LPWORD);
|
||||
HICON16 WINAPI ExtractIconEx16 ( LPCSTR, INT16, HICON16 *, HICON16 *, UINT16 );
|
||||
HINSTANCE16 WINAPI FindExecutable16(LPCSTR,LPCSTR,LPSTR);
|
||||
HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16,LPCSTR,UINT16,WORD);
|
||||
BOOL16 WINAPI ShellAbout16(HWND16,LPCSTR,LPCSTR,HICON16);
|
||||
BOOL16 WINAPI AboutDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
|
||||
|
||||
void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
|
||||
UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState);
|
||||
|
||||
static inline BOOL SHELL_OsIsUnicode(void)
|
||||
static BOOL __inline SHELL_OsIsUnicode(void)
|
||||
{
|
||||
/* if high-bit of version is 0, we are emulating NT */
|
||||
return !(GetVersion() & 0x80000000);
|
||||
|
@ -190,26 +179,26 @@ static inline BOOL SHELL_OsIsUnicode(void)
|
|||
SHFree(*ptr); \
|
||||
*ptr = NULL; \
|
||||
};
|
||||
static inline void __SHCloneStrA(char ** target,const char * source)
|
||||
static void __inline __SHCloneStrA(char ** target,const char * source)
|
||||
{
|
||||
*target = SHAlloc(strlen(source)+1);
|
||||
strcpy(*target, source);
|
||||
}
|
||||
|
||||
static inline void __SHCloneStrWtoA(char ** target, const WCHAR * source)
|
||||
static void __inline __SHCloneStrWtoA(char ** target, const WCHAR * source)
|
||||
{
|
||||
int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
|
||||
*target = SHAlloc(len);
|
||||
WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL);
|
||||
}
|
||||
|
||||
static inline void __SHCloneStrW(WCHAR ** target, const WCHAR * source)
|
||||
static void __inline __SHCloneStrW(WCHAR ** target, const WCHAR * source)
|
||||
{
|
||||
*target = SHAlloc( (lstrlenW(source)+1) * sizeof(WCHAR) );
|
||||
lstrcpyW(*target, source);
|
||||
}
|
||||
|
||||
static inline WCHAR * __SHCloneStrAtoW(WCHAR ** target, const char * source)
|
||||
static LPWSTR __inline __SHCloneStrAtoW(WCHAR ** target, const char * source)
|
||||
{
|
||||
int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
|
||||
*target = SHAlloc(len*sizeof(WCHAR));
|
||||
|
|
|
@ -37,6 +37,7 @@ DEFINE_GUID(IID_ISFHelper, 0x1fe68efbL, 0x1874, 0x9812, 0x56, 0xdc, 0x00, 0x00,
|
|||
/*****************************************************************************
|
||||
* ISFHelper interface
|
||||
*/
|
||||
#undef INTERFACE
|
||||
|
||||
#define INTERFACE ISFHelper
|
||||
DECLARE_INTERFACE_(ISFHelper,IUnknown)
|
||||
|
|
|
@ -32,38 +32,10 @@
|
|||
* in that string is parsed an stored.
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
#include "shlobj.h"
|
||||
#include "undocshell.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shlguid.h"
|
||||
#include "shlwapi.h"
|
||||
#include "msi.h"
|
||||
#include "appmgmt.h"
|
||||
#include "prsht.h"
|
||||
#include "initguid.h"
|
||||
#include "shresdef.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
DEFINE_GUID( SHELL32_AdvtShortcutProduct,
|
||||
0x9db1186f,0x40df,0x11d1,0xaa,0x8c,0x00,0xc0,0x4f,0xb6,0x78,0x63);
|
||||
DEFINE_GUID( SHELL32_AdvtShortcutComponent,
|
||||
0x9db1186e,0x40df,0x11d1,0xaa,0x8c,0x00,0xc0,0x4f,0xb6,0x78,0x63);
|
||||
|
||||
/* link file formats */
|
||||
|
||||
#include "pshpack1.h"
|
||||
|
@ -166,44 +138,44 @@ typedef struct
|
|||
BOOL bDirty;
|
||||
INT iIdOpen; /* id of the "Open" entry in the context menu */
|
||||
IUnknown *site;
|
||||
} IShellLinkImpl;
|
||||
} IShellLinkImpl, *LPIShellLinkImpl;
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IShellLinkW( IShellLinkW *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IShellLinkW( IShellLinkW *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblw));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IPersistFile( IPersistFile *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IPersistFile( IPersistFile *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPersistFile));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IPersistStream( IPersistStream *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IPersistStream( IPersistStream *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPersistStream));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IShellLinkDataList( IShellLinkDataList *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IShellLinkDataList( IShellLinkDataList *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblShellLinkDataList));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblShellExtInit));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IContextMenu( IContextMenu *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IContextMenu( IContextMenu *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblContextMenu));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IObjectWithSite( IObjectWithSite *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IObjectWithSite( IObjectWithSite *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblObjectWithSite));
|
||||
}
|
||||
|
||||
static inline IShellLinkImpl *impl_from_IShellPropSheetExt( IShellPropSheetExt *iface )
|
||||
static LPIShellLinkImpl __inline impl_from_IShellPropSheetExt( IShellPropSheetExt *iface )
|
||||
{
|
||||
return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPropSheetExt));
|
||||
}
|
||||
|
@ -212,7 +184,7 @@ static inline IShellLinkImpl *impl_from_IShellPropSheetExt( IShellPropSheetExt *
|
|||
static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWorkDir, LPWSTR* psPath);
|
||||
|
||||
/* strdup on the process heap */
|
||||
static inline LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str)
|
||||
static LPWSTR __inline HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str)
|
||||
{
|
||||
INT len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
|
||||
LPWSTR p = HeapAlloc( heap, flags, len*sizeof (WCHAR) );
|
||||
|
@ -222,13 +194,13 @@ static inline LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str)
|
|||
return p;
|
||||
}
|
||||
|
||||
static inline LPWSTR strdupW( LPCWSTR src )
|
||||
static LPWSTR __inline strdupW( LPCWSTR src )
|
||||
{
|
||||
LPWSTR dest;
|
||||
if (!src) return NULL;
|
||||
dest = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(src)+1)*sizeof(WCHAR) );
|
||||
dest = HeapAlloc( GetProcessHeap(), 0, (wcslen(src)+1)*sizeof(WCHAR) );
|
||||
if (dest)
|
||||
lstrcpyW(dest, src);
|
||||
wcscpy(dest, src);
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
@ -424,12 +396,12 @@ static BOOL StartLinkProcessor( LPCOLESTR szLink )
|
|||
PROCESS_INFORMATION pi;
|
||||
BOOL ret;
|
||||
|
||||
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR);
|
||||
len = sizeof(szFormat) + wcslen( szLink ) * sizeof(WCHAR);
|
||||
buffer = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
if( !buffer )
|
||||
return FALSE;
|
||||
|
||||
wsprintfW( buffer, szFormat, szLink );
|
||||
swprintf( buffer, szFormat, szLink );
|
||||
|
||||
TRACE("starting %s\n",debugstr_w(buffer));
|
||||
|
||||
|
@ -762,36 +734,36 @@ static HRESULT Stream_LoadAdvertiseInfo( IStream* stm, LPWSTR *str )
|
|||
|
||||
TRACE("%p\n",stm);
|
||||
|
||||
r = IStream_Read( stm, &buffer.dbh.cbSize, sizeof (DWORD), &count );
|
||||
r = IStream_Read( stm, &buffer.cbSize, sizeof (DWORD), &count );
|
||||
if( FAILED( r ) )
|
||||
return r;
|
||||
|
||||
/* make sure that we read the size of the structure even on error */
|
||||
size = sizeof buffer - sizeof (DWORD);
|
||||
if( buffer.dbh.cbSize != sizeof buffer )
|
||||
if( buffer.cbSize != sizeof buffer )
|
||||
{
|
||||
ERR("Ooops. This structure is not as expected...\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
r = IStream_Read( stm, &buffer.dbh.dwSignature, size, &count );
|
||||
r = IStream_Read( stm, &buffer.dwSignature, size, &count );
|
||||
if( FAILED( r ) )
|
||||
return r;
|
||||
|
||||
if( count != size )
|
||||
return E_FAIL;
|
||||
|
||||
TRACE("magic %08x string = %s\n", buffer.dbh.dwSignature, debugstr_w(buffer.szwDarwinID));
|
||||
TRACE("magic %08x string = %s\n", buffer.dwSignature, debugstr_w(buffer.szwDarwinID));
|
||||
|
||||
if( (buffer.dbh.dwSignature&0xffff0000) != 0xa0000000 )
|
||||
if( (buffer.dwSignature&0xffff0000) != 0xa0000000 )
|
||||
{
|
||||
ERR("Unknown magic number %08x in advertised shortcut\n", buffer.dbh.dwSignature);
|
||||
ERR("Unknown magic number %08x in advertised shortcut\n", buffer.dwSignature);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*str = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW(buffer.szwDarwinID)+1) * sizeof(WCHAR) );
|
||||
lstrcpyW( *str, buffer.szwDarwinID );
|
||||
(wcslen(buffer.szwDarwinID)+1) * sizeof(WCHAR) );
|
||||
wcscpy( *str, buffer.szwDarwinID );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -924,6 +896,7 @@ static HRESULT WINAPI IPersistStream_fnLoad(
|
|||
if( FAILED( r ) )
|
||||
goto end;
|
||||
|
||||
#if (NTDDI_VERSION < NTDDI_LONGHORN)
|
||||
if( hdr.dwFlags & SLDF_HAS_LOGO3ID )
|
||||
{
|
||||
r = Stream_LoadAdvertiseInfo( stm, &This->sProduct );
|
||||
|
@ -931,6 +904,7 @@ static HRESULT WINAPI IPersistStream_fnLoad(
|
|||
}
|
||||
if( FAILED( r ) )
|
||||
goto end;
|
||||
#endif
|
||||
|
||||
if( hdr.dwFlags & SLDF_HAS_DARWINID )
|
||||
{
|
||||
|
@ -970,7 +944,7 @@ end:
|
|||
*/
|
||||
static HRESULT Stream_WriteString( IStream* stm, LPCWSTR str )
|
||||
{
|
||||
USHORT len = lstrlenW( str ) + 1;
|
||||
USHORT len = wcslen( str ) + 1;
|
||||
DWORD count;
|
||||
HRESULT r;
|
||||
|
||||
|
@ -1057,8 +1031,8 @@ static EXP_DARWIN_LINK* shelllink_build_darwinid( LPCWSTR string, DWORD magic )
|
|||
EXP_DARWIN_LINK *buffer;
|
||||
|
||||
buffer = LocalAlloc( LMEM_ZEROINIT, sizeof *buffer );
|
||||
buffer->dbh.cbSize = sizeof *buffer;
|
||||
buffer->dbh.dwSignature = magic;
|
||||
buffer->cbSize = sizeof *buffer;
|
||||
buffer->dwSignature = magic;
|
||||
lstrcpynW( buffer->szwDarwinID, string, MAX_PATH );
|
||||
WideCharToMultiByte(CP_ACP, 0, string, -1, buffer->szDarwinID, MAX_PATH, NULL, NULL );
|
||||
|
||||
|
@ -1074,7 +1048,7 @@ static HRESULT Stream_WriteAdvertiseInfo( IStream* stm, LPCWSTR string, DWORD ma
|
|||
|
||||
buffer = shelllink_build_darwinid( string, magic );
|
||||
|
||||
return IStream_Write( stm, buffer, buffer->dbh.cbSize, &count );
|
||||
return IStream_Write( stm, buffer, buffer->cbSize, &count );
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -1116,8 +1090,10 @@ static HRESULT WINAPI IPersistStream_fnSave(
|
|||
header.dwFlags |= SLDF_HAS_ARGS;
|
||||
if( This->sIcoPath )
|
||||
header.dwFlags |= SLDF_HAS_ICONLOCATION;
|
||||
#if (NTDDI_VERSION < NTDDI_LONGHORN)
|
||||
if( This->sProduct )
|
||||
header.dwFlags |= SLDF_HAS_LOGO3ID;
|
||||
#endif
|
||||
if( This->sComponent )
|
||||
header.dwFlags |= SLDF_HAS_DARWINID;
|
||||
if( This->bRunAs )
|
||||
|
@ -1273,34 +1249,34 @@ static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWor
|
|||
GetFullPathNameW( path, MAX_PATH*2, buffer, &final );
|
||||
if( !final )
|
||||
final = buffer;
|
||||
lstrcpyW(final, sPathRel);
|
||||
wcscpy(final, sPathRel);
|
||||
|
||||
*abs_path = '\0';
|
||||
|
||||
if (SHELL_ExistsFileW(buffer)) {
|
||||
if (!GetFullPathNameW(buffer, MAX_PATH, abs_path, &final))
|
||||
lstrcpyW(abs_path, buffer);
|
||||
wcscpy(abs_path, buffer);
|
||||
} else {
|
||||
/* try if [working directory] + [relative path] finds an existing file */
|
||||
if (sWorkDir) {
|
||||
lstrcpyW(buffer, sWorkDir);
|
||||
lstrcpyW(PathAddBackslashW(buffer), sPathRel);
|
||||
wcscpy(buffer, sWorkDir);
|
||||
wcscpy(PathAddBackslashW(buffer), sPathRel);
|
||||
|
||||
if (SHELL_ExistsFileW(buffer))
|
||||
if (!GetFullPathNameW(buffer, MAX_PATH, abs_path, &final))
|
||||
lstrcpyW(abs_path, buffer);
|
||||
wcscpy(abs_path, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: This is even not enough - not all shell links can be resolved using this algorithm. */
|
||||
if (!*abs_path)
|
||||
lstrcpyW(abs_path, sPathRel);
|
||||
wcscpy(abs_path, sPathRel);
|
||||
|
||||
*psPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(abs_path)+1)*sizeof(WCHAR));
|
||||
*psPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(abs_path)+1)*sizeof(WCHAR));
|
||||
if (!*psPath)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
lstrcpyW(*psPath, abs_path);
|
||||
wcscpy(*psPath, abs_path);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
@ -1566,9 +1542,9 @@ static HRESULT SHELL_PidlGeticonLocationA(IShellFolder* psf, LPCITEMIDLIST pidl,
|
|||
hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, NULL, (LPVOID*)&pei);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = IExtractIconA_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL);
|
||||
hr = pei->lpVtbl->GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL);
|
||||
|
||||
IExtractIconA_Release(pei);
|
||||
pei->lpVtbl->Release(pei);
|
||||
}
|
||||
|
||||
IShellFolder_Release(psf);
|
||||
|
@ -1816,11 +1792,11 @@ static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR
|
|||
|
||||
HeapFree(GetProcessHeap(), 0, This->sDescription);
|
||||
This->sDescription = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( pszName )+1)*sizeof(WCHAR) );
|
||||
(wcslen( pszName )+1)*sizeof(WCHAR) );
|
||||
if ( !This->sDescription )
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
lstrcpyW( This->sDescription, pszName );
|
||||
wcscpy( This->sDescription, pszName );
|
||||
This->bDirty = TRUE;
|
||||
|
||||
return S_OK;
|
||||
|
@ -1848,10 +1824,10 @@ static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPC
|
|||
|
||||
HeapFree(GetProcessHeap(), 0, This->sWorkDir);
|
||||
This->sWorkDir = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( pszDir )+1)*sizeof (WCHAR) );
|
||||
(wcslen( pszDir )+1)*sizeof (WCHAR) );
|
||||
if ( !This->sWorkDir )
|
||||
return E_OUTOFMEMORY;
|
||||
lstrcpyW( This->sWorkDir, pszDir );
|
||||
wcscpy( This->sWorkDir, pszDir );
|
||||
This->bDirty = TRUE;
|
||||
|
||||
return S_OK;
|
||||
|
@ -1879,10 +1855,10 @@ static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR ps
|
|||
|
||||
HeapFree(GetProcessHeap(), 0, This->sArgs);
|
||||
This->sArgs = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( pszArgs )+1)*sizeof (WCHAR) );
|
||||
(wcslen( pszArgs )+1)*sizeof (WCHAR) );
|
||||
if ( !This->sArgs )
|
||||
return E_OUTOFMEMORY;
|
||||
lstrcpyW( This->sArgs, pszArgs );
|
||||
wcscpy( This->sArgs, pszArgs );
|
||||
This->bDirty = TRUE;
|
||||
|
||||
return S_OK;
|
||||
|
@ -1946,9 +1922,9 @@ static HRESULT SHELL_PidlGeticonLocationW(IShellFolder* psf, LPCITEMIDLIST pidl,
|
|||
hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW, NULL, (LPVOID*)&pei);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = IExtractIconW_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, &wFlags);
|
||||
hr = pei->lpVtbl->GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, &wFlags);
|
||||
|
||||
IExtractIconW_Release(pei);
|
||||
pei->lpVtbl->Release(pei);
|
||||
}
|
||||
|
||||
IShellFolder_Release(psf);
|
||||
|
@ -2016,10 +1992,10 @@ static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR
|
|||
|
||||
HeapFree(GetProcessHeap(), 0, This->sIcoPath);
|
||||
This->sIcoPath = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( pszIconPath )+1)*sizeof (WCHAR) );
|
||||
(wcslen( pszIconPath )+1)*sizeof (WCHAR) );
|
||||
if ( !This->sIcoPath )
|
||||
return E_OUTOFMEMORY;
|
||||
lstrcpyW( This->sIcoPath, pszIconPath );
|
||||
wcscpy( This->sIcoPath, pszIconPath );
|
||||
|
||||
This->iIcoNdx = iIcon;
|
||||
This->bDirty = TRUE;
|
||||
|
@ -2035,10 +2011,10 @@ static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR
|
|||
|
||||
HeapFree(GetProcessHeap(), 0, This->sPathRel);
|
||||
This->sPathRel = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( pszPathRel )+1) * sizeof (WCHAR) );
|
||||
(wcslen( pszPathRel )+1) * sizeof (WCHAR) );
|
||||
if ( !This->sPathRel )
|
||||
return E_OUTOFMEMORY;
|
||||
lstrcpyW( This->sPathRel, pszPathRel );
|
||||
wcscpy( This->sPathRel, pszPathRel );
|
||||
This->bDirty = TRUE;
|
||||
|
||||
return ShellLink_UpdatePath(This->sPathRel, This->sPath, This->sWorkDir, &This->sPath);
|
||||
|
@ -2061,11 +2037,11 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
|
|||
bSuccess = SHGetPathFromIDListW(This->pPidl, buffer);
|
||||
|
||||
if (bSuccess && *buffer) {
|
||||
This->sPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
|
||||
This->sPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(buffer)+1)*sizeof(WCHAR));
|
||||
if (!This->sPath)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
lstrcpyW(This->sPath, buffer);
|
||||
wcscpy(This->sPath, buffer);
|
||||
|
||||
This->bDirty = TRUE;
|
||||
} else
|
||||
|
@ -2073,11 +2049,11 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
|
|||
}
|
||||
|
||||
if (!This->sIcoPath && This->sPath) {
|
||||
This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
|
||||
This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(This->sPath)+1)*sizeof(WCHAR));
|
||||
if (!This->sIcoPath)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
lstrcpyW(This->sIcoPath, This->sPath);
|
||||
wcscpy(This->sIcoPath, This->sPath);
|
||||
This->iIcoNdx = 0;
|
||||
|
||||
This->bDirty = TRUE;
|
||||
|
@ -2095,7 +2071,7 @@ static LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str)
|
|||
if( !str )
|
||||
return NULL;
|
||||
|
||||
p = strchrW( str, ':' );
|
||||
p = wcschr( str, ':' );
|
||||
if( !p )
|
||||
return NULL;
|
||||
len = p - str;
|
||||
|
@ -2127,7 +2103,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str)
|
|||
str += 2;
|
||||
|
||||
/* there must be a colon straight after a guid */
|
||||
p = strchrW( str, ':' );
|
||||
p = wcschr( str, ':' );
|
||||
if( !p )
|
||||
return E_FAIL;
|
||||
len = p - str;
|
||||
|
@ -2151,7 +2127,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str)
|
|||
return E_FAIL;
|
||||
|
||||
/* skip to the next field */
|
||||
str = strchrW( str, ':' );
|
||||
str = wcschr( str, ':' );
|
||||
if( !str )
|
||||
return E_FAIL;
|
||||
}
|
||||
|
@ -2194,7 +2170,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
|
|||
TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
|
||||
|
||||
/* quotes at the ends of the string are stripped */
|
||||
len = lstrlenW(pszFile);
|
||||
len = wcslen(pszFile);
|
||||
if (pszFile[0] == '"' && pszFile[len-1] == '"')
|
||||
{
|
||||
unquoted = strdupW(pszFile);
|
||||
|
@ -2203,7 +2179,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
|
|||
}
|
||||
|
||||
/* any other quote marks are invalid */
|
||||
if (strchrW(pszFile, '"'))
|
||||
if (wcschr(pszFile, '"'))
|
||||
return S_FALSE;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->sPath);
|
||||
|
@ -2230,11 +2206,11 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
|
|||
ShellLink_GetVolumeInfo(buffer, &This->volume);
|
||||
|
||||
This->sPath = HeapAlloc( GetProcessHeap(), 0,
|
||||
(lstrlenW( buffer )+1) * sizeof (WCHAR) );
|
||||
(wcslen( buffer )+1) * sizeof (WCHAR) );
|
||||
if (!This->sPath)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
lstrcpyW(This->sPath, buffer);
|
||||
wcscpy(This->sPath, buffer);
|
||||
}
|
||||
This->bDirty = TRUE;
|
||||
HeapFree(GetProcessHeap(), 0, unquoted);
|
||||
|
@ -2352,8 +2328,10 @@ ShellLink_GetFlags( IShellLinkDataList* iface, DWORD* pdwFlags )
|
|||
flags |= SLDF_HAS_DARWINID;
|
||||
if (This->sIcoPath)
|
||||
flags |= SLDF_HAS_ICONLOCATION;
|
||||
#if (NTDDI_VERSION < NTDDI_LONGHORN)
|
||||
if (This->sProduct)
|
||||
flags |= SLDF_HAS_LOGO3ID;
|
||||
#endif
|
||||
if (This->pPidl)
|
||||
flags |= SLDF_HAS_ID_LIST;
|
||||
|
||||
|
@ -2506,7 +2484,7 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
|
|||
mii.cbSize = sizeof (mii);
|
||||
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
|
||||
mii.dwTypeData = (LPWSTR)szOpen;
|
||||
mii.cch = strlenW( mii.dwTypeData );
|
||||
mii.cch = wcslen( mii.dwTypeData );
|
||||
mii.wID = idCmdFirst + id++;
|
||||
mii.fState = MFS_DEFAULT | MFS_ENABLED;
|
||||
mii.fType = MFT_STRING;
|
||||
|
@ -2823,19 +2801,19 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
|
|||
DWORD len = 2;
|
||||
|
||||
if ( This->sArgs )
|
||||
len += lstrlenW( This->sArgs );
|
||||
len += wcslen( This->sArgs );
|
||||
if ( iciex->lpParametersW )
|
||||
len += lstrlenW( iciex->lpParametersW );
|
||||
len += wcslen( iciex->lpParametersW );
|
||||
|
||||
args = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
|
||||
args[0] = 0;
|
||||
if ( This->sArgs )
|
||||
lstrcatW( args, This->sArgs );
|
||||
wcscat( args, This->sArgs );
|
||||
if ( iciex->lpParametersW )
|
||||
{
|
||||
static const WCHAR space[] = { ' ', 0 };
|
||||
lstrcatW( args, space );
|
||||
lstrcatW( args, iciex->lpParametersW );
|
||||
wcscat( args, space );
|
||||
wcscat( args, iciex->lpParametersW );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,31 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "shellapi.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include "shlguid.h"
|
||||
#include "winreg.h"
|
||||
#include "winerror.h"
|
||||
|
||||
#include "undocshell.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "shlwapi.h"
|
||||
#include "debughlp.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -51,6 +27,7 @@ extern HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, L
|
|||
|
||||
static const WCHAR sShell32[12] = {'S','H','E','L','L','3','2','.','D','L','L','\0'};
|
||||
static const GUID dummy1 = {0xD969A300, 0xE7FF, 0x11d0, {0xA9, 0x3B, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19} };
|
||||
|
||||
/**************************************************************************
|
||||
* Default ClassFactory types
|
||||
*/
|
||||
|
@ -98,7 +75,7 @@ DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
|
|||
'2','x','%','0','2','x','%','0','2','x',
|
||||
'}','\0'};
|
||||
|
||||
return wsprintfW ( str, sFormat,
|
||||
return swprintf ( str, sFormat,
|
||||
guid->Data1, guid->Data2, guid->Data3,
|
||||
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
|
||||
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
|
||||
|
@ -129,7 +106,7 @@ HRESULT WINAPI SHCoCreateInstance(
|
|||
LPVOID *ppv)
|
||||
{
|
||||
DWORD hres;
|
||||
IID iid;
|
||||
CLSID iid;
|
||||
const CLSID * myclsid = clsid;
|
||||
WCHAR sKeyName[MAX_PATH];
|
||||
const WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'};
|
||||
|
@ -150,7 +127,7 @@ HRESULT WINAPI SHCoCreateInstance(
|
|||
if (!clsid)
|
||||
{
|
||||
if (!aclsid) return REGDB_E_CLASSNOTREG;
|
||||
SHCLSIDFromStringW(aclsid, &iid);
|
||||
CLSIDFromString((LPOLESTR)aclsid, &iid);
|
||||
myclsid = &iid;
|
||||
}
|
||||
|
||||
|
@ -159,9 +136,9 @@ HRESULT WINAPI SHCoCreateInstance(
|
|||
|
||||
/* we look up the dll path in the registry */
|
||||
__SHGUIDToStringW(myclsid, sClassID);
|
||||
lstrcpyW(sKeyName, sCLSID);
|
||||
lstrcatW(sKeyName, sClassID);
|
||||
lstrcatW(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);
|
||||
|
@ -685,7 +662,7 @@ UINT WINAPI DragQueryFileW(
|
|||
}
|
||||
}
|
||||
|
||||
i = strlenW(lpwDrop);
|
||||
i = wcslen(lpwDrop);
|
||||
if ( !lpszwFile) goto end; /* needed buffer size */
|
||||
lstrcpynW (lpszwFile, lpwDrop, lLength);
|
||||
end:
|
||||
|
|
|
@ -172,26 +172,26 @@ DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
|
|||
*/
|
||||
BOOL WINAPI GetFileNameFromBrowse(
|
||||
HWND hwndOwner,
|
||||
LPSTR lpstrFile,
|
||||
DWORD nMaxFile,
|
||||
LPCSTR lpstrInitialDir,
|
||||
LPCSTR lpstrDefExt,
|
||||
LPCSTR lpstrFilter,
|
||||
LPCSTR lpstrTitle)
|
||||
LPWSTR lpstrFile,
|
||||
UINT nMaxFile,
|
||||
LPCWSTR lpstrInitialDir,
|
||||
LPCWSTR lpstrDefExt,
|
||||
LPCWSTR lpstrFilter,
|
||||
LPCWSTR lpstrTitle)
|
||||
{
|
||||
HMODULE hmodule;
|
||||
FARPROC pGetOpenFileNameA;
|
||||
OPENFILENAMEA ofn;
|
||||
FARPROC pGetOpenFileNameW;
|
||||
OPENFILENAMEW ofn;
|
||||
BOOL ret;
|
||||
|
||||
TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
|
||||
hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
|
||||
hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt,
|
||||
lpstrFilter, lpstrTitle);
|
||||
|
||||
hmodule = LoadLibraryA("comdlg32.dll");
|
||||
hmodule = LoadLibraryW(L"comdlg32.dll");
|
||||
if(!hmodule) return FALSE;
|
||||
pGetOpenFileNameA = GetProcAddress(hmodule, "GetOpenFileNameA");
|
||||
if(!pGetOpenFileNameA)
|
||||
pGetOpenFileNameW = GetProcAddress(hmodule, "GetOpenFileNameW");
|
||||
if(!pGetOpenFileNameW)
|
||||
{
|
||||
FreeLibrary(hmodule);
|
||||
return FALSE;
|
||||
|
@ -208,7 +208,7 @@ BOOL WINAPI GetFileNameFromBrowse(
|
|||
ofn.lpstrTitle = lpstrTitle;
|
||||
ofn.lpstrDefExt = lpstrDefExt;
|
||||
ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST;
|
||||
ret = pGetOpenFileNameA(&ofn);
|
||||
ret = pGetOpenFileNameW(&ofn);
|
||||
|
||||
FreeLibrary(hmodule);
|
||||
return ret;
|
||||
|
@ -532,9 +532,9 @@ WORD WINAPI ArrangeWindows(
|
|||
* exported by ordinal
|
||||
*/
|
||||
DWORD WINAPI
|
||||
SignalFileOpen (DWORD dwParam1)
|
||||
SignalFileOpen (LPCITEMIDLIST pidl)
|
||||
{
|
||||
FIXME("(0x%08x):stub.\n", dwParam1);
|
||||
FIXME("(0x%08x):stub.\n", pidl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1048,8 +1048,9 @@ HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
|
|||
* SHRunControlPanel [SHELL32.161]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
|
||||
{ FIXME("0x%08x 0x%08x stub\n",x,z);
|
||||
HRESULT WINAPI SHRunControlPanel (LPCWSTR lpcszCmdLine, HWND hwndMsgParent)
|
||||
{
|
||||
FIXME("0x%08x 0x%08x stub\n",lpcszCmdLine,hwndMsgParent);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1103,7 +1104,7 @@ void WINAPI SHFreeUnusedLibraries (void)
|
|||
* DAD_AutoScroll [SHELL32.129]
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, LPPOINT pt)
|
||||
BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT * pt)
|
||||
{
|
||||
FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
|
||||
return 0;
|
||||
|
@ -1121,7 +1122,7 @@ BOOL WINAPI DAD_DragEnter(HWND hwnd)
|
|||
* DAD_DragEnterEx [SHELL32.131]
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p)
|
||||
BOOL WINAPI DAD_DragEnterEx(HWND hwnd, const POINT p)
|
||||
{
|
||||
FIXME("hwnd = %p (%d,%d)\n",hwnd,p.x,p.y);
|
||||
return FALSE;
|
||||
|
@ -1411,9 +1412,11 @@ HRESULT WINAPI SHLoadOLE(LPARAM lParam)
|
|||
* DriveType [SHELL32.64]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI DriveType(DWORD u)
|
||||
{ FIXME("0x%04x stub\n",u);
|
||||
return 0;
|
||||
HRESULT WINAPI DriveType(int DriveType)
|
||||
{
|
||||
WCHAR root[] = L"A:\\";
|
||||
root[0] = L'A' + DriveType;
|
||||
return GetDriveTypeW(root);
|
||||
}
|
||||
/*************************************************************************
|
||||
* InvalidateDriveType [SHELL32.65]
|
||||
|
@ -1494,9 +1497,9 @@ DWORD WINAPI RLBuildListOfPaths (void)
|
|||
* SHValidateUNC [SHELL32.173]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
|
||||
HRESULT WINAPI SHValidateUNC (HWND hwndOwner, LPWSTR pszFile, UINT fConnect)
|
||||
{
|
||||
FIXME("0x%08x 0x%08x 0x%08x stub\n",x,y,z);
|
||||
FIXME("0x%08x 0x%08x 0x%08x stub\n",hwndOwner,pszFile,fConnect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1701,14 +1704,14 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_
|
|||
break;
|
||||
}
|
||||
szHandler[(sizeof(szHandler) / sizeof(szHandler[0])) - 1] = 0;
|
||||
hr = SHCLSIDFromStringW(szHandler, &clsid);
|
||||
hr = CLSIDFromString(szHandler, &clsid);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
dwClsidSize = sizeof(szClsidHandler);
|
||||
if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS)
|
||||
{
|
||||
szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0;
|
||||
hr = SHCLSIDFromStringW(szClsidHandler, &clsid);
|
||||
hr = CLSIDFromString(szClsidHandler, &clsid);
|
||||
}
|
||||
}
|
||||
if (SUCCEEDED(hr))
|
||||
|
@ -1846,7 +1849,7 @@ HRESULT WINAPI CIDLData_CreateFromIDArray(
|
|||
*
|
||||
*/
|
||||
HRESULT WINAPI SHCreateStdEnumFmtEtc(
|
||||
DWORD cFormats,
|
||||
UINT cFormats,
|
||||
const FORMATETC *lpFormats,
|
||||
LPENUMFORMATETC *ppenumFormatetc)
|
||||
{
|
||||
|
@ -2103,7 +2106,7 @@ HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryR
|
|||
/*************************************************************************
|
||||
* SHSetLocalizedName (SHELL32.@)
|
||||
*/
|
||||
HRESULT WINAPI SHSetLocalizedName(LPWSTR pszPath, LPCWSTR pszResModule, int idsRes)
|
||||
HRESULT WINAPI SHSetLocalizedName(LPCWSTR pszPath, LPCWSTR pszResModule, int idsRes)
|
||||
{
|
||||
FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
|
||||
|
||||
|
|
|
@ -24,29 +24,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#define symlink(A, B)
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "wine/debug.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "shlobj.h"
|
||||
#include "shresdef.h"
|
||||
#include "shell32_main.h"
|
||||
#include "undocshell.h"
|
||||
#include "pidl.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "shlwapi.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -264,7 +242,7 @@ static void PathGetShortPathW(LPWSTR pszPath)
|
|||
|
||||
if (GetShortPathNameW(pszPath, path, MAX_PATH))
|
||||
{
|
||||
lstrcpyW(pszPath, path);
|
||||
wcscpy(pszPath, path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -576,7 +554,7 @@ int WINAPI PathCleanupSpec( LPCWSTR lpszPathW, LPWSTR lpszFileW )
|
|||
TRACE("Cleanup %s\n",debugstr_w(lpszFileW));
|
||||
|
||||
if (lpszPathW)
|
||||
length = strlenW(lpszPathW);
|
||||
length = wcslen(lpszPathW);
|
||||
|
||||
while (*p)
|
||||
{
|
||||
|
@ -727,8 +705,8 @@ LONG WINAPI PathProcessCommandW (
|
|||
FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n",
|
||||
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
|
||||
if(!lpszPath) return -1;
|
||||
if(lpszBuff) strcpyW(lpszBuff, lpszPath);
|
||||
return strlenW(lpszPath);
|
||||
if(lpszBuff) wcscpy(lpszBuff, lpszPath);
|
||||
return wcslen(lpszPath);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1173,13 +1151,13 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
|
|||
|
||||
if (userPrefix)
|
||||
{
|
||||
strcpyW(shellFolderPath, userPrefix);
|
||||
wcscpy(shellFolderPath, userPrefix);
|
||||
PathAddBackslashW(shellFolderPath);
|
||||
strcatW(shellFolderPath, szSHFolders);
|
||||
wcscat(shellFolderPath, szSHFolders);
|
||||
pShellFolderPath = shellFolderPath;
|
||||
strcpyW(userShellFolderPath, userPrefix);
|
||||
wcscpy(userShellFolderPath, userPrefix);
|
||||
PathAddBackslashW(userShellFolderPath);
|
||||
strcatW(userShellFolderPath, szSHUserFolders);
|
||||
wcscat(userShellFolderPath, szSHUserFolders);
|
||||
pUserShellFolderPath = userShellFolderPath;
|
||||
}
|
||||
else
|
||||
|
@ -1217,7 +1195,7 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
|
|||
lstrcpynW(path, szTemp, MAX_PATH);
|
||||
}
|
||||
ret = RegSetValueExW(shellFolderKey, value, 0, REG_SZ, (LPBYTE)path,
|
||||
(strlenW(path) + 1) * sizeof(WCHAR));
|
||||
(wcslen(path) + 1) * sizeof(WCHAR));
|
||||
if (ret != ERROR_SUCCESS)
|
||||
hr = HRESULT_FROM_WIN32(ret);
|
||||
else
|
||||
|
@ -1284,13 +1262,13 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
|
|||
switch (CSIDL_Data[folder].type)
|
||||
{
|
||||
case CSIDL_Type_User:
|
||||
strcpyW(pszPath, UserProfileW);
|
||||
wcscpy(pszPath, UserProfileW);
|
||||
break;
|
||||
case CSIDL_Type_AllUsers:
|
||||
strcpyW(pszPath, AllUsersProfileW);
|
||||
wcscpy(pszPath, AllUsersProfileW);
|
||||
break;
|
||||
case CSIDL_Type_CurrVer:
|
||||
strcpyW(pszPath, SystemDriveW);
|
||||
wcscpy(pszPath, SystemDriveW);
|
||||
break;
|
||||
default:
|
||||
; /* no corresponding env. var, do nothing */
|
||||
|
@ -1298,7 +1276,7 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
|
|||
if (pDefaultPath)
|
||||
{
|
||||
PathAddBackslashW(pszPath);
|
||||
strcatW(pszPath, pDefaultPath);
|
||||
wcscat(pszPath, pDefaultPath);
|
||||
}
|
||||
}
|
||||
TRACE("returning 0x%08x\n", hr);
|
||||
|
@ -1346,7 +1324,7 @@ static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder,
|
|||
hr = _SHGetDefaultValue(folder, pszPath);
|
||||
dwType = REG_EXPAND_SZ;
|
||||
RegSetValueExW(hKey, CSIDL_Data[folder].szValueName, 0, dwType,
|
||||
(LPBYTE)pszPath, (strlenW(pszPath)+1)*sizeof(WCHAR));
|
||||
(LPBYTE)pszPath, (wcslen(pszPath)+1)*sizeof(WCHAR));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1495,7 +1473,7 @@ static HRESULT _SHGetProfilesValue(HKEY profilesKey, LPCWSTR szValueName,
|
|||
debugstr_w(szValue));
|
||||
lRet = RegSetValueExW(profilesKey, szValueName, 0, REG_EXPAND_SZ,
|
||||
(LPBYTE)szValue,
|
||||
(strlenW(szValue) + 1) * sizeof(WCHAR));
|
||||
(wcslen(szValue) + 1) * sizeof(WCHAR));
|
||||
if (lRet)
|
||||
hr = HRESULT_FROM_WIN32(lRet);
|
||||
else
|
||||
|
@ -1530,7 +1508,7 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
|
|||
/* short-circuit if there's nothing to expand */
|
||||
if (szSrc[0] != '%')
|
||||
{
|
||||
strcpyW(szDest, szSrc);
|
||||
wcscpy(szDest, szSrc);
|
||||
hr = S_OK;
|
||||
goto end;
|
||||
}
|
||||
|
@ -1548,30 +1526,30 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
|
|||
}
|
||||
|
||||
*szDest = 0;
|
||||
strcpyW(szTemp, szSrc);
|
||||
wcscpy(szTemp, szSrc);
|
||||
while (SUCCEEDED(hr) && szTemp[0] == '%')
|
||||
{
|
||||
if (!strncmpiW(szTemp, AllUsersProfileW, strlenW(AllUsersProfileW)))
|
||||
if (!strncmpiW(szTemp, AllUsersProfileW, wcslen(AllUsersProfileW)))
|
||||
{
|
||||
WCHAR szAllUsers[MAX_PATH];
|
||||
|
||||
strcpyW(szDest, szProfilesPrefix);
|
||||
wcscpy(szDest, szProfilesPrefix);
|
||||
hr = _SHGetProfilesValue(key, AllUsersProfileValueW,
|
||||
szAllUsers, AllUsersW);
|
||||
PathAppendW(szDest, szAllUsers);
|
||||
PathAppendW(szDest, szTemp + strlenW(AllUsersProfileW));
|
||||
PathAppendW(szDest, szTemp + wcslen(AllUsersProfileW));
|
||||
}
|
||||
else if (!strncmpiW(szTemp, UserProfileW, strlenW(UserProfileW)))
|
||||
else if (!strncmpiW(szTemp, UserProfileW, wcslen(UserProfileW)))
|
||||
{
|
||||
WCHAR userName[MAX_PATH];
|
||||
DWORD userLen = MAX_PATH;
|
||||
|
||||
strcpyW(szDest, szProfilesPrefix);
|
||||
wcscpy(szDest, szProfilesPrefix);
|
||||
GetUserNameW(userName, &userLen);
|
||||
PathAppendW(szDest, userName);
|
||||
PathAppendW(szDest, szTemp + strlenW(UserProfileW));
|
||||
PathAppendW(szDest, szTemp + wcslen(UserProfileW));
|
||||
}
|
||||
else if (!strncmpiW(szTemp, SystemDriveW, strlenW(SystemDriveW)))
|
||||
else if (!strncmpiW(szTemp, SystemDriveW, wcslen(SystemDriveW)))
|
||||
{
|
||||
GetSystemDirectoryW(szDest, MAX_PATH);
|
||||
if (szDest[1] != ':')
|
||||
|
@ -1581,7 +1559,7 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
|
|||
}
|
||||
else
|
||||
{
|
||||
strcpyW(szDest + 3, szTemp + strlenW(SystemDriveW) + 1);
|
||||
wcscpy(szDest + 3, szTemp + wcslen(SystemDriveW) + 1);
|
||||
hr = S_OK;
|
||||
}
|
||||
}
|
||||
|
@ -1597,7 +1575,7 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
|
|||
hr = S_OK;
|
||||
}
|
||||
if (SUCCEEDED(hr) && szDest[0] == '%')
|
||||
strcpyW(szTemp, szDest);
|
||||
wcscpy(szTemp, szDest);
|
||||
else
|
||||
{
|
||||
/* terminate loop */
|
||||
|
@ -1703,7 +1681,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
|
|||
{
|
||||
HRESULT hr;
|
||||
WCHAR szBuildPath[MAX_PATH], szTemp[MAX_PATH];
|
||||
DWORD folder = nFolder & CSIDL_FOLDER_MASK;
|
||||
DWORD folder = nFolder & CSIDL_FOLDER_MASK; //FIXME
|
||||
CSIDL_Type type;
|
||||
int ret;
|
||||
|
||||
|
@ -1736,7 +1714,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
|
|||
*CSIDL_Data[folder].szDefaultPath)
|
||||
{
|
||||
PathAddBackslashW(szTemp);
|
||||
strcatW(szTemp, CSIDL_Data[folder].szDefaultPath);
|
||||
wcscat(szTemp, CSIDL_Data[folder].szDefaultPath);
|
||||
}
|
||||
hr = S_OK;
|
||||
break;
|
||||
|
@ -1747,7 +1725,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
|
|||
*CSIDL_Data[folder].szDefaultPath)
|
||||
{
|
||||
PathAddBackslashW(szTemp);
|
||||
strcatW(szTemp, CSIDL_Data[folder].szDefaultPath);
|
||||
wcscat(szTemp, CSIDL_Data[folder].szDefaultPath);
|
||||
}
|
||||
hr = S_OK;
|
||||
break;
|
||||
|
@ -1770,14 +1748,14 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
|
|||
if (*szTemp == '%')
|
||||
hr = _SHExpandEnvironmentStrings(szTemp, szBuildPath);
|
||||
else
|
||||
strcpyW(szBuildPath, szTemp);
|
||||
wcscpy(szBuildPath, szTemp);
|
||||
|
||||
if (FAILED(hr)) goto end;
|
||||
|
||||
if(pszSubPath) {
|
||||
/* make sure the new path does not exceed th bufferlength
|
||||
* rememebr to backslash and the termination */
|
||||
if(MAX_PATH < (lstrlenW(szBuildPath) + lstrlenW(pszSubPath) + 2)) {
|
||||
if(MAX_PATH < (wcslen(szBuildPath) + wcslen(pszSubPath) + 2)) {
|
||||
hr = HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE);
|
||||
goto end;
|
||||
}
|
||||
|
@ -1786,7 +1764,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW(
|
|||
}
|
||||
/* Copy the path if it's available before we might return */
|
||||
if (SUCCEEDED(hr) && pszPath)
|
||||
strcpyW(pszPath, szBuildPath);
|
||||
wcscpy(pszPath, szBuildPath);
|
||||
|
||||
/* if we don't care about existing directories we are ready */
|
||||
if(nFolder & CSIDL_FLAG_DONT_VERIFY) goto end;
|
||||
|
@ -1898,7 +1876,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken,
|
|||
{
|
||||
ret = RegSetValueExW(hUserKey,
|
||||
CSIDL_Data[folders[i]].szValueName, 0, REG_EXPAND_SZ,
|
||||
(LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR));
|
||||
(LPBYTE)path, (wcslen(path) + 1) * sizeof(WCHAR));
|
||||
if (ret)
|
||||
hr = HRESULT_FROM_WIN32(ret);
|
||||
else
|
||||
|
@ -1907,7 +1885,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken,
|
|||
hToken, SHGFP_TYPE_DEFAULT, path);
|
||||
ret = RegSetValueExW(hKey,
|
||||
CSIDL_Data[folders[i]].szValueName, 0, REG_SZ,
|
||||
(LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR));
|
||||
(LPBYTE)path, (wcslen(path) + 1) * sizeof(WCHAR));
|
||||
if (ret)
|
||||
hr = HRESULT_FROM_WIN32(ret);
|
||||
}
|
||||
|
@ -1958,13 +1936,13 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
|
|||
{
|
||||
hToken = (HANDLE)-1;
|
||||
hRootKey = HKEY_USERS;
|
||||
strcpyW(userShellFolderPath, DefaultW);
|
||||
wcscpy(userShellFolderPath, DefaultW);
|
||||
PathAddBackslashW(userShellFolderPath);
|
||||
strcatW(userShellFolderPath, szSHUserFolders);
|
||||
wcscat(userShellFolderPath, szSHUserFolders);
|
||||
pUserShellFolderPath = userShellFolderPath;
|
||||
strcpyW(shellFolderPath, DefaultW);
|
||||
wcscpy(shellFolderPath, DefaultW);
|
||||
PathAddBackslashW(shellFolderPath);
|
||||
strcatW(shellFolderPath, szSHFolders);
|
||||
wcscat(shellFolderPath, szSHFolders);
|
||||
pShellFolderPath = shellFolderPath;
|
||||
}
|
||||
else
|
||||
|
@ -2017,7 +1995,7 @@ static HRESULT _SHRegisterCommonShellFolders(void)
|
|||
* Success: TRUE,
|
||||
* Failure: FALSE
|
||||
*/
|
||||
static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) {
|
||||
static BOOL __inline _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) {
|
||||
WCHAR wszSubPath[MAX_PATH];
|
||||
int cLen = strlen(szBasePath);
|
||||
char *pBackslash;
|
||||
|
@ -2027,16 +2005,16 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) {
|
|||
/* Fall back to hard coded defaults. */
|
||||
switch (LOWORD(pwszSubPath)) {
|
||||
case IDS_PERSONAL:
|
||||
lstrcpyW(wszSubPath, PersonalW);
|
||||
wcscpy(wszSubPath, PersonalW);
|
||||
break;
|
||||
case IDS_MYMUSIC:
|
||||
lstrcpyW(wszSubPath, My_MusicW);
|
||||
wcscpy(wszSubPath, My_MusicW);
|
||||
break;
|
||||
case IDS_MYPICTURES:
|
||||
lstrcpyW(wszSubPath, My_PicturesW);
|
||||
wcscpy(wszSubPath, My_PicturesW);
|
||||
break;
|
||||
case IDS_MYVIDEO:
|
||||
lstrcpyW(wszSubPath, My_VideoW);
|
||||
wcscpy(wszSubPath, My_VideoW);
|
||||
break;
|
||||
default:
|
||||
ERR("LoadString(%d) failed!\n", LOWORD(pwszSubPath));
|
||||
|
@ -2044,7 +2022,7 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
lstrcpyW(wszSubPath, pwszSubPath);
|
||||
wcscpy(wszSubPath, pwszSubPath);
|
||||
}
|
||||
|
||||
if (szBasePath[cLen-1] != '/') szBasePath[cLen++] = '/';
|
||||
|
|
|
@ -18,24 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "shellapi.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "undocshell.h"
|
||||
#include "wine/winbase16.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
|
|
@ -16,27 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "shlobj.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shell32_main.h"
|
||||
#include "undocshell.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -153,8 +133,8 @@ int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
|
|||
TRACE("(%p, %p %s)\n",
|
||||
lpWideCharStr, lpWString, debugstr_w(lpWString));
|
||||
|
||||
strcpyW (lpWideCharStr, lpWString );
|
||||
return strlenW(lpWideCharStr);
|
||||
wcscpy (lpWideCharStr, lpWString );
|
||||
return wcslen(lpWideCharStr);
|
||||
}
|
||||
|
||||
BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
|
||||
|
@ -179,7 +159,7 @@ BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
|
|||
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
|
||||
|
||||
if (lstrcpynW (lpWide, lpStrW, nWide))
|
||||
{ return lstrlenW (lpWide);
|
||||
{ return wcslen (lpWide);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -205,7 +185,7 @@ BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
|
|||
TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
|
||||
|
||||
if (lstrcpynW ( lpwStr, lpOle, nwStr))
|
||||
{ return lstrlenW (lpwStr);
|
||||
{ return wcslen (lpwStr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -264,7 +244,7 @@ DWORD WINAPI CheckEscapesW(
|
|||
LPWSTR string,
|
||||
DWORD len)
|
||||
{
|
||||
DWORD size = lstrlenW(string);
|
||||
DWORD size = wcslen(string);
|
||||
LPWSTR s, d;
|
||||
|
||||
TRACE("(%s %d) stub\n", debugstr_w(string), len);
|
||||
|
|
|
@ -48,7 +48,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
|
|||
HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
||||
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path);
|
||||
|
||||
static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
|
||||
static int __inline SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
|
||||
{
|
||||
return sprintf(str, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
guid->Data1, guid->Data2, guid->Data3,
|
||||
|
@ -56,14 +56,14 @@ static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
|
|||
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
|
||||
}
|
||||
|
||||
static inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
|
||||
static int __inline SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
|
||||
{
|
||||
static const WCHAR fmtW[] =
|
||||
{ '{','%','0','8','l','x','-','%','0','4','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 };
|
||||
return sprintfW(str, fmtW,
|
||||
return swprintf(str, fmtW,
|
||||
guid->Data1, guid->Data2, guid->Data3,
|
||||
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
|
||||
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
|
||||
|
@ -71,6 +71,3 @@ static inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
|
|||
|
||||
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags);
|
||||
BOOL SHELL_FS_HideExtension(LPWSTR pwszPath);
|
||||
|
||||
DEFINE_GUID( CLSID_UnixFolder, 0xcc702eb2, 0x7dc5, 0x11d9, 0xc6, 0x87, 0x00, 0x04, 0x23, 0x8a, 0x01, 0xcd );
|
||||
DEFINE_GUID( CLSID_UnixDosFolder, 0x9d20aae8, 0x0625, 0x44b0, 0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9 );
|
||||
|
|
|
@ -18,43 +18,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winspool.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "enumidlist.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shellfolder.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include "shresdef.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
||||
/* List shortcuts of
|
||||
* CSIDL_COMMON_ADMINTOOLS
|
||||
* Note: CSIDL_ADMINTOOLS is ignored, tested with Window XP SP3+
|
||||
|
@ -455,7 +423,7 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
{
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
|
||||
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
|
||||
strcpyW(pszPath, This->szTarget);
|
||||
wcscpy(pszPath, This->szTarget);
|
||||
else
|
||||
HCR_GetClassNameW(&CLSID_AdminFolderShortcut, pszPath, MAX_PATH);
|
||||
}
|
||||
|
@ -488,9 +456,9 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
{
|
||||
int len = 0;
|
||||
|
||||
strcpyW(pszPath, This->szTarget);
|
||||
wcscpy(pszPath, This->szTarget);
|
||||
PathAddBackslashW(pszPath);
|
||||
len = lstrlenW(pszPath);
|
||||
len = wcslen(pszPath);
|
||||
|
||||
if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags | SHGDN_INFOLDER, pszPath + len, MAX_PATH + 1 - len)))
|
||||
{
|
||||
|
|
|
@ -20,38 +20,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "enumidlist.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shellfolder.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
@ -71,7 +40,7 @@ typedef struct {
|
|||
|
||||
UINT cfShellIDList; /* clipboardformat for IDropTarget */
|
||||
BOOL fAcceptFmt; /* flag for pending Drop */
|
||||
} IGenericSFImpl;
|
||||
} IGenericSFImpl, *LPIGenericSFImpl;
|
||||
|
||||
WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls);
|
||||
int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll);
|
||||
|
@ -128,7 +97,7 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
|
|||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static inline IGenericSFImpl *impl_from_ISFHelper( ISFHelper *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_ISFHelper( ISFHelper *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper));
|
||||
}
|
||||
|
@ -177,7 +146,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
|
|||
{
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
TRACE ("-- element: %s\n", debugstr_w (szElement));
|
||||
SHCLSIDFromStringW (szElement + 2, &clsid);
|
||||
CLSIDFromString (szElement + 2, &clsid);
|
||||
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
|
||||
}
|
||||
else if (PathGetDriveNumberW (lpszDisplayName) >= 0)
|
||||
|
@ -680,7 +649,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
{
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
|
||||
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
|
||||
strcpyW(pszPath, This->sPathTarget);
|
||||
wcscpy(pszPath, This->sPathTarget);
|
||||
else
|
||||
HCR_GetClassNameW(&CLSID_ShellDesktop, pszPath, MAX_PATH);
|
||||
}
|
||||
|
@ -718,9 +687,9 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
WCHAR szRegPath[100];
|
||||
LONG r;
|
||||
|
||||
lstrcpyW (szRegPath, clsidW);
|
||||
wcscpy (szRegPath, clsidW);
|
||||
SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
|
||||
lstrcatW (szRegPath, shellfolderW);
|
||||
wcscat (szRegPath, shellfolderW);
|
||||
r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath,
|
||||
wantsForParsingW, NULL, NULL, NULL);
|
||||
if (r == ERROR_SUCCESS)
|
||||
|
@ -764,7 +733,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
{
|
||||
lstrcpynW(pszPath, This->sPathTarget, MAX_PATH - 1);
|
||||
PathAddBackslashW(pszPath);
|
||||
cLen = lstrlenW(pszPath);
|
||||
cLen = wcslen(pszPath);
|
||||
}
|
||||
|
||||
_ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen);
|
||||
|
@ -859,7 +828,7 @@ static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface,
|
|||
if(!(dwFlags & SHGDN_FORPARSING) && SHELL_FS_HideExtension(szSrc)) {
|
||||
WCHAR *ext = PathFindExtensionW(szSrc);
|
||||
if(*ext != '\0') {
|
||||
INT len = strlenW(szDest);
|
||||
INT len = wcslen(szDest);
|
||||
lstrcpynW(szDest + len, ext, MAX_PATH - len);
|
||||
}
|
||||
}
|
||||
|
@ -1024,7 +993,7 @@ static const IShellFolder2Vtbl vt_MCFldr_ShellFolder2 =
|
|||
ISF_Desktop_fnMapColumnToSCID
|
||||
};
|
||||
|
||||
static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2));
|
||||
}
|
||||
|
@ -1172,7 +1141,7 @@ next:
|
|||
dwFetched) {
|
||||
_ILSimpleGetTextW (pidl, wszText, MAX_PATH);
|
||||
if (0 == lstrcmpiW (wszText, pwszName)) {
|
||||
snprintfW (pwszName, uLen, wszFormat, wszNewFolder, i++);
|
||||
_snwprintf (pwszName, uLen, wszFormat, wszNewFolder, i++);
|
||||
if (i > 99) {
|
||||
hr = E_FAIL;
|
||||
break;
|
||||
|
@ -1306,7 +1275,7 @@ ISF_Desktop_ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST
|
|||
SHFree(pidl);
|
||||
}
|
||||
|
||||
wszCurrentPath += lstrlenW(wszCurrentPath)+1;
|
||||
wszCurrentPath += wcslen(wszCurrentPath)+1;
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, wszPathsList);
|
||||
return ret;
|
||||
|
@ -1365,8 +1334,8 @@ HRESULT WINAPI ISF_Desktop_Constructor (
|
|||
sf->lpPF2 = &vt_FSFldr_PersistFolder2;
|
||||
sf->lpvtblSFHelper = &vt_FSFldr_ISFHelper;
|
||||
sf->pidlRoot = _ILCreateDesktop(); /* my qualified pidl */
|
||||
sf->sPathTarget = SHAlloc( (lstrlenW(szMyPath) + 1)*sizeof(WCHAR) );
|
||||
lstrcpyW( sf->sPathTarget, szMyPath );
|
||||
sf->sPathTarget = SHAlloc( (wcslen(szMyPath) + 1)*sizeof(WCHAR) );
|
||||
wcscpy( sf->sPathTarget, szMyPath );
|
||||
|
||||
if (InterlockedCompareExchangePointer((void *)&cached_sf, sf, NULL) != NULL)
|
||||
{
|
||||
|
|
|
@ -18,33 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "enumidlist.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
@ -61,7 +35,7 @@ typedef struct {
|
|||
/* both paths are parsible from the desktop */
|
||||
LPITEMIDLIST pidlRoot; /* absolute pidl */
|
||||
LPCITEMIDLIST apidl; /* currently focused font item */
|
||||
} IGenericSFImpl;
|
||||
} IGenericSFImpl, *LPIGenericSFImpl;
|
||||
|
||||
static const IShellFolder2Vtbl vt_ShellFolder2;
|
||||
static const IPersistFolder2Vtbl vt_NP_PersistFolder2;
|
||||
|
@ -88,9 +62,19 @@ static shvheader FontsSFHeader[] = {
|
|||
#define COLUMN_SIZE 2
|
||||
#define COLUMN_FILENAME 3
|
||||
|
||||
|
||||
#define FontsSHELLVIEWCOLUMNS (4)
|
||||
|
||||
|
||||
static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
{
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2));
|
||||
}
|
||||
|
||||
static LPIGenericSFImpl __inline impl_from_IContextMenu2(IContextMenu2 *iface)
|
||||
{
|
||||
return (LPIGenericSFImpl)((char *)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblContextMenuFontItem));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ISF_Fonts_Constructor
|
||||
*/
|
||||
|
@ -971,24 +955,25 @@ static HRESULT WINAPI ISF_Fonts_IContextMenu2_InvokeCommand(
|
|||
IContextMenu2 *iface,
|
||||
LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
_ICOM_THIS_From_IContextMenu2FontItem(IGenericSFImpl, iface);
|
||||
SHELLEXECUTEINFOW sei;
|
||||
PIDLFontStruct * pfont;
|
||||
SHFILEOPSTRUCTW op;
|
||||
IGenericSFImpl * This = impl_from_IContextMenu2(iface);
|
||||
|
||||
|
||||
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
|
||||
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCE(1) || lpcmi->lpVerb == MAKEINTRESOURCE(2) || lpcmi->lpVerb == MAKEINTRESOURCE(7))
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(2) || lpcmi->lpVerb == MAKEINTRESOURCEA(7))
|
||||
{
|
||||
ZeroMemory(&sei, sizeof(sei));
|
||||
sei.cbSize = sizeof(sei);
|
||||
sei.hwnd = lpcmi->hwnd;
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCE(1))
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
|
||||
sei.lpVerb = L"open";
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(2))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2))
|
||||
sei.lpVerb = L"print";
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(7))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7))
|
||||
sei.lpVerb = L"properties";
|
||||
|
||||
pfont = _ILGetFontStruct(This->apidl);
|
||||
|
@ -998,12 +983,12 @@ static HRESULT WINAPI ISF_Fonts_IContextMenu2_InvokeCommand(
|
|||
if (sei.hInstApp <= (HINSTANCE)32)
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(4))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(4))
|
||||
{
|
||||
FIXME("implement font copying\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(6))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(6))
|
||||
{
|
||||
ZeroMemory(&op, sizeof(op));
|
||||
op.hwnd = lpcmi->hwnd;
|
||||
|
|
|
@ -20,38 +20,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "enumidlist.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shellfolder.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
@ -78,7 +47,7 @@ typedef struct {
|
|||
|
||||
UINT cfShellIDList; /* clipboardformat for IDropTarget */
|
||||
BOOL fAcceptFmt; /* flag for pending Drop */
|
||||
} IGenericSFImpl;
|
||||
} IGenericSFImpl, *LPIGenericSFImpl;
|
||||
|
||||
static const IUnknownVtbl unkvt;
|
||||
static const IShellFolder2Vtbl sfvt;
|
||||
|
@ -86,24 +55,24 @@ static const IPersistFolder3Vtbl vt_FSFldr_PersistFolder3; /* IPersistFolder3 fo
|
|||
static const IDropTargetVtbl dtvt;
|
||||
static const ISFHelperVtbl shvt;
|
||||
|
||||
static inline IGenericSFImpl *impl_from_IShellFolder2( IShellFolder2 *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_IShellFolder2( IShellFolder2 *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblShellFolder));
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblShellFolder));
|
||||
}
|
||||
|
||||
static inline IGenericSFImpl *impl_from_IPersistFolder3( IPersistFolder3 *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_IPersistFolder3( IPersistFolder3 *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblPersistFolder3));
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblPersistFolder3));
|
||||
}
|
||||
|
||||
static inline IGenericSFImpl *impl_from_IDropTarget( IDropTarget *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_IDropTarget( IDropTarget *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblDropTarget));
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblDropTarget));
|
||||
}
|
||||
|
||||
static inline IGenericSFImpl *impl_from_ISFHelper( ISFHelper *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_ISFHelper( ISFHelper *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper));
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper));
|
||||
}
|
||||
|
||||
|
||||
|
@ -405,7 +374,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
|
|||
/* build the full pathname to the element */
|
||||
lstrcpynW(szPath, This->sPathTarget, MAX_PATH - 1);
|
||||
PathAddBackslashW(szPath);
|
||||
len = lstrlenW(szPath);
|
||||
len = wcslen(szPath);
|
||||
lstrcpynW(szPath + len, szElement, MAX_PATH - len);
|
||||
|
||||
/* get the pidl */
|
||||
|
@ -808,7 +777,7 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
|||
{
|
||||
lstrcpynW(pszPath, This->sPathTarget, MAX_PATH);
|
||||
PathAddBackslashW(pszPath);
|
||||
len = lstrlenW(pszPath);
|
||||
len = wcslen(pszPath);
|
||||
}
|
||||
_ILSimpleGetTextW(pidl, pszPath + len, MAX_PATH + 1 - len);
|
||||
if (!_ILIsFolder(pidl)) SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags);
|
||||
|
@ -880,7 +849,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
|
|||
if(!(dwFlags & SHGDN_FORPARSING) && SHELL_FS_HideExtension(szSrc)) {
|
||||
WCHAR *ext = PathFindExtensionW(szSrc);
|
||||
if(*ext != '\0') {
|
||||
INT len = strlenW(szDest);
|
||||
INT len = wcslen(szDest);
|
||||
lstrcpynW(szDest + len, ext, MAX_PATH - len);
|
||||
}
|
||||
}
|
||||
|
@ -1120,7 +1089,7 @@ next:
|
|||
dwFetched) {
|
||||
_ILSimpleGetTextW (pidl, wszText, MAX_PATH);
|
||||
if (0 == lstrcmpiW (wszText, pwszName)) {
|
||||
snprintfW (pwszName, uLen, wszFormat, wszNewFolder, i++);
|
||||
_snwprintf (pwszName, uLen, wszFormat, wszNewFolder, i++);
|
||||
if (i > 99) {
|
||||
hr = E_FAIL;
|
||||
break;
|
||||
|
@ -1174,7 +1143,7 @@ ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCWSTR pwszName,
|
|||
sizeof (wszTempText));
|
||||
LoadStringW (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, wszCaption,
|
||||
sizeof (wszCaption));
|
||||
sprintfW (wszText, wszTempText, wszNewDir);
|
||||
swprintf (wszText, wszTempText, wszNewDir);
|
||||
MessageBoxW (hwnd, wszText, wszCaption, MB_OK | MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
||||
|
@ -1194,7 +1163,7 @@ WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls)
|
|||
int iPathLen;
|
||||
int i;
|
||||
|
||||
iPathLen = lstrlenW(wszBasePath);
|
||||
iPathLen = wcslen(wszBasePath);
|
||||
wszPathsList = HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(WCHAR)*cidl+1);
|
||||
wszListPos = wszPathsList;
|
||||
|
||||
|
@ -1205,7 +1174,7 @@ WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls)
|
|||
lstrcpynW(wszListPos, wszBasePath, MAX_PATH);
|
||||
/* FIXME: abort if path too long */
|
||||
_ILSimpleGetTextW(pidls[i], wszListPos+iPathLen, MAX_PATH-iPathLen);
|
||||
wszListPos += lstrlenW(wszListPos)+1;
|
||||
wszListPos += wcslen(wszListPos)+1;
|
||||
}
|
||||
*wszListPos=0;
|
||||
return wszPathsList;
|
||||
|
@ -1271,7 +1240,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
|
|||
SHFree(pidl);
|
||||
}
|
||||
|
||||
wszCurrentPath += lstrlenW(wszCurrentPath)+1;
|
||||
wszCurrentPath += wcslen(wszCurrentPath)+1;
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, wszPathsList);
|
||||
return ret;
|
||||
|
@ -1485,7 +1454,7 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
|
|||
|
||||
/* set my path */
|
||||
if (SHGetPathFromIDListW (pidl, wszTemp)) {
|
||||
int len = strlenW(wszTemp);
|
||||
int len = wcslen(wszTemp);
|
||||
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
|
||||
if (!This->sPathTarget)
|
||||
return E_OUTOFMEMORY;
|
||||
|
@ -1555,14 +1524,14 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
|
|||
if (ppfti->csidl != -1) {
|
||||
if (SHGetSpecialFolderPathW (0, wszTemp, ppfti->csidl,
|
||||
ppfti->csidl & CSIDL_FLAG_CREATE)) {
|
||||
int len = strlenW(wszTemp);
|
||||
int len = wcslen(wszTemp);
|
||||
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
|
||||
if (!This->sPathTarget)
|
||||
return E_OUTOFMEMORY;
|
||||
memcpy(This->sPathTarget, wszTemp, (len + 1) * sizeof(WCHAR));
|
||||
}
|
||||
} else if (ppfti->szTargetParsingName[0]) {
|
||||
int len = strlenW(ppfti->szTargetParsingName);
|
||||
int len = wcslen(ppfti->szTargetParsingName);
|
||||
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
|
||||
if (!This->sPathTarget)
|
||||
return E_OUTOFMEMORY;
|
||||
|
@ -1570,7 +1539,7 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
|
|||
(len + 1) * sizeof(WCHAR));
|
||||
} else if (ppfti->pidlTargetFolder) {
|
||||
if (SHGetPathFromIDListW(ppfti->pidlTargetFolder, wszTemp)) {
|
||||
int len = strlenW(wszTemp);
|
||||
int len = wcslen(wszTemp);
|
||||
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
|
||||
if (!This->sPathTarget)
|
||||
return E_OUTOFMEMORY;
|
||||
|
|
|
@ -19,34 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "shlguid.h"
|
||||
#include "enumidlist.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
@ -62,14 +35,14 @@ typedef struct {
|
|||
/* both paths are parsible from the desktop */
|
||||
LPITEMIDLIST pidlRoot; /* absolute pidl */
|
||||
LPWSTR sName;
|
||||
} IGenericSFImpl;
|
||||
} IGenericSFImpl, *LPIGenericSFImpl;
|
||||
|
||||
static const IShellFolder2Vtbl vt_ShellFolder2;
|
||||
static const IPersistFolder2Vtbl vt_PersistFolder2;
|
||||
|
||||
static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2));
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2));
|
||||
}
|
||||
|
||||
|
||||
|
@ -137,10 +110,10 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
|
|||
&dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
szName[MAX_PATH-1] = 0;
|
||||
sf->sName = SHAlloc((strlenW(szName)+1) * sizeof(WCHAR));
|
||||
sf->sName = SHAlloc((wcslen(szName)+1) * sizeof(WCHAR));
|
||||
if (sf->sName)
|
||||
{
|
||||
lstrcpyW( sf->sName, szName );
|
||||
wcscpy( sf->sName, szName );
|
||||
}
|
||||
TRACE("sName %s\n", debugstr_w(sf->sName));
|
||||
}
|
||||
|
@ -239,7 +212,7 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
|
|||
{
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
TRACE ("-- element: %s\n", debugstr_w (szElement));
|
||||
SHCLSIDFromStringW (szElement + 2, &clsid);
|
||||
CLSIDFromString (szElement + 2, &clsid);
|
||||
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
|
||||
}
|
||||
/* do we have an absolute path name ? */
|
||||
|
@ -624,9 +597,9 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
|
|||
* Get the "WantsFORPARSING" flag from the registry
|
||||
*/
|
||||
|
||||
lstrcpyW (szRegPath, clsidW);
|
||||
wcscpy (szRegPath, clsidW);
|
||||
SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
|
||||
lstrcatW (szRegPath, shellfolderW);
|
||||
wcscat (szRegPath, shellfolderW);
|
||||
r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath,
|
||||
wantsForParsingW, NULL, NULL, NULL);
|
||||
if (r == ERROR_SUCCESS)
|
||||
|
@ -665,7 +638,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
|
|||
/* user friendly name */
|
||||
|
||||
if (_ILIsMyComputer(pidl) && This->sName)
|
||||
strcpyW(pszPath, This->sName);
|
||||
wcscpy(pszPath, This->sName);
|
||||
else
|
||||
HCR_GetClassNameW (clsid, pszPath, MAX_PATH);
|
||||
|
||||
|
@ -722,10 +695,10 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
|
|||
pszPath[MAX_PATH-7] = L'\0';
|
||||
}
|
||||
}
|
||||
strcatW (pszPath, wszOpenBracket);
|
||||
wcscat (pszPath, wszOpenBracket);
|
||||
wszDrive[2] = L'\0';
|
||||
strcatW (pszPath, wszDrive);
|
||||
strcatW (pszPath, wszCloseBracket);
|
||||
wcscat (pszPath, wszDrive);
|
||||
wcscat (pszPath, wszCloseBracket);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -796,7 +769,7 @@ static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (
|
|||
*pPidlOut = _ILCreateMyComputer();
|
||||
}
|
||||
|
||||
length = (strlenW(lpName)+1) * sizeof(WCHAR);
|
||||
length = (wcslen(lpName)+1) * sizeof(WCHAR);
|
||||
sName = SHAlloc(length);
|
||||
|
||||
if (!sName)
|
||||
|
@ -818,7 +791,7 @@ static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (
|
|||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
lstrcpyW(sName, lpName);
|
||||
wcscpy(sName, lpName);
|
||||
SHFree(This->sName);
|
||||
This->sName = sName;
|
||||
TRACE("result %s\n", debugstr_w(This->sName));
|
||||
|
|
|
@ -19,38 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "enumidlist.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shellfolder.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (mydocs);
|
||||
|
||||
|
@ -69,7 +38,7 @@ typedef struct {
|
|||
|
||||
UINT cfShellIDList; /* clipboardformat for IDropTarget */
|
||||
BOOL fAcceptFmt; /* flag for pending Drop */
|
||||
} IGenericSFImpl;
|
||||
} IGenericSFImpl, *LPIGenericSFImpl;
|
||||
|
||||
#define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl)
|
||||
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
|
||||
|
@ -175,7 +144,7 @@ WINAPI ISF_MyDocuments_fnParseDisplayName (IShellFolder2 * iface,
|
|||
{
|
||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||
TRACE ("-- element: %s\n", debugstr_w (szElement));
|
||||
SHCLSIDFromStringW (szElement + 2, &clsid);
|
||||
CLSIDFromString (szElement + 2, &clsid);
|
||||
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
|
||||
}
|
||||
else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) )
|
||||
|
@ -506,7 +475,7 @@ WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
{
|
||||
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
|
||||
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
|
||||
strcpyW(pszPath, This->sPathTarget);
|
||||
wcscpy(pszPath, This->sPathTarget);
|
||||
else
|
||||
HCR_GetClassNameW(&CLSID_MyDocuments, pszPath, MAX_PATH);
|
||||
TRACE("CP\n");
|
||||
|
@ -545,9 +514,9 @@ WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
WCHAR szRegPath[100];
|
||||
LONG r;
|
||||
|
||||
lstrcpyW (szRegPath, clsidW);
|
||||
wcscpy (szRegPath, clsidW);
|
||||
SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
|
||||
lstrcatW (szRegPath, shellfolderW);
|
||||
wcscat (szRegPath, shellfolderW);
|
||||
r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath,
|
||||
wantsForParsingW, NULL, NULL, NULL);
|
||||
if (r == ERROR_SUCCESS)
|
||||
|
@ -599,7 +568,7 @@ WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
if (!_ILIsDesktop(pidl))
|
||||
{
|
||||
PathAddBackslashW(pszPath);
|
||||
cLen = lstrlenW(pszPath);
|
||||
cLen = wcslen(pszPath);
|
||||
_ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen);
|
||||
if (!_ILIsFolder(pidl))
|
||||
{
|
||||
|
@ -787,9 +756,9 @@ static const IShellFolder2Vtbl vt_MCFldr_ShellFolder2 =
|
|||
ISF_MyDocuments_fnMapColumnToSCID
|
||||
};
|
||||
|
||||
static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
|
||||
{
|
||||
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2));
|
||||
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
|
@ -904,8 +873,8 @@ HRESULT WINAPI ISF_MyDocuments_Constructor (
|
|||
sf->lpVtbl = &vt_MCFldr_ShellFolder2;
|
||||
sf->lpPF2 = &vt_FSFldr_PersistFolder2;
|
||||
sf->pidlRoot = _ILCreateMyDocuments(); /* my qualified pidl */
|
||||
sf->sPathTarget = SHAlloc( (lstrlenW(szMyPath) + 1)*sizeof(WCHAR) );
|
||||
lstrcpyW( sf->sPathTarget, szMyPath );
|
||||
sf->sPathTarget = SHAlloc( (wcslen(szMyPath) + 1)*sizeof(WCHAR) );
|
||||
wcscpy( sf->sPathTarget, szMyPath );
|
||||
|
||||
if (InterlockedCompareExchangePointer((void *)&cached_sf, sf, NULL) != NULL)
|
||||
{
|
||||
|
|
|
@ -20,32 +20,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "enumidlist.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include "shlwapi.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
|
|
@ -20,40 +20,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winspool.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "enumidlist.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shellfolder.h"
|
||||
#include "wine/debug.h"
|
||||
#include "debughlp.h"
|
||||
#include "shfldr.h"
|
||||
#include "shresdef.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
@ -117,7 +84,7 @@ static HRESULT WINAPI IEI_Printers_fnQueryInterface(IExtractIconW *iface, REFIID
|
|||
|
||||
if(*ppvObj)
|
||||
{
|
||||
IExtractIconW_AddRef((IExtractIconW*) *ppvObj);
|
||||
((IExtractIconW*)*ppvObj)->lpVtbl->AddRef(*ppvObj);
|
||||
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -225,7 +192,7 @@ static HRESULT WINAPI IEIA_Printers_fnQueryInterface(IExtractIconA * iface, REFI
|
|||
{
|
||||
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
|
||||
|
||||
return IExtractIconW_QueryInterface(This, riid, ppvObj);
|
||||
return This->lpVtbl->QueryInterface(This, riid, ppvObj);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -235,7 +202,7 @@ static ULONG WINAPI IEIA_Printers_fnAddRef(IExtractIconA * iface)
|
|||
{
|
||||
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
|
||||
|
||||
return IExtractIconW_AddRef(This);
|
||||
return This->lpVtbl->AddRef(This);
|
||||
}
|
||||
/**************************************************************************
|
||||
* IExtractIconA_Release
|
||||
|
@ -244,7 +211,7 @@ static ULONG WINAPI IEIA_Printers_fnRelease(IExtractIconA * iface)
|
|||
{
|
||||
_ICOM_THIS_From_IExtractIconA(IExtractIconW, iface);
|
||||
|
||||
return IExtractIconW_AddRef(This);
|
||||
return This->lpVtbl->AddRef(This);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -264,7 +231,7 @@ static HRESULT WINAPI IEIA_Printers_fnGetIconLocation(
|
|||
|
||||
TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags);
|
||||
|
||||
ret = IExtractIconW_GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags);
|
||||
ret = This->lpVtbl->GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags);
|
||||
WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL);
|
||||
HeapFree(GetProcessHeap(), 0, lpwstrFile);
|
||||
|
||||
|
@ -286,7 +253,7 @@ static HRESULT WINAPI IEIA_Printers_fnExtract(IExtractIconA *iface, LPCSTR pszFi
|
|||
TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len);
|
||||
ret = IExtractIconW_Extract(This, lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
||||
ret = This->lpVtbl->Extract(This, lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
||||
HeapFree(GetProcessHeap(), 0, lpwstrFile);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -18,31 +18,9 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#define MAX_PROPERTY_SHEET_PAGE 32
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
#include "ntquery.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shlobj.h"
|
||||
#include "shresdef.h"
|
||||
#include "pidl.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "shell32_main.h"
|
||||
#include "enumidlist.h"
|
||||
#include "xdg.h"
|
||||
#include "recyclebin.h"
|
||||
#include <prsht.h>
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(recyclebin);
|
||||
|
||||
|
@ -91,7 +69,7 @@ typedef struct tagRecycleBin
|
|||
INT iIdEmpty;
|
||||
LPITEMIDLIST pidl;
|
||||
LPCITEMIDLIST apidl;
|
||||
} RecycleBin;
|
||||
} RecycleBin, *LPRecycleBin;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -114,17 +92,17 @@ static const IShellFolder2Vtbl recycleBinVtbl;
|
|||
static const IPersistFolder2Vtbl recycleBinPersistVtbl;
|
||||
static const IShellExtInitVtbl eivt;
|
||||
|
||||
static RecycleBin *impl_from_IContextMenu2(IContextMenu2 *iface)
|
||||
static LPRecycleBin __inline impl_from_IContextMenu2(IContextMenu2 *iface)
|
||||
{
|
||||
return (RecycleBin *)((char *)iface - FIELD_OFFSET(RecycleBin, lpContextMenu2));
|
||||
}
|
||||
|
||||
static RecycleBin *impl_from_IPersistFolder(IPersistFolder2 *iface)
|
||||
static LPRecycleBin __inline impl_from_IPersistFolder(IPersistFolder2 *iface)
|
||||
{
|
||||
return (RecycleBin *)((char *)iface - FIELD_OFFSET(RecycleBin, lpPersistFolderVtbl));
|
||||
}
|
||||
|
||||
static inline RecycleBin *impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
static LPRecycleBin __inline impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
{
|
||||
return (RecycleBin *)((char*)iface - FIELD_OFFSET(RecycleBin, lpSEI));
|
||||
}
|
||||
|
@ -670,12 +648,12 @@ static HRESULT WINAPI RecycleBin_GetDetailsOf(IShellFolder2 *iface, LPCITEMIDLIS
|
|||
break;
|
||||
case COLUMN_TYPE:
|
||||
szTypeName[0] = L'\0';
|
||||
lstrcpyW(buffer,PathFindExtensionW(pFileDetails->szName));
|
||||
wcscpy(buffer,PathFindExtensionW(pFileDetails->szName));
|
||||
if (!( HCR_MapTypeToValueW(buffer, buffer, sizeof(buffer)/sizeof(WCHAR), TRUE) &&
|
||||
HCR_MapTypeToValueW(buffer, szTypeName, sizeof(szTypeName)/sizeof(WCHAR), FALSE )))
|
||||
{
|
||||
lstrcpyW (szTypeName, PathFindExtensionW(pFileDetails->szName));
|
||||
strcatW(szTypeName, L"-");
|
||||
wcscpy (szTypeName, PathFindExtensionW(pFileDetails->szName));
|
||||
wcscat(szTypeName, L"-");
|
||||
Length = wcslen(szTypeName);
|
||||
if (LoadStringW(shell32_hInstance, IDS_SHV_COLUMN1, &szTypeName[Length], (sizeof(szTypeName)/sizeof(WCHAR))- Length))
|
||||
szTypeName[(sizeof(szTypeName)/sizeof(WCHAR))-1] = L'\0';
|
||||
|
@ -878,7 +856,7 @@ RecycleBin_IContextMenu2Folder_QueryContextMenu( IContextMenu2* iface, HMENU hme
|
|||
LoadStringW(shell32_hInstance, IDS_EMPTY_BITBUCKET, szBuffer, sizeof(szBuffer)/sizeof(WCHAR));
|
||||
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = strlenW( mii.dwTypeData );
|
||||
mii.cch = wcslen( mii.dwTypeData );
|
||||
mii.wID = idCmdFirst + id++;
|
||||
mii.fType = MFT_STRING;
|
||||
This->iIdEmpty = 1;
|
||||
|
@ -1067,7 +1045,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand(
|
|||
|
||||
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
|
||||
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCE(1) || lpcmi->lpVerb == MAKEINTRESOURCE(5))
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(5))
|
||||
{
|
||||
Context.pFileDetails = _ILGetRecycleStruct(This->apidl);
|
||||
Context.bFound = FALSE;
|
||||
|
@ -1076,7 +1054,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand(
|
|||
if (!Context.bFound)
|
||||
return E_FAIL;
|
||||
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCE(1))
|
||||
if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
|
||||
{
|
||||
/* restore file */
|
||||
if (RestoreFile(Context.hDeletedFile))
|
||||
|
@ -1090,12 +1068,12 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand(
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(3))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(3))
|
||||
{
|
||||
FIXME("implement cut\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCE(7))
|
||||
else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7))
|
||||
{
|
||||
FIXME("implement properties\n");
|
||||
return E_NOTIMPL;
|
||||
|
@ -1206,18 +1184,18 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive)
|
|||
lc.iSubItem = 0;
|
||||
lc.fmt = LVCFMT_FIXED_WIDTH;
|
||||
lc.cx = columnSize;
|
||||
lc.cchTextMax = lstrlenW(szVolume);
|
||||
lc.cchTextMax = wcslen(szVolume);
|
||||
lc.pszText = szVolume;
|
||||
(void)ListView_InsertColumnW(hDlgCtrl, 0, &lc);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc);
|
||||
|
||||
if (!LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_DISKSPACE, szVolume, sizeof(szVolume) / sizeof(WCHAR)))
|
||||
szVolume[0] = 0;
|
||||
|
||||
lc.iSubItem = 1;
|
||||
lc.cx = rect.right - rect.left - columnSize;
|
||||
lc.cchTextMax = lstrlenW(szVolume);
|
||||
lc.cchTextMax = wcslen(szVolume);
|
||||
lc.pszText = szVolume;
|
||||
(void)ListView_InsertColumnW(hDlgCtrl, 1, &lc);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 1, (LPARAM)&lc);
|
||||
|
||||
dwDrives = GetLogicalDrives();
|
||||
itemCount = 0;
|
||||
|
@ -1234,13 +1212,13 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive)
|
|||
dwSerial = -1;
|
||||
}
|
||||
|
||||
sprintfW(szVolume, L"%s (%c)", szName, szDrive[0]);
|
||||
swprintf(szVolume, L"%s (%c)", szName, szDrive[0]);
|
||||
memset(&li, 0x0, sizeof(LVITEMW));
|
||||
li.mask = LVIF_TEXT | LVIF_PARAM;
|
||||
li.iSubItem = 0;
|
||||
li.pszText = szVolume;
|
||||
li.iItem = itemCount;
|
||||
(void)ListView_InsertItemW(hDlgCtrl, &li);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMN, 0, (LPARAM)&li);
|
||||
if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable , &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
|
||||
{
|
||||
if (StrFormatByteSizeW(TotalNumberOfFreeBytes.QuadPart, szVolume, sizeof(szVolume) / sizeof(WCHAR)))
|
||||
|
@ -1249,7 +1227,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive)
|
|||
pItem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DRIVE_ITEM_CONTEXT));
|
||||
if (pItem)
|
||||
{
|
||||
sprintfW(szName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Bitbucket\\Volume\\%04X-%04X", LOWORD(dwSerial), HIWORD(dwSerial));
|
||||
swprintf(szName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Bitbucket\\Volume\\%04X-%04X", LOWORD(dwSerial), HIWORD(dwSerial));
|
||||
dwSize = sizeof(DWORD);
|
||||
RegGetValueW(HKEY_CURRENT_USER, szName, L"MaxCapacity", RRF_RT_DWORD, NULL, &pItem->dwMaxCapacity, &dwSize);
|
||||
dwSize = sizeof(DWORD);
|
||||
|
@ -1257,7 +1235,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive)
|
|||
pItem->dwSerial = dwSerial;
|
||||
li.mask = LVIF_PARAM;
|
||||
li.lParam = (LPARAM)pItem;
|
||||
(void)ListView_SetItemW(hDlgCtrl, &li);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
|
||||
if (CurDrive == DefaultDrive)
|
||||
{
|
||||
defIndex = itemCount;
|
||||
|
@ -1271,7 +1249,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive)
|
|||
li.iSubItem = 1;
|
||||
li.pszText = szVolume;
|
||||
li.iItem = itemCount;
|
||||
(void)ListView_SetItemW(hDlgCtrl, &li);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
|
||||
}
|
||||
}
|
||||
itemCount++;
|
||||
|
@ -1294,7 +1272,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive)
|
|||
li.stateMask = (UINT)-1;
|
||||
li.state = LVIS_FOCUSED|LVIS_SELECTED;
|
||||
li.iItem = defIndex;
|
||||
(void)ListView_SetItemW(hDlgCtrl, &li);
|
||||
(void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1320,10 +1298,10 @@ static BOOL StoreDriveSettings(HWND hwndDlg)
|
|||
for(iIndex = 0; iIndex < iCount; iIndex++)
|
||||
{
|
||||
li.iItem = iIndex;
|
||||
if (ListView_GetItemW(hDlgCtrl, &li))
|
||||
if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li))
|
||||
{
|
||||
pItem = (PDRIVE_ITEM_CONTEXT)li.lParam;
|
||||
sprintfW(szSerial, L"%04X-%04X", LOWORD(pItem->dwSerial), HIWORD(pItem->dwSerial));
|
||||
swprintf(szSerial, L"%04X-%04X", LOWORD(pItem->dwSerial), HIWORD(pItem->dwSerial));
|
||||
if (RegCreateKeyExW(hKey, szSerial, 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS)
|
||||
{
|
||||
dwSize = sizeof(DWORD);
|
||||
|
@ -1353,7 +1331,7 @@ static VOID FreeDriveItemContext(HWND hwndDlg)
|
|||
for(iIndex = 0; iIndex < iCount; iIndex++)
|
||||
{
|
||||
li.iItem = iIndex;
|
||||
if (ListView_GetItemW(hDlgCtrl, &li))
|
||||
if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, (LPVOID)li.lParam);
|
||||
}
|
||||
|
@ -1380,7 +1358,7 @@ GetDefaultItem(HWND hwndDlg, LVITEMW * li)
|
|||
for (iIndex = 0; iIndex < iItemCount; iIndex++)
|
||||
{
|
||||
li->iItem = iIndex;
|
||||
if (ListView_GetItemW(hDlgCtrl, li))
|
||||
if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)li))
|
||||
{
|
||||
if (li->state & LVIS_SELECTED)
|
||||
return iIndex;
|
||||
|
@ -1462,7 +1440,7 @@ BitBucketDlg(
|
|||
ZeroMemory(&li, sizeof(li));
|
||||
li.mask = LVIF_PARAM;
|
||||
li.iItem = lppl->iItem;
|
||||
if (!ListView_GetItemW(lppl->hdr.hwndFrom, &li))
|
||||
if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&li))
|
||||
return TRUE;
|
||||
|
||||
pItem = (PDRIVE_ITEM_CONTEXT)li.lParam;
|
||||
|
@ -1559,7 +1537,7 @@ TRASH_CanTrashFile(LPCWSTR wszPath)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
sprintfW(szBuffer, L"%04X-%04X", LOWORD(VolSerialNumber), HIWORD(VolSerialNumber));
|
||||
swprintf(szBuffer, L"%04X-%04X", LOWORD(VolSerialNumber), HIWORD(VolSerialNumber));
|
||||
wcscat(szKey, szBuffer);
|
||||
|
||||
if (RegCreateKeyExW(HKEY_CURRENT_USER, szKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, &dwDisposition) != ERROR_SUCCESS)
|
||||
|
|
|
@ -19,34 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
#include "shlwapi.h"
|
||||
#include "ddeml.h"
|
||||
|
||||
#include "wine/winbase16.h"
|
||||
#include "shell32_main.h"
|
||||
#include "pidl.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(exec);
|
||||
|
||||
|
@ -160,11 +133,11 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
else
|
||||
cmd = lpFile;
|
||||
|
||||
used += strlenW(cmd);
|
||||
used += wcslen(cmd);
|
||||
if (used < len)
|
||||
{
|
||||
strcpyW(res, cmd);
|
||||
res += strlenW(cmd);
|
||||
wcscpy(res, cmd);
|
||||
res += wcslen(cmd);
|
||||
}
|
||||
}
|
||||
found_p1 = TRUE;
|
||||
|
@ -178,11 +151,11 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
case 'l':
|
||||
case 'L':
|
||||
if (lpFile) {
|
||||
used += strlenW(lpFile);
|
||||
used += wcslen(lpFile);
|
||||
if (used < len)
|
||||
{
|
||||
strcpyW(res, lpFile);
|
||||
res += strlenW(lpFile);
|
||||
wcscpy(res, lpFile);
|
||||
res += wcslen(lpFile);
|
||||
}
|
||||
}
|
||||
found_p1 = TRUE;
|
||||
|
@ -198,13 +171,13 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
LPVOID pv;
|
||||
HGLOBAL hmem = SHAllocShared(pidl, ILGetSize(pidl), 0);
|
||||
pv = SHLockShared(hmem, 0);
|
||||
chars = sprintfW(buf, wszILPtr, pv);
|
||||
chars = swprintf(buf, wszILPtr, pv);
|
||||
if (chars >= sizeof(buf)/sizeof(WCHAR))
|
||||
ERR("pidl format buffer too small!\n");
|
||||
used += chars;
|
||||
if (used < len)
|
||||
{
|
||||
strcpyW(res,buf);
|
||||
wcscpy(res,buf);
|
||||
res += chars;
|
||||
}
|
||||
SHUnlockShared(pv);
|
||||
|
@ -218,7 +191,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
*/
|
||||
|
||||
/* Make sure that we have at least one more %.*/
|
||||
if (strchrW(fmt, '%'))
|
||||
if (wcschr(fmt, '%'))
|
||||
{
|
||||
WCHAR tmpBuffer[1024];
|
||||
PWSTR tmpB = tmpBuffer;
|
||||
|
@ -234,20 +207,20 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
|||
envRet = GetEnvironmentVariableW(tmpBuffer, tmpEnvBuff, MAX_PATH);
|
||||
if (envRet == 0 || envRet > MAX_PATH)
|
||||
{
|
||||
used += strlenW(tmpBuffer);
|
||||
used += wcslen(tmpBuffer);
|
||||
if (used < len)
|
||||
{
|
||||
strcpyW( res, tmpBuffer );
|
||||
res += strlenW(tmpBuffer);
|
||||
wcscpy( res, tmpBuffer );
|
||||
res += wcslen(tmpBuffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
used += strlenW(tmpEnvBuff);
|
||||
used += wcslen(tmpEnvBuff);
|
||||
if (used < len)
|
||||
{
|
||||
strcpyW( res, tmpEnvBuff );
|
||||
res += strlenW(tmpEnvBuff);
|
||||
wcscpy( res, tmpEnvBuff );
|
||||
res += wcslen(tmpEnvBuff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -379,15 +352,15 @@ static void *SHELL_BuildEnvW( const WCHAR *path )
|
|||
static const WCHAR wPath[] = {'P','A','T','H','=',0};
|
||||
WCHAR *strings, *new_env;
|
||||
WCHAR *p, *p2;
|
||||
int total = strlenW(path) + 1;
|
||||
int total = wcslen(path) + 1;
|
||||
BOOL got_path = FALSE;
|
||||
|
||||
if (!(strings = GetEnvironmentStringsW())) return NULL;
|
||||
p = strings;
|
||||
while (*p)
|
||||
{
|
||||
int len = strlenW(p) + 1;
|
||||
if (!strncmpiW( p, wPath, 5 )) got_path = TRUE;
|
||||
int len = wcslen(p) + 1;
|
||||
if (!wcsnicmp( p, wPath, 5 )) got_path = TRUE;
|
||||
total += len;
|
||||
p += len;
|
||||
}
|
||||
|
@ -403,22 +376,22 @@ static void *SHELL_BuildEnvW( const WCHAR *path )
|
|||
p2 = new_env;
|
||||
while (*p)
|
||||
{
|
||||
int len = strlenW(p) + 1;
|
||||
int len = wcslen(p) + 1;
|
||||
memcpy( p2, p, len * sizeof(WCHAR) );
|
||||
if (!strncmpiW( p, wPath, 5 ))
|
||||
if (!wcsnicmp( p, wPath, 5 ))
|
||||
{
|
||||
p2[len - 1] = ';';
|
||||
strcpyW( p2 + len, path );
|
||||
p2 += strlenW(path) + 1;
|
||||
wcscpy( p2 + len, path );
|
||||
p2 += wcslen(path) + 1;
|
||||
}
|
||||
p += len;
|
||||
p2 += len;
|
||||
}
|
||||
if (!got_path)
|
||||
{
|
||||
strcpyW( p2, wPath );
|
||||
strcatW( p2, path );
|
||||
p2 += strlenW(p2) + 1;
|
||||
wcscpy( p2, wPath );
|
||||
wcscat( p2, path );
|
||||
p2 += wcslen(p2) + 1;
|
||||
}
|
||||
*p2 = 0;
|
||||
FreeEnvironmentStringsW( strings );
|
||||
|
@ -446,8 +419,8 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env)
|
|||
BOOL found = FALSE;
|
||||
|
||||
if (env) *env = NULL;
|
||||
strcpyW(buffer, wszKeyAppPaths);
|
||||
strcatW(buffer, szName);
|
||||
wcscpy(buffer, wszKeyAppPaths);
|
||||
wcscat(buffer, szName);
|
||||
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp);
|
||||
if (res) goto end;
|
||||
|
||||
|
@ -481,15 +454,15 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW
|
|||
RegCloseKey(hkeyClass);
|
||||
|
||||
/* Looking for ...buffer\shell\<verb>\command */
|
||||
strcatW(filetype, wszShell);
|
||||
strcatW(filetype, verb);
|
||||
strcatW(filetype, wCommand);
|
||||
wcscat(filetype, wszShell);
|
||||
wcscat(filetype, verb);
|
||||
wcscat(filetype, wCommand);
|
||||
|
||||
if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, command,
|
||||
&commandlen) == ERROR_SUCCESS)
|
||||
{
|
||||
commandlen /= sizeof(WCHAR);
|
||||
if (key) strcpyW(key, filetype);
|
||||
if (key) wcscpy(key, filetype);
|
||||
#if 0
|
||||
LPWSTR tmp;
|
||||
WCHAR param[256];
|
||||
|
@ -505,13 +478,13 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW
|
|||
from the associated ddeexec key */
|
||||
tmp = strstrW(filetype, wCommand);
|
||||
tmp[0] = '\0';
|
||||
strcatW(filetype, wDdeexec);
|
||||
wcscat(filetype, wDdeexec);
|
||||
if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, param,
|
||||
¶mlen) == ERROR_SUCCESS)
|
||||
{
|
||||
paramlen /= sizeof(WCHAR);
|
||||
strcatW(command, wSpace);
|
||||
strcatW(command, param);
|
||||
wcscat(command, wSpace);
|
||||
wcscat(command, param);
|
||||
commandlen += paramlen;
|
||||
}
|
||||
#endif
|
||||
|
@ -587,13 +560,13 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
|
|||
attribs = GetFileAttributesW(lpFile);
|
||||
if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
strcpyW(filetype, wszFolder);
|
||||
wcscpy(filetype, wszFolder);
|
||||
filetypelen = 6; /* strlen("Folder") */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* First thing we need is the file's extension */
|
||||
extension = strrchrW(xlpFile, '.'); /* Assume last "." is the one; */
|
||||
extension = wcschr(xlpFile, '.'); /* Assume last "." is the one; */
|
||||
/* File->Run in progman uses */
|
||||
/* .\FILE.EXE :( */
|
||||
TRACE("xlpFile=%s,extension=%s\n", debugstr_w(xlpFile), debugstr_w(extension));
|
||||
|
@ -629,9 +602,9 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
|
|||
while (*p == ' ' || *p == '\t') p++;
|
||||
}
|
||||
|
||||
if (strcmpiW(tok, &extension[1]) == 0) /* have to skip the leading "." */
|
||||
if (wcsicmp(tok, &extension[1]) == 0) /* have to skip the leading "." */
|
||||
{
|
||||
strcpyW(lpResult, xlpFile);
|
||||
wcscpy(lpResult, xlpFile);
|
||||
/* Need to perhaps check that the file has a path
|
||||
* attached */
|
||||
TRACE("found %s\n", debugstr_w(lpResult));
|
||||
|
@ -703,18 +676,18 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
|
|||
extension++;
|
||||
if (GetProfileStringW(wExtensions, extension, wszEmpty, command, sizeof(command)/sizeof(WCHAR)) > 0)
|
||||
{
|
||||
if (strlenW(command) != 0)
|
||||
if (wcslen(command) != 0)
|
||||
{
|
||||
strcpyW(lpResult, command);
|
||||
tok = strchrW(lpResult, '^'); /* should be ^.extension? */
|
||||
wcscpy(lpResult, command);
|
||||
tok = wcschr(lpResult, '^'); /* should be ^.extension? */
|
||||
if (tok != NULL)
|
||||
{
|
||||
tok[0] = '\0';
|
||||
strcatW(lpResult, xlpFile); /* what if no dir in xlpFile? */
|
||||
tok = strchrW(command, '^'); /* see above */
|
||||
if ((tok != NULL) && (strlenW(tok)>5))
|
||||
wcscat(lpResult, xlpFile); /* what if no dir in xlpFile? */
|
||||
tok = wcschr(command, '^'); /* see above */
|
||||
if ((tok != NULL) && (wcslen(tok)>5))
|
||||
{
|
||||
strcatW(lpResult, &tok[5]);
|
||||
wcscat(lpResult, &tok[5]);
|
||||
}
|
||||
}
|
||||
retval = 33; /* FIXME - see above */
|
||||
|
@ -757,7 +730,7 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec,
|
|||
static const WCHAR wApplication[] = {'\\','a','p','p','l','i','c','a','t','i','o','n',0};
|
||||
static const WCHAR wTopic[] = {'\\','t','o','p','i','c',0};
|
||||
WCHAR regkey[256];
|
||||
WCHAR * endkey = regkey + strlenW(key);
|
||||
WCHAR * endkey = regkey + wcslen(key);
|
||||
WCHAR app[256], topic[256], ifexec[256], res[256];
|
||||
LONG applen, topiclen, ifexeclen;
|
||||
WCHAR * exec;
|
||||
|
@ -770,8 +743,8 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec,
|
|||
unsigned ret = SE_ERR_NOASSOC;
|
||||
BOOL unicode = !(GetVersion() & 0x80000000);
|
||||
|
||||
strcpyW(regkey, key);
|
||||
strcpyW(endkey, wApplication);
|
||||
wcscpy(regkey, key);
|
||||
wcscpy(endkey, wApplication);
|
||||
applen = sizeof(app);
|
||||
if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, app, &applen) != ERROR_SUCCESS)
|
||||
{
|
||||
|
@ -784,15 +757,15 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec,
|
|||
/* Get application command from start string and find filename of application */
|
||||
if (*start == '"')
|
||||
{
|
||||
strcpyW(command, start+1);
|
||||
if ((ptr = strchrW(command, '"')))
|
||||
wcscpy(command, start+1);
|
||||
if ((ptr = wcschr(command, '"')))
|
||||
*ptr = 0;
|
||||
ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
LPWSTR p,space;
|
||||
for (p=(LPWSTR)start; (space=strchrW(p, ' ')); p=space+1)
|
||||
for (p=(LPWSTR)start; (space=wcschr(p, ' ')); p=space+1)
|
||||
{
|
||||
int idx = space-start;
|
||||
memcpy(command, start, idx*sizeof(WCHAR));
|
||||
|
@ -809,25 +782,25 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec,
|
|||
ERR("Unable to find application path for command %s\n", debugstr_w(start));
|
||||
return ERROR_ACCESS_DENIED;
|
||||
}
|
||||
strcpyW(app, ptr);
|
||||
wcscpy(app, ptr);
|
||||
|
||||
/* Remove extensions (including .so) */
|
||||
ptr = app + strlenW(app) - (sizeSo-1);
|
||||
if (strlenW(app) >= sizeSo &&
|
||||
!strcmpW(ptr, wSo))
|
||||
ptr = app + wcslen(app) - (sizeSo-1);
|
||||
if (wcslen(app) >= sizeSo &&
|
||||
!wcscmp(ptr, wSo))
|
||||
*ptr = 0;
|
||||
|
||||
ptr = strrchrW(app, '.');
|
||||
ptr = wcschr(app, '.');
|
||||
assert(ptr);
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
strcpyW(endkey, wTopic);
|
||||
wcscpy(endkey, wTopic);
|
||||
topiclen = sizeof(topic);
|
||||
if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS)
|
||||
{
|
||||
static const WCHAR wSystem[] = {'S','y','s','t','e','m',0};
|
||||
strcpyW(topic, wSystem);
|
||||
wcscpy(topic, wSystem);
|
||||
}
|
||||
|
||||
if (unicode)
|
||||
|
@ -864,7 +837,7 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec,
|
|||
SetLastError(ERROR_DDE_FAIL);
|
||||
return 30; /* whatever */
|
||||
}
|
||||
strcpyW(endkey, wIfexec);
|
||||
wcscpy(endkey, wIfexec);
|
||||
ifexeclen = sizeof(ifexec);
|
||||
if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS)
|
||||
{
|
||||
|
@ -881,7 +854,7 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec,
|
|||
* error DMLERR_NOTPROCESSED on XTYP_EXECUTE request.
|
||||
*/
|
||||
if (unicode)
|
||||
hDdeData = DdeClientTransaction((LPBYTE)res, (strlenW(res) + 1) * sizeof(WCHAR), hConv, 0L, 0,
|
||||
hDdeData = DdeClientTransaction((LPBYTE)res, (wcslen(res) + 1) * sizeof(WCHAR), hConv, 0L, 0,
|
||||
XTYP_EXECUTE, 30000, &tid);
|
||||
else
|
||||
{
|
||||
|
@ -943,14 +916,14 @@ static UINT_PTR execute_from_key(LPWSTR key, LPCWSTR lpFile, WCHAR *env, LPCWSTR
|
|||
|
||||
/* Get the parameters needed by the application
|
||||
from the associated ddeexec key */
|
||||
tmp = strstrW(key, wCommand);
|
||||
tmp = wcsstr(key, wCommand);
|
||||
assert(tmp);
|
||||
strcpyW(tmp, wDdeexec);
|
||||
wcscpy(tmp, wDdeexec);
|
||||
|
||||
if (RegQueryValueW(HKEY_CLASSES_ROOT, key, ddeexec, &ddeexeclen) == ERROR_SUCCESS)
|
||||
{
|
||||
TRACE("Got ddeexec %s => %s\n", debugstr_w(key), debugstr_w(ddeexec));
|
||||
if (!param[0]) strcpyW(param, executable_name);
|
||||
if (!param[0]) wcscpy(param, executable_name);
|
||||
retval = dde_connect(key, param, ddeexec, lpFile, env, szCommandline, psei->lpIDList, execfunc, psei, psei_out);
|
||||
}
|
||||
else if (param[0])
|
||||
|
@ -1304,7 +1277,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
static const WCHAR wExplorer[] = {'e','x','p','l','o','r','e','r','.','e','x','e',0};
|
||||
//static const WCHAR wProperties[] = { 'p','r','o','p','e','r','t','i','e','s',0 };
|
||||
static const DWORD unsupportedFlags =
|
||||
SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
|
||||
SEE_MASK_INVOKEIDLIST | SEE_MASK_HOTKEY |
|
||||
SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI |
|
||||
SEE_MASK_UNICODE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR;
|
||||
|
||||
|
@ -1342,7 +1315,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
}
|
||||
else if (*sei_tmp.lpFile == '\"')
|
||||
{
|
||||
DWORD l = strlenW(sei_tmp.lpFile+1);
|
||||
DWORD l = wcslen(sei_tmp.lpFile+1);
|
||||
if(l >= dwApplicationNameLen) dwApplicationNameLen = l+1;
|
||||
wszApplicationName = HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR));
|
||||
memcpy(wszApplicationName, sei_tmp.lpFile+1, (l+1)*sizeof(WCHAR));
|
||||
|
@ -1351,19 +1324,19 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
appKnownSingular = TRUE;
|
||||
TRACE("wszApplicationName=%s\n",debugstr_w(wszApplicationName));
|
||||
} else {
|
||||
DWORD l = strlenW(sei_tmp.lpFile)+1;
|
||||
DWORD l = wcslen(sei_tmp.lpFile)+1;
|
||||
if(l > dwApplicationNameLen) dwApplicationNameLen = l+1;
|
||||
wszApplicationName = HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR));
|
||||
memcpy(wszApplicationName, sei_tmp.lpFile, l*sizeof(WCHAR));
|
||||
}
|
||||
|
||||
if (sei_tmp.lpParameters)
|
||||
strcpyW(wszParameters, sei_tmp.lpParameters);
|
||||
wcscpy(wszParameters, sei_tmp.lpParameters);
|
||||
else
|
||||
*wszParameters = '\0';
|
||||
|
||||
if (sei_tmp.lpDirectory)
|
||||
strcpyW(wszDir, sei_tmp.lpDirectory);
|
||||
wcscpy(wszDir, sei_tmp.lpDirectory);
|
||||
else
|
||||
*wszDir = '\0';
|
||||
|
||||
|
@ -1386,9 +1359,9 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IShellExecuteHookW_Execute(pSEH, &sei_tmp);
|
||||
hr = pSEH->lpVtbl->Execute(pSEH, &sei_tmp);
|
||||
|
||||
IShellExecuteHookW_Release(pSEH);
|
||||
pSEH->lpVtbl->Release(pSEH);
|
||||
|
||||
if (hr == S_OK) {
|
||||
HeapFree(GetProcessHeap(), 0, wszApplicationName);
|
||||
|
@ -1434,8 +1407,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
done = SHELL_ArgifyW(wcmd, sizeof(wcmd)/sizeof(WCHAR), wszParameters, wszApplicationName, sei_tmp.lpIDList, NULL, &resultLen);
|
||||
if (!done && wszApplicationName[0])
|
||||
{
|
||||
strcatW(wcmd, wSpace);
|
||||
strcatW(wcmd, wszApplicationName);
|
||||
wcscat(wcmd, wSpace);
|
||||
wcscat(wcmd, wszApplicationName);
|
||||
}
|
||||
if (resultLen > sizeof(wcmd)/sizeof(WCHAR))
|
||||
ERR("Argify buffer not large enough... truncating\n");
|
||||
|
@ -1452,8 +1425,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW(sei_tmp.lpIDList, buffer, sizeof(buffer)))) {
|
||||
if (buffer[0]==':' && buffer[1]==':') {
|
||||
/* open shell folder for the specified class GUID */
|
||||
strcpyW(wszParameters, buffer);
|
||||
strcpyW(wszApplicationName, wExplorer);
|
||||
wcscpy(wszParameters, buffer);
|
||||
wcscpy(wszApplicationName, wExplorer);
|
||||
appKnownSingular = TRUE;
|
||||
|
||||
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
|
||||
|
@ -1463,7 +1436,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
DWORD resultLen;
|
||||
/* Check if we're executing a directory and if so use the
|
||||
handler for the Folder class */
|
||||
strcpyW(target, buffer);
|
||||
wcscpy(target, buffer);
|
||||
attribs = GetFileAttributesW(buffer);
|
||||
if (attribs != INVALID_FILE_ATTRIBUTES &&
|
||||
(attribs & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||
|
@ -1555,7 +1528,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
end = src;
|
||||
|
||||
/* copy the parameter string to 'wszParameters' */
|
||||
strcpyW(wszParameters, src);
|
||||
wcscpy(wszParameters, src);
|
||||
|
||||
/* terminate previous command string after the quote character */
|
||||
*end = '\0';
|
||||
|
@ -1568,7 +1541,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
LPWSTR space, s;
|
||||
|
||||
LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/;
|
||||
for(s=beg; (space=strchrW(s, ' ')); s=space+1) {
|
||||
for(s=beg; (space=wcschr(s, ' ')); s=space+1) {
|
||||
int idx = space-sei_tmp.lpFile;
|
||||
memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR));
|
||||
buffer[idx] = '\0';
|
||||
|
@ -1579,27 +1552,27 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
/* separate out command from parameter string */
|
||||
LPCWSTR p = space + 1;
|
||||
|
||||
while(isspaceW(*p))
|
||||
while(iswspace(*p))
|
||||
++p;
|
||||
|
||||
strcpyW(wszParameters, p);
|
||||
wcscpy(wszParameters, p);
|
||||
*space = '\0';
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
strcpyW(wfileName, sei_tmp.lpFile);
|
||||
wcscpy(wfileName, sei_tmp.lpFile);
|
||||
}
|
||||
} else
|
||||
strcpyW(wfileName, sei_tmp.lpFile);
|
||||
wcscpy(wfileName, sei_tmp.lpFile);
|
||||
|
||||
lpFile = wfileName;
|
||||
|
||||
strcpyW(wcmd, wszApplicationName);
|
||||
wcscpy(wcmd, wszApplicationName);
|
||||
if (sei_tmp.lpParameters[0]) {
|
||||
strcatW(wcmd, wSpace);
|
||||
strcatW(wcmd, wszParameters);
|
||||
wcscat(wcmd, wSpace);
|
||||
wcscat(wcmd, wszParameters);
|
||||
}
|
||||
|
||||
retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei);
|
||||
|
@ -1617,12 +1590,12 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
/* Must quote to handle case where cmd contains spaces,
|
||||
* else security hole if malicious user creates executable file "C:\\Program"
|
||||
*/
|
||||
strcpyW(wszQuotedCmd, wQuote);
|
||||
strcatW(wszQuotedCmd, wcmd);
|
||||
strcatW(wszQuotedCmd, wQuote);
|
||||
wcscpy(wszQuotedCmd, wQuote);
|
||||
wcscat(wszQuotedCmd, wcmd);
|
||||
wcscat(wszQuotedCmd, wQuote);
|
||||
if (wszParameters[0]) {
|
||||
strcatW(wszQuotedCmd, wSpace);
|
||||
strcatW(wszQuotedCmd, wszParameters);
|
||||
wcscat(wszQuotedCmd, wSpace);
|
||||
wcscat(wszQuotedCmd, wszParameters);
|
||||
}
|
||||
TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(sei_tmp.lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(lpstrProtocol));
|
||||
if (*lpstrProtocol)
|
||||
|
@ -1638,23 +1611,23 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
LPWSTR lpstrRes;
|
||||
INT iSize;
|
||||
|
||||
lpstrRes = strchrW(lpFile, ':');
|
||||
lpstrRes = wcschr(lpFile, ':');
|
||||
if (lpstrRes)
|
||||
iSize = lpstrRes - lpFile;
|
||||
else
|
||||
iSize = strlenW(lpFile);
|
||||
iSize = wcslen(lpFile);
|
||||
|
||||
TRACE("Got URL: %s\n", debugstr_w(lpFile));
|
||||
/* Looking for ...protocol\shell\lpOperation\command */
|
||||
memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR));
|
||||
lpstrProtocol[iSize] = '\0';
|
||||
strcatW(lpstrProtocol, wShell);
|
||||
strcatW(lpstrProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen);
|
||||
strcatW(lpstrProtocol, wCommand);
|
||||
wcscat(lpstrProtocol, wShell);
|
||||
wcscat(lpstrProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen);
|
||||
wcscat(lpstrProtocol, wCommand);
|
||||
|
||||
/* Remove File Protocol from lpFile */
|
||||
/* In the case file://path/file */
|
||||
if (!strncmpiW(lpFile, wFile, iSize))
|
||||
if (!wcsnicmp(lpFile, wFile, iSize))
|
||||
{
|
||||
lpFile += iSize;
|
||||
while (*lpFile == ':') lpFile++;
|
||||
|
@ -1662,12 +1635,12 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
|||
retval = execute_from_key(lpstrProtocol, lpFile, NULL, sei_tmp.lpParameters, wcmd, execfunc, &sei_tmp, sei);
|
||||
}
|
||||
/* Check if file specified is in the form www.??????.*** */
|
||||
else if (!strncmpiW(lpFile, wWww, 3))
|
||||
else if (!wcsnicmp(lpFile, wWww, 3))
|
||||
{
|
||||
/* if so, append lpFile http:// and call ShellExecute */
|
||||
WCHAR lpstrTmpFile[256];
|
||||
strcpyW(lpstrTmpFile, wHttp);
|
||||
strcatW(lpstrTmpFile, lpFile);
|
||||
wcscpy(lpstrTmpFile, wHttp);
|
||||
wcscat(lpstrTmpFile, lpFile);
|
||||
retval = (UINT_PTR)ShellExecuteW(sei_tmp.hwnd, sei_tmp.lpVerb, lpstrTmpFile, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,28 +21,9 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
//#define NO_SHLWAPI_STREAM
|
||||
#include <precomp.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "shellapi.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include "shresdef.h"
|
||||
#define NO_SHLWAPI_STREAM
|
||||
#include "shlwapi.h"
|
||||
#include "shell32_main.h"
|
||||
#include "undocshell.h"
|
||||
#include "wine/debug.h"
|
||||
#include "xdg.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -660,11 +641,9 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
|
|||
* Win9x exports ANSI
|
||||
* WinNT/2000 exports Unicode
|
||||
*/
|
||||
DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path)
|
||||
DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCWSTR path)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
return SHCreateDirectoryExW(hWnd, path, NULL);
|
||||
return SHCreateDirectoryExA(hWnd, path, NULL);
|
||||
return SHCreateDirectoryExW(hWnd, path, NULL);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -699,7 +678,7 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path)
|
|||
* If hWnd is set to NULL, no user interface is displayed and the function
|
||||
* returns ERROR_CANCELLED.
|
||||
*/
|
||||
int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES sec)
|
||||
int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, const SECURITY_ATTRIBUTES *sec)
|
||||
{
|
||||
LPWSTR wPath;
|
||||
DWORD retCode;
|
||||
|
@ -720,7 +699,7 @@ int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES se
|
|||
*
|
||||
* See SHCreateDirectoryExA.
|
||||
*/
|
||||
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
|
||||
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, const SECURITY_ATTRIBUTES *sec)
|
||||
{
|
||||
int ret = ERROR_BAD_PATHNAME;
|
||||
TRACE("(%p, %s, %p)\n", hWnd, debugstr_w(path), sec);
|
||||
|
@ -731,7 +710,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s
|
|||
}
|
||||
else
|
||||
{
|
||||
ret = SHNotifyCreateDirectoryW(path, sec);
|
||||
ret = SHNotifyCreateDirectoryW(path, (LPSECURITY_ATTRIBUTES)sec);
|
||||
/* Refuse to work on certain error codes before trying to create directories recursively */
|
||||
if (ret != ERROR_SUCCESS &&
|
||||
ret != ERROR_FILE_EXISTS &&
|
||||
|
@ -751,7 +730,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s
|
|||
{
|
||||
*pSlash = 0; /* terminate path at separator */
|
||||
|
||||
ret = SHNotifyCreateDirectoryW(szTemp, pSlash + 1 == pEnd ? sec : NULL);
|
||||
ret = SHNotifyCreateDirectoryW(szTemp, pSlash + 1 == pEnd ? (LPSECURITY_ATTRIBUTES)sec : NULL);
|
||||
}
|
||||
*pSlash++ = '\\'; /* put the separator back */
|
||||
}
|
||||
|
@ -919,7 +898,7 @@ typedef struct
|
|||
} FILE_LIST;
|
||||
|
||||
|
||||
static inline void grow_list(FILE_LIST *list)
|
||||
static void __inline grow_list(FILE_LIST *list)
|
||||
{
|
||||
FILE_ENTRY *new = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list->feFiles,
|
||||
list->num_alloc * 2 * sizeof(*new) );
|
||||
|
@ -931,11 +910,11 @@ static inline void grow_list(FILE_LIST *list)
|
|||
*/
|
||||
static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile)
|
||||
{
|
||||
DWORD dwLen = lstrlenW(szFile) + 1;
|
||||
DWORD dwLen = wcslen(szFile) + 1;
|
||||
LPWSTR ptr;
|
||||
|
||||
feFile->szFullPath = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
|
||||
lstrcpyW(feFile->szFullPath, szFile);
|
||||
wcscpy(feFile->szFullPath, szFile);
|
||||
|
||||
ptr = StrRChrW(szFile, NULL, '\\');
|
||||
if (ptr)
|
||||
|
@ -944,9 +923,9 @@ static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile)
|
|||
feFile->szDirectory = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
|
||||
lstrcpynW(feFile->szDirectory, szFile, dwLen);
|
||||
|
||||
dwLen = lstrlenW(feFile->szFullPath) - dwLen + 1;
|
||||
dwLen = wcslen(feFile->szFullPath) - dwLen + 1;
|
||||
feFile->szFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
|
||||
lstrcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */
|
||||
wcscpy(feFile->szFilename, ptr + 1); /* skip over backslash */
|
||||
}
|
||||
feFile->bFromWildcard = FALSE;
|
||||
}
|
||||
|
@ -959,11 +938,11 @@ static LPWSTR wildcard_to_file(LPWSTR szWildCard, LPWSTR szFileName)
|
|||
ptr = StrRChrW(szWildCard, NULL, '\\');
|
||||
dwDirLen = ptr - szWildCard + 1;
|
||||
|
||||
dwFullLen = dwDirLen + lstrlenW(szFileName) + 1;
|
||||
dwFullLen = dwDirLen + wcslen(szFileName) + 1;
|
||||
szFullPath = HeapAlloc(GetProcessHeap(), 0, dwFullLen * sizeof(WCHAR));
|
||||
|
||||
lstrcpynW(szFullPath, szWildCard, dwDirLen + 1);
|
||||
lstrcatW(szFullPath, szFileName);
|
||||
wcscat(szFullPath, szFileName);
|
||||
|
||||
return szFullPath;
|
||||
}
|
||||
|
@ -1030,7 +1009,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
|
|||
}
|
||||
else
|
||||
{
|
||||
lstrcpyW(szCurFile, ptr);
|
||||
wcscpy(szCurFile, ptr);
|
||||
flList->feFiles[i].bFromRelative = FALSE;
|
||||
}
|
||||
|
||||
|
@ -1052,7 +1031,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
|
|||
}
|
||||
|
||||
/* advance to the next string */
|
||||
ptr += lstrlenW(ptr) + 1;
|
||||
ptr += wcslen(ptr) + 1;
|
||||
i++;
|
||||
}
|
||||
flList->dwNumFiles = i;
|
||||
|
@ -1091,7 +1070,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR
|
|||
if (PathFileExistsW(szDestPath))
|
||||
PathCombineW(szTo, szDestPath, feFrom->szFilename);
|
||||
else
|
||||
lstrcpyW(szTo, szDestPath);
|
||||
wcscpy(szTo, szDestPath);
|
||||
|
||||
if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) {
|
||||
if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op))
|
||||
|
@ -1103,11 +1082,11 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR
|
|||
}
|
||||
}
|
||||
|
||||
szTo[lstrlenW(szTo) + 1] = '\0';
|
||||
szTo[wcslen(szTo) + 1] = '\0';
|
||||
SHNotifyCreateDirectoryW(szTo, NULL);
|
||||
|
||||
PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
|
||||
szFrom[lstrlenW(szFrom) + 1] = '\0';
|
||||
szFrom[wcslen(szFrom) + 1] = '\0';
|
||||
|
||||
memcpy(&fileOp, op->req, sizeof(fileOp));
|
||||
fileOp.pFrom = szFrom;
|
||||
|
@ -1274,7 +1253,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
|
|||
WCHAR tmp[8];
|
||||
const WCHAR format[] = {'%','d',0};
|
||||
|
||||
wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles);
|
||||
_snwprintf(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles);
|
||||
return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL);
|
||||
}
|
||||
else
|
||||
|
@ -1365,10 +1344,10 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
|
|||
SHNotifyCreateDirectoryW(szDestPath, NULL);
|
||||
|
||||
PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
|
||||
szFrom[lstrlenW(szFrom) + 1] = '\0';
|
||||
szFrom[wcslen(szFrom) + 1] = '\0';
|
||||
|
||||
lstrcpyW(szTo, szDestPath);
|
||||
szTo[lstrlenW(szDestPath) + 1] = '\0';
|
||||
wcscpy(szTo, szDestPath);
|
||||
szTo[wcslen(szDestPath) + 1] = '\0';
|
||||
|
||||
memcpy(&fileOp, lpFileOp, sizeof(fileOp));
|
||||
fileOp.pFrom = szFrom;
|
||||
|
@ -1674,7 +1653,7 @@ DWORD WINAPI SheChangeDirW(LPWSTR path)
|
|||
/*************************************************************************
|
||||
* IsNetDrive [SHELL32.66]
|
||||
*/
|
||||
BOOL WINAPI IsNetDrive(DWORD drive)
|
||||
INT WINAPI IsNetDrive(INT drive)
|
||||
{
|
||||
char root[4];
|
||||
strcpy(root, "A:\\");
|
||||
|
|
|
@ -21,32 +21,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "shlguid.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shlwapi.h"
|
||||
#include "wine/debug.h"
|
||||
#include "shfldr.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
||||
|
||||
|
@ -70,7 +45,7 @@ static const WCHAR wszDotShellClassInfo[] = {
|
|||
* TRUE if returned non-NULL value.
|
||||
* FALSE otherwise.
|
||||
*/
|
||||
static inline BOOL SHELL32_GetCustomFolderAttributeFromPath(
|
||||
static BOOL __inline SHELL32_GetCustomFolderAttributeFromPath(
|
||||
LPWSTR pwszFolderPath, LPCWSTR pwszHeading, LPCWSTR pwszAttribute,
|
||||
LPWSTR pwszValue, DWORD cchValue)
|
||||
{
|
||||
|
@ -224,7 +199,7 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
|
|||
}
|
||||
|
||||
if (pidlChild) {
|
||||
int len = lstrlenW(ppfti.szTargetParsingName);
|
||||
int len = wcslen(ppfti.szTargetParsingName);
|
||||
|
||||
if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
|
||||
hr = E_INVALIDARG;
|
||||
|
|
|
@ -19,20 +19,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(pidl);
|
||||
|
||||
|
|
|
@ -18,23 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlwapi.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
#ifdef FM_SEPARATOR
|
||||
#undef FM_SEPARATOR
|
||||
|
@ -330,9 +314,9 @@ static BOOL FileMenu_AppendItemW(
|
|||
|
||||
if (lpText != FM_SEPARATOR)
|
||||
{
|
||||
int len = strlenW (lpText);
|
||||
int len = wcslen (lpText);
|
||||
myItem = (LPFMITEM) SHAlloc( sizeof(FMITEM) + len*sizeof(WCHAR));
|
||||
strcpyW (myItem->szItemText, lpText);
|
||||
wcscpy (myItem->szItemText, lpText);
|
||||
myItem->cchItemText = len;
|
||||
myItem->iIconIndex = icon;
|
||||
myItem->hMenu = hMenu;
|
||||
|
@ -825,7 +809,7 @@ void WINAPI FileMenu_AbortInitMenu (void)
|
|||
* LPXXXXX pointer to struct containing a func addr at offset 8
|
||||
* or NULL at failure.
|
||||
*/
|
||||
LPVOID WINAPI SHFind_InitMenuPopup (HMENU hMenu, HWND hWndParent, DWORD w, DWORD x)
|
||||
IContextMenu * WINAPI SHFind_InitMenuPopup (HMENU hMenu, HWND hWndParent, UINT w, UINT x)
|
||||
{
|
||||
FIXME("hmenu=%p hwnd=%p 0x%08x 0x%08x stub\n",
|
||||
hMenu,hWndParent,w,x);
|
||||
|
@ -859,7 +843,8 @@ static BOOL _SHIsMenuSeparator(HMENU hm, int i)
|
|||
* Shell_MergeMenus [SHELL32.67]
|
||||
*/
|
||||
HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
|
||||
{ int nItem;
|
||||
{
|
||||
INT nItem;
|
||||
HMENU hmSubMenu;
|
||||
BOOL bAlreadySeparated;
|
||||
MENUITEMINFOW miiSrc;
|
||||
|
|
|
@ -36,35 +36,7 @@
|
|||
* Release() ???
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
|
||||
#include "windef.h"
|
||||
#include "winerror.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "objbase.h"
|
||||
#include "servprov.h"
|
||||
#include "shlguid.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "shlobj.h"
|
||||
#include "undocshell.h"
|
||||
#include "shresdef.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "docobj.h"
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shellfolder.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -110,7 +82,7 @@ typedef struct
|
|||
UINT cScrollDelay; /* Send a WM_*SCROLL msg every 250 ms during drag-scroll */
|
||||
POINT ptLastMousePos; /* Mouse position at last DragOver call */
|
||||
IContextMenu2 *pCM;
|
||||
} IShellViewImpl;
|
||||
} IShellViewImpl, *LPIShellViewImpl;
|
||||
|
||||
static const IShellViewVtbl svvt;
|
||||
static const IOleCommandTargetVtbl ctvt;
|
||||
|
@ -119,24 +91,24 @@ static const IDropSourceVtbl dsvt;
|
|||
static const IViewObjectVtbl vovt;
|
||||
|
||||
|
||||
static inline IShellViewImpl *impl_from_IOleCommandTarget( IOleCommandTarget *iface )
|
||||
static LPIShellViewImpl __inline impl_from_IOleCommandTarget( IOleCommandTarget *iface )
|
||||
{
|
||||
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblOleCommandTarget));
|
||||
return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblOleCommandTarget));
|
||||
}
|
||||
|
||||
static inline IShellViewImpl *impl_from_IDropTarget( IDropTarget *iface )
|
||||
static LPIShellViewImpl __inline impl_from_IDropTarget( IDropTarget *iface )
|
||||
{
|
||||
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropTarget));
|
||||
return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropTarget));
|
||||
}
|
||||
|
||||
static inline IShellViewImpl *impl_from_IDropSource( IDropSource *iface )
|
||||
static LPIShellViewImpl __inline impl_from_IDropSource( IDropSource *iface )
|
||||
{
|
||||
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropSource));
|
||||
return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropSource));
|
||||
}
|
||||
|
||||
static inline IShellViewImpl *impl_from_IViewObject( IViewObject *iface )
|
||||
static LPIShellViewImpl __inline impl_from_IViewObject( IViewObject *iface )
|
||||
{
|
||||
return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblViewObject));
|
||||
return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblViewObject));
|
||||
}
|
||||
|
||||
/* ListView Header ID's */
|
||||
|
@ -566,7 +538,10 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
|
|||
lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/
|
||||
lvItem.pszText = LPSTR_TEXTCALLBACKW; /*get text on a callback basis*/
|
||||
lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/
|
||||
return (-1==ListView_InsertItemW(This->hWndList, &lvItem))? FALSE: TRUE;
|
||||
if (SendMessageW(This->hWndList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem) == -1)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
|
@ -835,7 +810,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This)
|
|||
lvItem.iItem = 0;
|
||||
lvItem.iSubItem = 0;
|
||||
|
||||
while(ListView_GetItemW(This->hWndList, &lvItem) && (i < This->cidl))
|
||||
while(SendMessageW(This->hWndList, LVM_GETITEMW, 0, (LPARAM)&lvItem) && (i < This->cidl))
|
||||
{
|
||||
if(lvItem.state & LVIS_SELECTED)
|
||||
{
|
||||
|
|
|
@ -29,19 +29,7 @@
|
|||
* Up to date as of SHELL32 v5.00 (W2K)
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
#include "winreg.h"
|
||||
|
||||
#include "shell32_main.h"
|
||||
#include "shlobj.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -441,12 +429,14 @@ static POLICYDATA sh32_policy_table[] =
|
|||
strForceCopyACLW,
|
||||
SHELL_NO_POLICY
|
||||
},
|
||||
#if (NTDDI_VERSION < NTDDI_LONGHORN)
|
||||
{
|
||||
REST_NOLOGO3CHANNELNOTIFY,
|
||||
strExplorer,
|
||||
strNoMSAppLogo,
|
||||
SHELL_NO_POLICY
|
||||
},
|
||||
#endif
|
||||
{
|
||||
REST_NOFORGETSOFTWAREUPDATE,
|
||||
strExplorer,
|
||||
|
|
|
@ -263,4 +263,40 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi
|
|||
#define IDR_AVI_FILENUKE 163
|
||||
#define IDR_AVI_FILEDELETE 164
|
||||
|
||||
#define FCIDM_SHVIEW_ARRANGE 0x7001
|
||||
#define FCIDM_SHVIEW_DELETE 0x7011
|
||||
#define FCIDM_SHVIEW_PROPERTIES 0x7013
|
||||
#define FCIDM_SHVIEW_CUT 0x7018
|
||||
#define FCIDM_SHVIEW_COPY 0x7019
|
||||
#define FCIDM_SHVIEW_INSERT 0x701A
|
||||
#define FCIDM_SHVIEW_UNDO 0x701B
|
||||
#define FCIDM_SHVIEW_INSERTLINK 0x701C
|
||||
#define FCIDM_SHVIEW_SELECTALL 0x7021
|
||||
#define FCIDM_SHVIEW_INVERTSELECTION 0x7022
|
||||
|
||||
#define FCIDM_SHVIEW_BIGICON 0x7029 //FIXME
|
||||
#define FCIDM_SHVIEW_SMALLICON 0x702A //FIXME
|
||||
#define FCIDM_SHVIEW_LISTVIEW 0x702B //FIXME
|
||||
#define FCIDM_SHVIEW_REPORTVIEW 0x702C //FIXME
|
||||
/* 0x7030-0x703f are used by the shellbrowser */
|
||||
#define FCIDM_SHVIEW_AUTOARRANGE 0x7031
|
||||
#define FCIDM_SHVIEW_SNAPTOGRID 0x7032
|
||||
|
||||
#define FCIDM_SHVIEW_HELP 0x7041
|
||||
#define FCIDM_SHVIEW_RENAME 0x7050
|
||||
#define FCIDM_SHVIEW_CREATELINK 0x7051
|
||||
#define FCIDM_SHVIEW_NEWLINK 0x7052
|
||||
#define FCIDM_SHVIEW_NEWFOLDER 0x7053
|
||||
|
||||
#define FCIDM_SHVIEW_REFRESH 0x7100 /* FIXME */
|
||||
#define FCIDM_SHVIEW_EXPLORE 0x7101 /* FIXME */
|
||||
#define FCIDM_SHVIEW_OPEN 0x7102 /* FIXME */
|
||||
|
||||
|
||||
#define FCIDM_TB_UPFOLDER 0xA001
|
||||
#define FCIDM_TB_NEWFOLDER 0xA002
|
||||
#define FCIDM_TB_SMALLICON 0xA003
|
||||
#define FCIDM_TB_REPORTVIEW 0xA004
|
||||
#define FCIDM_TB_DESKTOP 0xA005 /* FIXME */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,28 +6,7 @@
|
|||
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#define YDEBUG
|
||||
#include "winerror.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlobj.h"
|
||||
#include "objbase.h"
|
||||
|
||||
#include "shlwapi.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shellfolder.h"
|
||||
#include "debughlp.h"
|
||||
#include "shresdef.h"
|
||||
#include "shlguid.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dmenu);
|
||||
|
||||
|
@ -61,11 +40,11 @@ typedef struct
|
|||
PStaticShellEntry shead; /* first static shell extension entry */
|
||||
UINT iIdSCMFirst; /* first static used id */
|
||||
UINT iIdSCMLast; /* last static used id */
|
||||
}IDefaultContextMenuImpl;
|
||||
}IDefaultContextMenuImpl, *LPIDefaultContextMenuImpl;
|
||||
|
||||
static inline IDefaultContextMenuImpl *impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
static LPIDefaultContextMenuImpl __inline impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
{
|
||||
return (IDefaultContextMenuImpl *)((char*)iface - FIELD_OFFSET(IDefaultContextMenuImpl, lpVtbl));
|
||||
return (LPIDefaultContextMenuImpl)((char*)iface - FIELD_OFFSET(IDefaultContextMenuImpl, lpVtbl));
|
||||
}
|
||||
|
||||
VOID INewItem_SetCurrentShellFolder(IShellFolder * psfParent); // HACK
|
||||
|
@ -255,7 +234,7 @@ SH_AddStaticEntryForFileClass(IDefaultContextMenuImpl * This, WCHAR * szExt)
|
|||
result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, NULL, RRF_RT_REG_SZ, NULL, (LPBYTE)szBuffer, &dwBuffer);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
Length = strlenW(szBuffer);
|
||||
Length = wcslen(szBuffer);
|
||||
if (Length + (sizeof(szShell)/sizeof(WCHAR)) + 1 < sizeof(szBuffer)/sizeof(WCHAR))
|
||||
{
|
||||
wcscpy(&szBuffer[Length], szShell);
|
||||
|
@ -276,7 +255,7 @@ SH_AddStaticEntryForFileClass(IDefaultContextMenuImpl * This, WCHAR * szExt)
|
|||
result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, L"PerceivedType", RRF_RT_REG_SZ, NULL, (LPBYTE)&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))], &dwBuffer);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
Length = strlenW(&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))]) + (sizeof(szShellAssoc)/sizeof(WCHAR));
|
||||
Length = wcslen(&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))]) + (sizeof(szShellAssoc)/sizeof(WCHAR));
|
||||
wcscat(&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))], szShell);
|
||||
TRACE("szBuffer %s\n", debugstr_w(szBuffer));
|
||||
|
||||
|
@ -572,7 +551,7 @@ BuildBackgroundContextMenu(
|
|||
mii.fType = MFT_STRING;
|
||||
mii.wID = iIdCmdFirst++;
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = strlenW( mii.dwTypeData );
|
||||
mii.cch = wcslen( mii.dwTypeData );
|
||||
mii.fState = MFS_ENABLED;
|
||||
mii.hSubMenu = hSubMenu;
|
||||
InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii);
|
||||
|
@ -704,7 +683,7 @@ AddStaticContextMenusToMenu(
|
|||
|
||||
}
|
||||
|
||||
mii.cch = strlenW(mii.dwTypeData);
|
||||
mii.cch = wcslen(mii.dwTypeData);
|
||||
InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii);
|
||||
mii.fState = fState;
|
||||
mii.wID++;
|
||||
|
@ -1494,7 +1473,7 @@ DoDynamicShellExtensions(
|
|||
if (verb >= pCurrent->iIdCmdFirst && verb <= pCurrent->iIdCmdFirst + pCurrent->NumIds)
|
||||
{
|
||||
/* invoke the dynamic context menu */
|
||||
lpcmi->lpVerb = MAKEINTRESOURCE(verb - pCurrent->iIdCmdFirst);
|
||||
lpcmi->lpVerb = MAKEINTRESOURCEA(verb - pCurrent->iIdCmdFirst);
|
||||
return IContextMenu_InvokeCommand(pCurrent->CMenu, lpcmi);
|
||||
}
|
||||
|
||||
|
@ -1704,7 +1683,7 @@ SHCreateDefaultContextMenu(
|
|||
*
|
||||
*/
|
||||
|
||||
INT
|
||||
HRESULT
|
||||
WINAPI
|
||||
CDefFolderMenu_Create2(
|
||||
LPCITEMIDLIST pidlFolder,
|
||||
|
@ -1714,7 +1693,7 @@ CDefFolderMenu_Create2(
|
|||
IShellFolder *psf,
|
||||
LPFNDFMCALLBACK lpfn,
|
||||
UINT nKeys,
|
||||
HKEY *ahkeyClsKeys,
|
||||
const HKEY *ahkeyClsKeys,
|
||||
IContextMenu **ppcm)
|
||||
{
|
||||
DEFCONTEXTMENU pdcm;
|
||||
|
|
|
@ -6,25 +6,7 @@
|
|||
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
#include "shlobj.h"
|
||||
#include "shtypes.h"
|
||||
#include "shell32_main.h"
|
||||
#include "shellfolder.h"
|
||||
#include "undocshell.h"
|
||||
#include "shlwapi.h"
|
||||
#include "stdio.h"
|
||||
#include "winuser.h"
|
||||
#include "shresdef.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
|
@ -54,10 +36,10 @@ typedef struct
|
|||
LPWSTR szPath;
|
||||
IShellFolder *pSFParent;
|
||||
PSHELLNEW_ITEM s_SnHead;
|
||||
}INewMenuImpl;
|
||||
}INewMenuImpl, *LPINewMenuImpl;
|
||||
|
||||
static const IContextMenu2Vtbl cmvt;
|
||||
static const IShellExtInitVtbl sei;
|
||||
//static const IContextMenu2Vtbl cmvt;
|
||||
//static const IShellExtInitVtbl sei;
|
||||
static WCHAR szNew[MAX_PATH];
|
||||
|
||||
|
||||
|
@ -280,7 +262,7 @@ InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu, INewMenuImpl * This)
|
|||
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA;
|
||||
mii.fType = MFT_STRING;
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = strlenW(mii.dwTypeData);
|
||||
mii.cch = wcslen(mii.dwTypeData);
|
||||
mii.wID = idFirst++;
|
||||
InsertMenuItemW(hMenu, idMenu++, TRUE, &mii);
|
||||
|
||||
|
@ -289,7 +271,7 @@ InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu, INewMenuImpl * This)
|
|||
szBuffer[0] = 0;
|
||||
szBuffer[MAX_PATH-1] = 0;
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = strlenW(mii.dwTypeData);
|
||||
mii.cch = wcslen(mii.dwTypeData);
|
||||
mii.wID = idFirst++;
|
||||
InsertMenuItemW(hMenu, idMenu++, TRUE, &mii);
|
||||
|
||||
|
@ -317,7 +299,7 @@ InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu, INewMenuImpl * This)
|
|||
{
|
||||
TRACE("szDesc %s\n", debugstr_w(pCurItem->szDesc));
|
||||
mii.dwTypeData = pCurItem->szDesc;
|
||||
mii.cch = strlenW(mii.dwTypeData);
|
||||
mii.cch = wcslen(mii.dwTypeData);
|
||||
mii.wID = idFirst++;
|
||||
InsertMenuItemW(hMenu, idMenu++, TRUE, &mii);
|
||||
}
|
||||
|
@ -396,7 +378,7 @@ DoShellNewCmd(INewMenuImpl * This, LPCMINVOKECOMMANDINFO lpcmi)
|
|||
if (ptr)
|
||||
{
|
||||
ptr[1] = 's';
|
||||
sprintfW(szTemp, szBuffer, szPath);
|
||||
swprintf(szTemp, szBuffer, szPath);
|
||||
ptr = szTemp;
|
||||
}
|
||||
else
|
||||
|
@ -437,7 +419,7 @@ DoShellNewCmd(INewMenuImpl * This, LPCMINVOKECOMMANDINFO lpcmi)
|
|||
dwError = GetLastError();
|
||||
|
||||
TRACE("FileName %s szBuffer %s i %u error %x\n", debugstr_w(szBuffer), debugstr_w(szPath), i, dwError);
|
||||
sprintfW(szBuffer, szFormat, szPath, i, pCurItem->szExt);
|
||||
swprintf(szBuffer, szFormat, szPath, i, pCurItem->szExt);
|
||||
i++;
|
||||
}while(hFile == INVALID_HANDLE_VALUE && dwError == ERROR_FILE_EXISTS);
|
||||
|
||||
|
@ -500,7 +482,7 @@ DoMeasureItem(INewMenuImpl *This, HWND hWnd, MEASUREITEMSTRUCT * lpmis)
|
|||
return E_FAIL;
|
||||
}
|
||||
hDC = GetDC(hWnd);
|
||||
GetTextExtentPoint32W(hDC, pCurItem->szDesc, strlenW(pCurItem->szDesc), &size);
|
||||
GetTextExtentPoint32W(hDC, pCurItem->szDesc, wcslen(pCurItem->szDesc), &size);
|
||||
lpmis->itemWidth = size.cx + 32;
|
||||
lpmis->itemHeight = max(size.cy, 20);
|
||||
ReleaseDC (hWnd, hDC);
|
||||
|
@ -577,12 +559,12 @@ static void DoNewFolder(
|
|||
}
|
||||
|
||||
|
||||
static inline INewMenuImpl *impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
static LPINewMenuImpl __inline impl_from_IShellExtInit( IShellExtInit *iface )
|
||||
{
|
||||
return (INewMenuImpl *)((char*)iface - FIELD_OFFSET(INewMenuImpl, lpvtblShellExtInit));
|
||||
}
|
||||
|
||||
static __inline INewMenuImpl * impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
static LPINewMenuImpl __inline impl_from_IContextMenu( IContextMenu2 *iface )
|
||||
{
|
||||
return (INewMenuImpl *)((char*)iface - FIELD_OFFSET(INewMenuImpl, lpVtblContextMenu));
|
||||
}
|
||||
|
@ -686,7 +668,7 @@ INewItem_IContextMenu_fnQueryContextMenu(IContextMenu2 *iface,
|
|||
mii.fType = MFT_STRING;
|
||||
mii.wID = idCmdFirst + id++;
|
||||
mii.dwTypeData = szBuffer;
|
||||
mii.cch = strlenW( mii.dwTypeData );
|
||||
mii.cch = wcslen( mii.dwTypeData );
|
||||
mii.fState = MFS_ENABLED;
|
||||
|
||||
if (hSubMenu)
|
||||
|
|
|
@ -18,45 +18,35 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "windef.h"
|
||||
#include "shlobj.h"
|
||||
#include "base/shell/explorer-new/todo.h"
|
||||
|
||||
#include "shell32_main.h"
|
||||
#include <precomp.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
const GUID CLSID_StartMenu = { 0x4622AD11, 0xFF23, 0x11D0, {0x8D,0x34,0x00,0xA0,0xC9,0x0F,0x27,0x19} };
|
||||
|
||||
typedef struct _tagStartMenu {
|
||||
const IMenuPopupVtbl *vtbl;
|
||||
const IObjectWithSiteVtbl *objectSiteVtbl;
|
||||
const IInitializeObjectVtbl *initObjectVtbl;
|
||||
IUnknown *pUnkSite;
|
||||
LONG refCount;
|
||||
} StartMenu;
|
||||
} StartMenu, *LPStartMenu;
|
||||
|
||||
static const IMenuPopupVtbl StartMenuVtbl;
|
||||
static const IObjectWithSiteVtbl StartMenu_ObjectWithSiteVtbl;
|
||||
static const IInitializeObjectVtbl StartMenu_InitializeObjectVtbl;
|
||||
|
||||
static inline StartMenu *impl_from_IMenuPopup(IMenuPopup *iface)
|
||||
static LPStartMenu __inline impl_from_IMenuPopup(IMenuPopup *iface)
|
||||
{
|
||||
return (StartMenu *)((char *)iface - FIELD_OFFSET(StartMenu, vtbl));
|
||||
return (LPStartMenu)((char *)iface - FIELD_OFFSET(StartMenu, vtbl));
|
||||
}
|
||||
|
||||
static inline StartMenu *impl_from_IObjectWithSite(IObjectWithSite *iface)
|
||||
static LPStartMenu __inline impl_from_IObjectWithSite(IObjectWithSite *iface)
|
||||
{
|
||||
return (StartMenu *)((char *)iface - FIELD_OFFSET(StartMenu, objectSiteVtbl));
|
||||
return (LPStartMenu)((char *)iface - FIELD_OFFSET(StartMenu, objectSiteVtbl));
|
||||
}
|
||||
|
||||
static inline StartMenu *impl_from_IInitializeObject(IInitializeObject *iface)
|
||||
static LPStartMenu __inline impl_from_IInitializeObject(IInitializeObject *iface)
|
||||
{
|
||||
return (StartMenu *)((char *)iface - FIELD_OFFSET(StartMenu, initObjectVtbl));
|
||||
return (LPStartMenu)((char *)iface - FIELD_OFFSET(StartMenu, initObjectVtbl));
|
||||
}
|
||||
|
||||
HRESULT WINAPI StartMenu_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
|
||||
|
|
|
@ -51,8 +51,7 @@ BOOL WINAPI ILGetDisplayNameEx(
|
|||
|
||||
LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
|
||||
void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
|
||||
|
||||
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath);
|
||||
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME
|
||||
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
|
||||
|
||||
HRESULT WINAPI SHILCreateFromPathA (
|
||||
|
@ -176,7 +175,7 @@ typedef struct
|
|||
* System Imagelist Routines
|
||||
*/
|
||||
|
||||
int WINAPI Shell_GetCachedImageIndex(
|
||||
int WINAPI Shell_GetCachedImageIndexA(
|
||||
LPCSTR lpszFileName,
|
||||
int nIconIndex,
|
||||
UINT bSimulateDoc);
|
||||
|
@ -415,7 +414,7 @@ VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
|
|||
/* PathProcessCommand flags */
|
||||
#define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */
|
||||
#define PPCF_INCLUDEARGS 0x02
|
||||
#define PPCF_NODIRECTORIES 0x10
|
||||
//#define PPCF_NODIRECTORIES 0x10 move to shlobj
|
||||
#define PPCF_DONTRESOLVE 0x20
|
||||
#define PPCF_PATHISRELATIVE 0x40
|
||||
|
||||
|
@ -545,9 +544,6 @@ DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
|
|||
/* policy functions */
|
||||
BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
|
||||
|
||||
DEFINE_GUID(CLSID_OpenWith, 0x09799AFB, 0xAD67, 0x11d1, 0xAB,0xCD,0x00,0xC0,0x4F,0xC3,0x09,0x36);
|
||||
DEFINE_GUID(CLSID_StartMenu, 0x4622AD11, 0xFF23, 0x11D0, 0x8D,0x34,0x00,0xA0,0xC9,0x0F,0x27,0x19);
|
||||
|
||||
/* Shell Desktop functions */
|
||||
|
||||
#undef INTERFACE
|
||||
|
@ -579,6 +575,8 @@ DECLARE_INTERFACE_(IShellDesktop,IUnknown)
|
|||
HANDLE WINAPI SHCreateDesktop(IShellDesktop*);
|
||||
BOOL WINAPI SHDesktopMessageLoop(HANDLE);
|
||||
|
||||
#define CSIDL_FOLDER_MASK 0x00ff
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* defined(__cplusplus) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue