ReactOS 0.4.16-dev-329-g9223134
shellord.c File Reference
#include <wine/config.h>
#include <windef.h>
#include <winbase.h>
#include <wine/winternl.h>
#include <shlobj.h>
#include <undocshell.h>
#include <shlwapi.h>
#include <commdlg.h>
#include <commoncontrols.h>
#include "../shellrecyclebin/recyclebin.h"
#include <wine/debug.h>
#include <wine/unicode.h>
#include "pidl.h"
#include "shell32_main.h"
Include dependency graph for shellord.c:

Go to the source code of this file.

Classes

struct  tagCREATEMRULIST
 
struct  _PSXA
 
struct  _PSXA_CALL
 
struct  UxSubclassInfo
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COBJMACROS
 
#define MRUF_STRING_LIST   0 /* list will contain strings */
 
#define MRUF_BINARY_LIST   1 /* list will contain binary data */
 
#define MRUF_DELAYED_SAVE   2 /* only save list order to reg. is FreeMRUList */
 

Typedefs

typedef struct tagCREATEMRULIST CREATEMRULISTA
 
typedef struct tagCREATEMRULISTLPCREATEMRULISTA
 
typedef struct _PSXA PSXA
 
typedef struct _PSXAPPSXA
 
typedef struct _PSXA_CALL PSXA_CALL
 
typedef struct _PSXA_CALLPPSXA_CALL
 
typedef struct UxSubclassInfo UxSubclassInfo
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
 WINE_DECLARE_DEBUG_CHANNEL (pidl)
 
HANDLE WINAPI CreateMRUListA (LPCREATEMRULISTA lpcml)
 
VOID WINAPI FreeMRUList (HANDLE hMRUList)
 
INT WINAPI AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
 
INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
 
INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
 
DWORD WINAPI ParseFieldA (LPCSTR src, DWORD nField, LPSTR dst, DWORD len)
 
