ReactOS 0.4.17-dev-243-g1369312
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
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
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
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

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 813 of file shellord.c.

815{
816 /* Unimplemented in WinXP SP3 */
817 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
818 hwndParent, dwReserved, lpRect, cKids, lpKids);
819 return 0;
820}
static HWND hwndParent
Definition: cryptui.c:299
_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 2423 of file shellord.c.

2428{
2429 UINT i;
2430 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
2431 HRESULT hResult;
2432
2433 TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
2434 if (TRACE_ON(pidl))
2435 {
2436 pdump (pidlFolder);
2437 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
2438 }
2439 hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, FALSE, ppdataObject);
2440 return hResult;
2441}
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:322
#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(), CCabFolder::GetUIObjectOf(), CZipFolder::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 1741 of file shellord.c.

1742{
1743 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1744 return FALSE;
1745}
#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 1750 of file shellord.c.

1751{
1752 FIXME("hwnd = %p\n",hwnd);
1753 return FALSE;
1754}

◆ DAD_DragEnterEx()

BOOL WINAPI DAD_DragEnterEx ( HWND  hwnd,
POINT  p 
)

Definition at line 1759 of file shellord.c.

1760{
1761 FIXME("hwnd = %p (%d,%d)\n",hwnd,p.x,p.y);
1762 return FALSE;
1763}
GLfloat GLfloat p
Definition: glext.h:8902

◆ DAD_DragLeave()

BOOL WINAPI DAD_DragLeave ( VOID  )

Definition at line 1777 of file shellord.c.

1778{
1779 FIXME("\n");
1780 return FALSE;
1781}

◆ DAD_DragMove()

BOOL WINAPI DAD_DragMove ( POINT  p)

Definition at line 1768 of file shellord.c.

1769{
1770 FIXME("(%d,%d)\n",p.x,p.y);
1771 return FALSE;
1772}

◆ DAD_SetDragImage()

BOOL WINAPI DAD_SetDragImage ( HIMAGELIST  himlTrack,
LPPOINT  lppt 
)

Definition at line 1788 of file shellord.c.

1791{
1792 FIXME("%p %p stub\n",himlTrack, lppt);
1793 return FALSE;
1794}

◆ DAD_ShowDragImage()

BOOL WINAPI DAD_ShowDragImage ( BOOL  bShow)

Definition at line 1801 of file shellord.c.

1802{
1803 FIXME("0x%08x stub\n",bShow);
1804 return FALSE;
1805}

◆ DoEnvironmentSubstA()

DWORD WINAPI DoEnvironmentSubstA ( LPSTR  pszString,
UINT  cchString 
)

Definition at line 2015 of file shellord.c.