DWORD WINAPI ParseFieldW (LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
 
DWORD WINAPI ParseFieldAW (LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
 
BOOL WINAPI GetFileNameFromBrowse (HWND hwndOwner, LPWSTR lpstrFile, UINT nMaxFile, LPCWSTR lpstrInitialDir, LPCWSTR lpstrDefExt, LPCWSTR lpstrFilter, LPCWSTR lpstrTitle)
 
VOID WINAPI SHGetSetSettings (LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
 
VOID WINAPI SHGetSettings (LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
 
LRESULT WINAPI SHShellFolderView_Message (HWND hwndCabinet, UINT uMessage, LPARAM lParam)
 
BOOL WINAPI RegisterShellHook (HWND hWnd, DWORD dwType)
 
int ShellMessageBoxW (HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType,...)
 
int ShellMessageBoxA (HINSTANCE hInstance, HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,...)
 
HRESULT WINAPI SHRegisterDragDrop (HWND hWnd, LPDROPTARGET pDropTarget)
 
HRESULT WINAPI SHRevokeDragDrop (HWND hWnd)
 
HRESULT WINAPI SHDoDragDrop (HWND hWnd, LPDATAOBJECT lpDataObject, LPDROPSOURCE lpDropSource, DWORD dwOKEffect, LPDWORD pdwEffect)
 
WORD WINAPI ArrangeWindows (HWND hwndParent, DWORD dwReserved, const RECT *lpRect, WORD cKids, const HWND *lpKids)
 
BOOL WINAPI SignalFileOpen (PCIDLIST_ABSOLUTE pidl)
 
static INT SHADD_get_policy (LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
 
static INT CALLBACK SHADD_compare_mru (LPCVOID data1, LPCVOID data2, DWORD cbData)
 
static INT SHADD_create_add_mru_data (HANDLE mruhandle, LPCSTR doc_name, LPCSTR new_lnk_name, LPSTR buffer, INT *len)
 
void WINAPI SHAddToRecentDocs (UINT uFlags, LPCVOID pv)
 
HRESULT WINAPI SHCreateShellFolderViewEx (LPCSFV psvcbi, IShellView **ppv)
 
HRESULT WINAPI SHWinHelp (HWND hwnd, LPCWSTR pszHelp, UINT uCommand, ULONG_PTR dwData)
 
BOOL WINAPI SHRunControlPanel (_In_ LPCWSTR commandLine, _In_opt_ HWND parent)
 
VOID WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
 
HRESULT WINAPI SHGetInstanceExplorer (IUnknown **lpUnknown)
 
void WINAPI SHFreeUnusedLibraries (void)
 
BOOL WINAPI DAD_AutoScroll (HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT *pt)
 
BOOL WINAPI DAD_DragEnter (HWND hwnd)
 
BOOL WINAPI DAD_DragEnterEx (HWND hwnd, POINT p)
 
BOOL WINAPI DAD_DragMove (POINT p)
 
BOOL WINAPI DAD_DragLeave (VOID)
 
BOOL WINAPI DAD_SetDragImage (HIMAGELIST himlTrack, LPPOINT lppt)
 
BOOL WINAPI DAD_ShowDragImage (BOOL bShow)
 
BOOL WINAPI ReadCabinetState (CABINETSTATE *cs, int length)
 
BOOL WINAPI WriteCabinetState (CABINETSTATE *cs)
 
BOOL WINAPI FileIconInit (BOOL bFullInit)
 
HRESULT WINAPI SetAppStartingCursor (HWND u, DWORD v)
 
HRESULT WINAPI SHLoadOLE (LPARAM lParam)
 
int WINAPI DriveType (int DriveType)
 
int WINAPI InvalidateDriveType (int u)
 
HRESULT WINAPI SHAbortInvokeCommand (void)
 
int WINAPI SHOutOfMemoryMessageBox (HWND hwndOwner, LPCSTR lpCaption, UINT uType)
 
HRESULT WINAPI SHFlushClipboard (void)
 
BOOL WINAPI SHWaitForFileToOpen (LPCITEMIDLIST pidl, DWORD dwFlags, DWORD dwTimeout)
 
DWORD WINAPI RLBuildListOfPaths (void)
 
BOOL WINAPI SHValidateUNC (HWND hwndOwner, PWSTR pszFile, UINT fConnect)
 
DWORD WINAPI DoEnvironmentSubstA (LPSTR pszString, UINT cchString)
 
DWORD WINAPI DoEnvironmentSubstW (LPWSTR pszString, UINT cchString)
 
DWORD WINAPI DoEnvironmentSubstAW (LPVOID x, UINT y)
 
BOOL WINAPI GUIDFromStringA (LPCSTR str, LPGUID guid)
 
BOOL WINAPI GUIDFromStringW (LPCWSTR str, LPGUID guid)
 
BOOL WINAPI PathIsTemporaryA (LPSTR Str)
 
BOOL WINAPI PathIsTemporaryW (LPWSTR Str)
 
static BOOL CALLBACK PsxaCall (HPROPSHEETPAGE hpage, LPARAM lParam)
 
UINT WINAPI SHAddFromPropSheetExtArray (HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
 
HPSXA WINAPI SHCreatePropSheetExtArray (HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
 
HPSXA WINAPI SHCreatePropSheetExtArrayEx (HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj)
 
UINT WINAPI SHReplaceFromPropSheetExtArray (HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
 
void WINAPI SHDestroyPropSheetExtArray (HPSXA hpsxa)
 
HRESULT WINAPI CIDLData_CreateFromIDArray (PCIDLIST_ABSOLUTE pidlFolder, UINT cpidlFiles, PCUIDLIST_RELATIVE_ARRAY lppidlFiles, LPDATAOBJECT *ppdataObject)
 
HRESULT WINAPI SHCreateStdEnumFmtEtc (UINT cFormats, const FORMATETC *lpFormats, LPENUMFORMATETC *ppenumFormatetc)
 
BOOL WINAPI SHFindFiles (PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
 
void WINAPI SHUpdateImageW (LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
 
VOID WINAPI SHUpdateImageA (LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iImageIndex)
 
INT WINAPI SHHandleUpdateImage (PCIDLIST_ABSOLUTE pidlExtra)
 
BOOL WINAPI SHObjectProperties (HWND hwnd, DWORD dwType, LPCWSTR szObject, LPCWSTR szPage)
 
BOOL WINAPI SHGetNewLinkInfoA (LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags)
 
BOOL WINAPI SHGetNewLinkInfoW (LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
 
HRESULT WINAPI SHStartNetConnectionDialog (HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
 
HRESULT WINAPI SHSetLocalizedName (LPCWSTR pszPath, LPCWSTR pszResModule, int idsRes)
 
BOOL WINAPI LinkWindow_RegisterClass (void)
 
BOOL WINAPI LinkWindow_UnregisterClass (DWORD dwUnused)
 
void WINAPI SHFlushSFCache (void)
 
HRESULT WINAPI SHGetImageList (int iImageList, REFIID riid, void **ppv)
 
HRESULT WINAPI SHCreateShellFolderView (const SFV_CREATE *pcsfv, IShellView **ppsv)
 
EXTERN_C BOOL WINAPI SHTestTokenMembership (HANDLE TokenHandle, ULONG ulRID)
 
BOOL WINAPI IsUserAnAdmin (VOID)
 
static void UxSubclassInfo_Destroy (UxSubclassInfo *pInfo)
 
static BOOL DoSanitizeText (LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
 
static void DoSanitizeClipboard (HWND hwnd, UxSubclassInfo *pInfo)
 
static LRESULT CALLBACK LimitEditWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static UxSubclassInfoUxSubclassInfo_Create (HWND hwnd, LPWSTR valid, LPWSTR invalid)
 
HRESULT WINAPI SHLimitInputEdit (HWND hWnd, IShellFolder *psf)
 

Variables

static LPUNKNOWN SHELL32_IExplorerInterface =0
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 26 of file shellord.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file shellord.c.

◆ MRUF_BINARY_LIST

#define MRUF_BINARY_LIST   1 /* list will contain binary data */

Definition at line 66 of file shellord.c.

◆ MRUF_DELAYED_SAVE

#define MRUF_DELAYED_SAVE   2 /* only save list order to reg. is FreeMRUList */

Definition at line 67 of file shellord.c.

◆ MRUF_STRING_LIST

#define MRUF_STRING_LIST   0 /* list will contain strings */

Definition at line 65 of file shellord.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file shellord.c.

Typedef Documentation

◆ CREATEMRULISTA

◆ LPCREATEMRULISTA

◆ PPSXA

typedef struct _PSXA * PPSXA

◆ PPSXA_CALL

◆ PSXA

typedef struct _PSXA PSXA

◆ PSXA_CALL

◆ UxSubclassInfo

Function Documentation

◆ AddMRUData()

INT WINAPI AddMRUData ( HANDLE  hList,
LPCVOID  lpData,
DWORD  cbData 
)

Definition at line 462 of file comctl32undoc.c.

463{
464 LPWINEMRULIST mp = hList;
465 LPWINEMRUITEM witem;
466 INT i, replace;
467
468 if ((replace = FindMRUData (hList, lpData, cbData, NULL)) >= 0) {
469 /* Item exists, just move it to the front */
470 LPWSTR pos = wcschr(mp->realMRU, replace + 'a');
471 while (pos > mp->realMRU)
472 {
473 pos[0] = pos[-1];
474 pos--;
475 }
476 }
477 else {
478 /* either add a new entry or replace oldest */
479 if (mp->cursize < mp->extview.uMax) {
480 /* Add in a new item */
481 replace = mp->cursize;
482 mp->cursize++;
483 }
484 else {
485 /* get the oldest entry and replace data */
486 replace = mp->realMRU[mp->cursize - 1] - 'a';
487 Free(mp->array[replace]);
488 }
489
490 /* Allocate space for new item and move in the data */
491 mp->array[replace] = witem = Alloc(cbData + sizeof(WINEMRUITEM));
492 witem->itemFlag |= WMRUIF_CHANGED;
493 witem->size = cbData;
494 memcpy( &witem->datastart, lpData, cbData);
495
496 /* now rotate MRU list */
497 for(i=mp->cursize-1; i>=1; i--)
498 mp->realMRU[i] = mp->realMRU[i-1];
499 }
500
501 /* The new item gets the front spot */
503 mp->realMRU[0] = replace + 'a';
504
505 TRACE("(%p, %p, %d) adding data, /%c/ now most current\n",
506 hList, lpData, cbData, replace+'a');
507
508 if (!(mp->extview.fFlags & MRU_CACHEWRITE)) {
509 /* save changed stuff right now */
510 MRU_SaveChanged( mp );
511 }
512
513 return replace;
514}
#define WMRUIF_CHANGED
INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
LPVOID WINAPI Alloc(DWORD dwSize)
Definition: comctl32undoc.c:68
static void MRU_SaveChanged(LPWINEMRULIST mp)
#define WMRUF_CHANGED
#define MRU_CACHEWRITE
#define NULL
Definition: types.h:112
#define wcschr
Definition: compat.h:17
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HWND hList
Definition: livecd.c:10
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:38
#define TRACE(s)
Definition: solgame.cpp:4
LPWINEMRUITEM * array
MRUINFOW extview
int32_t INT
Definition: typedefs.h:58
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by SHADD_create_add_mru_data(), and SHAddToRecentDocs().

◆ ArrangeWindows()

WORD WINAPI ArrangeWindows ( HWND  hwndParent,
DWORD  dwReserved,
const RECT lpRect,
WORD  cKids,
const HWND lpKids 
)

Definition at line 808 of file shellord.c.

810{
811 /* Unimplemented in WinXP SP3 */
812 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
813 hwndParent, dwReserved, lpRect, cKids, lpKids);
814 return 0;
815}
static HWND hwndParent
Definition: cryptui.c:300
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ CIDLData_CreateFromIDArray()

HRESULT WINAPI CIDLData_CreateFromIDArray ( PCIDLIST_ABSOLUTE  pidlFolder,
UINT  cpidlFiles,
PCUIDLIST_RELATIVE_ARRAY  lppidlFiles,
LPDATAOBJECT ppdataObject 
)

Definition at line 2418 of file shellord.c.

2423{
2424 UINT i;
2425 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
2426 HRESULT hResult;
2427
2428 TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
2429 if (TRACE_ON(pidl))
2430 {
2431 pdump (pidlFolder);
2432 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
2433 }
2434 hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, FALSE, ppdataObject);
2435 return hResult;
2436}
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
#define FALSE
Definition: types.h:117
#define TRACE_ON(x)
Definition: compat.h:75
unsigned int UINT
Definition: ndis.h:50
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by _CDataObject_CreateInstance(), CZipFolder::GetUIObjectOf(), CCabFolder::GetUIObjectOf(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), test_AttributesRegistration(), test_MultipleFiles(), TestAdviseAndCanonical(), TestDefaultFormat(), and TestSetAndGetExtraFormat().

◆ CreateMRUListA()

HANDLE WINAPI CreateMRUListA ( LPCREATEMRULISTA  lpcml)

Referenced by SHAddToRecentDocs().

◆ DAD_AutoScroll()

BOOL WINAPI DAD_AutoScroll ( HWND  hwnd,
AUTO_SCROLL_DATA samples,
const POINT pt 
)

Definition at line 1736 of file shellord.c.

1737{
1738 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1739 return FALSE;
1740}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define pt(x, y)
Definition: drawing.c:79
GLsizei samples
Definition: glext.h:7006

◆ DAD_DragEnter()

BOOL WINAPI DAD_DragEnter ( HWND  hwnd)

Definition at line 1745 of file shellord.c.

1746{
1747 FIXME("hwnd = %p\n",hwnd);
1748 return FALSE;
1749}

◆ DAD_DragEnterEx()

BOOL WINAPI DAD_DragEnterEx ( HWND  hwnd,
POINT  p 
)

Definition at line 1754 of file shellord.c.

1755{
1756 FIXME("hwnd = %p (%d,%d)\n",hwnd,p.x,p.y);
1757 return FALSE;
1758}
GLfloat GLfloat p
Definition: glext.h:8902

◆ DAD_DragLeave()

BOOL WINAPI DAD_DragLeave ( VOID  )

Definition at line 1772 of file shellord.c.

1773{
1774 FIXME("\n");
1775 return FALSE;
1776}

◆ DAD_DragMove()

BOOL WINAPI DAD_DragMove ( POINT  p)

Definition at line 1763 of file shellord.c.

1764{
1765 FIXME("(%d,%d)\n",p.x,p.y);
1766 return FALSE;
1767}

◆ DAD_SetDragImage()

BOOL WINAPI DAD_SetDragImage ( HIMAGELIST  himlTrack,
LPPOINT  lppt 
)

Definition at line 1783 of file shellord.c.

1786{
1787 FIXME("%p %p stub\n",himlTrack, lppt);
1788 return FALSE;
1789}

◆ DAD_ShowDragImage()

BOOL WINAPI DAD_ShowDragImage ( BOOL  bShow)

Definition at line 1796 of file shellord.c.

1797{
1798 FIXME("0x%08x stub\n",bShow);
1799 return FALSE;
1800}

◆ DoEnvironmentSubstA()

DWORD WINAPI DoEnvironmentSubstA ( LPSTR  pszString,
UINT  cchString 
)

Definition at line 2010 of file shellord.c.

2011{
2012 LPSTR dst;
2013 BOOL res = FALSE;
2014 DWORD len = cchString;
2015
2016 TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
2017 if (pszString == NULL) /* Really return 0? */
2018 return 0;
2019 if ((dst = (LPSTR)HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
2020 {
2022 /* len includes the terminating 0 */
2023 if (len && len < cchString)
2024 {
2025 res = TRUE;
2027 }
2028 else
2029 len = cchString;
2030
2032 }
2033 return MAKELONG(len, res);
2034}
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:399
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_a
Definition: kernel32.h:31
#define MAKELONG(a, b)
Definition: typedefs.h:249
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
char * LPSTR
Definition: xmlstorage.h:182
char CHAR
Definition: xmlstorage.h:175

Referenced by DoEnvironmentSubstAW(), and test_DoEnvironmentSubst().

◆ DoEnvironmentSubstAW()

DWORD WINAPI DoEnvironmentSubstAW ( LPVOID  x,
UINT  y 
)

Definition at line 2085 of file shellord.c.

2086{
2087 if (SHELL_OsIsUnicode())
2088 return DoEnvironmentSubstW(x, y);
2089 return DoEnvironmentSubstA(x, y);
2090}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:145
DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
Definition: shellord.c:2055
DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
Definition: shellord.c:2010

◆ DoEnvironmentSubstW()

DWORD WINAPI DoEnvironmentSubstW ( LPWSTR  pszString,
UINT  cchString 
)

Definition at line 2055 of file shellord.c.

2056{
2057 LPWSTR dst;
2058 BOOL res = FALSE;
2059 DWORD len = cchString;
2060
2061 TRACE("(%s, %d)\n", debugstr_w(pszString), cchString);
2062
2063 if ((cchString < MAXLONG) && (dst = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(WCHAR))))
2064 {
2066 /* len includes the terminating 0 */
2067 if (len && len <= cchString)
2068 {
2069 res = TRUE;
2070 memcpy(pszString, dst, len * sizeof(WCHAR));
2071 }
2072 else
2073 len = cchString;
2074
2076 }
2077 return MAKELONG(len, res);
2078}
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define debugstr_w
Definition: kernel32.h:32
#define MAXLONG
Definition: umtypes.h:116
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DoEnvironmentSubstAW(), and test_DoEnvironmentSubst().

◆ DoSanitizeClipboard()

static void DoSanitizeClipboard ( HWND  hwnd,
UxSubclassInfo pInfo 
)
static

Definition at line 2876 of file shellord.c.

2877{
2878 HGLOBAL hData;
2879 LPWSTR pszText, pszSanitized;
2880 DWORD cbData;
2881
2883 return;
2884 if (!OpenClipboard(hwnd))
2885 return;
2886
2888 pszText = GlobalLock(hData);
2889 if (!pszText)
2890 {
2892 return;
2893 }
2894 SHStrDupW(pszText, &pszSanitized);
2895 GlobalUnlock(hData);
2896
2897 if (pszSanitized &&
2898 DoSanitizeText(pszSanitized, pInfo->pwszInvalidChars, pInfo->pwszValidChars))
2899 {
2900 MessageBeep(0xFFFFFFFF);
2901
2902 /* Update clipboard text */
2903 cbData = (lstrlenW(pszSanitized) + 1) * sizeof(WCHAR);
2904 hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, cbData);
2905 pszText = GlobalLock(hData);
2906 if (pszText)
2907 {
2908 CopyMemory(pszText, pszSanitized, cbData);
2909 GlobalUnlock(hData);
2910
2912 }
2913 }
2914
2915 CoTaskMemFree(pszSanitized);
2917}
#define CF_UNICODETEXT
Definition: constants.h:408
#define lstrlenW
Definition: compat.h:750
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define ES_READONLY
Definition: pedump.c:675
static BOOL DoSanitizeText(LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
Definition: shellord.c:2843
LPWSTR pwszValidChars
Definition: shellord.c:2822
LPWSTR pwszInvalidChars
Definition: shellord.c:2823
#define CopyMemory
Definition: winbase.h:1735
#define GMEM_MOVEABLE
Definition: winbase.h:320
#define GMEM_SHARE
Definition: winbase.h:331
#define GetWindowLongPtrW
Definition: winuser.h:4832
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
BOOL WINAPI MessageBeep(_In_ UINT uType)
HANDLE WINAPI GetClipboardData(_In_ UINT)
#define GWL_STYLE
Definition: winuser.h:855

Referenced by LimitEditWindowProc().

◆ DoSanitizeText()

static BOOL DoSanitizeText ( LPWSTR  pszSanitized,
LPCWSTR  pszInvalidChars,
LPCWSTR  pszValidChars 
)
static

Definition at line 2843 of file shellord.c.

2844{
2845 LPWSTR pch1, pch2;
2846 BOOL bFound = FALSE;
2847
2848 for (pch1 = pch2 = pszSanitized; *pch1; ++pch1)
2849 {
2850 if (pszInvalidChars)
2851 {
2852 if (wcschr(pszInvalidChars, *pch1) != NULL)
2853 {
2854 bFound = TRUE;
2855 continue;
2856 }
2857 }
2858 else if (pszValidChars)
2859 {
2860 if (wcschr(pszValidChars, *pch1) == NULL)
2861 {
2862 bFound = TRUE;
2863 continue;
2864 }
2865 }
2866
2867 *pch2 = *pch1;
2868 ++pch2;
2869 }
2870 *pch2 = 0;
2871
2872 return bFound;
2873}

Referenced by DoSanitizeClipboard().

◆ DriveType()

int WINAPI DriveType ( int  DriveType)

Definition at line 1928 of file shellord.c.

1929{
1930 WCHAR root[] = L"A:\\";
1931 root[0] = L'A' + DriveType;
1932 return GetDriveTypeW(root);
1933}
UINT DriveType
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define L(x)
Definition: ntvdm.h:50

◆ EnumMRUListA()

INT WINAPI EnumMRUListA ( HANDLE  hList,
INT  nItemPos,
LPVOID  lpBuffer,
DWORD  nBufferSize 
)

Definition at line 860 of file comctl32undoc.c.

862{
863 const WINEMRULIST *mp = hList;
864 LPWINEMRUITEM witem;
866 DWORD lenA;
867
868 if (!mp) return -1;
869 if ((nItemPos < 0) || !lpBuffer) return mp->cursize;
870 if (nItemPos >= mp->cursize) return -1;
871 desired = mp->realMRU[nItemPos];
872 desired -= 'a';
873 TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
874 witem = mp->array[desired];
875 if(mp->extview.fFlags & MRU_BINARY) {
876 datasize = min( witem->size, nBufferSize );
877 memcpy( lpBuffer, &witem->datastart, datasize);
878 } else {
879 lenA = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
880 NULL, 0, NULL, NULL);
881 datasize = min( lenA, nBufferSize );
884 ((char *)lpBuffer)[ datasize - 1 ] = '\0';
885 datasize = lenA - 1;
886 }
887 TRACE("(%p, %d, %p, %d): returning len=%d\n",
888 hList, nItemPos, lpBuffer, nBufferSize, datasize);
889 return datasize;
890}
#define MRU_BINARY
static SIZE_T datasize
Definition: asm.c:30
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
int desired
Definition: jpeglib.h:1119
#define min(a, b)
Definition: monoChain.cc:55

Referenced by SHAddToRecentDocs().

◆ FileIconInit()

BOOL WINAPI FileIconInit ( BOOL  bFullInit)

Definition at line 1888 of file shellord.c.

1889{
1890 return SIC_Initialize();
1891}
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:481

Referenced by DisplayImageList(), and StartWithDesktop().

◆ FindMRUData()

INT WINAPI FindMRUData ( HANDLE  hList,
LPCVOID  lpData,
DWORD  cbData,
LPINT  lpRegNum 
)

Definition at line 388 of file comctl32undoc.c.

390{
391 const WINEMRULIST *mp = hList;
392 INT ret;
393 UINT i;
394 LPSTR dataA = NULL;
395
396 if (!mp || !mp->extview.u.string_cmpfn)
397 return -1;
398
399 if(!(mp->extview.fFlags & MRU_BINARY) && !mp->isUnicode) {
400 DWORD len = WideCharToMultiByte(CP_ACP, 0, lpData, -1,
401 NULL, 0, NULL, NULL);
402 dataA = Alloc(len);
403 WideCharToMultiByte(CP_ACP, 0, lpData, -1, dataA, len, NULL, NULL);
404 }
405
406 for(i=0; i<mp->cursize; i++) {
407 if (mp->extview.fFlags & MRU_BINARY) {
408 if (!mp->extview.u.binary_cmpfn(lpData, &mp->array[i]->datastart, cbData))
409 break;
410 }
411 else {
412 if(mp->isUnicode) {
413 if (!mp->extview.u.string_cmpfn(lpData, (LPWSTR)&mp->array[i]->datastart))
414 break;
415 } else {
417 (LPWSTR)&mp->array[i]->datastart, -1,
418 NULL, 0, NULL, NULL);
419 LPSTR itemA = Alloc(len);
420 INT cmp;
422 itemA, len, NULL, NULL);
423
424 cmp = mp->extview.u.string_cmpfn((LPWSTR)dataA, (LPWSTR)itemA);
425 Free(itemA);
426 if(!cmp)
427 break;
428 }
429 }
430 }
431 Free(dataA);
432 if (i < mp->cursize)
433 ret = i;
434 else
435 ret = -1;
436 if (lpRegNum && (ret != -1))
437 *lpRegNum = 'a' + i;
438
439 TRACE("(%p, %p, %d, %p) returning %d\n",
440 hList, lpData, cbData, lpRegNum, ret);
441
442 return ret;
443}
#define cmp(status, error)
Definition: error.c:114
MRUBinaryCmpFn binary_cmpfn
MRUStringCmpFnW string_cmpfn
union tagMRUINFOW::@336 u
int ret

Referenced by SHAddToRecentDocs().

◆ FreeMRUList()

VOID WINAPI FreeMRUList ( HANDLE  hMRUList)

Definition at line 348 of file comctl32undoc.c.

349{
350 LPWINEMRULIST mp = hMRUList;
351 UINT i;
352
353 TRACE("(%p)\n", hMRUList);
354 if (!hMRUList)
355 return;
356
357 if (mp->wineFlags & WMRUF_CHANGED) {
358 /* need to open key and then save the info */
359 MRU_SaveChanged( mp );
360 }
361
362 for(i=0; i<mp->extview.uMax; i++)
363 Free(mp->array[i]);
364
365 Free(mp->realMRU);
366 Free(mp->array);
368 Free(mp);
369}
LPWSTR lpszSubKey

Referenced by SHAddToRecentDocs().

◆ GetFileNameFromBrowse()

BOOL WINAPI GetFileNameFromBrowse ( HWND  hwndOwner,
LPWSTR  lpstrFile,
UINT  nMaxFile,
LPCWSTR  lpstrInitialDir,
LPCWSTR  lpstrDefExt,
LPCWSTR  lpstrFilter,
LPCWSTR  lpstrTitle 
)

Definition at line 154 of file shellord.c.

162{
163typedef BOOL (WINAPI *GetOpenFileNameProc)(OPENFILENAMEW *ofn);
165 GetOpenFileNameProc pGetOpenFileNameW;
167 BOOL ret;
168
169 TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
170 hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt,
171 lpstrFilter, lpstrTitle);
172
173 hmodule = LoadLibraryW(L"comdlg32.dll");
174 if(!hmodule) return FALSE;
175 pGetOpenFileNameW = (GetOpenFileNameProc)GetProcAddress(hmodule, "GetOpenFileNameW");
176 if(!pGetOpenFileNameW)
177 {
179 return FALSE;
180 }
181
182 memset(&ofn, 0, sizeof(ofn));
183
184 ofn.lStructSize = sizeof(ofn);
185 ofn.hwndOwner = hwndOwner;
186 ofn.lpstrFilter = lpstrFilter;
187 ofn.lpstrFile = lpstrFile;
188 ofn.nMaxFile = nMaxFile;
189 ofn.lpstrInitialDir = lpstrInitialDir;
190 ofn.lpstrTitle = lpstrTitle;
191 ofn.lpstrDefExt = lpstrDefExt;
193 ret = pGetOpenFileNameW(&ofn);
194
196 return ret;
197}
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
static HMODULE hmodule
Definition: rasapi.c:29
#define BOOL
Definition: nt_native.h:43
#define memset(x, y, z)
Definition: compat.h:39
OPENFILENAME ofn
Definition: sndrec32.cpp:56
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrTitle
Definition: commdlg.h:341
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
#define WINAPI
Definition: msvc.h:6

◆ GUIDFromStringA()

BOOL WINAPI GUIDFromStringA ( LPCSTR  str,
LPGUID  guid 
)

Definition at line 2095 of file shellord.c.

2096{
2097 ANSI_STRING ansi_str;
2098 WCHAR szWide[40];
2099 UNICODE_STRING guid_str = { 0, sizeof(szWide), szWide };
2100 if (*str != '{')
2101 return FALSE;
2102 RtlInitAnsiString(&ansi_str, str);
2103 return !RtlAnsiStringToUnicodeString(&guid_str, &ansi_str, FALSE) &&
2104 !RtlGUIDFromString(&guid_str, guid);
2105}
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
const GUID * guid
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
const WCHAR * str

Referenced by TEST_GUIDFromStringA().

◆ GUIDFromStringW()

BOOL WINAPI GUIDFromStringW ( LPCWSTR  str,
LPGUID  guid 
)

Definition at line 2110 of file shellord.c.

2111{
2112 UNICODE_STRING guid_str;
2113 if (!str || *str != L'{')
2114 return FALSE;
2115 RtlInitUnicodeString(&guid_str, str);
2116 return !RtlGUIDFromString(&guid_str, guid);
2117}
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

◆ InvalidateDriveType()

int WINAPI InvalidateDriveType ( int  u)

Definition at line 1938 of file shellord.c.

1939{
1940 TRACE("0x%08x stub\n",u);
1941 return 0;
1942}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240

◆ IsUserAnAdmin()

BOOL WINAPI IsUserAnAdmin ( VOID  )

Definition at line 2807 of file shellord.c.

2808{
2810}
EXTERN_C BOOL WINAPI SHTestTokenMembership(HANDLE TokenHandle, ULONG ulRID)
Definition: shellord.c:2755
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652

Referenced by CStartMenuBtnCtxMenu::AddStartContextMenuItems(), and ProcessRunOnceItems().

◆ LimitEditWindowProc()

static LRESULT CALLBACK LimitEditWindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2920 of file shellord.c.

2921{
2922 WNDPROC fnWndProc;
2923 WCHAR wch;
2924 UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
2925 if (!pInfo)
2926 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
2927
2928 fnWndProc = pInfo->fnWndProc;
2929
2930 switch (uMsg)
2931 {
2932 case WM_KEYDOWN:
2933 if (GetKeyState(VK_SHIFT) < 0 && wParam == VK_INSERT)
2934 DoSanitizeClipboard(hwnd, pInfo);
2935 else if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
2936 DoSanitizeClipboard(hwnd, pInfo);
2937
2938 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2939
2940 case WM_PASTE:
2941 DoSanitizeClipboard(hwnd, pInfo);
2942 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2943
2944 case WM_CHAR:
2945 if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
2946 break;
2947
2948 if (pInfo->pwszInvalidChars)
2949 {
2950 if (wcschr(pInfo->pwszInvalidChars, (WCHAR)wParam) != NULL)
2951 {
2952 MessageBeep(0xFFFFFFFF);
2953 break;
2954 }
2955 }
2956 else if (pInfo->pwszValidChars)
2957 {
2958 if (wcschr(pInfo->pwszValidChars, (WCHAR)wParam) == NULL)
2959 {
2960 MessageBeep(0xFFFFFFFF);
2961 break;
2962 }
2963 }
2964 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2965
2966 case WM_UNICHAR:
2967 if (wParam == UNICODE_NOCHAR)
2968 return TRUE;
2969
2970 /* FALL THROUGH */
2971
2972 case WM_IME_CHAR:
2973 wch = (WCHAR)wParam;
2974 if (GetKeyState(VK_CONTROL) < 0 && wch == L'V')
2975 break;
2976
2977 if (!IsWindowUnicode(hwnd) && HIBYTE(wch) != 0)
2978 {
2979 CHAR data[] = {HIBYTE(wch), LOBYTE(wch)};
2980 MultiByteToWideChar(CP_ACP, 0, data, 2, &wch, 1);
2981 }
2982
2983 if (pInfo->pwszInvalidChars)
2984 {
2985 if (wcschr(pInfo->pwszInvalidChars, wch) != NULL)
2986 {
2987 MessageBeep(0xFFFFFFFF);
2988 break;
2989 }
2990 }
2991 else if (pInfo->pwszValidChars)
2992 {
2993 if (wcschr(pInfo->pwszValidChars, wch) == NULL)
2994 {
2995 MessageBeep(0xFFFFFFFF);
2996 break;
2997 }
2998 }
2999 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3000
3001 case WM_NCDESTROY:
3003 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3004
3005 default:
3006 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3007 }
3008
3009 return 0;
3010}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define MultiByteToWideChar
Definition: compat.h:110
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define WM_UNICHAR
Definition: richedit.h:67
static void DoSanitizeClipboard(HWND hwnd, UxSubclassInfo *pInfo)
Definition: shellord.c:2876
static void UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
Definition: shellord.c:2827
WNDPROC fnWndProc
Definition: shellord.c:2821
#define WM_PASTE
Definition: winuser.h:1866
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CONTROL
Definition: winuser.h:2206
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_IME_CHAR
Definition: winuser.h:1837
#define WM_CHAR
Definition: winuser.h:1720
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1687
#define VK_SHIFT
Definition: winuser.h:2205
#define WM_KEYDOWN
Definition: winuser.h:1718
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_INSERT
Definition: winuser.h:2235
SHORT WINAPI GetKeyState(_In_ int)

Referenced by UxSubclassInfo_Create().

◆ LinkWindow_RegisterClass()

BOOL WINAPI LinkWindow_RegisterClass ( void  )

Definition at line 2635 of file shellord.c.

2636{
2637 FIXME("()\n");
2638 return TRUE;
2639}

◆ LinkWindow_UnregisterClass()

BOOL WINAPI LinkWindow_UnregisterClass ( DWORD  dwUnused)

Definition at line 2644 of file shellord.c.

2645{
2646 FIXME("()\n");
2647 return TRUE;
2648}

◆ ParseFieldA()

DWORD WINAPI ParseFieldA ( LPCSTR  src,
DWORD  nField,
LPSTR  dst,
DWORD  len 
)

Definition at line 83 of file shellord.c.

88{
89 WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
90
91 if (!src || !src[0] || !dst || !len)
92 return 0;
93
94 /* skip n fields delimited by ',' */
95 while (nField > 1)
96 {
97 if (*src=='\0') return FALSE;
98 if (*(src++)==',') nField--;
99 }
100
101 /* copy part till the next ',' to dst */
102 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
103
104 /* finalize the string */
105 *dst=0x0;
106
107 return TRUE;
108}
#define WARN(fmt,...)
Definition: precomp.h:61
GLenum src
Definition: glext.h:6340

Referenced by HCR_RegGetIconA(), and ParseFieldAW().

◆ ParseFieldAW()

DWORD WINAPI ParseFieldAW ( LPCVOID  src,
DWORD  nField,
LPVOID  dst,
DWORD  len 
)

Definition at line 143 of file shellord.c.

144{
145 if (SHELL_OsIsUnicode())
146 return ParseFieldW(src, nField, dst, len);
147 return ParseFieldA(src, nField, dst, len);
148}
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
Definition: shellord.c:117
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len)
Definition: shellord.c:83

◆ ParseFieldW()

DWORD WINAPI ParseFieldW ( LPCWSTR  src,
DWORD  nField,
LPWSTR  dst,
DWORD  len 
)

Definition at line 117 of file shellord.c.

118{
119 WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
120
121 if (!src || !src[0] || !dst || !len)
122 return 0;
123
124 /* skip n fields delimited by ',' */
125 while (nField > 1)
126 {
127 if (*src == 0x0) return FALSE;
128 if (*src++ == ',') nField--;
129 }
130
131 /* copy part till the next ',' to dst */
132 while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
133
134 /* finalize the string */
135 *dst = 0x0;
136
137 return TRUE;
138}

Referenced by CFSExtractIcon_CreateInstance(), HCR_RegGetIconW(), and ParseFieldAW().

◆ PathIsTemporaryA()

BOOL WINAPI PathIsTemporaryA ( LPSTR  Str)

Definition at line 2126 of file shellord.c.

2128{
2129#ifdef __REACTOS__
2130 WCHAR szWide[MAX_PATH];
2131
2132 TRACE("(%s)\n", debugstr_a(Str));
2133
2134 SHAnsiToUnicode(Str, szWide, _countof(szWide));
2135 return PathIsTemporaryW(szWide);
2136#else
2137 FIXME("(%s)stub\n", debugstr_a(Str));
2138 return FALSE;
2139#endif
2140}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
Definition: string.c:2673
BOOL WINAPI PathIsTemporaryW(LPWSTR Str)
Definition: shellord.c:2149
#define _countof(array)
Definition: sndvol32.h:70

Referenced by Test_PathIsTemporaryA().

◆ PathIsTemporaryW()

BOOL WINAPI PathIsTemporaryW ( LPWSTR  Str)

Definition at line 2149 of file shellord.c.

2151{
2152#ifdef __REACTOS__
2153 WCHAR szLongPath[MAX_PATH], szTempPath[MAX_PATH];
2154 DWORD attrs;
2155 LPCWSTR pszTarget = Str;
2156
2157 TRACE("(%s)\n", debugstr_w(Str));
2158
2159 attrs = GetFileAttributesW(Str);
2160 if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_TEMPORARY))
2161 return TRUE;
2162
2165 {
2166 return FALSE;
2167 }
2168
2169 if (GetLongPathNameW(Str, szLongPath, _countof(szLongPath)))
2170 pszTarget = szLongPath;
2171
2172 return (PathIsEqualOrSubFolder(szTempPath, pszTarget) ||
2175#else
2176 FIXME("(%s)stub\n", debugstr_w(Str));
2177 return FALSE;
2178#endif
2179}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
Definition: path.c:1456
EXTERN_C BOOL WINAPI PathIsEqualOrSubFolder(_In_ LPCWSTR pszPath1OrCSIDL, _In_ LPCWSTR pszPath2)
Definition: utils.cpp:1274
#define UlongToPtr(u)
Definition: config.h:106
static char szTempPath[MAX_PATH]
Definition: data.c:16
#define FILE_ATTRIBUTE_TEMPORARY
Definition: nt_native.h:708
#define CSIDL_INTERNET_CACHE
Definition: shlobj.h:2204
#define CSIDL_CDBURN_AREA
Definition: shlobj.h:2228
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by PathIsTemporaryA(), and Test_PathIsTemporaryW().

◆ PsxaCall()

static BOOL CALLBACK PsxaCall ( HPROPSHEETPAGE  hpage,
LPARAM  lParam 
)
static

Definition at line 2197 of file shellord.c.

2198{
2200
2201 if (Call != NULL)
2202 {
2203 if ((Call->bMultiple || !Call->bCalled) &&
2204 Call->lpfnAddReplaceWith(hpage, Call->lParam))
2205 {
2206 Call->bCalled = TRUE;
2207 Call->uiCount++;
2208 return TRUE;
2209 }
2210 }
2211
2212 return FALSE;
2213}
struct _PSXA_CALL * PPSXA_CALL
LPFNADDPROPSHEETPAGE lpfnAddReplaceWith
Definition: shellord.c:2190
LPARAM lParam
Definition: shellord.c:2191
BOOL bCalled
Definition: shellord.c:2192
BOOL bMultiple
Definition: shellord.c:2193
UINT uiCount
Definition: shellord.c:2194

Referenced by SHAddFromPropSheetExtArray(), and SHReplaceFromPropSheetExtArray().

◆ ReadCabinetState()

BOOL WINAPI ReadCabinetState ( CABINETSTATE cs,
int  length 
)

Definition at line 1806 of file shellord.c.

1807{
1808 HKEY hkey = 0;
1809 DWORD type, r;
1810 C_ASSERT(sizeof(*cs) == FIELD_OFFSET(CABINETSTATE, fMenuEnumFilter) + sizeof(UINT));
1811
1812 TRACE("%p %d\n", cs, length);
1813
1814 if( (cs == NULL) || (length < (int)sizeof(*cs)) )
1815 return FALSE;
1816
1817 r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey );
1818 if( r == ERROR_SUCCESS )
1819 {
1820 type = REG_BINARY;
1821 r = RegQueryValueExW( hkey, L"Settings",
1822 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1823 RegCloseKey( hkey );
1824
1825 }
1826
1827 /* if we can't read from the registry, create default values */
1828 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1829 (cs->cLength != length) )
1830 {
1831 SHELLSTATE shellstate;
1832 shellstate.fWin95Classic = FALSE;
1834
1835 TRACE("Initializing shell cabinet settings\n");
1836 memset(cs, 0, sizeof(*cs));
1837 cs->cLength = sizeof(*cs);
1838 cs->nVersion = 2;
1839 cs->fFullPathTitle = FALSE;
1840 cs->fSaveLocalView = TRUE;
1841 cs->fNotShell = FALSE;
1842 cs->fSimpleDefault = TRUE;
1843 cs->fDontShowDescBar = FALSE;
1844 cs->fNewWindowMode = shellstate.fWin95Classic;
1845 cs->fShowCompColor = FALSE;
1846 cs->fDontPrettyNames = FALSE;
1847 cs->fAdminsCreateCommonGroups = TRUE;
1848 cs->fMenuEnumFilter = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
1849 }
1850
1851 return TRUE;
1852}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define cs
Definition: i386-dis.c:442
#define C_ASSERT(e)
Definition: intsafe.h:73
#define REG_BINARY
Definition: nt_native.h:1496
VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
Definition: shellord.c:225
#define SSF_WIN95CLASSIC
Definition: shlobj.h:1613
BOOL fWin95Classic
Definition: shlobj.h:1549
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by full_title(), IntGetNewWindowMode(), IntSetNewWindowMode(), and CabinetStateSettings::Load().

◆ RegisterShellHook()

BOOL WINAPI RegisterShellHook ( HWND  hWnd,
DWORD  dwType 
)

Definition at line 509 of file shellord.c.

512{
513 if (dwType == 3)
514 {
517 }
518 else if (dwType == 0)
519 {
521 }
522
523 ERR("Unsupported argument");
524 return FALSE;
525}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: precomp.h:57
HWND WINAPI SetTaskmanWindow(HWND)
Definition: window.c:1880
BOOL WINAPI DeregisterShellHookWindow(_In_ HWND)
BOOL WINAPI RegisterShellHookWindow(_In_ HWND)

Referenced by CTaskSwitchWnd::OnCreate(), and CTaskSwitchWnd::OnDestroy().

◆ RLBuildListOfPaths()

DWORD WINAPI RLBuildListOfPaths ( void  )

Definition at line 1991 of file shellord.c.

1992{ FIXME("stub\n");
1993 return 0;
1994}

◆ SetAppStartingCursor()

HRESULT WINAPI SetAppStartingCursor ( HWND  u,
DWORD  v 
)

Definition at line 1896 of file shellord.c.

1897{ FIXME("hwnd=%p 0x%04x stub\n",u,v );
1898 return 0;
1899}
const GLdouble * v
Definition: gl.h:2040

◆ SHAbortInvokeCommand()

HRESULT WINAPI SHAbortInvokeCommand ( void  )

Definition at line 1947 of file shellord.c.

1948{ FIXME("stub\n");
1949 return 1;
1950}

◆ SHADD_compare_mru()

static INT CALLBACK SHADD_compare_mru ( LPCVOID  data1,
LPCVOID  data2,
DWORD  cbData 
)
static

Definition at line 887 of file shellord.c.

888{
889#ifdef __REACTOS__
890 LPCWSTR psz1, psz2;
891 INT iCmp = lstrcmpiW(data1, data2);
892 if (iCmp != 0)
893 return iCmp;
894 psz1 = data1;
895 psz2 = data2;
896 psz1 += lstrlenW(psz1) + 1;
897 psz2 += lstrlenW(psz2) + 1;
898 return lstrcmpiW(psz1, psz2);
899#else
900 return lstrcmpiA(data1, data2);
901#endif
902}
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224
Definition: tftpd.h:126
Definition: tftpd.h:138

Referenced by SHAddToRecentDocs().

◆ SHADD_create_add_mru_data()

static INT SHADD_create_add_mru_data ( HANDLE  mruhandle,
LPCSTR  doc_name,
LPCSTR  new_lnk_name,
LPSTR  buffer,
INT len 
)
static

Definition at line 955 of file shellord.c.

957{
958 LPSTR ptr;
959 INT wlen;
960
961 /*FIXME: Document:
962 * RecentDocs MRU data structure seems to be:
963 * +0h document file name w/ terminating 0h
964 * +nh short int w/ size of remaining
965 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
966 * +n+4h 10 bytes zeros - unknown
967 * +n+eh shortcut file name w/ terminating 0h
968 * +n+e+nh 3 zero bytes - unknown
969 */
970
971 /* Create the MRU data structure for "RecentDocs"
972 */
973 ptr = buffer;
974 lstrcpyA(ptr, doc_name);
975 ptr += (lstrlenA(buffer) + 1);
976 wlen= lstrlenA(new_lnk_name) + 1 + 12;
977 *((short int*)ptr) = wlen;
978 ptr += 2; /* step past the length */
979 *(ptr++) = 0x30; /* unknown reason */
980 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
981 memset(ptr, 0, 10);
982 ptr += 10;
983 lstrcpyA(ptr, new_lnk_name);
984 ptr += (lstrlenA(new_lnk_name) + 1);
985 memset(ptr, 0, 3);
986 ptr += 3;
987 *len = ptr - buffer;
988
989 /* Add the new entry into the MRU list
990 */
991 return AddMRUData(mruhandle, buffer, *len);
992}
GLuint buffer
Definition: glext.h:5915
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static PVOID ptr
Definition: dispmode.c:27
INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData)

Referenced by SHAddToRecentDocs().

◆ SHADD_get_policy()

static INT SHADD_get_policy ( LPCSTR  policy,
LPDWORD  type,
LPVOID  buffer,
LPDWORD  len 
)
static

Definition at line 846 of file shellord.c.

847{
848 HKEY Policy_basekey;
849 INT ret;
850
851 /* Get the key for the policies location in the registry
852 */
854 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
855 0, KEY_READ, &Policy_basekey)) {
856
858 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
859 0, KEY_READ, &Policy_basekey)) {
860 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
861 policy);
862 *len = 0;
864 }
865 }
866
867 /* Retrieve the data if it exists
868 */
869 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
870 RegCloseKey(Policy_basekey);
871 return ret;
872}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:47
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
DWORD WINAPI SHQueryValueExA(HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1402
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SHAddToRecentDocs().

◆ SHAddFromPropSheetExtArray()

UINT WINAPI SHAddFromPropSheetExtArray ( HPSXA  hpsxa,
LPFNADDPROPSHEETPAGE  lpfnAddPage,
LPARAM  lParam 
)

Definition at line 2218 of file shellord.c.

2219{
2220 PSXA_CALL Call;
2221 UINT i;
2222 PPSXA psxa = (PPSXA)hpsxa;
2223
2224 TRACE("(%p,%p,%08lx)\n", hpsxa, lpfnAddPage, lParam);
2225
2226 if (psxa)
2227 {
2228 ZeroMemory(&Call, sizeof(Call));
2229 Call.lpfnAddReplaceWith = lpfnAddPage;
2230 Call.lParam = lParam;
2231 Call.bMultiple = TRUE;
2232
2233 /* Call the AddPage method of all registered IShellPropSheetExt interfaces */
2234 for (i = 0; i != psxa->uiCount; i++)
2235 {
2236 psxa->pspsx[i]->lpVtbl->AddPages(psxa->pspsx[i], PsxaCall, (LPARAM)&Call);
2237 }
2238
2239 return Call.uiCount;
2240 }
2241
2242 return 0;
2243}
HRESULT AddPages([in] LPFNSVADDPROPSHEETPAGE pfnAddPage, [in] LPARAM lParam)
static BOOL CALLBACK PsxaCall(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: shellord.c:2197
struct _PSXA * PPSXA
UINT uiCount
Definition: shellord.c:2183
IShellPropSheetExt * pspsx[1]
Definition: shellord.c:2185
#define ZeroMemory
Definition: winbase.h:1737
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by Applet1(), DisplayAdvancedSettings(), KeyboardApplet(), MouseApplet(), and SystemApplet().

◆ SHAddToRecentDocs()

void WINAPI SHAddToRecentDocs ( UINT  uFlags,
LPCVOID  pv 
)

Definition at line 1010 of file shellord.c.

1011{
1012#ifdef __REACTOS__
1013 INT ret;
1014 WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80];
1016 DWORD cbBuffer;
1017 HANDLE hFind;
1019 HKEY hExplorerKey;
1020 LONG error;
1021 LPWSTR pchDotExt, pchTargetTitle, pchLinkTitle;
1022 MRUINFOW mru;
1023 HANDLE hMRUList = NULL;
1024 IShellLinkW *psl = NULL;
1025 IPersistFile *pPf = NULL;
1026 HRESULT hr;
1027 BYTE Buffer[(MAX_PATH + 64) * sizeof(WCHAR)];
1028
1029 TRACE("%04x %p\n", uFlags, pv);
1030
1031 /* check policy */
1033 TRACE("policy value for NoRecentDocsHistory = %08x\n", ret);
1034 if (ret != 0)
1035 return;
1036
1037 /* store to szTargetPath */
1038 szTargetPath[0] = 0;
1039 if (pv)
1040 {
1041 switch (uFlags)
1042 {
1043 case SHARD_PATHA:
1044 MultiByteToWideChar(CP_ACP, 0, pv, -1, szLinkDir, ARRAYSIZE(szLinkDir));
1045 GetFullPathNameW(szLinkDir, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
1046 break;
1047
1048 case SHARD_PATHW:
1049 GetFullPathNameW(pv, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
1050 break;
1051
1052 case SHARD_PIDL:
1053 SHGetPathFromIDListW(pv, szLinkDir);
1054 GetFullPathNameW(szLinkDir, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
1055 break;
1056
1057 default:
1058 FIXME("Unsupported flags: %u\n", uFlags);
1059 return;
1060 }
1061 }
1062
1063 /* get recent folder */
1065 {
1066 ERR("serious issues 1\n");
1067 return;
1068 }
1069 TRACE("Users Recent dir %S\n", szLinkDir);
1070
1071 /* open Explorer key */
1072 error = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1073 0, NULL, 0,
1074 KEY_READ | KEY_WRITE, NULL, &hExplorerKey, NULL);
1075 if (error)
1076 {
1077 ERR("Failed to RegCreateKeyExW: 0x%08X\n", error);
1078 return;
1079 }
1080
1081 if (!pv)
1082 {
1083 TRACE("pv is NULL, so delete all shortcut files in %S\n", szLinkDir);
1084
1085 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
1086 PathAppendW(szLinkFile, L"*.lnk");
1087
1088 hFind = FindFirstFileW(szLinkFile, &find);
1089 if (hFind != INVALID_HANDLE_VALUE)
1090 {
1091 do
1092 {
1093 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
1094 PathAppendW(szLinkFile, find.cFileName);
1095 DeleteFileW(szLinkFile);
1096 } while (FindNextFile(hFind, &find));
1097 FindClose(hFind);
1098 }
1099
1100 SHDeleteKeyW(hExplorerKey, L"RecentDocs");
1101 RegCloseKey(hExplorerKey);
1102 return;
1103 }
1104
1105 if (szTargetPath[0] == 0 || !PathFileExistsW(szTargetPath) ||
1106 PathIsDirectoryW(szTargetPath))
1107 {
1108 /* path is not normal file */
1109 RegCloseKey(hExplorerKey);
1110 return;
1111 }
1112
1113 hr = CoInitialize(NULL);
1114 if (FAILED(hr))
1115 {
1116 ERR("CoInitialize: %08X\n", hr);
1117 RegCloseKey(hExplorerKey);
1118 return;
1119 }
1120
1121 /* check if file is a shortcut */
1122 ret = 0;
1123 pchDotExt = PathFindExtensionW(szTargetPath);
1124 while (lstrcmpiW(pchDotExt, L".lnk") == 0)
1125 {
1126 hr = IShellLink_ConstructFromPath(szTargetPath, &IID_IShellLinkW, (LPVOID*)&psl);
1127 if (FAILED(hr))
1128 {
1129 ERR("IShellLink_ConstructFromPath: 0x%08X\n", hr);
1130 goto Quit;
1131 }
1132
1133 IShellLinkW_GetPath(psl, szPath, ARRAYSIZE(szPath), NULL, 0);
1134 IShellLinkW_Release(psl);
1135 psl = NULL;
1136
1137 lstrcpynW(szTargetPath, szPath, ARRAYSIZE(szTargetPath));
1138 pchDotExt = PathFindExtensionW(szTargetPath);
1139
1140 if (++ret >= 8)
1141 {
1142 ERR("Link loop?\n");
1143 goto Quit;
1144 }
1145 }
1146 if (!lstrcmpiW(pchDotExt, L".exe"))
1147 {
1148 /* executables are not added */
1149 goto Quit;
1150 }
1151
1152 /* *** JOB 0: Build strings *** */
1153
1154 pchTargetTitle = PathFindFileNameW(szTargetPath);
1155
1156 lstrcpyW(szDescription, L"Shortcut to ");
1158
1159 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
1160 PathAppendW(szLinkFile, pchTargetTitle);
1161 StrCatBuffW(szLinkFile, L".lnk", ARRAYSIZE(szLinkFile));
1162 pchLinkTitle = PathFindFileNameW(szLinkFile);
1163
1164 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
1165
1166 /* store MRU data */
1167 cbBuffer = sizeof(Buffer);
1168 ret = DoStoreMRUData(Buffer, &cbBuffer, pchTargetTitle, szTargetPath, pchLinkTitle);
1169 if (!ret)
1170 {
1171 ERR("DoStoreMRUData failed: %d\n", ret);
1172 goto Quit;
1173 }
1174
1175 /* create MRU list */
1176 mru.cbSize = sizeof(mru);
1177 mru.uMax = 16;
1179 mru.hKey = hExplorerKey;
1180 mru.lpszSubKey = L"RecentDocs";
1181 mru.lpfnCompare = (MRUCMPPROCW)SHADD_compare_mru;
1182 hMRUList = CreateMRUListW(&mru);
1183 if (!hMRUList)
1184 {
1185 ERR("CreateMRUListW failed\n");
1186 goto Quit;
1187 }
1188
1189 /* already exists? */
1190 ret = FindMRUData(hMRUList, Buffer, cbBuffer, NULL);
1191 if (ret >= 0)
1192 {
1193 /* Just touch for speed */
1194 HANDLE hFile;
1198 {
1199 TRACE("Just touch file '%S'.\n", szLinkFile);
1201 goto Quit;
1202 }
1203 }
1204
1205 /* add MRU data */
1206 ret = AddMRUData(hMRUList, Buffer, cbBuffer);
1207 if (ret < 0)
1208 {
1209 ERR("AddMRUData failed: %d\n", ret);
1210 goto Quit;
1211 }
1212
1213 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
1214
1215 hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
1216 &IID_IShellLinkW, (LPVOID *)&psl);
1217 if (FAILED(hr))
1218 {
1219 ERR("CoInitialize for IID_IShellLinkW: %08X\n", hr);
1220 goto Quit;
1221 }
1222
1223 hr = IShellLinkW_QueryInterface(psl, &IID_IPersistFile, (LPVOID *)&pPf);
1224 if (FAILED(hr))
1225 {
1226 ERR("IShellLinkW_QueryInterface: %08X\n", hr);
1227 goto Quit;
1228 }
1229
1230 if (uFlags == SHARD_PIDL)
1231 hr = IShellLinkW_SetIDList(psl, pv);
1232 else
1233 hr = IShellLinkW_SetPath(psl, pv);
1234
1235 IShellLinkW_SetDescription(psl, szDescription);
1236
1237 hr = IPersistFile_Save(pPf, szLinkFile, TRUE);
1238 if (FAILED(hr))
1239 {
1240 ERR("IPersistFile_Save: 0x%08X\n", hr);
1241 }
1242
1243 hr = IPersistFile_SaveCompleted(pPf, szLinkFile);
1244 if (FAILED(hr))
1245 {
1246 ERR("IPersistFile_SaveCompleted: 0x%08X\n", hr);
1247 }
1248
1249Quit:
1250 if (hMRUList)
1251 FreeMRUList(hMRUList);
1252 if (pPf)
1253 IPersistFile_Release(pPf);
1254 if (psl)
1255 IShellLinkW_Release(psl);
1257 RegCloseKey(hExplorerKey);
1258#else
1259/* If list is a string list lpfnCompare has the following prototype
1260 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
1261 * for binary lists the prototype is
1262 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
1263 * where cbData is the no. of bytes to compare.
1264 * Need to check what return value means identical - 0?
1265 */
1266
1267
1268 UINT olderrormode;
1269 HKEY HCUbasekey;
1270 CHAR doc_name[MAX_PATH];
1271 CHAR link_dir[MAX_PATH];
1272 CHAR new_lnk_filepath[MAX_PATH];
1273 CHAR new_lnk_name[MAX_PATH];
1274 CHAR * ext;
1275 IMalloc *ppM;
1276 LPITEMIDLIST pidl;
1277 HWND hwnd = 0; /* FIXME: get real window handle */
1278 INT ret;
1279 DWORD data[64], datalen, type;
1280
1281 TRACE("%04x %p\n", uFlags, pv);
1282
1283 /*FIXME: Document:
1284 * RecentDocs MRU data structure seems to be:
1285 * +0h document file name w/ terminating 0h
1286 * +nh short int w/ size of remaining
1287 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
1288 * +n+4h 10 bytes zeros - unknown
1289 * +n+eh shortcut file name w/ terminating 0h
1290 * +n+e+nh 3 zero bytes - unknown
1291 */
1292
1293 /* See if we need to do anything.
1294 */
1295 datalen = 64;
1296 ret=SHADD_get_policy( "NoRecentDocsHistory", &type, data, &datalen);
1297 if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
1298 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
1299 return;
1300 }
1301 if (ret == ERROR_SUCCESS) {
1302 if (!( (type == REG_DWORD) ||
1303 ((type == REG_BINARY) && (datalen == 4)) )) {
1304 ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
1305 type, datalen);
1306 return;
1307 }
1308
1309 TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
1310 /* now test the actual policy value */
1311 if ( data[0] != 0)
1312 return;
1313 }
1314
1315 /* Open key to where the necessary info is
1316 */
1317 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
1318 * and the close should be done during the _DETACH. The resulting
1319 * key is stored in the DLL global data.
1320 */
1322 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1323 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
1324 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
1325 return;
1326 }
1327
1328 /* Get path to user's "Recent" directory
1329 */
1330 if(SUCCEEDED(SHGetMalloc(&ppM))) {
1332 &pidl))) {
1333 SHGetPathFromIDListA(pidl, link_dir);
1334 IMalloc_Free(ppM, pidl);
1335 }
1336 else {
1337 /* serious issues */
1338 link_dir[0] = 0;
1339 ERR("serious issues 1\n");
1340 }
1341 IMalloc_Release(ppM);
1342 }
1343 else {
1344 /* serious issues */
1345 link_dir[0] = 0;
1346 ERR("serious issues 2\n");
1347 }
1348 TRACE("Users Recent dir %s\n", link_dir);
1349
1350 /* If no input, then go clear the lists */
1351 if (!pv) {
1352 /* clear user's Recent dir
1353 */
1354
1355 /* FIXME: delete all files in "link_dir"
1356 *
1357 * while( more files ) {
1358 * lstrcpyA(old_lnk_name, link_dir);
1359 * PathAppendA(old_lnk_name, filenam);
1360 * DeleteFileA(old_lnk_name);
1361 * }
1362 */
1363 FIXME("should delete all files in %s\\\n", link_dir);
1364
1365 /* clear MRU list
1366 */
1367 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
1368 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
1369 * and naturally it fails w/ rc=2. It should do it against
1370 * HKEY_CURRENT_USER which is where it is stored, and where
1371 * the MRU routines expect it!!!!
1372 */
1373 RegDeleteKeyA(HCUbasekey, "RecentDocs");
1374 RegCloseKey(HCUbasekey);
1375 return;
1376 }
1377
1378 /* Have data to add, the jobs to be done:
1379 * 1. Add document to MRU list in registry "HKCU\Software\
1380 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
1381 * 2. Add shortcut to document in the user's Recent directory
1382 * (CSIDL_RECENT).
1383 * 3. Add shortcut to Start menu's Documents submenu.
1384 */
1385
1386 /* Get the pure document name from the input
1387 */
1388 switch (uFlags)
1389 {
1390 case SHARD_PIDL:
1391 if (!SHGetPathFromIDListA(pv, doc_name))
1392 {
1393 WARN("can't get path from PIDL\n");
1394 return;
1395 }
1396 break;
1397
1398 case SHARD_PATHA:
1399 lstrcpynA(doc_name, pv, MAX_PATH);
1400 break;
1401
1402 case SHARD_PATHW:
1403 WideCharToMultiByte(CP_ACP, 0, pv, -1, doc_name, MAX_PATH, NULL, NULL);
1404 break;
1405
1406 default:
1407 FIXME("Unsupported flags: %u\n", uFlags);
1408 return;
1409 }
1410
1411 TRACE("full document name %s\n", debugstr_a(doc_name));
1412
1413 PathStripPathA(doc_name);
1414 TRACE("stripped document name %s\n", debugstr_a(doc_name));
1415
1416
1417 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
1418
1419 { /* on input needs:
1420 * doc_name - pure file-spec, no path
1421 * link_dir - path to the user's Recent directory
1422 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
1423 * creates:
1424 * new_lnk_name- pure file-spec, no path for new .lnk file
1425 * new_lnk_filepath
1426 * - path and file name of new .lnk file
1427 */
1428 CREATEMRULISTA mymru;
1429 HANDLE mruhandle;
1430 INT len, pos, bufused, err;
1431 INT i;
1432 DWORD attr;
1433 CHAR buffer[2048];
1434 CHAR *ptr;
1435 CHAR old_lnk_name[MAX_PATH];
1436 short int slen;
1437
1438 mymru.cbSize = sizeof(CREATEMRULISTA);
1439 mymru.nMaxItems = 15;
1441 mymru.hKey = HCUbasekey;
1442 mymru.lpszSubKey = "RecentDocs";
1443 mymru.lpfnCompare = SHADD_compare_mru;
1444 mruhandle = CreateMRUListA(&mymru);
1445 if (!mruhandle) {
1446 /* MRU failed */
1447 ERR("MRU processing failed, handle zero\n");
1448 RegCloseKey(HCUbasekey);
1449 return;
1450 }
1451 len = lstrlenA(doc_name);
1452 pos = FindMRUData(mruhandle, doc_name, len, 0);
1453
1454 /* Now get the MRU entry that will be replaced
1455 * and delete the .lnk file for it
1456 */
1457 if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
1458 buffer, 2048)) != -1) {
1459 ptr = buffer;
1460 ptr += (lstrlenA(buffer) + 1);
1461 slen = *((short int*)ptr);
1462 ptr += 2; /* skip the length area */
1463 if (bufused >= slen + (ptr-buffer)) {
1464 /* buffer size looks good */
1465 ptr += 12; /* get to string */
1466 len = bufused - (ptr-buffer); /* get length of buf remaining */
1467 if (ptr[0] && (lstrlenA(ptr) <= len-1)) {
1468 /* appears to be good string */
1469 lstrcpyA(old_lnk_name, link_dir);
1470 PathAppendA(old_lnk_name, ptr);
1471 if (!DeleteFileA(old_lnk_name)) {
1472 if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
1473 if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
1474 ERR("Delete for %s failed, err=%d, attr=%08x\n",
1475 old_lnk_name, err, attr);
1476 }
1477 else {
1478 TRACE("old .lnk file %s did not exist\n",
1479 old_lnk_name);
1480 }
1481 }
1482 else {
1483 ERR("Delete for %s failed, attr=%08x\n",
1484 old_lnk_name, attr);
1485 }
1486 }
1487 else {
1488 TRACE("deleted old .lnk file %s\n", old_lnk_name);
1489 }
1490 }
1491 }
1492 }
1493
1494 /* Create usable .lnk file name for the "Recent" directory
1495 */
1496 wsprintfA(new_lnk_name, "%s.lnk", doc_name);
1497 lstrcpyA(new_lnk_filepath, link_dir);
1498 PathAppendA(new_lnk_filepath, new_lnk_name);
1499 i = 1;
1500 olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
1501 while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
1502 i++;
1503 wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
1504 lstrcpyA(new_lnk_filepath, link_dir);
1505 PathAppendA(new_lnk_filepath, new_lnk_name);
1506 }
1507 SetErrorMode(olderrormode);
1508 TRACE("new shortcut will be %s\n", new_lnk_filepath);
1509
1510 /* Now add the new MRU entry and data
1511 */
1512 pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
1513 buffer, &len);
1514 FreeMRUList(mruhandle);
1515 TRACE("Updated MRU list, new doc is position %d\n", pos);
1516 }
1517
1518 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
1519
1520 { /* on input needs:
1521 * doc_name - pure file-spec, no path
1522 * new_lnk_filepath
1523 * - path and file name of new .lnk file
1524 * uFlags[in] - flags on call to SHAddToRecentDocs
1525 * pv[in] - document path/pidl on call to SHAddToRecentDocs
1526 */
1527 IShellLinkA *psl = NULL;
1528 IPersistFile *pPf = NULL;
1529 HRESULT hres;
1531 WCHAR widelink[MAX_PATH];
1532
1533 CoInitialize(0);
1534
1535 hres = CoCreateInstance( &CLSID_ShellLink,
1536 NULL,
1537 CLSCTX_INPROC_SERVER,
1538 &IID_IShellLinkA,
1539 (LPVOID )&psl);
1540 if(SUCCEEDED(hres)) {
1541
1542 hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile,
1543 (LPVOID *)&pPf);
1544 if(FAILED(hres)) {
1545 /* bombed */
1546 ERR("failed QueryInterface for IPersistFile %08x\n", hres);
1547 goto fail;
1548 }
1549
1550 /* Set the document path or pidl */
1551 if (uFlags == SHARD_PIDL) {
1552 hres = IShellLinkA_SetIDList(psl, pv);
1553 } else {
1554 hres = IShellLinkA_SetPath(psl, pv);
1555 }
1556 if(FAILED(hres)) {
1557 /* bombed */
1558 ERR("failed Set{IDList|Path} %08x\n", hres);
1559 goto fail;
1560 }
1561
1562 lstrcpyA(desc, "Shortcut to ");
1563 lstrcatA(desc, doc_name);
1564 hres = IShellLinkA_SetDescription(psl, desc);
1565 if(FAILED(hres)) {
1566 /* bombed */
1567 ERR("failed SetDescription %08x\n", hres);
1568 goto fail;
1569 }
1570
1571 MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
1572 widelink, MAX_PATH);
1573 /* create the short cut */
1574 hres = IPersistFile_Save(pPf, widelink, TRUE);
1575 if(FAILED(hres)) {
1576 /* bombed */
1577 ERR("failed IPersistFile::Save %08x\n", hres);
1578 IPersistFile_Release(pPf);
1579 IShellLinkA_Release(psl);
1580 goto fail;
1581 }
1582 hres = IPersistFile_SaveCompleted(pPf, widelink);
1583 IPersistFile_Release(pPf);
1584 IShellLinkA_Release(psl);
1585 TRACE("shortcut %s has been created, result=%08x\n",
1586 new_lnk_filepath, hres);
1587 }
1588 else {
1589 ERR("CoCreateInstance failed, hres=%08x\n", hres);
1590 }
1591 }
1592
1593 fail:
1595
1596 /* all done */
1597 RegCloseKey(HCUbasekey);
1598 return;
1599#endif
1600}
Definition: bufpool.h:45
INT(CALLBACK * MRUCMPPROCW)(LPCWSTR, LPCWSTR)
HANDLE WINAPI CreateMRUListW(const MRUINFOW *infoW)
static TAGID TAGID find
Definition: db.cpp:155
static const WCHAR szDescription[]
Definition: provider.c:55
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1034
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
UINT uFlags
Definition: api.c:59
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define lstrcpynA
Definition: compat.h:751
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define lstrcpyW
Definition: compat.h:749
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrcpynW
Definition: compat.h:738
static const WCHAR *const ext[]
Definition: module.c:53
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
Definition: shellole.c:285
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3257
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
void WINAPI PathStripPathA(LPSTR lpszPath)
Definition: path.c:677
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1546
LPWSTR WINAPI StrCatBuffW(LPWSTR lpszStr, LPCWSTR lpszCat, INT cchMax)
Definition: string.c:1444
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1031
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define error(str)
Definition: mkdosfs.c:1605
LPCWSTR szPath
Definition: env.c:37
static const WCHAR desc[]
Definition: protectdata.c:36
HRESULT hres
Definition: protocol.c:465
_In_ HANDLE hFile
Definition: mswsock.h:90
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define KEY_WRITE
Definition: nt_native.h:1031
#define GENERIC_WRITE
Definition: nt_native.h:90
const GUID IID_IPersistFile
#define PathAppendA
Definition: pathcch.h:308
#define PathAppendW
Definition: pathcch.h:309
long LONG
Definition: pedump.c:60
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
Definition: pidl.c:1390
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1452
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596
static INT CALLBACK SHADD_compare_mru(LPCVOID data1, LPCVOID data2, DWORD cbData)
Definition: shellord.c:887
#define MRUF_BINARY_LIST
Definition: shellord.c:66
#define MRUF_DELAYED_SAVE
Definition: shellord.c:67
INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA lpcml)
VOID WINAPI FreeMRUList(HANDLE hMRUList)
static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR new_lnk_name, LPSTR buffer, INT *len)
Definition: shellord.c:955
static INT SHADD_get_policy(LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
Definition: shellord.c:846
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
struct tagCREATEMRULIST CREATEMRULISTA
static IMalloc * ppM
Definition: shlfolder.c:47
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_RECENT
Definition: shlobj.h:2181
#define SHARD_PATHW
Definition: shlobj.h:1176
#define SHARD_PIDL
Definition: shlobj.h:1174
#define SHARD_PATHA
Definition: shlobj.h:1175
@ REST_NORECENTDOCSHISTORY
Definition: shlobj.h:1674
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:150
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
Definition: cookie.c:202
LPCSTR lpszSubKey
Definition: shellord.c:60
DWORD nMaxItems
Definition: shellord.c:57
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FindNextFile
Definition: winbase.h:3813
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
unsigned char BYTE
Definition: xxhash.c:193

Referenced by StartMenu::ActivateEntry(), CShellDispatch::AddToRecent(), DoOpenFile(), DoSaveFile(), Entry::launch_entry(), ShellEntry::launch_entry(), OnClearRecentItems(), Preview_pLoadImage(), SetFileName(), and RegistrySettings::SetMostRecentFile().

◆ SHCreatePropSheetExtArray()

HPSXA WINAPI SHCreatePropSheetExtArray ( HKEY  hKey,
LPCWSTR  pszSubKey,
UINT  max_iface 
)

Definition at line 2248 of file shellord.c.

2249{
2250 return SHCreatePropSheetExtArrayEx(hKey, pszSubKey, max_iface, NULL);
2251}
FxAutoRegKey hKey
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj)
Definition: shellord.c:2256

Referenced by Applet1(), DisplayApplet(), KeyboardApplet(), MouseApplet(), and SystemApplet().

◆ SHCreatePropSheetExtArrayEx()

HPSXA WINAPI SHCreatePropSheetExtArrayEx ( HKEY  hKey,
LPCWSTR  pszSubKey,
UINT  max_iface,
LPDATAOBJECT  pDataObj 
)

Definition at line 2256 of file shellord.c.

2257{
2258 WCHAR szHandler[64];
2259 DWORD dwHandlerLen;
2260 WCHAR szClsidHandler[39];
2261 DWORD dwClsidSize;
2262 CLSID clsid;
2263 LONG lRet;
2264 DWORD dwIndex;
2265 IShellExtInit *psxi;
2266 IShellPropSheetExt *pspsx;
2267 HKEY hkBase, hkPropSheetHandlers;
2268 PPSXA psxa = NULL;
2269
2270 TRACE("(%p,%s,%u)\n", hKey, debugstr_w(pszSubKey), max_iface);
2271
2272 if (max_iface == 0)
2273 return NULL;
2274
2275 /* Open the registry key */
2276 lRet = RegOpenKeyW(hKey, pszSubKey, &hkBase);
2277 if (lRet != ERROR_SUCCESS)
2278 return NULL;
2279
2280 lRet = RegOpenKeyExW(hkBase, L"shellex\\PropertySheetHandlers", 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers);
2281 RegCloseKey(hkBase);
2282 if (lRet == ERROR_SUCCESS)
2283 {
2284 /* Create and initialize the Property Sheet Extensions Array */
2285 psxa = LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2286 if (psxa)
2287 {
2288 ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2289 psxa->uiAllocated = max_iface;
2290
2291 /* Enumerate all subkeys and attempt to load the shell extensions */
2292 dwIndex = 0;
2293 do
2294 {
2295 dwHandlerLen = sizeof(szHandler) / sizeof(szHandler[0]);
2296 lRet = RegEnumKeyExW(hkPropSheetHandlers, dwIndex++, szHandler, &dwHandlerLen, NULL, NULL, NULL, NULL);
2297 if (lRet != ERROR_SUCCESS)
2298 {
2299 if (lRet == ERROR_MORE_DATA)
2300 continue;
2301
2302 if (lRet == ERROR_NO_MORE_ITEMS)
2303 lRet = ERROR_SUCCESS;
2304 break;
2305 }
2306
2307 /* The CLSID is stored either in the key itself or in its default value. */
2308 if (FAILED(lRet = SHCLSIDFromStringW(szHandler, &clsid)))
2309 {
2310 dwClsidSize = sizeof(szClsidHandler);
2311 if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS)
2312 {
2313 /* Force a NULL-termination and convert the string */
2314 szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0;
2315 lRet = SHCLSIDFromStringW(szClsidHandler, &clsid);
2316 }
2317 }
2318
2319 if (SUCCEEDED(lRet))
2320 {
2321 /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance.
2322 Only if both interfaces are supported it's a real shell extension.
2323 Then call IShellExtInit's Initialize method. */
2324 if (SUCCEEDED(CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER/* | CLSCTX_NO_CODE_DOWNLOAD */, &IID_IShellPropSheetExt, (LPVOID *)&pspsx)))
2325 {
2326 if (SUCCEEDED(pspsx->lpVtbl->QueryInterface(pspsx, &IID_IShellExtInit, (PVOID *)&psxi)))
2327 {
2328 if (SUCCEEDED(psxi->lpVtbl->Initialize(psxi, NULL, pDataObj, hKey)))
2329 {
2330 /* Add the IShellPropSheetExt instance to the array */
2331 psxa->pspsx[psxa->uiCount++] = pspsx;
2332 }
2333 else
2334 {
2335 psxi->lpVtbl->Release(psxi);
2336 pspsx->lpVtbl->Release(pspsx);
2337 }
2338 }
2339 else
2340 pspsx->lpVtbl->Release(pspsx);
2341 }
2342 }
2343
2344 } while (psxa->uiCount != psxa->uiAllocated);
2345 }
2346 else
2348
2349 RegCloseKey(hkPropSheetHandlers);
2350 }
2351
2352 if (lRet != ERROR_SUCCESS && psxa)
2353 {
2354 SHDestroyPropSheetExtArray((HPSXA)psxa);
2355 psxa = NULL;
2356 }
2357
2358 return (HPSXA)psxa;
2359}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MORE_DATA
Definition: dderror.h:13
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:256
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
nsresult QueryInterface(nsIIDRef riid, void **result)
nsrefcnt Release()
REFCLSID clsid
Definition: msctf.c:82
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2395
UINT uiAllocated
Definition: shellord.c:2184
#define LMEM_FIXED
Definition: winbase.h:394