2016{
2017 LPSTR dst;
2018 BOOL res = FALSE;
2019 DWORD len = cchString;
2020
2021 TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
2022 if (pszString == NULL) /* Really return 0? */
2023 return 0;
2024 if ((dst = (LPSTR)HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
2025 {
2026 len = ExpandEnvironmentStringsA(pszString, dst, cchString);
2027 /* len includes the terminating 0 */
2028 if (len && len < cchString)
2029 {
2030 res = TRUE;
2031 memcpy(pszString, dst, len);
2032 }
2033 else
2034 len = cchString;
2035
2037 }
2038 return MAKELONG(len, res);
2039}
#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:372
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
char CHAR
Definition: pedump.c:57
char * LPSTR
Definition: typedefs.h:51
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by DoEnvironmentSubstAW(), and test_DoEnvironmentSubst().

◆ DoEnvironmentSubstAW()

DWORD WINAPI DoEnvironmentSubstAW ( LPVOID  x,
UINT  y 
)

Definition at line 2090 of file shellord.c.

2091{
2092 if (SHELL_OsIsUnicode())
2093 return DoEnvironmentSubstW(x, y);
2094 return DoEnvironmentSubstA(x, y);
2095}
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:193
DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
Definition: shellord.c:2060
DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
Definition: shellord.c:2015

◆ DoEnvironmentSubstW()

DWORD WINAPI DoEnvironmentSubstW ( LPWSTR  pszString,
UINT  cchString 
)

Definition at line 2060 of file shellord.c.

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

Referenced by DoEnvironmentSubstAW(), and test_DoEnvironmentSubst().

◆ DoSanitizeClipboard()

static void DoSanitizeClipboard ( HWND  hwnd,
UxSubclassInfo pInfo 
)
static

Definition at line 2947 of file shellord.c.

2948{
2949 HGLOBAL hData;
2950 LPWSTR pszText, pszSanitized;
2951 DWORD cbData;
2952
2954 return;
2955 if (!OpenClipboard(hwnd))
2956 return;
2957
2959 pszText = GlobalLock(hData);
2960 if (!pszText)
2961 {
2963 return;
2964 }
2965 SHStrDupW(pszText, &pszSanitized);
2966 GlobalUnlock(hData);
2967
2968 if (pszSanitized &&
2969 DoSanitizeText(pszSanitized, pInfo->pwszInvalidChars, pInfo->pwszValidChars))
2970 {
2971 MessageBeep(0xFFFFFFFF);
2972
2973 /* Update clipboard text */
2974 cbData = (lstrlenW(pszSanitized) + 1) * sizeof(WCHAR);
2976 pszText = GlobalLock(hData);
2977 if (pszText)
2978 {
2979 CopyMemory(pszText, pszSanitized, cbData);
2980 GlobalUnlock(hData);
2981
2983 }
2984 }
2985
2986 CoTaskMemFree(pszSanitized);
2988}
#define CF_UNICODETEXT
Definition: constants.h:408
#define lstrlenW
Definition: compat.h:750
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2148
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define CopyMemory
Definition: minwinbase.h:29
#define ES_READONLY
Definition: pedump.c:675
static BOOL DoSanitizeText(LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
Definition: shellord.c:2914
LPWSTR pwszValidChars
Definition: shellord.c:2893
LPWSTR pwszInvalidChars
Definition: shellord.c:2894
#define GMEM_MOVEABLE
Definition: winbase.h:318
#define GMEM_SHARE
Definition: winbase.h:329
#define GetWindowLongPtrW
Definition: winuser.h:4983
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:863

Referenced by LimitEditWindowProc().

◆ DoSanitizeText()

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

Definition at line 2914 of file shellord.c.

2915{
2916 LPWSTR pch1, pch2;
2917 BOOL bFound = FALSE;
2918
2919 for (pch1 = pch2 = pszSanitized; *pch1; ++pch1)
2920 {
2921 if (pszInvalidChars)
2922 {
2923 if (wcschr(pszInvalidChars, *pch1) != NULL)
2924 {
2925 bFound = TRUE;
2926 continue;
2927 }
2928 }
2929 else if (pszValidChars)
2930 {
2931 if (wcschr(pszValidChars, *pch1) == NULL)
2932 {
2933 bFound = TRUE;
2934 continue;
2935 }
2936 }
2937
2938 *pch2 = *pch1;
2939 ++pch2;
2940 }
2941 *pch2 = 0;
2942
2943 return bFound;
2944}

Referenced by DoSanitizeClipboard().

◆ DriveType()

int WINAPI DriveType ( int  DriveType)

Definition at line 1933 of file shellord.c.

1934{
1935 WCHAR root[] = L"A:\\";
1936 root[0] = L'A' + DriveType;
1937 return GetDriveTypeW(root);
1938}
UINT DriveType
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define L(x)
Definition: resources.c:13

◆ 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
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
int desired
Definition: jpeglib.h:1121
#define min(a, b)
Definition: monoChain.cc:55
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68

Referenced by SHAddToRecentDocs().

◆ FileIconInit()

BOOL WINAPI FileIconInit ( BOOL  bFullInit)

Definition at line 1893 of file shellord.c.

1894{
1895 return SIC_Initialize();
1896}
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:515

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}
return ret
Definition: mutex.c:146
#define cmp(status, error)
Definition: error.c:118
MRUBinaryCmpFn binary_cmpfn
MRUStringCmpFnW string_cmpfn
union tagMRUINFOW::@328 u

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 2100 of file shellord.c.

2101{
2102 ANSI_STRING ansi_str;
2103 WCHAR szWide[40];
2104 UNICODE_STRING guid_str = { 0, sizeof(szWide), szWide };
2105 if (*str != '{')
2106 return FALSE;
2107 RtlInitAnsiString(&ansi_str, str);
2108 return !RtlAnsiStringToUnicodeString(&guid_str, &ansi_str, FALSE) &&
2109 !RtlGUIDFromString(&guid_str, guid);
2110}
GUID guid
Definition: version.c:147
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
const WCHAR * str
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)

Referenced by TEST_GUIDFromStringA().

◆ GUIDFromStringW()

BOOL WINAPI GUIDFromStringW ( LPCWSTR  str,
LPGUID  guid 
)

Definition at line 2115 of file shellord.c.

2116{
2117 UNICODE_STRING guid_str;
2118 if (!str || *str != L'{')
2119 return FALSE;
2120 RtlInitUnicodeString(&guid_str, str);
2121 return !RtlGUIDFromString(&guid_str, guid);
2122}
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

◆ InvalidateDriveType()

int WINAPI InvalidateDriveType ( int  u)

Definition at line 1943 of file shellord.c.

1944{
1945 TRACE("0x%08x stub\n",u);
1946 return 0;
1947}
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 2878 of file shellord.c.

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

Referenced by CStartMenuBtnCtxMenu::AddStartContextMenuItems(), InitializeServerAdminUI(), prepare_and_run_test(), ProcessRunOnceItems(), and run_registry_test().

◆ LimitEditWindowProc()

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

Definition at line 2991 of file shellord.c.

2992{
2993 WNDPROC fnWndProc;
2994 WCHAR wch;
2995 UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
2996 if (!pInfo)
2997 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
2998
2999 fnWndProc = pInfo->fnWndProc;
3000
3001 switch (uMsg)
3002 {
3003 case WM_KEYDOWN:
3004 if (GetKeyState(VK_SHIFT) < 0 && wParam == VK_INSERT)
3005 DoSanitizeClipboard(hwnd, pInfo);
3006 else if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
3007 DoSanitizeClipboard(hwnd, pInfo);
3008
3009 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3010
3011 case WM_PASTE:
3012 DoSanitizeClipboard(hwnd, pInfo);
3013 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3014
3015 case WM_CHAR:
3016 if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
3017 break;
3018
3019 if (pInfo->pwszInvalidChars)
3020 {
3021 if (wcschr(pInfo->pwszInvalidChars, (WCHAR)wParam) != NULL)
3022 {
3023 MessageBeep(0xFFFFFFFF);
3024 break;
3025 }
3026 }
3027 else if (pInfo->pwszValidChars)
3028 {
3029 if (wcschr(pInfo->pwszValidChars, (WCHAR)wParam) == NULL)
3030 {
3031 MessageBeep(0xFFFFFFFF);
3032 break;
3033 }
3034 }
3035 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3036
3037 case WM_UNICHAR:
3038 if (wParam == UNICODE_NOCHAR)
3039 return TRUE;
3040
3041 /* FALL THROUGH */
3042
3043 case WM_IME_CHAR:
3044 wch = (WCHAR)wParam;
3045 if (GetKeyState(VK_CONTROL) < 0 && wch == L'V')
3046 break;
3047
3048 if (!IsWindowUnicode(hwnd) && HIBYTE(wch) != 0)
3049 {
3050 CHAR data[] = {HIBYTE(wch), LOBYTE(wch)};
3051 MultiByteToWideChar(CP_ACP, 0, data, 2, &wch, 1);
3052 }
3053
3054 if (pInfo->pwszInvalidChars)
3055 {
3056 if (wcschr(pInfo->pwszInvalidChars, wch) != NULL)
3057 {
3058 MessageBeep(0xFFFFFFFF);
3059 break;
3060 }
3061 }
3062 else if (pInfo->pwszValidChars)
3063 {
3064 if (wcschr(pInfo->pwszValidChars, wch) == NULL)
3065 {
3066 MessageBeep(0xFFFFFFFF);
3067 break;
3068 }
3069 }
3070 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3071
3072 case WM_NCDESTROY:
3074 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3075
3076 default:
3077 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3078 }
3079
3080 return 0;
3081}
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:2947
static void UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
Definition: shellord.c:2898
WNDPROC fnWndProc
Definition: shellord.c:2892
#define WM_PASTE
Definition: winuser.h:1891
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CONTROL
Definition: winuser.h:2239
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_IME_CHAR
Definition: winuser.h:1862
#define WM_CHAR
Definition: winuser.h:1745
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1712
#define VK_SHIFT
Definition: winuser.h:2238
#define WM_KEYDOWN
Definition: winuser.h:1743
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_INSERT
Definition: winuser.h:2268
SHORT WINAPI GetKeyState(_In_ int)

Referenced by UxSubclassInfo_Create().

◆ LinkWindow_RegisterClass()

BOOL WINAPI LinkWindow_RegisterClass ( void  )

Definition at line 2705 of file shellord.c.

2706{
2707 FIXME("()\n");
2708 return TRUE;
2709}

◆ LinkWindow_UnregisterClass()

BOOL WINAPI LinkWindow_UnregisterClass ( DWORD  dwUnused)

Definition at line 2714 of file shellord.c.

2715{
2716 FIXME("()\n");
2717 return TRUE;
2718}

◆ 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 2131 of file shellord.c.

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

Referenced by Test_PathIsTemporaryA().

◆ PathIsTemporaryW()

BOOL WINAPI PathIsTemporaryW ( LPWSTR  Str)

Definition at line 2154 of file shellord.c.

2156{
2157#ifdef __REACTOS__
2158 WCHAR szLongPath[MAX_PATH], szTempPath[MAX_PATH];
2159 DWORD attrs;
2160 LPCWSTR pszTarget = Str;
2161
2162 TRACE("(%s)\n", debugstr_w(Str));
2163
2164 attrs = GetFileAttributesW(Str);
2165 if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_TEMPORARY))
2166 return TRUE;
2167
2170 {
2171 return FALSE;
2172 }
2173
2174 if (GetLongPathNameW(Str, szLongPath, _countof(szLongPath)))
2175 pszTarget = szLongPath;
2176
2177 return (PathIsEqualOrSubFolder(szTempPath, pszTarget) ||
2180#else
2181 FIXME("(%s)stub\n", debugstr_w(Str));
2182 return FALSE;
2183#endif
2184}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:1999
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:1684
#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:2212
#define CSIDL_CDBURN_AREA
Definition: shlobj.h:2236
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by PathIsTemporaryA(), and Test_PathIsTemporaryW().

◆ PsxaCall()

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

Definition at line 2202 of file shellord.c.

2203{
2205
2206 if (Call != NULL)
2207 {
2208 if ((Call->bMultiple || !Call->bCalled) &&
2209 Call->lpfnAddReplaceWith(hpage, Call->lParam))
2210 {
2211 Call->bCalled = TRUE;
2212 Call->uiCount++;
2213 return TRUE;
2214 }
2215 }
2216
2217 return FALSE;
2218}
struct _PSXA_CALL * PPSXA_CALL
LPFNADDPROPSHEETPAGE lpfnAddReplaceWith
Definition: shellord.c:2195
LPARAM lParam
Definition: shellord.c:2196
BOOL bCalled
Definition: shellord.c:2197
BOOL bMultiple
Definition: shellord.c:2198
UINT uiCount
Definition: shellord.c:2199

Referenced by SHAddFromPropSheetExtArray(), and SHReplaceFromPropSheetExtArray().

◆ ReadCabinetState()

BOOL WINAPI ReadCabinetState ( CABINETSTATE cs,
int  length 
)

Definition at line 1811 of file shellord.c.

1812{
1813 HKEY hkey = 0;
1814 DWORD type, r;
1815 C_ASSERT(sizeof(*cs) == FIELD_OFFSET(CABINETSTATE, fMenuEnumFilter) + sizeof(UINT));
1816
1817 TRACE("%p %d\n", cs, length);
1818
1819 if( (cs == NULL) || (length < (int)sizeof(*cs)) )
1820 return FALSE;
1821
1822 r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey );
1823 if( r == ERROR_SUCCESS )
1824 {
1825 type = REG_BINARY;
1826 r = RegQueryValueExW( hkey, L"Settings",
1827 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1828 RegCloseKey( hkey );
1829
1830 }
1831
1832 /* if we can't read from the registry, create default values */
1833 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1834 (cs->cLength != length) )
1835 {
1836 SHELLSTATE shellstate;
1837 shellstate.fWin95Classic = FALSE;
1839
1840 TRACE("Initializing shell cabinet settings\n");
1841 memset(cs, 0, sizeof(*cs));
1842 cs->cLength = sizeof(*cs);
1843 cs->nVersion = 2;
1844 cs->fFullPathTitle = FALSE;
1845 cs->fSaveLocalView = TRUE;
1846 cs->fNotShell = FALSE;
1847 cs->fSimpleDefault = TRUE;
1848 cs->fDontShowDescBar = FALSE;
1849 cs->fNewWindowMode = shellstate.fWin95Classic;
1850 cs->fShowCompColor = FALSE;
1851 cs->fDontPrettyNames = FALSE;
1852 cs->fAdminsCreateCommonGroups = TRUE;
1853 cs->fMenuEnumFilter = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
1854 }
1855
1856 return TRUE;
1857}
#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:1499
VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
Definition: shellord.c:225
#define SSF_WIN95CLASSIC
Definition: shlobj.h:1620
BOOL fWin95Classic
Definition: shlobj.h:1556
#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(), CabinetStateSettings::Load(), and ViewDlg_Apply().

◆ RegisterShellHook()

BOOL WINAPI RegisterShellHook ( HWND  hWnd,
DWORD  dwType 
)

Definition at line 514 of file shellord.c.

517{
518 if (dwType == 3)
519 {
522 }
523 else if (dwType == 0)
524 {
526 }
527
528 ERR("Unsupported argument");
529 return FALSE;
530}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: precomp.h:57
HWND WINAPI SetTaskmanWindow(HWND)
Definition: window.c:1878
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 1996 of file shellord.c.

1997{ FIXME("stub\n");
1998 return 0;
1999}

◆ SetAppStartingCursor()

HRESULT WINAPI SetAppStartingCursor ( HWND  u,
DWORD  v 
)

Definition at line 1901 of file shellord.c.

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

◆ SHAbortInvokeCommand()

HRESULT WINAPI SHAbortInvokeCommand ( void  )

Definition at line 1952 of file shellord.c.

1953{ FIXME("stub\n");
1954 return 1;
1955}

◆ SHADD_compare_mru()

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

Definition at line 892 of file shellord.c.

893{
894#ifdef __REACTOS__
895 LPCWSTR psz1, psz2;
896 INT iCmp = lstrcmpiW(data1, data2);
897 if (iCmp != 0)
898 return iCmp;
899 psz1 = data1;
900 psz2 = data2;
901 psz1 += lstrlenW(psz1) + 1;
902 psz2 += lstrlenW(psz2) + 1;
903 return lstrcmpiW(psz1, psz2);
904#else
905 return lstrcmpiA(data1, data2);
906#endif
907}
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4133
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 960 of file shellord.c.

962{
963 LPSTR ptr;
964 INT wlen;
965
966 /*FIXME: Document:
967 * RecentDocs MRU data structure seems to be:
968 * +0h document file name w/ terminating 0h
969 * +nh short int w/ size of remaining
970 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
971 * +n+4h 10 bytes zeros - unknown
972 * +n+eh shortcut file name w/ terminating 0h
973 * +n+e+nh 3 zero bytes - unknown
974 */
975
976 /* Create the MRU data structure for "RecentDocs"
977 */
978 ptr = buffer;
979 lstrcpyA(ptr, doc_name);
980 ptr += (lstrlenA(buffer) + 1);
981 wlen= lstrlenA(new_lnk_name) + 1 + 12;
982 *((short int*)ptr) = wlen;
983 ptr += 2; /* step past the length */
984 *(ptr++) = 0x30; /* unknown reason */
985 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
986 memset(ptr, 0, 10);
987 ptr += 10;
988 lstrcpyA(ptr, new_lnk_name);
989 ptr += (lstrlenA(new_lnk_name) + 1);
990 memset(ptr, 0, 3);
991 ptr += 3;
992 *len = ptr - buffer;
993
994 /* Add the new entry into the MRU list
995 */
996 return AddMRUData(mruhandle, buffer, *len);
997}
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 851 of file shellord.c.

852{
853 HKEY Policy_basekey;
854 INT ret;
855
856 /* Get the key for the policies location in the registry
857 */
859 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
860 0, KEY_READ, &Policy_basekey)) {
861
863 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
864 0, KEY_READ, &Policy_basekey)) {
865 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
866 policy);
867 *len = 0;
869 }
870 }
871
872 /* Retrieve the data if it exists
873 */
874 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
875 RegCloseKey(Policy_basekey);
876 return ret;
877}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:73
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:1444
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_READ
Definition: nt_native.h:1026
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SHAddToRecentDocs().