Referenced by SHCreatePropSheetExtArray().

◆ SHCreateShellFolderView()

HRESULT WINAPI SHCreateShellFolderView ( const SFV_CREATE pcsfv,
IShellView **  ppsv 
)

Definition at line 2721 of file shellord.c.

2723{
2724 IShellView * psf;
2725 HRESULT hRes;
2726
2727 *ppsv = NULL;
2728 if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
2729 return E_INVALIDARG;
2730
2731 TRACE("sf=%p outer=%p callback=%p\n",
2732 pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
2733
2734 hRes = IShellView_Constructor(pcsfv->pshf, &psf);
2735 if (FAILED(hRes))
2736 return hRes;
2737
2738 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppsv);
2739 IShellView_Release(psf);
2740
2741 return hRes;
2742}
#define E_INVALIDARG
Definition: ddrawi.h:101
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1360
IShellView * psvOuter
Definition: shlobj.h:1359
UINT cbSize
Definition: shlobj.h:1357
IShellFolder * pshf
Definition: shlobj.h:1358

◆ SHCreateShellFolderViewEx()

HRESULT WINAPI SHCreateShellFolderViewEx ( LPCSFV  psvcbi,
IShellView **  ppv 
)

Definition at line 1616 of file shellord.c.

1619{
1620 IShellView * psf;
1621 HRESULT hRes;
1622
1623 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1624 psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
1625 psvcbi->fvm, psvcbi->psvOuter);
1626
1627 *ppv = NULL;
1628 hRes = IShellView_Constructor(psvcbi->pshf, &psf);
1629
1630 if (FAILED(hRes))
1631 return hRes;
1632
1633 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
1634 IShellView_Release(psf);
1635
1636 return hRes;
1637}
REFIID LPVOID * ppv
Definition: atlbase.h:39
FOLDERVIEWMODE fvm
Definition: shlobj.h:1282
IShellView * psvOuter
Definition: shlobj.h:1278
LPFNVIEWCALLBACK pfnCallback
Definition: shlobj.h:1281
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1279
IShellFolder * pshf
Definition: shlobj.h:1277

◆ SHCreateStdEnumFmtEtc()

HRESULT WINAPI SHCreateStdEnumFmtEtc ( UINT  cFormats,
const FORMATETC *  lpFormats,
LPENUMFORMATETC ppenumFormatetc 
)

Definition at line 2444 of file shellord.c.

2448{
2449 IEnumFORMATETC *pef;
2450 HRESULT hRes;
2451 TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
2452
2453 hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
2454 if (FAILED(hRes))
2455 return hRes;
2456
2457 IEnumFORMATETC_AddRef(pef);
2458 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
2459 IEnumFORMATETC_Release(pef);
2460
2461 return hRes;
2462}
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppFormat)
const GUID IID_IEnumFORMATETC

Referenced by CDevSettings_EnumFormatEtc().

◆ SHDestroyPropSheetExtArray()

void WINAPI SHDestroyPropSheetExtArray ( HPSXA  hpsxa)

Definition at line 2395 of file shellord.c.

2396{
2397 UINT i;
2398 PPSXA psxa = (PPSXA)hpsxa;
2399
2400 TRACE("(%p)\n", hpsxa);
2401
2402 if (psxa)
2403 {
2404 for (i = 0; i != psxa->uiCount; i++)
2405 {
2406 psxa->pspsx[i]->lpVtbl->Release(psxa->pspsx[i]);
2407 }
2408
2409 LocalFree(psxa);
2410 }
2411}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
ULONG Release()