◆ SHAddFromPropSheetExtArray()

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

Definition at line 2223 of file shellord.c.

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

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

◆ SHAddToRecentDocs()

void WINAPI SHAddToRecentDocs ( UINT  uFlags,
LPCVOID  pv 
)

Definition at line 1015 of file shellord.c.

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

Referenced by CShellDispatch::AddToRecent(), ClearRecentAndMru(), DoOpenFile(), DoSaveFile(), Preview_pLoadImage(), SetFileName(), and RegistrySettings::SetMostRecentFile().

◆ SHCreatePropSheetExtArray()

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

Definition at line 2253 of file shellord.c.

2254{
2255 return SHCreatePropSheetExtArrayEx(hKey, pszSubKey, max_iface, NULL);
2256}
FxAutoRegKey hKey
_In_opt_ LPCSTR pszSubKey
Definition: shlwapi.h:783
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj)
Definition: shellord.c:2261

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

◆ SHCreatePropSheetExtArrayEx()

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

Definition at line 2261 of file shellord.c.

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

Referenced by SHCreatePropSheetExtArray().

◆ SHCreateShellFolderView()

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

Definition at line 2792 of file shellord.c.

2794{
2795 IShellView * psf;
2796 HRESULT hRes;
2797
2798 *ppsv = NULL;
2799 if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
2800 return E_INVALIDARG;
2801
2802 TRACE("sf=%p outer=%p callback=%p\n",
2803 pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
2804
2805 hRes = IShellView_Constructor(pcsfv->pshf, &psf);
2806 if (FAILED(hRes))
2807 return hRes;
2808
2809 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppsv);
2810 IShellView_Release(psf);
2811
2812 return hRes;
2813}
#define E_INVALIDARG
Definition: ddrawi.h:101
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1367
IShellView * psvOuter
Definition: shlobj.h:1366
UINT cbSize
Definition: shlobj.h:1364
IShellFolder * pshf
Definition: shlobj.h:1365

◆ SHCreateShellFolderViewEx()

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

Definition at line 1621 of file shellord.c.

1624{
1625 IShellView * psf;
1626 HRESULT hRes;
1627
1628 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1629 psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
1630 psvcbi->fvm, psvcbi->psvOuter);
1631
1632 *ppv = NULL;
1633 hRes = IShellView_Constructor(psvcbi->pshf, &psf);
1634
1635 if (FAILED(hRes))
1636 return hRes;
1637
1638 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
1639 IShellView_Release(psf);
1640
1641 return hRes;
1642}
REFIID LPVOID * ppv
Definition: atlbase.h:39
FOLDERVIEWMODE fvm
Definition: shlobj.h:1289
IShellView * psvOuter
Definition: shlobj.h:1285
LPFNVIEWCALLBACK pfnCallback
Definition: shlobj.h:1288
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1286
IShellFolder * pshf
Definition: shlobj.h:1284

◆ SHCreateStdEnumFmtEtc()

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

Definition at line 2449 of file shellord.c.

2453{
2454 IEnumFORMATETC *pef;
2455 HRESULT hRes;
2456 TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
2457
2458 hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
2459 if (FAILED(hRes))
2460 return hRes;
2461
2462 IEnumFORMATETC_AddRef(pef);
2463 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
2464 IEnumFORMATETC_Release(pef);
2465
2466 return hRes;
2467}
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 2400 of file shellord.c.

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

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

◆ SHDoDragDrop()

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

Definition at line 797 of file shellord.c.

803{
804 FIXME("(%p %p %p 0x%08x %p):stub.\n",
805 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
806 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
807}
HRESULT WINAPI DoDragDrop(IDataObject *pDataObject, IDropSource *pDropSource, DWORD dwOKEffect, DWORD *pdwEffect)
Definition: ole2.c:737

◆ ShellMessageBoxA()

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

Definition at line 630 of file shellord.c.

637{
638#ifdef __REACTOS__
639 CHAR *szText = NULL, szTitle[100];
640 LPCSTR pszText, pszTitle = szTitle;
641 LPSTR pszTemp;
643 int ret;
644
645 __ms_va_start(args, uType);
646
647 TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
648
649 if (IS_INTRESOURCE(lpCaption))
651 else
652 pszTitle = lpCaption;
653
654 if (IS_INTRESOURCE(lpText))
655 {
656 /* Retrieve the length of the Unicode string and obtain the maximum
657 * possible length for the corresponding ANSI string (not counting
658 * any possible NULL-terminator). */
659 const WCHAR *ptr;
660 UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
661
663 NULL, 0, NULL, NULL);
664
665 if (len)
666 {
667 szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(CHAR));
668 if (szText) LoadStringA(hInstance, LOWORD(lpText), szText, len + 1);
669 }
670 pszText = szText;
671 if (!pszText) {
672 WARN("Failed to load id %d\n", LOWORD(lpText));
674 return 0;
675 }
676 }
677 else
678 pszText = lpText;
679
681 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
682
684
685 ret = MessageBoxA(hWnd, pszTemp, pszTitle, uType | MB_SETFOREGROUND);
686
687 HeapFree(GetProcessHeap(), 0, szText);
688 LocalFree(pszTemp);
689 return ret;
690
691#else // __REACTOS__
692
693// Wine version, broken.
694 char szText[100],szTitle[100];
695 LPCSTR pszText = szText, pszTitle = szTitle;
696 LPSTR pszTemp;
698 int ret;
699
700 __ms_va_start(args, uType);
701 /* wvsprintfA(buf,fmt, args); */
702
703 TRACE("(%p,%p,%p,%p,%08x)\n",
704 hInstance,hWnd,lpText,lpCaption,uType);
705
706 if (IS_INTRESOURCE(lpCaption))
707 LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
708 else
709 pszTitle = lpCaption;
710
711 if (IS_INTRESOURCE(lpText))
712 LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
713 else
714 pszText = lpText;
715
717 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
718
720
721 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
722 LocalFree(pszTemp);
723 return ret;
724#endif
725}
#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
#define IS_INTRESOURCE(x)
Definition: loader.c:613
INT WINAPI DECLSPEC_HOTPATCH LoadStringA(HINSTANCE instance, UINT resource_id, LPSTR buffer, INT buflen)
Definition: string.c:1263
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define LOWORD(l)
Definition: pedump.c:82
#define LoadStringW
Definition: utils.h:64
#define args
Definition: format.c:66
Definition: match.c:390
const char * LPCSTR
Definition: typedefs.h:52
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
#define __ms_va_list
Definition: windef.h:250
#define __ms_va_end(list)
Definition: windef.h:252
#define __ms_va_start(list, arg)
Definition: windef.h:251
#define MB_SETFOREGROUND
Definition: winuser.h:825
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)

◆ ShellMessageBoxW()

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

Definition at line 559 of file shellord.c.