Referenced by Applet1(), DisplayAdvancedSettings(), DisplayApplet(), KeyboardApplet(), MouseApplet(), SHCreatePropSheetExtArrayEx(), and SystemApplet().

◆ SHDoDragDrop()

HRESULT WINAPI SHDoDragDrop ( HWND  hWnd,
LPDATAOBJECT  lpDataObject,
LPDROPSOURCE  lpDropSource,
DWORD  dwOKEffect,
LPDWORD  pdwEffect 
)

Definition at line 792 of file shellord.c.

798{
799 FIXME("(%p %p %p 0x%08x %p):stub.\n",
800 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
801 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
802}
HRESULT WINAPI DoDragDrop(IDataObject *pDataObject, IDropSource *pDropSource, DWORD dwOKEffect, DWORD *pdwEffect)
Definition: ole2.c:753

◆ ShellMessageBoxA()

int ShellMessageBoxA ( HINSTANCE  hInstance,
HWND  hWnd,
LPCSTR  lpText,
LPCSTR  lpCaption,
UINT  uType,
  ... 
)

Definition at line 625 of file shellord.c.

632{
633#ifdef __REACTOS__
634 CHAR *szText = NULL, szTitle[100];
635 LPCSTR pszText, pszTitle = szTitle;
636 LPSTR pszTemp;
638 int ret;
639
640 __ms_va_start(args, uType);
641
642 TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
643
644 if (IS_INTRESOURCE(lpCaption))
646 else
647 pszTitle = lpCaption;
648
649 if (IS_INTRESOURCE(lpText))
650 {
651 /* Retrieve the length of the Unicode string and obtain the maximum
652 * possible length for the corresponding ANSI string (not counting
653 * any possible NULL-terminator). */
654 const WCHAR *ptr;
655 UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
656
658 NULL, 0, NULL, NULL);
659
660 if (len)
661 {
662 szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(CHAR));
663 if (szText) LoadStringA(hInstance, LOWORD(lpText), szText, len + 1);
664 }
665 pszText = szText;
666 if (!pszText) {
667 WARN("Failed to load id %d\n", LOWORD(lpText));
669 return 0;
670 }
671 }
672 else
673 pszText = lpText;
674
676 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
677
679
680 ret = MessageBoxA(hWnd, pszTemp, pszTitle, uType | MB_SETFOREGROUND);
681
682 HeapFree(GetProcessHeap(), 0, szText);
683 LocalFree(pszTemp);
684 return ret;
685
686#else // __REACTOS__
687
688// Wine version, broken.
689 char szText[100],szTitle[100];
690 LPCSTR pszText = szText, pszTitle = szTitle;
691 LPSTR pszTemp;
693 int ret;
694
695 __ms_va_start(args, uType);
696 /* wvsprintfA(buf,fmt, args); */
697
698 TRACE("(%p,%p,%p,%p,%08x)\n",
699 hInstance,hWnd,lpText,lpCaption,uType);
700
701 if (IS_INTRESOURCE(lpCaption))
702 LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
703 else
704 pszTitle = lpCaption;
705
706 if (IS_INTRESOURCE(lpText))
707 LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
708 else
709 pszText = lpText;
710
712 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
713
715
716 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
717 LocalFree(pszTemp);
718 return ret;
719#endif
720}
#define ARRAY_SIZE(A)
Definition: main.h:20
HINSTANCE hInstance
Definition: charmap.c:19
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define LOWORD(l)
Definition: pedump.c:82
#define args
Definition: format.c:66
Definition: match.c:390
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:447
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:445
#define __ms_va_list
Definition: windef.h:456
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
#define MB_SETFOREGROUND
Definition: winuser.h:817
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
const char * LPCSTR
Definition: xmlstorage.h:183

◆ ShellMessageBoxW()

int ShellMessageBoxW ( HINSTANCE  hInstance,
HWND  hWnd,
LPCWSTR  lpText,
LPCWSTR  lpCaption,
UINT  uType,
  ... 
)

Definition at line 554 of file shellord.c.

561{
562 WCHAR szText[100],szTitle[100];
563 LPCWSTR pszText = szText, pszTitle = szTitle;
564 LPWSTR pszTemp;
566 int ret;
567
568 __ms_va_start(args, uType);
569 /* wvsprintfA(buf,fmt, args); */
570
571 TRACE("(%p,%p,%p,%p,%08x)\n",
572 hInstance,hWnd,lpText,lpCaption,uType);
573
574 if (IS_INTRESOURCE(lpCaption))
576 else
577 pszTitle = lpCaption;
578
579 if (IS_INTRESOURCE(lpText))
580 LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
581 else
582 pszText = lpText;
583
585 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
586
588
589 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
590 LocalFree(pszTemp);
591 return ret;
592}
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)

◆ SHFindFiles()

BOOL WINAPI SHFindFiles ( PCIDLIST_ABSOLUTE  pidlFolder,
PCIDLIST_ABSOLUTE  pidlSaveFile 
)

Definition at line 2467 of file shellord.c.

2468{
2469 FIXME("params ignored: %p %p\n", pidlFolder, pidlSaveFile);
2471 {
2472 return FALSE;
2473 }
2474 /* Open the search results folder */
2475 /* FIXME: CSearchBar should be opened as well */
2476 return ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{E17D4FC0-5564-11D1-83F2-00A0C90DC849}", NULL, SW_SHOWNORMAL) > (HINSTANCE)32;
2477}
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2492
@ REST_NOFIND
Definition: shlobj.h:1650
HANDLE HINSTANCE
Definition: typedefs.h:77
#define SW_SHOWNORMAL
Definition: winuser.h:773

Referenced by CTaskSwitchWnd::HandleAppCommand(), CTrayWindow::HandleCommand(), CTrayWindow::HandleHotKey(), CDesktopBrowser::OnCommand(), and StartMenuHandler::ShowSearchDialog().

◆ SHFlushClipboard()

HRESULT WINAPI SHFlushClipboard ( void  )

Definition at line 1967 of file shellord.c.

1968{
1969 return OleFlushClipboard();
1970}
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2293

◆ SHFlushSFCache()

void WINAPI SHFlushSFCache ( void  )

Definition at line 2659 of file shellord.c.

2660{
2661}

◆ SHFreeUnusedLibraries()

void WINAPI SHFreeUnusedLibraries ( void  )

Definition at line 1727 of file shellord.c.

1728{
1729 FIXME("stub\n");
1731}
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void)
Definition: compobj.c:3701

◆ SHGetImageList()

HRESULT WINAPI SHGetImageList ( int  iImageList,
REFIID  riid,
void **  ppv 
)

Definition at line 2673 of file shellord.c.

2674{
2675 HIMAGELIST hLarge, hSmall;
2676 HIMAGELIST hNew;
2677 HRESULT ret = E_FAIL;
2678
2679 /* Wine currently only maintains large and small image lists */
2680 if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
2681 {
2682 FIXME("Unsupported image list %i requested\n", iImageList);
2683 return E_FAIL;
2684 }
2685
2686 Shell_GetImageLists(&hLarge, &hSmall);
2687#ifndef __REACTOS__
2688 hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall);
2689
2690 /* Get the interface for the new image list */
2691 if (hNew)
2692 {
2694 ImageList_Destroy(hNew);
2695 }
2696#else
2697 /* Duplicating the imagelist causes the start menu items not to draw on
2698 * the first show. Was the Duplicate necessary for some reason? I believe
2699 * Windows returns the raw pointer here. */
2700 hNew = (iImageList == SHIL_LARGE ? hLarge : hSmall);
2701 ret = IImageList2_QueryInterface((IImageList2 *) hNew, riid, ppv);
2702#endif
2703
2704 return ret;
2705}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void **ppv)
Definition: imagelist.c:4038
HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himlSrc)
Definition: imagelist.c:1801
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:683
REFIID riid
Definition: atlbase.h:39
#define SHIL_SYSSMALL
Definition: shellapi.h:188
#define SHIL_SMALL
Definition: shellapi.h:186
#define SHIL_LARGE
Definition: shellapi.h:185

Referenced by check_icon_size(), CISFBand::CreateSimpleToolbar(), CISFBand::InvokeCommand(), CSearchBar::OnInitDialog(), CAddressBand::SetSite(), test_get_file_info_iconlist(), test_SHGetImageList(), and CMenuToolbarBase::UpdateImageLists().

◆ SHGetInstanceExplorer()

HRESULT WINAPI SHGetInstanceExplorer ( IUnknown **  lpUnknown)

Definition at line 1703 of file shellord.c.

1704{ TRACE("%p\n", lpUnknown);
1705
1706 *lpUnknown = SHELL32_IExplorerInterface;
1707
1709 return E_FAIL;
1710
1711 IUnknown_AddRef(SHELL32_IExplorerInterface);
1712 return S_OK;
1713}
#define S_OK
Definition: intsafe.h:52
static LPUNKNOWN SHELL32_IExplorerInterface
Definition: shellord.c:1686

Referenced by _SHGetInstanceExplorer(), and SHOpenFolderWindow().

◆ SHGetNewLinkInfoA()

BOOL WINAPI SHGetNewLinkInfoA ( LPCSTR  pszLinkTo,
LPCSTR  pszDir,
LPSTR  pszName,
BOOL pfMustCopy,
UINT  uFlags 
)

Definition at line 2543 of file shellord.c.

2545{
2546 WCHAR wszLinkTo[MAX_PATH];
2547 WCHAR wszDir[MAX_PATH];
2548 WCHAR wszName[MAX_PATH];
2549 BOOL res;
2550
2551 MultiByteToWideChar(CP_ACP, 0, pszLinkTo, -1, wszLinkTo, MAX_PATH);
2552 MultiByteToWideChar(CP_ACP, 0, pszDir, -1, wszDir, MAX_PATH);
2553
2554 res = SHGetNewLinkInfoW(wszLinkTo, wszDir, wszName, pfMustCopy, uFlags);
2555
2556 if (res)
2557 WideCharToMultiByte(CP_ACP, 0, wszName, -1, pszName, MAX_PATH, NULL, NULL);
2558
2559 return res;
2560}
_In_ LPCSTR pszDir
Definition: shellapi.h:585
_In_ LPCSTR _Out_ BOOL * pfMustCopy
Definition: shellapi.h:587
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2562

Referenced by test_sh_new_link_info().

◆ SHGetNewLinkInfoW()

BOOL WINAPI SHGetNewLinkInfoW ( LPCWSTR  pszLinkTo,
LPCWSTR  pszDir,
LPWSTR  pszName,
BOOL pfMustCopy,
UINT  uFlags 
)

Definition at line 2562 of file shellord.c.

2564{
2565 const WCHAR *basename;
2566 WCHAR *dst_basename;
2567 int i=2;
2568
2569 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
2570 pszName, pfMustCopy, uFlags);
2571
2572 *pfMustCopy = FALSE;
2573
2574 if (uFlags & SHGNLI_PIDL)
2575 {
2576 FIXME("SHGNLI_PIDL flag unsupported\n");
2577 return FALSE;
2578 }
2579
2580 if (uFlags)
2581 FIXME("ignoring flags: 0x%08x\n", uFlags);
2582
2583 /* FIXME: should test if the file is a shortcut or DOS program */
2585 return FALSE;
2586
2587 basename = strrchrW(pszLinkTo, '\\');
2588 if (basename)
2589 basename = basename+1;
2590 else
2591 basename = pszLinkTo;
2592
2593 lstrcpynW(pszName, pszDir, MAX_PATH);
2594 if (!PathAddBackslashW(pszName))
2595 return FALSE;
2596
2597 dst_basename = pszName + strlenW(pszName);
2598
2599 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename);
2600
2602 {
2603 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i);
2604 i++;
2605 }
2606
2607 return TRUE;
2608}
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
#define PathAddBackslashW
Definition: pathcch.h:301
#define strlenW(s)
Definition: unicode.h:34
#define strrchrW(s, c)
Definition: unicode.h:41
#define snprintfW
Definition: unicode.h:66
#define SHGNLI_PIDL
Definition: shellapi.h:405