566{
567 WCHAR szText[100],szTitle[100];
568 LPCWSTR pszText = szText, pszTitle = szTitle;
569 LPWSTR pszTemp;
571 int ret;
572
573 __ms_va_start(args, uType);
574 /* wvsprintfA(buf,fmt, args); */
575
576 TRACE("(%p,%p,%p,%p,%08x)\n",
577 hInstance,hWnd,lpText,lpCaption,uType);
578
579 if (IS_INTRESOURCE(lpCaption))
581 else
582 pszTitle = lpCaption;
583
584 if (IS_INTRESOURCE(lpText))
585 LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
586 else
587 pszText = lpText;
588
590 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
591
593
594 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
595 LocalFree(pszTemp);
596 return ret;
597}
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 2472 of file shellord.c.

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

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

◆ SHFlushClipboard()

HRESULT WINAPI SHFlushClipboard ( void  )

Definition at line 1972 of file shellord.c.

1973{
1974 return OleFlushClipboard();
1975}
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2290

◆ SHFlushSFCache()

void WINAPI SHFlushSFCache ( void  )

Definition at line 2730 of file shellord.c.

2731{
2732}

◆ SHFreeUnusedLibraries()

void WINAPI SHFreeUnusedLibraries ( void  )

Definition at line 1732 of file shellord.c.

1733{
1734 FIXME("stub\n");
1736}
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void)
Definition: combase.c:1936

◆ SHGetImageList()

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

Definition at line 2744 of file shellord.c.

2745{
2746 HIMAGELIST hLarge, hSmall;
2747 HIMAGELIST hNew;
2748 HRESULT ret = E_FAIL;
2749
2750 /* Wine currently only maintains large and small image lists */
2751 if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
2752 {
2753 FIXME("Unsupported image list %i requested\n", iImageList);
2754 return E_FAIL;
2755 }
2756
2757 Shell_GetImageLists(&hLarge, &hSmall);
2758#ifndef __REACTOS__
2759 hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall);
2760
2761 /* Get the interface for the new image list */
2762 if (hNew)
2763 {
2765 ImageList_Destroy(hNew);
2766 }
2767#else
2768 /* Duplicating the imagelist causes the start menu items not to draw on
2769 * the first show. Was the Duplicate necessary for some reason? I believe
2770 * Windows returns the raw pointer here. */
2771 hNew = (iImageList == SHIL_LARGE ? hLarge : hSmall);
2772 ret = IImageList2_QueryInterface((IImageList2 *) hNew, riid, ppv);
2773#endif
2774
2775 return ret;
2776}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void **ppv)
Definition: imagelist.c:4132
HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himlSrc)
Definition: imagelist.c:1819
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:689
REFIID riid
Definition: atlbase.h:39
#define SHIL_SYSSMALL
Definition: shellapi.h:187
#define SHIL_SMALL
Definition: shellapi.h:185
#define SHIL_LARGE
Definition: shellapi.h:184

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

◆ SHGetInstanceExplorer()

HRESULT WINAPI SHGetInstanceExplorer ( IUnknown **  lpUnknown)

Definition at line 1708 of file shellord.c.

1709{ TRACE("%p\n", lpUnknown);
1710
1711 *lpUnknown = SHELL32_IExplorerInterface;
1712
1714 return E_FAIL;
1715
1716 IUnknown_AddRef(SHELL32_IExplorerInterface);
1717 return S_OK;
1718}
#define S_OK
Definition: intsafe.h:52
static LPUNKNOWN SHELL32_IExplorerInterface
Definition: shellord.c:1691

Referenced by _SHGetInstanceExplorer(), and SHOpenFolderWindow().

◆ SHGetNewLinkInfoA()

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

Definition at line 2609 of file shellord.c.

2611{
2612 WCHAR wszLinkTo[MAX_PATH];
2613 WCHAR wszDir[MAX_PATH];
2614 WCHAR wszName[MAX_PATH];
2615 BOOL res;
2616
2617 MultiByteToWideChar(CP_ACP, 0, pszLinkTo, -1, wszLinkTo, MAX_PATH);
2618 MultiByteToWideChar(CP_ACP, 0, pszDir, -1, wszDir, MAX_PATH);
2619
2620 res = SHGetNewLinkInfoW(wszLinkTo, wszDir, wszName, pfMustCopy, uFlags);
2621
2622 if (res)
2623 WideCharToMultiByte(CP_ACP, 0, wszName, -1, pszName, MAX_PATH, NULL, NULL);
2624
2625 return res;
2626}
_In_ LPCSTR pszDir
Definition: shellapi.h:601
_In_ LPCSTR _Out_ BOOL * pfMustCopy
Definition: shellapi.h:603
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2628

Referenced by test_sh_new_link_info().

◆ SHGetNewLinkInfoW()

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

Definition at line 2628 of file shellord.c.

2630{
2631 const WCHAR *basename;
2632 WCHAR *dst_basename;
2633 int i=2;
2634
2635 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
2636 pszName, pfMustCopy, uFlags);
2637
2638 *pfMustCopy = FALSE;
2639
2640 if (uFlags & SHGNLI_PIDL)
2641 {
2642 FIXME("SHGNLI_PIDL flag unsupported\n");
2643 return FALSE;
2644 }
2645
2646 if (uFlags)
2647 FIXME("ignoring flags: 0x%08x\n", uFlags);
2648
2649 /* FIXME: should test if the file is a shortcut or DOS program */
2651 return FALSE;
2652
2653 basename = strrchrW(pszLinkTo, '\\');
2654 if (basename)
2655 basename = basename+1;
2656 else
2657 basename = pszLinkTo;
2658
2659 lstrcpynW(pszName, pszDir, MAX_PATH);
2660 if (!PathAddBackslashW(pszName))
2661 return FALSE;
2662
2663 dst_basename = pszName + strlenW(pszName);
2664
2665 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename);
2666
2668 {
2669 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i);
2670 i++;
2671 }
2672
2673 return TRUE;
2674}
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
#define PathAddBackslashW
Definition: pathcch.h:302
#define SHGNLI_PIDL
Definition: shellapi.h:416
#define strlenW(s)
Definition: unicode.h:28
#define strrchrW(s, c)
Definition: unicode.h:35
#define snprintfW
Definition: unicode.h:60

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;
338 if (SHELL_GlobalCounterChanged(&g_ShellStateCounter, SHELL_GCOUNTER_SHELLSTATE))
339 g_CachedSSF = 0;
340
341#define SHGSS_ReadAdv(name, SSF) ( \
342 (g_CachedSSF & (SSF)) != (SSF) && (cb = sizeof(DWORD)) != 0 && \
343 SHQueryValueEx(hKeyAdv, (name), NULL, NULL, &data, &cb) == ERROR_SUCCESS && \
344 cb == sizeof(DWORD) && (read |= (SSF)) != 0 )
345#define SHGSS_GetFieldHelper(field, SSF, src, dst, cachevar) \
346 do { \
347 if (dwMask & (SSF)) \
348 { \
349 (dst)->field = (src)->field; \
350 cachevar |= (SSF); \
351 } \
352 } while (0)
353#define SHGSS_CacheField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), &rss.ss, gpss, read)
354#define SHGSS_GetField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, dummy)
355#define SHGSS_GetAdv(name, field, SSF) \
356 do { \
357 if (SHGSS_ReadAdv((name), (SSF))) \
358 gpss->field = ((SSF) & inverted) ? data == FALSE : data != FALSE; \
359 SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, read); \
360 } while (0)
361
362 if (SHGSS_ReadAdv(L"Hidden", SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES))
363 {
364 gpss->fShowAllObjects = data == 1;
365 gpss->fShowSysFiles = data > 1;
366 }
367 SHGSS_GetField(fShowAllObjects, SSF_SHOWALLOBJECTS);
368 SHGSS_GetField(fShowSysFiles, SSF_SHOWSYSFILES);
369 SHGSS_GetSetAdv(SHGSS_GetAdv);
370 if (dwMask & ~(read | g_CachedSSF))
371 {
372 REGSHELLSTATE rss;
374 {
375 SHGSS_GetSetStruct(SHGSS_CacheField); // Copy the requested items to gpss
376 }
377 else
378 {
380 read = 0; // The advanced items we read are no longer valid in gpss
381 g_CachedSSF = SSF_STRUCTONLY;
382 /* HACKFIX: This should not be needed. Defaults should be used
383 * until an override option is selected. See CORE-20585. */
384 rss.ss = *gpss;
386 }
387 }
388 SHGSS_GetSetStruct(SHGSS_GetField); // Copy requested items from gpss to output
389 g_CachedSSF |= read;
390 }
391 if (hKeyAdv)
392 RegCloseKey(hKeyAdv);
393#else
394 if(bSet)
395 {
396 FIXME("%p 0x%08x TRUE\n", lpss, dwMask);
397 }
398 else
399 {
400 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
401 }
402#endif //__REACTOS__
403}
#define read
Definition: acwin.h:97
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
DWORD WINAPI SHSendMessageBroadcastW(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ordinal.c:4195
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
Definition: ordinal.c:4821
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1348
EXTERN_C BOOL SHELL32_ReadRegShellState(PREGSHELLSTATE prss)
Definition: general.cpp:79
EXTERN_C void SHELL32_GetDefaultShellState(LPSHELLSTATE pss)
Definition: general.cpp:34
EXTERN_C LSTATUS SHELL32_WriteRegShellState(PREGSHELLSTATE prss)
Definition: general.cpp:52
GLuint GLfloat * val
Definition: glext.h:7180
@ SHKEY_Key_Explorer
Definition: ordinal.c:2807
@ SHKEY_Root_HKCU
Definition: ordinal.c:2805
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
Definition: ntbasedef.h:331
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
Definition: shellord.c:413
#define SSF_SHOWSYSFILES
Definition: shlobj.h:1616
#define SSF_SHOWEXTENSIONS
Definition: shlobj.h:1613
#define SSF_SHOWSUPERHIDDEN
Definition: shlobj.h:1628
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1612
#define SHELL_GlobalCounterIncrement(handle)
Definition: shlwapi_undoc.h:50
#define SHELL_GlobalCounterIsInitialized(handle)
Definition: shlwapi_undoc.h:48
#define SHELL_GlobalCounterCreate(refguid, handle)
Definition: shlwapi_undoc.h:43
SHELLSTATE ss
Definition: ShellState.cpp:22
BOOL fShowSysFiles
Definition: shlobj.h:1552
BOOL fShowSuperHidden
Definition: shlobj.h:1564
BOOL fShowAllObjects
Definition: shlobj.h:1548
#define WM_SETTINGCHANGE
Definition: winuser.h:1657

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

◆ SHGetSettings()

VOID WINAPI SHGetSettings ( LPSHELLFLAGSTATE  lpsfs,
DWORD  dwMask 
)

Definition at line 413 of file shellord.c.

414{
415#ifdef __REACTOS__
418 *lpsfs = *(LPSHELLFLAGSTATE)&ss;
419 if (dwMask & SSF_HIDEICONS)
420 lpsfs->fHideIcons = ss.fHideIcons;
421 if (dwMask & ssf_autocheckselect)
422 lpsfs->fAutoCheckSelect = ss.fAutoCheckSelect;
423 if (dwMask & ssf_iconsonly)
424 lpsfs->fIconsOnly = ss.fIconsOnly;
425#else
426 HKEY hKey;
428 DWORD dwDataSize = sizeof (DWORD);
429
430 TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
431
432 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
433 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
434 return;
435
436 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
437 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
438
439 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
440 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
441
442 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
443 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
444
445 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
446 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
447
448 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
449 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
450
451 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
452 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
453
454 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
455 { if (dwData == 0)
456 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
457 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
458 }
459 else if (dwData == 1)
460 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
461 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
462 }
463 else if (dwData == 2)
464 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
465 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
466 }
467 }
469#endif //__REACTOS__
470 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
471}
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
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define DWORD
Definition: nt_native.h:44
static HANDLE ULONG_PTR dwData
Definition: pipe.c:111
#define SSF_FILTER
Definition: shlobj.h:1626
#define SSF_DONTPRETTYPATH
Definition: shlobj.h:1621
#define SSF_SORTCOLUMNS
Definition: shlobj.h:1615
struct SHELLFLAGSTATE * LPSHELLFLAGSTATE
#define SSF_SHOWATTRIBCOL
Definition: shlobj.h:1618
#define SSF_MAPNETDRVBUTTON
Definition: shlobj.h:1622
#define SSF_SHOWINFOTIP
Definition: shlobj.h:1623
#define SSF_HIDEICONS
Definition: shlobj.h:1624
BOOL fMapNetDrvBtn
Definition: shlobj.h:1601
BOOL fShowInfoTip
Definition: shlobj.h:1602
BOOL fHideIcons
Definition: shlobj.h:1603
BOOL fIconsOnly
Definition: shlobj.h:1605
BOOL fShowExtensions
Definition: shlobj.h:1592
BOOL fAutoCheckSelect
Definition: shlobj.h:1604
BOOL fShowSysFiles
Definition: shlobj.h:1594
BOOL fDontPrettyPath
Definition: shlobj.h:1599
BOOL fShowAllObjects
Definition: shlobj.h:1591
BOOL fShowAttribCol
Definition: shlobj.h:1600

Referenced by SHGetSetSettings(), and START_TEST().

◆ SHHandleUpdateImage()

INT WINAPI SHHandleUpdateImage ( PCIDLIST_ABSOLUTE  pidlExtra)

Definition at line 2564 of file shellord.c.

2565{
2566#ifdef __REACTOS__
2567 if (!pidlExtra)
2568 return -1;
2569
2571 (UNALIGNED const SHCNF_UPDATEIMAGE_DATA_2*)pidlExtra;
2572 if (pData->dwProcessId == GetCurrentProcessId())
2574
2575 WCHAR szHashItem[MAX_PATH];
2576 StrCpyNW(szHashItem, pData->szHashItem, _countof(szHashItem));
2577
2578 return SHLookupIconIndexW(szHashItem, pData->iIndex, pData->uFlags);
2579#else
2580 FIXME("%p - stub\n", pidlExtra);
2581
2582 return -1;
2583#endif
2584}
WCHAR *WINAPI StrCpyNW(WCHAR *dst, const WCHAR *src, int count)
Definition: string.c:462
EXTERN_C INT WINAPI SHLookupIconIndexW(LPCWSTR lpName, INT iIndex, UINT uFlags)
Definition: stubs.cpp:413
#define UNALIGNED
Definition: pecoff.h:347
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1155