Referenced by SHGetNewLinkInfoA(), and SHGetNewLinkInfoWrapW().

◆ SHGetSetSettings()

VOID WINAPI SHGetSetSettings ( LPSHELLSTATE  lpss,
DWORD  dwMask,
BOOL  bSet 
)

Definition at line 225 of file shellord.c.

226{
227#ifdef __REACTOS__
228 const DWORD inverted = SSF_SHOWEXTENSIONS;
229 LPSHELLSTATE gpss = &g_ShellState.ss;
230 HKEY hKeyAdv;
231
232 if (!SHELL_GlobalCounterIsInitialized(g_hShellState))
233 {
234 SHELL_GlobalCounterCreate(&SHGCGUID_ShellState, g_hShellState);
235 }
236
237 if (!lpss)
238 {
239 SHELL_GlobalCounterIncrement(SHELL_GCOUNTER_SHELLSTATE);
240 return;
241 }
242
243 hKeyAdv = SHGetShellKey(SHKEY_Root_HKCU | SHKEY_Key_Explorer, L"Advanced", bSet);
244 if (!hKeyAdv && bSet)
245 return;
246
247#define SSF_STRUCTONLY (SSF_NOCONFIRMRECYCLE | SSF_DOUBLECLICKINWEBVIEW | SSF_DESKTOPHTML | \
248 SSF_WIN95CLASSIC | SSF_SORTCOLUMNS | SSF_STARTPANELON)
249#define SHGSS_GetSetStruct(getsetmacro) \
250 do { \
251 getsetmacro(fNoConfirmRecycle, SSF_NOCONFIRMRECYCLE); \
252 getsetmacro(fDoubleClickInWebView, SSF_DOUBLECLICKINWEBVIEW); \
253 getsetmacro(fDesktopHTML, SSF_DESKTOPHTML); \
254 getsetmacro(fWin95Classic, SSF_WIN95CLASSIC); \
255 getsetmacro(lParamSort, SSF_SORTCOLUMNS); \
256 getsetmacro(iSortDirection, SSF_SORTCOLUMNS); \
257 getsetmacro(fStartPanelOn, SSF_STARTPANELON); \
258 } while (0)
259#define SHGSS_GetSetAdv(getsetmacro) \
260 do { \
261 getsetmacro(L"HideFileExt", fShowExtensions, SSF_SHOWEXTENSIONS); \
262 getsetmacro(L"ShowCompColor", fShowCompColor, SSF_SHOWCOMPCOLOR); \
263 getsetmacro(L"DontPrettyPath", fDontPrettyPath, SSF_DONTPRETTYPATH); \
264 getsetmacro(L"ShowAttribCol", fShowAttribCol, SSF_SHOWATTRIBCOL); \
265 getsetmacro(L"MapNetDrvBtn", fMapNetDrvBtn, SSF_MAPNETDRVBUTTON); \
266 getsetmacro(L"ShowInfoTip", fShowInfoTip, SSF_SHOWINFOTIP); \
267 getsetmacro(L"HideIcons", fHideIcons, SSF_HIDEICONS); \
268 getsetmacro(L"WebView", fWebView, SSF_WEBVIEW); \
269 getsetmacro(L"Filter", fFilter, SSF_FILTER); \
270 getsetmacro(L"ShowSuperHidden", fShowSuperHidden, SSF_SHOWSUPERHIDDEN); \
271 getsetmacro(L"NoNetCrawling", fNoNetCrawling, SSF_NONETCRAWLING); \
272 getsetmacro(L"SeparateProcess", fSepProcess, SSF_SEPPROCESS); \
273 getsetmacro(L"AutoCheckSelect", fAutoCheckSelect, ssf_autocheckselect); \
274 getsetmacro(L"IconsOnly", fIconsOnly, ssf_iconsonly); \
275 getsetmacro(L"ShowTypeOverlay", fShowTypeOverlay, ssf_showtypeoverlay); \
276 getsetmacro(L"ShowStatusBar", fShowStatusBar, ssf_showstatusbar); \
277 } while (0)
278
279 if (bSet)
280 {
281 DWORD changed = 0;
282 if (dwMask & ~g_CachedSSF)
283 {
284 SHELLSTATE tempstate;
285 SHGetSetSettings(&tempstate, dwMask, FALSE); // Read entries that are not in g_CachedSSF
286 }
287
288#define SHGSS_WriteAdv(name, value, SSF) \
289 do { \
290 DWORD val = (value), cb = sizeof(DWORD); \
291 if (SHSetValueW(hKeyAdv, NULL, (name), REG_DWORD, &val, cb) == ERROR_SUCCESS) \
292 { \
293 ++changed; \
294 } \
295 } while (0)
296#define SHGSS_SetAdv(name, field, SSF) \
297 do { \
298 if ((dwMask & (SSF)) && gpss->field != lpss->field) \
299 { \
300 const DWORD bitval = (gpss->field = lpss->field); \
301 SHGSS_WriteAdv((name), ((SSF) & inverted) ? !bitval : !!bitval, (SSF)); \
302 } \
303 } while (0)
304#define SHGSS_SetStruct(field, SSF) \
305 do { \
306 if ((dwMask & (SSF)) && gpss->field != lpss->field) \
307 { \
308 gpss->field = lpss->field; \
309 ++changed; \
310 } \
311 } while (0)
312
313 if ((dwMask & SSF_SHOWALLOBJECTS) && gpss->fShowAllObjects != lpss->fShowAllObjects)
314 {
315 gpss->fShowAllObjects = lpss->fShowAllObjects;
316 SHGSS_WriteAdv(L"Hidden", lpss->fShowAllObjects ? 1 : 2, SSF_SHOWALLOBJECTS);
317 }
318 SHGSS_SetStruct(fShowSysFiles, SSF_SHOWSYSFILES);
319 SHGSS_GetSetAdv(SHGSS_SetAdv);
320 SHGSS_GetSetStruct(SHGSS_SetStruct);
321 if (changed)
322 {
323 if ((dwMask & SSF_SHOWSUPERHIDDEN) && (DLL_EXPORT_VERSION) < _WIN32_WINNT_VISTA)
324 {
325 // This is probably a Windows bug but write this alternative name just in case someone reads it
326 DWORD val = gpss->fShowSuperHidden != FALSE;
327 SHSetValueW(hKeyAdv, NULL, L"SuperHidden", REG_DWORD, &val, sizeof(val));
328 }
329 SHELL32_WriteRegShellState(&g_ShellState); // Write the new SHELLSTATE
330 SHGetSetSettings(NULL, 0, TRUE); // Invalidate counter
331 SHSendMessageBroadcastW(WM_SETTINGCHANGE, 0, (LPARAM)L"ShellState"); // Notify everyone
332 }
333 }
334 else
335 {
336 DWORD read = 0, data, cb, dummy = 0;
337 if (SHELL_GlobalCounterChanged(&g_ShellStateCounter, SHELL_GCOUNTER_SHELLSTATE))
338 g_CachedSSF = 0;
339
340#define SHGSS_ReadAdv(name, SSF) ( \
341 (g_CachedSSF & (SSF)) != (SSF) && (cb = sizeof(DWORD)) != 0 && \
342 SHQueryValueEx(hKeyAdv, (name), NULL, NULL, &data, &cb) == ERROR_SUCCESS && \
343 cb == sizeof(DWORD) && (read |= (SSF)) != 0 )
344#define SHGSS_GetFieldHelper(field, SSF, src, dst, cachevar) \
345 do { \
346 if (dwMask & (SSF)) \
347 { \
348 (dst)->field = (src)->field; \
349 cachevar |= (SSF); \
350 } \
351 } while (0)
352#define SHGSS_CacheField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), &rss.ss, gpss, read)
353#define SHGSS_GetField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, dummy)
354#define SHGSS_GetAdv(name, field, SSF) \
355 do { \
356 if (SHGSS_ReadAdv((name), (SSF))) \
357 gpss->field = ((SSF) & inverted) ? data == FALSE : data != FALSE; \
358 SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, read); \
359 } while (0)
360
361 if (SHGSS_ReadAdv(L"Hidden", SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES))
362 {
363 gpss->fShowAllObjects = data == 1;
364 gpss->fShowSysFiles = data > 1;
365 }
366 SHGSS_GetField(fShowAllObjects, SSF_SHOWALLOBJECTS);
367 SHGSS_GetField(fShowSysFiles, SSF_SHOWSYSFILES);
368 SHGSS_GetSetAdv(SHGSS_GetAdv);
369 if (dwMask & ~(read | g_CachedSSF))
370 {
371 REGSHELLSTATE rss;
373 {
374 SHGSS_GetSetStruct(SHGSS_CacheField); // Copy the requested items to gpss
375 }
376 else
377 {
379 read = 0; // The advanced items we read are no longer valid in gpss
380 g_CachedSSF = SSF_STRUCTONLY;
381 }
382 }
383 SHGSS_GetSetStruct(SHGSS_GetField); // Copy requested items from gpss to output
384 g_CachedSSF |= read;
385 }
386 if (hKeyAdv)
387 RegCloseKey(hKeyAdv);
388#else
389 if(bSet)
390 {
391 FIXME("%p 0x%08x TRUE\n", lpss, dwMask);
392 }
393 else
394 {
395 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
396 }
397#endif //__REACTOS__
398}
#define read
Definition: acwin.h:96
DWORD WINAPI SHSendMessageBroadcastW(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ordinal.c:4072
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
Definition: ordinal.c:4601
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1306
EXTERN_C BOOL SHELL32_ReadRegShellState(PREGSHELLSTATE prss)
Definition: general.cpp:85
EXTERN_C void SHELL32_GetDefaultShellState(LPSHELLSTATE pss)
Definition: general.cpp:33
EXTERN_C LSTATUS SHELL32_WriteRegShellState(PREGSHELLSTATE prss)
Definition: general.cpp:51
GLuint GLfloat * val
Definition: glext.h:7180
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
@ SHKEY_Key_Explorer
Definition: ordinal.c:2806
@ SHKEY_Root_HKCU
Definition: ordinal.c:2804
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
Definition: shellord.c:408
#define SSF_SHOWSYSFILES
Definition: shlobj.h:1609
#define SSF_SHOWEXTENSIONS
Definition: shlobj.h:1606
#define SSF_SHOWSUPERHIDDEN
Definition: shlobj.h:1621
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1605
#define SHELL_GlobalCounterIncrement(handle)
Definition: shlwapi_undoc.h:61
#define SHELL_GlobalCounterIsInitialized(handle)
Definition: shlwapi_undoc.h:59
#define SHELL_GlobalCounterCreate(refguid, handle)
Definition: shlwapi_undoc.h:54
BOOL fShowSysFiles
Definition: shlobj.h:1545
BOOL fShowSuperHidden
Definition: shlobj.h:1557
BOOL fShowAllObjects
Definition: shlobj.h:1541
#define WM_SETTINGCHANGE
Definition: winuser.h:1632

Referenced by DesktopOnInitDialog(), CDefView::FillList(), GeneralDlg_OnInitDialog(), CShellDispatch::GetSetting(), IntSetShellStateSettings(), CStartMenuSettingsPage::OnApply(), ReadCabinetState(), RecycleBinDlg(), CACListISF::Reset(), SHELL_GetDefaultFolderEnumSHCONTF(), SHGetSetSettings(), SHGetSettings(), START_TEST(), and ViewDlg_Apply().

◆ SHGetSettings()

VOID WINAPI SHGetSettings ( LPSHELLFLAGSTATE  lpsfs,
DWORD  dwMask 
)

Definition at line 408 of file shellord.c.

409{
410#ifdef __REACTOS__
413 *lpsfs = *(LPSHELLFLAGSTATE)&ss;
414 if (dwMask & SSF_HIDEICONS)
415 lpsfs->fHideIcons = ss.fHideIcons;
416 if (dwMask & ssf_autocheckselect)
417 lpsfs->fAutoCheckSelect = ss.fAutoCheckSelect;
418 if (dwMask & ssf_iconsonly)
419 lpsfs->fIconsOnly = ss.fIconsOnly;
420#else
421 HKEY hKey;
423 DWORD dwDataSize = sizeof (DWORD);
424
425 TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
426
427 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
428 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
429 return;
430
431 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
432 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
433
434 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
435 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
436
437 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
438 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
439
440 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
441 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
442
443 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
444 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
445
446 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
447 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
448
449 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
450 { if (dwData == 0)
451 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
452 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
453 }
454 else if (dwData == 1)
455 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
456 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
457 }
458 else if (dwData == 2)
459 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
460 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
461 }
462 }
464#endif //__REACTOS__
465 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
466}
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
unsigned short WORD
Definition: ntddk_ex.h:93
#define ss
Definition: i386-dis.c:441
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define DWORD
Definition: nt_native.h:44
#define SSF_FILTER
Definition: shlobj.h:1619
#define SSF_DONTPRETTYPATH
Definition: shlobj.h:1614
#define SSF_SORTCOLUMNS
Definition: shlobj.h:1608
struct SHELLFLAGSTATE * LPSHELLFLAGSTATE
#define SSF_SHOWATTRIBCOL
Definition: shlobj.h:1611
#define SSF_MAPNETDRVBUTTON
Definition: shlobj.h:1615
#define SSF_SHOWINFOTIP
Definition: shlobj.h:1616
#define SSF_HIDEICONS
Definition: shlobj.h:1617
BOOL fMapNetDrvBtn
Definition: shlobj.h:1594
BOOL fShowInfoTip
Definition: shlobj.h:1595
BOOL fHideIcons
Definition: shlobj.h:1596
BOOL fIconsOnly
Definition: shlobj.h:1598
BOOL fShowExtensions
Definition: shlobj.h:1585
BOOL fAutoCheckSelect
Definition: shlobj.h:1597
BOOL fShowSysFiles
Definition: shlobj.h:1587
BOOL fDontPrettyPath
Definition: shlobj.h:1592
BOOL fShowAllObjects
Definition: shlobj.h:1584
BOOL fShowAttribCol
Definition: shlobj.h:1593

Referenced by SHGetSetSettings(), and START_TEST().

◆ SHHandleUpdateImage()

INT WINAPI SHHandleUpdateImage ( PCIDLIST_ABSOLUTE  pidlExtra)

Definition at line 2513 of file shellord.c.

2514{
2515 FIXME("%p - stub\n", pidlExtra);
2516
2517 return -1;
2518}

◆ SHLimitInputEdit()

HRESULT WINAPI SHLimitInputEdit ( HWND  hWnd,
IShellFolder psf 
)

Definition at line 3047 of file shellord.c.