◆ SHLimitInputEdit()

HRESULT WINAPI SHLimitInputEdit ( HWND  hWnd,
IShellFolder psf 
)

Definition at line 3118 of file shellord.c.

3119{
3120 IItemNameLimits *pLimits;
3121 HRESULT hr;
3122 LPWSTR pwszValidChars, pwszInvalidChars;
3123 UxSubclassInfo *pInfo;
3124
3125 pInfo = GetPropW(hWnd, L"UxSubclassInfo");
3126 if (pInfo)
3127 {
3129 pInfo = NULL;
3130 }
3131
3132 hr = psf->lpVtbl->QueryInterface(psf, &IID_IItemNameLimits, (LPVOID *)&pLimits);
3133 if (FAILED(hr))
3134 {
3135 ERR("hr: %x\n", hr);
3136 return hr;
3137 }
3138
3139 pwszValidChars = pwszInvalidChars = NULL;
3140 hr = pLimits->lpVtbl->GetValidCharacters(pLimits, &pwszValidChars, &pwszInvalidChars);
3141 if (FAILED(hr))
3142 {
3143 ERR("hr: %x\n", hr);
3144 pLimits->lpVtbl->Release(pLimits);
3145 return hr;
3146 }
3147
3148 pInfo = UxSubclassInfo_Create(hWnd, pwszValidChars, pwszInvalidChars);
3149 if (!pInfo)
3150 hr = E_FAIL;
3151
3152 pLimits->lpVtbl->Release(pLimits);
3153
3154 return hr;
3155}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static UxSubclassInfo * UxSubclassInfo_Create(HWND hwnd, LPWSTR valid, LPWSTR invalid)
Definition: shellord.c:3084

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

◆ SHLoadOLE()

HRESULT WINAPI SHLoadOLE ( LPARAM  lParam)

Definition at line 1925 of file shellord.c.

1926{ FIXME("0x%08lx stub\n",lParam);
1927 return S_OK;
1928}

◆ SHObjectProperties()

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

Definition at line 2586 of file shellord.c.

2587{
2588 LPITEMIDLIST pidl = NULL;
2589 switch (dwType)
2590 {
2591 case SHOP_FILEPATH:
2592 pidl = ILCreateFromPathW(szObject);
2593 break;
2594 }
2595 if (pidl)
2596 {
2597 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST, hwnd, L"properties",
2598 NULL, szPage, NULL, SW_SHOWNORMAL, NULL, pidl };
2599 BOOL result = ShellExecuteExW(&sei);
2600 ILFree(pidl);
2601 return result;
2602 }
2603
2604 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
2605
2606 return TRUE;
2607}
GLuint64EXT * result
Definition: glext.h:11304
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1108
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2723
#define SHOP_FILEPATH
Definition: vfdshmenu.cpp:36

◆ SHOutOfMemoryMessageBox()

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

Definition at line 1960 of file shellord.c.

1964{
1965 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1966 return 0;
1967}

◆ SHRegisterDragDrop()

HRESULT WINAPI SHRegisterDragDrop ( HWND  hWnd,
LPDROPTARGET  pDropTarget 
)

Definition at line 743 of file shellord.c.

746{
747 static BOOL ole_initialized = FALSE;
748 HRESULT hr;
749
750 TRACE("(%p,%p)\n", hWnd, pDropTarget);
751
752 if (!ole_initialized)
753 {
755 if (FAILED(hr))
756 return hr;
757 ole_initialized = TRUE;
758 }
759 return RegisterDragDrop(hWnd, pDropTarget);
760}
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:162
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:547

◆ SHReplaceFromPropSheetExtArray()

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

Definition at line 2369 of file shellord.c.

2370{
2371 PSXA_CALL Call;
2372 UINT i;
2373 PPSXA psxa = (PPSXA)hpsxa;
2374
2375 TRACE("(%p,%u,%p,%08lx)\n", hpsxa, uPageID, lpfnReplaceWith, lParam);
2376
2377 if (psxa)
2378 {
2379 ZeroMemory(&Call, sizeof(Call));
2380 Call.lpfnAddReplaceWith = lpfnReplaceWith;
2381 Call.lParam = lParam;
2382
2383 /* Call the ReplacePage method of all registered IShellPropSheetExt interfaces.
2384 Each shell extension is only allowed to call the callback once during the callback. */
2385 for (i = 0; i != psxa->uiCount; i++)
2386 {
2387 Call.bCalled = FALSE;
2388 psxa->pspsx[i]->lpVtbl->ReplacePage(psxa->pspsx[i], uPageID, PsxaCall, (LPARAM)&Call);
2389 }
2390
2391 return Call.uiCount;
2392 }
2393
2394 return 0;
2395}
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 778 of file shellord.c.

779{
780 TRACE("(%p)\n", hWnd);
781 return RevokeDragDrop(hWnd);
782}
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:629

◆ SHRunControlPanel()

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

Definition at line 1666 of file shellord.c.

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

Referenced by CShellDispatch::ControlPanelItem().

◆ SHSetInstanceExplorer()

VOID WINAPI SHSetInstanceExplorer ( LPUNKNOWN  lpUnknown)

Definition at line 1698 of file shellord.c.

1699{ TRACE("%p\n", lpUnknown);
1700 SHELL32_IExplorerInterface = lpUnknown;
1701}

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

◆ SHSetLocalizedName()

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

Definition at line 2693 of file shellord.c.

2694{
2695 FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
2696
2697 return S_OK;
2698}

◆ SHShellFolderView_Message()

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

Definition at line 493 of file shellord.c.

497{
498 FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
499 return 0;
500}

◆ SHStartNetConnectionDialog()

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

Definition at line 2676 of file shellord.c.

2677{
2678#ifdef __REACTOS__
2679 if (SHELL_OsIsUnicode())
2680 return SHStartNetConnectionDialogW(hwnd, (LPCWSTR)pszRemoteName, dwType);
2681 return SHStartNetConnectionDialogA(hwnd, pszRemoteName, dwType);
2682#else
2683 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
2684
2685 return S_OK;
2686#endif
2687}
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogW(_In_ HWND hwnd, _In_ LPCWSTR pszRemoteName, _In_ DWORD dwType)
Definition: stubs.cpp:457
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogA(_In_ HWND hwnd, _In_ LPCSTR pszRemoteName, _In_ DWORD dwType)
Definition: utils.cpp:1575

◆ SHTestTokenMembership()

EXTERN_C BOOL WINAPI SHTestTokenMembership ( HANDLE  TokenHandle,
ULONG  ulRID 
)

Definition at line 2826 of file shellord.c.