3048{
3049 IItemNameLimits *pLimits;
3050 HRESULT hr;
3051 LPWSTR pwszValidChars, pwszInvalidChars;
3052 UxSubclassInfo *pInfo;
3053
3054 pInfo = GetPropW(hWnd, L"UxSubclassInfo");
3055 if (pInfo)
3056 {
3058 pInfo = NULL;
3059 }
3060
3061 hr = psf->lpVtbl->QueryInterface(psf, &IID_IItemNameLimits, (LPVOID *)&pLimits);
3062 if (FAILED(hr))
3063 {
3064 ERR("hr: %x\n", hr);
3065 return hr;
3066 }
3067
3068 pwszValidChars = pwszInvalidChars = NULL;
3069 hr = pLimits->lpVtbl->GetValidCharacters(pLimits, &pwszValidChars, &pwszInvalidChars);
3070 if (FAILED(hr))
3071 {
3072 ERR("hr: %x\n", hr);
3073 pLimits->lpVtbl->Release(pLimits);
3074 return hr;
3075 }
3076
3077 pInfo = UxSubclassInfo_Create(hWnd, pwszValidChars, pwszInvalidChars);
3078 if (!pInfo)
3079 hr = E_FAIL;
3080
3081 pLimits->lpVtbl->Release(pLimits);
3082
3083 return hr;
3084}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static UxSubclassInfo * UxSubclassInfo_Create(HWND hwnd, LPWSTR valid, LPWSTR invalid)
Definition: shellord.c:3013

Referenced by DialogProc(), DoNullFolderTest(), CDefView::OnNotify(), START_TEST(), and test_SHLimitInputEdit().

◆ SHLoadOLE()

HRESULT WINAPI SHLoadOLE ( LPARAM  lParam)

Definition at line 1920 of file shellord.c.

1921{ FIXME("0x%08lx stub\n",lParam);
1922 return S_OK;
1923}

◆ SHObjectProperties()

BOOL WINAPI SHObjectProperties ( HWND  hwnd,
DWORD  dwType,
LPCWSTR  szObject,
LPCWSTR  szPage 
)

Definition at line 2520 of file shellord.c.

2521{
2522 LPITEMIDLIST pidl = NULL;
2523 switch (dwType)
2524 {
2525 case SHOP_FILEPATH:
2526 pidl = ILCreateFromPathW(szObject);
2527 break;
2528 }
2529 if (pidl)
2530 {
2531 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST, hwnd, L"properties",
2532 NULL, szPage, NULL, SW_SHOWNORMAL, NULL, pidl };
2533 BOOL result = ShellExecuteExW(&sei);
2534 ILFree(pidl);
2535 return result;
2536 }
2537
2538 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
2539
2540 return TRUE;
2541}
GLuint64EXT * result
Definition: glext.h:11304
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1042
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1099
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2434
#define SHOP_FILEPATH
Definition: vfdshmenu.cpp:36

◆ SHOutOfMemoryMessageBox()

int WINAPI SHOutOfMemoryMessageBox ( HWND  hwndOwner,
LPCSTR  lpCaption,
UINT  uType 
)

Definition at line 1955 of file shellord.c.

1959{
1960 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1961 return 0;
1962}

◆ SHRegisterDragDrop()

HRESULT WINAPI SHRegisterDragDrop ( HWND  hWnd,
LPDROPTARGET  pDropTarget 
)

Definition at line 738 of file shellord.c.

741{
742 static BOOL ole_initialized = FALSE;
743 HRESULT hr;
744
745 TRACE("(%p,%p)\n", hWnd, pDropTarget);
746
747 if (!ole_initialized)
748 {
750 if (FAILED(hr))
751 return hr;
752 ole_initialized = TRUE;
753 }
754 return RegisterDragDrop(hWnd, pDropTarget);
755}
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:557

◆ SHReplaceFromPropSheetExtArray()

UINT WINAPI SHReplaceFromPropSheetExtArray ( HPSXA  hpsxa,
UINT  uPageID,
LPFNADDPROPSHEETPAGE  lpfnReplaceWith,
LPARAM  lParam 
)

Definition at line 2364 of file shellord.c.

2365{
2366 PSXA_CALL Call;
2367 UINT i;
2368 PPSXA psxa = (PPSXA)hpsxa;
2369
2370 TRACE("(%p,%u,%p,%08lx)\n", hpsxa, uPageID, lpfnReplaceWith, lParam);
2371
2372 if (psxa)
2373 {
2374 ZeroMemory(&Call, sizeof(Call));
2375 Call.lpfnAddReplaceWith = lpfnReplaceWith;
2376 Call.lParam = lParam;
2377
2378 /* Call the ReplacePage method of all registered IShellPropSheetExt interfaces.
2379 Each shell extension is only allowed to call the callback once during the callback. */
2380 for (i = 0; i != psxa->uiCount; i++)
2381 {
2382 Call.bCalled = FALSE;
2383 psxa->pspsx[i]->lpVtbl->ReplacePage(psxa->pspsx[i], uPageID, PsxaCall, (LPARAM)&Call);
2384 }
2385
2386 return Call.uiCount;
2387 }
2388
2389 return 0;
2390}
HRESULT ReplacePage([in] EXPPS uPageID, [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith, [in] LPARAM lParam)

Referenced by DisplayApplet(), and MouseApplet().

◆ SHRevokeDragDrop()

HRESULT WINAPI SHRevokeDragDrop ( HWND  hWnd)

Definition at line 773 of file shellord.c.

774{
775 TRACE("(%p)\n", hWnd);
776 return RevokeDragDrop(hWnd);
777}
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:639

◆ SHRunControlPanel()

BOOL WINAPI SHRunControlPanel ( _In_ LPCWSTR  commandLine,
_In_opt_ HWND  parent 
)

Definition at line 1661 of file shellord.c.

1662{
1663#ifdef __REACTOS__
1664 /*
1665 * TODO: Run in-process when possible, using
1666 * HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\InProcCPLs
1667 * and possibly some extra rules.
1668 * See also https://docs.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shruncontrolpanel
1669 * "If the specified Control Panel item is already running, SHRunControlPanel
1670 * attempts to switch to that instance rather than opening a new instance."
1671 * This function is not supported as of Windows Vista, where it always returns FALSE.
1672 * However we need to keep it "alive" even when ReactOS is compliled as NT6+
1673 * in order to keep control panel elements launch commands.
1674 */
1675 WCHAR parameters[MAX_PATH] = L"shell32.dll,Control_RunDLL ";
1676 TRACE("(%s, %p)n", debugstr_w(commandLine), parent);
1677 wcscat(parameters, commandLine);
1678
1679 return ((INT_PTR)ShellExecuteW(parent, L"open", L"rundll32.exe", parameters, NULL, SW_SHOWNORMAL) > 32);
1680#else
1681 FIXME("(%s, %p): stub\n", debugstr_w(commandLine), parent);
1682 return FALSE;
1683#endif
1684}
r parent
Definition: btrfs.c:3010
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
int32_t INT_PTR
Definition: typedefs.h:64

Referenced by CShellDispatch::ControlPanelItem().

◆ SHSetInstanceExplorer()

VOID WINAPI SHSetInstanceExplorer ( LPUNKNOWN  lpUnknown)

Definition at line 1693 of file shellord.c.

1694{ TRACE("%p\n", lpUnknown);
1695 SHELL32_IExplorerInterface = lpUnknown;
1696}

Referenced by SHCreateFromDesktop(), ExplorerInstance::Wait(), and wmain().

◆ SHSetLocalizedName()

HRESULT WINAPI SHSetLocalizedName ( LPCWSTR  pszPath,
LPCWSTR  pszResModule,
int  idsRes 
)

Definition at line 2625 of file shellord.c.

2626{
2627 FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
2628
2629 return S_OK;
2630}

◆ SHShellFolderView_Message()

LRESULT WINAPI SHShellFolderView_Message ( HWND  hwndCabinet,
UINT  uMessage,
LPARAM  lParam 
)

Definition at line 488 of file shellord.c.

492{
493 FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
494 return 0;
495}

◆ SHStartNetConnectionDialog()

HRESULT WINAPI SHStartNetConnectionDialog ( HWND  hwnd,
LPCSTR  pszRemoteName,
DWORD  dwType 
)

Definition at line 2610 of file shellord.c.

2611{
2612#ifdef __REACTOS__
2613 if (SHELL_OsIsUnicode())
2614 return SHStartNetConnectionDialogW(hwnd, (LPCWSTR)pszRemoteName, dwType);
2615 return SHStartNetConnectionDialogA(hwnd, pszRemoteName, dwType);
2616#else
2617 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
2618
2619 return S_OK;
2620#endif
2621}
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogW(_In_ HWND hwnd, _In_ LPCWSTR pszRemoteName, _In_ DWORD dwType)
Definition: stubs.cpp:599
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogA(_In_ HWND hwnd, _In_ LPCSTR pszRemoteName, _In_ DWORD dwType)
Definition: utils.cpp:1165

◆ SHTestTokenMembership()

EXTERN_C BOOL WINAPI SHTestTokenMembership ( HANDLE  TokenHandle,
ULONG  ulRID 
)

Definition at line 2755 of file shellord.c.

2756{
2758 DWORD nSubAuthority0, nSubAuthority1;
2759 DWORD nSubAuthorityCount;
2760 PSID SidToCheck;
2761 BOOL IsMember = FALSE;
2762
2763 if ((ulRID == SECURITY_SERVICE_RID) || ulRID == SECURITY_LOCAL_SYSTEM_RID)
2764 {
2765 nSubAuthority0 = ulRID;
2766 nSubAuthority1 = 0;
2767 nSubAuthorityCount= 1;
2768 }
2769 else
2770 {
2771 nSubAuthority0 = SECURITY_BUILTIN_DOMAIN_RID;
2772 nSubAuthority1 = ulRID;
2773 nSubAuthorityCount= 2;
2774 }
2775
2776 if (!AllocateAndInitializeSid(&ntAuth,
2777 nSubAuthorityCount,
2778 nSubAuthority0,
2779 nSubAuthority1,
2780 0, 0, 0, 0, 0, 0,
2781 &SidToCheck))
2782 {
2783 return FALSE;
2784 }
2785
2786 if (!CheckTokenMembership(TokenHandle, SidToCheck, &IsMember))
2787 {
2788 IsMember = FALSE;
2789 }
2790
2791 FreeSid(SidToCheck);
2792 return IsMember;
2793}
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:674
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:698
_In_ ACCESS_MASK _In_ ULONG _Out_ PHANDLE TokenHandle
Definition: psfuncs.h:726
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define SECURITY_SERVICE_RID
Definition: setypes.h:562
#define SECURITY_LOCAL_SYSTEM_RID
Definition: setypes.h:574
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554

Referenced by IsUserAnAdmin().

◆ SHUpdateImageA()

VOID WINAPI SHUpdateImageA ( LPCSTR  pszHashItem,
INT  iIndex,
UINT  uFlags,
INT  iImageIndex 
)

Definition at line 2508 of file shellord.c.

2509{
2510 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
2511}

◆ SHUpdateImageW()

void WINAPI SHUpdateImageW ( LPCWSTR  pszHashItem,
int  iIndex,
UINT  uFlags,
int  iImageIndex 
)

Definition at line 2498 of file shellord.c.

2499{
2500 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
2501}

◆ SHValidateUNC()

BOOL WINAPI SHValidateUNC ( HWND  hwndOwner,
PWSTR  pszFile,
UINT  fConnect 
)

Definition at line 1999 of file shellord.c.

2000{
2001 FIXME("(%p, %s, 0x%08x): stub\n", hwndOwner, debugstr_w(pszFile), fConnect);
2002 return FALSE;
2003}

◆ SHWaitForFileToOpen()

BOOL WINAPI SHWaitForFileToOpen ( LPCITEMIDLIST  pidl,
DWORD  dwFlags,
DWORD  dwTimeout 
)

Definition at line 1976 of file shellord.c.

1980{
1981 FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
1982 return FALSE;
1983}
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6081

◆ SHWinHelp()

HRESULT WINAPI SHWinHelp ( HWND  hwnd,
LPCWSTR  pszHelp,
UINT  uCommand,
ULONG_PTR  dwData 
)

Definition at line 1644 of file shellord.c.

1645{
1646 TRACE("(%p, %s, 0x%08x, %p)\n", hwnd, debugstr_w(pszHelp), uCommand, dwData);
1647 if (!WinHelpW(hwnd, pszHelp, uCommand, dwData))
1648 {
1649#if 0
1652#endif
1653 return FALSE;
1654 }
1655 return TRUE;
1656}
#define shell32_hInstance
#define ShellMessageBoxW
Definition: precomp.h:62
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
#define MB_ICONSTOP
Definition: winuser.h:806
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ SignalFileOpen()

BOOL WINAPI SignalFileOpen ( PCIDLIST_ABSOLUTE  pidl)

Definition at line 824 of file shellord.c.

825{
826 FIXME("(%p):stub.\n", pidl);
827
828 return FALSE;
829}

◆ UxSubclassInfo_Create()

static UxSubclassInfo * UxSubclassInfo_Create ( HWND  hwnd,
LPWSTR  valid,
LPWSTR  invalid 
)
static

Definition at line 3013 of file shellord.c.

3014{
3015 UxSubclassInfo *pInfo;
3017 if (!pInfo)
3018 {
3019 ERR("HeapAlloc failed.\n");
3022 return NULL;
3023 }
3024
3026 if (!pInfo->fnWndProc)
3027 {
3028 ERR("SetWindowLongPtrW failed\n");
3031 HeapFree(GetProcessHeap(), 0, pInfo);
3032 return NULL;
3033 }
3034
3035 pInfo->hwnd = hwnd;
3036 pInfo->pwszValidChars = valid;
3037 pInfo->pwszInvalidChars = invalid;
3038 if (!SetPropW(hwnd, L"UxSubclassInfo", pInfo))
3039 {
3041 pInfo = NULL;
3042 }
3043 return pInfo;
3044}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOLEAN valid
static const WCHAR invalid[]
Definition: assoc.c:39
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static LRESULT CALLBACK LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shellord.c:2920
#define GWLP_WNDPROC
Definition: treelist.c:66
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SetWindowLongPtrW
Definition: winuser.h:5358

Referenced by SHLimitInputEdit().

◆ UxSubclassInfo_Destroy()

static void UxSubclassInfo_Destroy ( UxSubclassInfo pInfo)
static

Definition at line 2827 of file shellord.c.

2828{
2829 if (!pInfo)
2830 return;
2831
2832 RemovePropW(pInfo->hwnd, L"UxSubclassInfo");
2833
2836
2838
2839 HeapFree(GetProcessHeap(), 0, pInfo);
2840}
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)

Referenced by LimitEditWindowProc(), SHLimitInputEdit(), and UxSubclassInfo_Create().

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( pidl  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

◆ WriteCabinetState()

BOOL WINAPI WriteCabinetState ( CABINETSTATE cs)

Definition at line 1858 of file shellord.c.

1859{
1860 DWORD r;
1861 HKEY hkey = 0;
1862
1863 TRACE("%p\n",cs);
1864
1865 if( cs == NULL )
1866 return FALSE;
1867
1868 r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0,
1869 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1870 if( r == ERROR_SUCCESS )
1871 {
1872 r = RegSetValueExW( hkey, L"Settings", 0,
1873 REG_BINARY, (LPBYTE) cs, cs->cLength);
1874
1875 RegCloseKey( hkey );
1876 }
1877
1878#ifdef __REACTOS__
1879 /* TODO: if (r==ERROR_SUCCESS) Increment GLOBALCOUNTER_FOLDERSETTINGSCHANGE */
1880#endif
1881 return (r==ERROR_SUCCESS);
1882}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882

Referenced by IntSetNewWindowMode().

Variable Documentation

◆ SHELL32_IExplorerInterface

LPUNKNOWN SHELL32_IExplorerInterface =0
static

Definition at line 1686 of file shellord.c.

Referenced by SHGetInstanceExplorer(), and SHSetInstanceExplorer().