2827{
2829 DWORD nSubAuthority0, nSubAuthority1;
2830 DWORD nSubAuthorityCount;
2831 PSID SidToCheck;
2832 BOOL IsMember = FALSE;
2833
2834 if ((ulRID == SECURITY_SERVICE_RID) || ulRID == SECURITY_LOCAL_SYSTEM_RID)
2835 {
2836 nSubAuthority0 = ulRID;
2837 nSubAuthority1 = 0;
2838 nSubAuthorityCount= 1;
2839 }
2840 else
2841 {
2842 nSubAuthority0 = SECURITY_BUILTIN_DOMAIN_RID;
2843 nSubAuthority1 = ulRID;
2844 nSubAuthorityCount= 2;
2845 }
2846
2847 if (!AllocateAndInitializeSid(&ntAuth,
2848 nSubAuthorityCount,
2849 nSubAuthority0,
2850 nSubAuthority1,
2851 0, 0, 0, 0, 0, 0,
2852 &SidToCheck))
2853 {
2854 return FALSE;
2855 }
2856
2857 if (!CheckTokenMembership(TokenHandle, SidToCheck, &IsMember))
2858 {
2859 IsMember = FALSE;
2860 }
2861
2862 FreeSid(SidToCheck);
2863 return IsMember;
2864}
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:727
#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 2546 of file shellord.c.

2547{
2548#ifdef __REACTOS__
2549 WCHAR szHashItem[MAX_PATH];
2550 SHAnsiToUnicode(pszHashItem, szHashItem, _countof(szHashItem));
2551 SHUpdateImageW(szHashItem, iIndex, uFlags, iImageIndex);
2552#else
2553 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
2554#endif
2555}
void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
Definition: shellord.c:2506

◆ SHUpdateImageW()

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

Definition at line 2506 of file shellord.c.

2507{
2508#ifdef __REACTOS__
2509 // If iImageIndex == -1 (undetermined), it will fall back to the default value of 1.
2510 INT iEffectiveImageIndex = (iImageIndex == -1) ? 1 : iImageIndex;
2511
2513 item1.cbSize = sizeof(item1);
2514 item1.iIndex = iIndex;
2515 item1.iEffective = iEffectiveImageIndex;
2516 item1.uFlags = uFlags;
2517 item1.iEffective2 = iEffectiveImageIndex;
2518 item1.terminator = 0;
2519
2521
2522 LPWSTR pEnd = StrCpyNXW(item2.szHashItem, pszHashItem, _countof(item2.szHashItem));
2523 *pEnd = UNICODE_NULL;
2524
2525 item2.cbOffset = (WORD)((PBYTE)pEnd - (PBYTE)&item2);
2526 item2.iIndex = iIndex;
2527 item2.iEffectiveImageIndex = iEffectiveImageIndex;
2528 item2.uFlags = uFlags;
2529 item2.dwProcessId = GetCurrentProcessId();
2530 item2.terminator = 0;
2531
2533#else
2534 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
2535#endif
2536}
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
WCHAR *WINAPI StrCpyNXW(WCHAR *dst, const WCHAR *src, int len)
Definition: string.c:1028
static const struct metadata_item item1[]
Definition: metadata.c:3603
static const struct metadata_item item2[]
Definition: metadata.c:3608
#define UNICODE_NULL
BYTE * PBYTE
Definition: pedump.c:66
#define SHCNE_UPDATEIMAGE
Definition: shlobj.h:1912
#define SHCNF_IDLIST
Definition: shlobj.h:1929

Referenced by SHUpdateImageA().

◆ SHValidateUNC()

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

Definition at line 2004 of file shellord.c.

2005{
2006 FIXME("(%p, %s, 0x%08x): stub\n", hwndOwner, debugstr_w(pszFile), fConnect);
2007 return FALSE;
2008}

◆ SHWaitForFileToOpen()

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

Definition at line 1981 of file shellord.c.

1985{
1986 FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
1987 return FALSE;
1988}
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141

◆ SHWinHelp()

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

Definition at line 1649 of file shellord.c.

1650{
1651 TRACE("(%p, %s, 0x%08x, %p)\n", hwnd, debugstr_w(pszHelp), uCommand, dwData);
1652 if (!WinHelpW(hwnd, pszHelp, uCommand, dwData))
1653 {
1654#if 0
1657#endif
1658 return FALSE;
1659 }
1660 return TRUE;
1661}
#define shell32_hInstance
#define ShellMessageBoxW
Definition: precomp.h:63
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
#define MB_ICONSTOP
Definition: winuser.h:814
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ SignalFileOpen()

BOOL WINAPI SignalFileOpen ( PCIDLIST_ABSOLUTE  pidl)

Definition at line 829 of file shellord.c.

830{
831 FIXME("(%p):stub.\n", pidl);
832
833 return FALSE;
834}

◆ UxSubclassInfo_Create()

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

Definition at line 3084 of file shellord.c.

3085{
3086 UxSubclassInfo *pInfo;
3088 if (!pInfo)
3089 {
3090 ERR("HeapAlloc failed.\n");
3092 CoTaskMemFree(invalid);
3093 return NULL;
3094 }
3095
3097 if (!pInfo->fnWndProc)
3098 {
3099 ERR("SetWindowLongPtrW failed\n");
3101 CoTaskMemFree(invalid);
3102 HeapFree(GetProcessHeap(), 0, pInfo);
3103 return NULL;
3104 }
3105
3106 pInfo->hwnd = hwnd;
3107 pInfo->pwszValidChars = valid;
3108 pInfo->pwszInvalidChars = invalid;
3109 if (!SetPropW(hwnd, L"UxSubclassInfo", pInfo))
3110 {
3112 pInfo = NULL;
3113 }
3114 return pInfo;
3115}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOLEAN valid
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static LRESULT CALLBACK LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shellord.c:2991
#define GWLP_WNDPROC
Definition: treelist.c:66
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SetWindowLongPtrW
Definition: winuser.h:5512

Referenced by SHLimitInputEdit().

◆ UxSubclassInfo_Destroy()

static void UxSubclassInfo_Destroy ( UxSubclassInfo pInfo)
static

Definition at line 2898 of file shellord.c.

2899{
2900 if (!pInfo)
2901 return;
2902
2903 RemovePropW(pInfo->hwnd, L"UxSubclassInfo");
2904
2907
2909
2910 HeapFree(GetProcessHeap(), 0, pInfo);
2911}
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 1863 of file shellord.c.

1864{
1865 DWORD r;
1866 HKEY hkey = 0;
1867
1868 TRACE("%p\n",cs);
1869
1870 if( cs == NULL )
1871 return FALSE;
1872
1873 r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0,
1874 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1875 if( r == ERROR_SUCCESS )
1876 {
1877 r = RegSetValueExW( hkey, L"Settings", 0,
1878 REG_BINARY, (LPBYTE) cs, cs->cLength);
1879
1880 RegCloseKey( hkey );
1881 }
1882
1883#ifdef __REACTOS__
1884 /* TODO: if (r==ERROR_SUCCESS) Increment GLOBALCOUNTER_FOLDERSETTINGSCHANGE */
1885#endif
1886 return (r==ERROR_SUCCESS);
1887}
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(), and ViewDlg_Apply().

Variable Documentation

◆ SHELL32_IExplorerInterface

LPUNKNOWN SHELL32_IExplorerInterface =0
static

Definition at line 1691 of file shellord.c.

Referenced by SHGetInstanceExplorer(), and SHSetInstanceExplorer().