ReactOS 0.4.17-dev-1421-g4623072
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 <strsafe.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 tagCREATEMRULIST * LPCREATEMRULISTA
 
typedef struct _PSXA PSXA
 
typedef struct _PSXA * PPSXA
 
typedef struct _PSXA_CALL PSXA_CALL
 
typedef struct _PSXA_CALL * PPSXA_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)
 
EXTERN_C HRESULT SHGetNameAndFlagsW (LPCITEMIDLIST pidl, DWORD Shgdn, LPWSTR pszText, UINT cchBuf, DWORD *pSfgao)
 
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 (_In_ HWND hwnd)
 
BOOL WINAPI DAD_DragEnterEx (_In_ HWND hwnd, _In_ POINT p)
 
BOOL WINAPI DAD_DragMove (_In_ POINT p)
 
BOOL WINAPI DAD_DragLeave (VOID)
 
BOOL WINAPI DAD_SetDragImage (_In_ HIMAGELIST himlTrack, _In_opt_ LPPOINT lppt)
 
BOOL WINAPI DAD_ShowDragImage (_In_ 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 UxSubclassInfo * UxSubclassInfo_Create (HWND hwnd, LPWSTR valid, LPWSTR invalid)
 
HRESULT WINAPI SHLimitInputEdit (HWND hWnd, IShellFolder *psf)
 

Variables

static HIMAGELIST DAD_himlTrack = NULL
 
static POINT DAD_ptHotspot
 
static BOOL DAD_bDragging = FALSE
 
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 67 of file shellord.c.

◆ MRUF_DELAYED_SAVE

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

Definition at line 68 of file shellord.c.

◆ MRUF_STRING_LIST

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

Definition at line 66 of file shellord.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file shellord.c.

Typedef Documentation

◆ CREATEMRULISTA

◆ LPCREATEMRULISTA

◆ PPSXA

typedef struct _PSXA * PPSXA

◆ PPSXA_CALL

◆ PSXA

typedef struct _PSXA PSXA

◆ PSXA_CALL

◆ UxSubclassInfo

Function Documentation

◆ AddMRUData()

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

Definition at line 462 of file comctl32undoc.c.

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

821{
822 /* Unimplemented in WinXP SP3 */
823 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
824 hwndParent, dwReserved, lpRect, cKids, lpKids);
825 return 0;
826}
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 2526 of file shellord.c.

2531{
2532 UINT i;
2533 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
2534 HRESULT hResult;
2535
2536 TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
2537 if (TRACE_ON(pidl))
2538 {
2539 pdump (pidlFolder);
2540 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
2541 }
2542 hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, FALSE, ppdataObject);
2543 return hResult;
2544}
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: sysinfo.c:13
_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 1760 of file shellord.c.

1761{
1762 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1763 return FALSE;
1764}
#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 ( _In_ HWND  hwnd)

Definition at line 1775 of file shellord.c.

1776{
1777 POINT p;
1778
1779 GetCursorPos(&p);
1780 return DAD_DragEnterEx(hwnd, p);
1781}
GLfloat GLfloat p
Definition: glext.h:8902
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
BOOL WINAPI DAD_DragEnterEx(_In_ HWND hwnd, _In_ POINT p)
Definition: shellord.c:1795

◆ DAD_DragEnterEx()

BOOL WINAPI DAD_DragEnterEx ( _In_ HWND  hwnd,
_In_ POINT  p 
)

Definition at line 1795 of file shellord.c.

1796{
1797 if (!DAD_himlTrack)
1798 return FALSE;
1799
1801 return FALSE;
1802
1803 if (!ImageList_DragEnter(hwnd, p.x, p.y))
1804 {
1806 return FALSE;
1807 }
1808
1810 return TRUE;
1811}
#define TRUE
Definition: types.h:120
VOID WINAPI ImageList_EndDrag(void)
Definition: imagelist.c:1865
BOOL WINAPI ImageList_DragEnter(HWND hwndLock, INT x, INT y)
Definition: imagelist.c:976
BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, INT iTrack, INT dxHotspot, INT dyHotspot)
Definition: imagelist.c:648
static HIMAGELIST DAD_himlTrack
Definition: shellord.c:79
static BOOL DAD_bDragging
Definition: shellord.c:81
static POINT DAD_ptHotspot
Definition: shellord.c:80
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24

Referenced by DAD_DragEnter().

◆ DAD_DragLeave()

BOOL WINAPI DAD_DragLeave ( VOID  )

Definition at line 1838 of file shellord.c.

1839{
1840 if (!DAD_bDragging)
1841 return FALSE;
1842
1846 return TRUE;
1847}
BOOL WINAPI ImageList_DragLeave(HWND hwndLock)
Definition: imagelist.c:1010

Referenced by DAD_SetDragImage().

◆ DAD_DragMove()

BOOL WINAPI DAD_DragMove ( _In_ POINT  p)

Definition at line 1823 of file shellord.c.

1824{
1825 if (!DAD_bDragging)
1826 return FALSE;
1827
1828 return ImageList_DragMove(p.x, p.y);
1829}
BOOL WINAPI ImageList_DragMove(INT x, INT y)
Definition: imagelist.c:1088

◆ DAD_SetDragImage()

BOOL WINAPI DAD_SetDragImage ( _In_ HIMAGELIST  himlTrack,
_In_opt_ LPPOINT  lppt 
)

Definition at line 1865 of file shellord.c.

1868{
1869 if (himlTrack == (HIMAGELIST)(ULONG_PTR)-1)
1870 {
1871 if (DAD_bDragging)
1872 DAD_DragLeave();
1874 return TRUE;
1875 }
1876
1877 if (!himlTrack)
1878 return FALSE;
1879
1880 DAD_himlTrack = himlTrack;
1881 if (lppt)
1882 DAD_ptHotspot = *lppt;
1883 else
1885
1886 return TRUE;
1887}
BOOL WINAPI DAD_DragLeave(void)
Definition: shellord.c:1838
uint32_t ULONG_PTR
Definition: typedefs.h:65

◆ DAD_ShowDragImage()

BOOL WINAPI DAD_ShowDragImage ( _In_ BOOL  bShow)

Definition at line 1902 of file shellord.c.

1903{
1904 if (!DAD_bDragging)
1905 return FALSE;
1906
1907 return ImageList_DragShowNolock(bShow);
1908}
BOOL WINAPI ImageList_DragShowNolock(BOOL bShow)
Definition: imagelist.c:1171

◆ DoEnvironmentSubstA()

DWORD WINAPI DoEnvironmentSubstA ( LPSTR  pszString,
UINT  cchString 
)

Definition at line 2118 of file shellord.c.

2119{
2120 LPSTR dst;
2121 BOOL res = FALSE;
2122 DWORD len = cchString;
2123
2124 TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
2125 if (pszString == NULL) /* Really return 0? */
2126 return 0;
2127 if ((dst = (LPSTR)HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
2128 {
2129 len = ExpandEnvironmentStringsA(pszString, dst, cchString);
2130 /* len includes the terminating 0 */
2131 if (len && len < cchString)
2132 {
2133 res = TRUE;
2134 memcpy(pszString, dst, len);
2135 }
2136 else
2137 len = cchString;
2138
2140 }
2141 return MAKELONG(len, res);
2142}
#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 2193 of file shellord.c.

2194{
2195 if (SHELL_OsIsUnicode())
2196 return DoEnvironmentSubstW(x, y);
2197 return DoEnvironmentSubstA(x, y);
2198}
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:197
DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
Definition: shellord.c:2163
DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
Definition: shellord.c:2118

◆ DoEnvironmentSubstW()

DWORD WINAPI DoEnvironmentSubstW ( LPWSTR  pszString,
UINT  cchString 
)

Definition at line 2163 of file shellord.c.

2164{
2165 LPWSTR dst;
2166 BOOL res = FALSE;
2167 DWORD len = cchString;
2168
2169 TRACE("(%s, %d)\n", debugstr_w(pszString), cchString);
2170
2171 if ((cchString < MAXLONG) && (dst = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(WCHAR))))
2172 {
2173 len = ExpandEnvironmentStringsW(pszString, dst, cchString);
2174 /* len includes the terminating 0 */
2175 if (len && len <= cchString)
2176 {
2177 res = TRUE;
2178 memcpy(pszString, dst, len * sizeof(WCHAR));
2179 }
2180 else
2181 len = cchString;
2182
2184 }
2185 return MAKELONG(len, res);
2186}
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 3089 of file shellord.c.

3090{
3091 HGLOBAL hData;
3092 LPWSTR pszText, pszSanitized;
3093 DWORD cbData;
3094
3096 return;
3097 if (!OpenClipboard(hwnd))
3098 return;
3099
3101 pszText = GlobalLock(hData);
3102 if (!pszText)
3103 {
3105 return;
3106 }
3107 SHStrDupW(pszText, &pszSanitized);
3108 GlobalUnlock(hData);
3109
3110 if (pszSanitized &&
3111 DoSanitizeText(pszSanitized, pInfo->pwszInvalidChars, pInfo->pwszValidChars))
3112 {
3113 MessageBeep(0xFFFFFFFF);
3114
3115 /* Update clipboard text */
3116 cbData = (lstrlenW(pszSanitized) + 1) * sizeof(WCHAR);
3118 pszText = GlobalLock(hData);
3119 if (pszText)
3120 {
3121 CopyMemory(pszText, pszSanitized, cbData);
3122 GlobalUnlock(hData);
3123
3125 }
3126 }
3127
3128 CoTaskMemFree(pszSanitized);
3130}
#define CF_UNICODETEXT
Definition: constants.h:408
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define lstrlenW
Definition: compat.h:750
HRESULT WINAPI SHStrDupW(const WCHAR *src, WCHAR **dest)
Definition: main.c:1692
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
#define CopyMemory
Definition: minwinbase.h:29
#define ES_READONLY
Definition: pedump.c:675
#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
static BOOL DoSanitizeText(LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
Definition: shellord.c:3056
LPWSTR pwszValidChars
Definition: shellord.c:3035
LPWSTR pwszInvalidChars
Definition: shellord.c:3036
#define GMEM_MOVEABLE
Definition: winbase.h:318
#define GMEM_SHARE
Definition: winbase.h:329

Referenced by LimitEditWindowProc().

◆ DoSanitizeText()

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

Definition at line 3056 of file shellord.c.

3057{
3058 LPWSTR pch1, pch2;
3059 BOOL bFound = FALSE;
3060
3061 for (pch1 = pch2 = pszSanitized; *pch1; ++pch1)
3062 {
3063 if (pszInvalidChars)
3064 {
3065 if (wcschr(pszInvalidChars, *pch1) != NULL)
3066 {
3067 bFound = TRUE;
3068 continue;
3069 }
3070 }
3071 else if (pszValidChars)
3072 {
3073 if (wcschr(pszValidChars, *pch1) == NULL)
3074 {
3075 bFound = TRUE;
3076 continue;
3077 }
3078 }
3079
3080 *pch2 = *pch1;
3081 ++pch2;
3082 }
3083 *pch2 = 0;
3084
3085 return bFound;
3086}

Referenced by DoSanitizeClipboard().

◆ DriveType()

int WINAPI DriveType ( int  DriveType)

Definition at line 2036 of file shellord.c.

2037{
2038 WCHAR root[] = L"A:\\";
2039 root[0] = L'A' + DriveType;
2040 return GetDriveTypeW(root);
2041}
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 1996 of file shellord.c.

1997{
1998 return SIC_Initialize();
1999}
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:147
#define cmp(status, error)
Definition: error.c:118
MRUBinaryCmpFn binary_cmpfn
MRUStringCmpFnW string_cmpfn
union tagMRUINFOW::@432 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 161 of file shellord.c.

169{
170typedef BOOL (WINAPI *GetOpenFileNameProc)(OPENFILENAMEW *ofn);
172 GetOpenFileNameProc pGetOpenFileNameW;
174 BOOL ret;
175
176 TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
177 hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt,
178 lpstrFilter, lpstrTitle);
179
180 hmodule = LoadLibraryW(L"comdlg32.dll");
181 if(!hmodule) return FALSE;
182 pGetOpenFileNameW = (GetOpenFileNameProc)GetProcAddress(hmodule, "GetOpenFileNameW");
183 if(!pGetOpenFileNameW)
184 {
186 return FALSE;
187 }
188
189 memset(&ofn, 0, sizeof(ofn));
190
191 ofn.lStructSize = sizeof(ofn);
192 ofn.hwndOwner = hwndOwner;
193 ofn.lpstrFilter = lpstrFilter;
194 ofn.lpstrFile = lpstrFile;
195 ofn.nMaxFile = nMaxFile;
196 ofn.lpstrInitialDir = lpstrInitialDir;
197 ofn.lpstrTitle = lpstrTitle;
198 ofn.lpstrDefExt = lpstrDefExt;
200 ret = pGetOpenFileNameW(&ofn);
201
203 return ret;
204}
#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 2203 of file shellord.c.

2204{
2205 ANSI_STRING ansi_str;
2206 WCHAR szWide[40];
2207 UNICODE_STRING guid_str = { 0, sizeof(szWide), szWide };
2208 if (*str != '{')
2209 return FALSE;
2210 RtlInitAnsiString(&ansi_str, str);
2211 return !RtlAnsiStringToUnicodeString(&guid_str, &ansi_str, FALSE) &&
2212 !RtlGUIDFromString(&guid_str, guid);
2213}
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 2218 of file shellord.c.

2219{
2220 UNICODE_STRING guid_str;
2221 if (!str || *str != L'{')
2222 return FALSE;
2223 RtlInitUnicodeString(&guid_str, str);
2224 return !RtlGUIDFromString(&guid_str, guid);
2225}
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

◆ InvalidateDriveType()

int WINAPI InvalidateDriveType ( int  u)

Definition at line 2046 of file shellord.c.

2047{
2048 TRACE("0x%08x stub\n",u);
2049 return 0;
2050}
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 3020 of file shellord.c.

3021{
3023}
EXTERN_C BOOL WINAPI SHTestTokenMembership(HANDLE TokenHandle, ULONG ulRID)
Definition: shellord.c:2968
#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 3133 of file shellord.c.

3134{
3135 WNDPROC fnWndProc;
3136 WCHAR wch;
3137 UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
3138 if (!pInfo)
3139 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
3140
3141 fnWndProc = pInfo->fnWndProc;
3142
3143 switch (uMsg)
3144 {
3145 case WM_KEYDOWN:
3146 if (GetKeyState(VK_SHIFT) < 0 && wParam == VK_INSERT)
3147 DoSanitizeClipboard(hwnd, pInfo);
3148 else if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
3149 DoSanitizeClipboard(hwnd, pInfo);
3150
3151 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3152
3153 case WM_PASTE:
3154 DoSanitizeClipboard(hwnd, pInfo);
3155 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3156
3157 case WM_CHAR:
3158 if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
3159 break;
3160
3161 if (pInfo->pwszInvalidChars)
3162 {
3163 if (wcschr(pInfo->pwszInvalidChars, (WCHAR)wParam) != NULL)
3164 {
3165 MessageBeep(0xFFFFFFFF);
3166 break;
3167 }
3168 }
3169 else if (pInfo->pwszValidChars)
3170 {
3171 if (wcschr(pInfo->pwszValidChars, (WCHAR)wParam) == NULL)
3172 {
3173 MessageBeep(0xFFFFFFFF);
3174 break;
3175 }
3176 }
3177 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3178
3179 case WM_UNICHAR:
3180 if (wParam == UNICODE_NOCHAR)
3181 return TRUE;
3182
3183 /* FALL THROUGH */
3184
3185 case WM_IME_CHAR:
3186 wch = (WCHAR)wParam;
3187 if (GetKeyState(VK_CONTROL) < 0 && wch == L'V')
3188 break;
3189
3190 if (!IsWindowUnicode(hwnd) && HIBYTE(wch) != 0)
3191 {
3192 CHAR data[] = {HIBYTE(wch), LOBYTE(wch)};
3193 MultiByteToWideChar(CP_ACP, 0, data, 2, &wch, 1);
3194 }
3195
3196 if (pInfo->pwszInvalidChars)
3197 {
3198 if (wcschr(pInfo->pwszInvalidChars, wch) != NULL)
3199 {
3200 MessageBeep(0xFFFFFFFF);
3201 break;
3202 }
3203 }
3204 else if (pInfo->pwszValidChars)
3205 {
3206 if (wcschr(pInfo->pwszValidChars, wch) == NULL)
3207 {
3208 MessageBeep(0xFFFFFFFF);
3209 break;
3210 }
3211 }
3212 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3213
3214 case WM_NCDESTROY:
3216 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3217
3218 default:
3219 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3220 }
3221
3222 return 0;
3223}
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_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)
#define WM_UNICHAR
Definition: richedit.h:67
static void DoSanitizeClipboard(HWND hwnd, UxSubclassInfo *pInfo)
Definition: shellord.c:3089
static void UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
Definition: shellord.c:3040
WNDPROC fnWndProc
Definition: shellord.c:3034

Referenced by UxSubclassInfo_Create().

◆ LinkWindow_RegisterClass()

BOOL WINAPI LinkWindow_RegisterClass ( void  )

Definition at line 2847 of file shellord.c.

2848{
2849 FIXME("()\n");
2850 return TRUE;
2851}

◆ LinkWindow_UnregisterClass()

BOOL WINAPI LinkWindow_UnregisterClass ( DWORD  dwUnused)

Definition at line 2856 of file shellord.c.

2857{
2858 FIXME("()\n");
2859 return TRUE;
2860}

◆ ParseFieldA()

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

Definition at line 90 of file shellord.c.

95{
96 WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
97
98 if (!src || !src[0] || !dst || !len)
99 return 0;
100
101 /* skip n fields delimited by ',' */
102 while (nField > 1)
103 {
104 if (*src=='\0') return FALSE;
105 if (*(src++)==',') nField--;
106 }
107
108 /* copy part till the next ',' to dst */
109 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
110
111 /* finalize the string */
112 *dst=0x0;
113
114 return TRUE;
115}
#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 150 of file shellord.c.

151{
152 if (SHELL_OsIsUnicode())
153 return ParseFieldW(src, nField, dst, len);
154 return ParseFieldA(src, nField, dst, len);
155}
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
Definition: shellord.c:124
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len)
Definition: shellord.c:90

◆ ParseFieldW()

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

Definition at line 124 of file shellord.c.

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

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

◆ PathIsTemporaryA()

BOOL WINAPI PathIsTemporaryA ( LPSTR  Str)

Definition at line 2234 of file shellord.c.

2236{
2237#ifdef __REACTOS__
2238 WCHAR szWide[MAX_PATH];
2239
2240 TRACE("(%s)\n", debugstr_a(Str));
2241
2242 SHAnsiToUnicode(Str, szWide, _countof(szWide));
2243 return PathIsTemporaryW(szWide);
2244#else
2245 FIXME("(%s)stub\n", debugstr_a(Str));
2246 return FALSE;
2247#endif
2248}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SHAnsiToUnicode(const char *src, WCHAR *dest, int dest_len)
Definition: main.c:1801
BOOL WINAPI PathIsTemporaryW(LPWSTR Str)
Definition: shellord.c:2257
#define _countof(array)
Definition: sndvol32.h:70

Referenced by Test_PathIsTemporaryA().

◆ PathIsTemporaryW()

BOOL WINAPI PathIsTemporaryW ( LPWSTR  Str)

Definition at line 2257 of file shellord.c.

2259{
2260#ifdef __REACTOS__
2261 WCHAR szLongPath[MAX_PATH], szTempPath[MAX_PATH];
2262 DWORD attrs;
2263 LPCWSTR pszTarget = Str;
2264
2265 TRACE("(%s)\n", debugstr_w(Str));
2266
2267 attrs = GetFileAttributesW(Str);
2268 if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_TEMPORARY))
2269 return TRUE;
2270
2273 {
2274 return FALSE;
2275 }
2276
2277 if (GetLongPathNameW(Str, szLongPath, _countof(szLongPath)))
2278 pszTarget = szLongPath;
2279
2280 return (PathIsEqualOrSubFolder(szTempPath, pszTarget) ||
2283#else
2284 FIXME("(%s)stub\n", debugstr_w(Str));
2285 return FALSE;
2286#endif
2287}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
Definition: path.c:1555
EXTERN_C BOOL WINAPI PathIsEqualOrSubFolder(_In_ LPCWSTR pszPath1OrCSIDL, _In_ LPCWSTR pszPath2)
Definition: utils.cpp:1718
#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:2251
#define CSIDL_CDBURN_AREA
Definition: shlobj.h:2275
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 2305 of file shellord.c.

2306{
2308
2309 if (Call != NULL)
2310 {
2311 if ((Call->bMultiple || !Call->bCalled) &&
2312 Call->lpfnAddReplaceWith(hpage, Call->lParam))
2313 {
2314 Call->bCalled = TRUE;
2315 Call->uiCount++;
2316 return TRUE;
2317 }
2318 }
2319
2320 return FALSE;
2321}
struct _PSXA_CALL * PPSXA_CALL
LPFNADDPROPSHEETPAGE lpfnAddReplaceWith
Definition: shellord.c:2298
LPARAM lParam
Definition: shellord.c:2299
BOOL bCalled
Definition: shellord.c:2300
BOOL bMultiple
Definition: shellord.c:2301
UINT uiCount
Definition: shellord.c:2302

Referenced by SHAddFromPropSheetExtArray(), and SHReplaceFromPropSheetExtArray().

◆ ReadCabinetState()

BOOL WINAPI ReadCabinetState ( CABINETSTATE *  cs,
int  length 
)

Definition at line 1914 of file shellord.c.

1915{
1916 HKEY hkey = 0;
1917 DWORD type, r;
1918 C_ASSERT(sizeof(*cs) == FIELD_OFFSET(CABINETSTATE, fMenuEnumFilter) + sizeof(UINT));
1919
1920 TRACE("%p %d\n", cs, length);
1921
1922 if( (cs == NULL) || (length < (int)sizeof(*cs)) )
1923 return FALSE;
1924
1925 r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey );
1926 if( r == ERROR_SUCCESS )
1927 {
1928 type = REG_BINARY;
1929 r = RegQueryValueExW( hkey, L"Settings",
1930 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1931 RegCloseKey( hkey );
1932
1933 }
1934
1935 /* if we can't read from the registry, create default values */
1936 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1937 (cs->cLength != length) )
1938 {
1939 SHELLSTATE shellstate;
1940 shellstate.fWin95Classic = FALSE;
1942
1943 TRACE("Initializing shell cabinet settings\n");
1944 memset(cs, 0, sizeof(*cs));
1945 cs->cLength = sizeof(*cs);
1946 cs->nVersion = 2;
1947 cs->fFullPathTitle = FALSE;
1948 cs->fSaveLocalView = TRUE;
1949 cs->fNotShell = FALSE;
1950 cs->fSimpleDefault = TRUE;
1951 cs->fDontShowDescBar = FALSE;
1952 cs->fNewWindowMode = shellstate.fWin95Classic;
1953 cs->fShowCompColor = FALSE;
1954 cs->fDontPrettyNames = FALSE;
1955 cs->fAdminsCreateCommonGroups = TRUE;
1956 cs->fMenuEnumFilter = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
1957 }
1958
1959 return TRUE;
1960}
#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:232
#define SSF_WIN95CLASSIC
Definition: shlobj.h:1659
BOOL fWin95Classic
Definition: shlobj.h:1594
#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 520 of file shellord.c.

523{
524 if (dwType == 3)
525 {
528 }
529 else if (dwType == 0)
530 {
532 }
533
534 ERR("Unsupported argument");
535 return FALSE;
536}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL WINAPI DeregisterShellHookWindow(_In_ HWND)
BOOL WINAPI RegisterShellHookWindow(_In_ HWND)
HWND WINAPI SetTaskmanWindow(HWND)
Definition: window.c:1902

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

◆ RLBuildListOfPaths()

DWORD WINAPI RLBuildListOfPaths ( void  )

Definition at line 2099 of file shellord.c.

2100{ FIXME("stub\n");
2101 return 0;
2102}

◆ SetAppStartingCursor()

HRESULT WINAPI SetAppStartingCursor ( HWND  u,
DWORD  v 
)

Definition at line 2004 of file shellord.c.

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

◆ SHAbortInvokeCommand()

HRESULT WINAPI SHAbortInvokeCommand ( void  )

Definition at line 2055 of file shellord.c.

2056{ FIXME("stub\n");
2057 return 1;
2058}

◆ SHADD_compare_mru()

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

Definition at line 898 of file shellord.c.

899{
900#ifdef __REACTOS__
901 LPCWSTR psz1, psz2;
902 INT iCmp = lstrcmpiW(data1, data2);
903 if (iCmp != 0)
904 return iCmp;
905 psz1 = data1;
906 psz2 = data2;
907 psz1 += lstrlenW(psz1) + 1;
908 psz2 += lstrlenW(psz2) + 1;
909 return lstrcmpiW(psz1, psz2);
910#else
911 return lstrcmpiA(data1, data2);
912#endif
913}
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 966 of file shellord.c.

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

858{
859 HKEY Policy_basekey;
860 INT ret;
861
862 /* Get the key for the policies location in the registry
863 */
865 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
866 0, KEY_READ, &Policy_basekey)) {
867
869 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
870 0, KEY_READ, &Policy_basekey)) {
871 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
872 policy);
873 *len = 0;
875 }
876 }
877
878 /* Retrieve the data if it exists
879 */
880 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
881 RegCloseKey(Policy_basekey);
882 return ret;
883}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:78
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, const char *name, DWORD *reserved, DWORD *type, void *buff, DWORD *buff_len)
Definition: main.c:2149
#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 2326 of file shellord.c.

2327{
2328 PSXA_CALL Call;
2329 UINT i;
2330 PPSXA psxa = (PPSXA)hpsxa;
2331
2332 TRACE("(%p,%p,%08lx)\n", hpsxa, lpfnAddPage, lParam);
2333
2334 if (psxa)
2335 {
2336 ZeroMemory(&Call, sizeof(Call));
2337 Call.lpfnAddReplaceWith = lpfnAddPage;
2338 Call.lParam = lParam;
2339 Call.bMultiple = TRUE;
2340
2341 /* Call the AddPage method of all registered IShellPropSheetExt interfaces */
2342 for (i = 0; i != psxa->uiCount; i++)
2343 {
2344 psxa->pspsx[i]->lpVtbl->AddPages(psxa->pspsx[i], PsxaCall, (LPARAM)&Call);
2345 }
2346
2347 return Call.uiCount;
2348 }
2349
2350 return 0;
2351}
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:2305
struct _PSXA * PPSXA
UINT uiCount
Definition: shellord.c:2291
IShellPropSheetExt * pspsx[1]
Definition: shellord.c:2293

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

◆ SHAddToRecentDocs()

void WINAPI SHAddToRecentDocs ( UINT  uFlags,
LPCVOID  pv 
)

Definition at line 1021 of file shellord.c.

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

2357{
2358 return SHCreatePropSheetExtArrayEx(hKey, pszSubKey, max_iface, NULL);
2359}
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:2364

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

◆ SHCreatePropSheetExtArrayEx()

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

Definition at line 2364 of file shellord.c.

2365{
2366 WCHAR szHandler[64];
2367 DWORD dwHandlerLen;
2368 WCHAR szClsidHandler[39];
2369 DWORD dwClsidSize;
2370 CLSID clsid;
2371 LONG lRet;
2372 DWORD dwIndex;
2373 IShellExtInit *psxi;
2374 IShellPropSheetExt *pspsx;
2375 HKEY hkBase, hkPropSheetHandlers;
2376 PPSXA psxa = NULL;
2377
2378 TRACE("(%p,%s,%u)\n", hKey, debugstr_w(pszSubKey), max_iface);
2379
2380 if (max_iface == 0)
2381 return NULL;
2382
2383 /* Open the registry key */
2384 lRet = RegOpenKeyW(hKey, pszSubKey, &hkBase);
2385 if (lRet != ERROR_SUCCESS)
2386 return NULL;
2387
2388 lRet = RegOpenKeyExW(hkBase, L"shellex\\PropertySheetHandlers", 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers);
2389 RegCloseKey(hkBase);
2390 if (lRet == ERROR_SUCCESS)
2391 {
2392 /* Create and initialize the Property Sheet Extensions Array */
2393 psxa = LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2394 if (psxa)
2395 {
2396 ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2397 psxa->uiAllocated = max_iface;
2398
2399 /* Enumerate all subkeys and attempt to load the shell extensions */
2400 dwIndex = 0;
2401 do
2402 {
2403 dwHandlerLen = sizeof(szHandler) / sizeof(szHandler[0]);
2404 lRet = RegEnumKeyExW(hkPropSheetHandlers, dwIndex++, szHandler, &dwHandlerLen, NULL, NULL, NULL, NULL);
2405 if (lRet != ERROR_SUCCESS)
2406 {
2407 if (lRet == ERROR_MORE_DATA)
2408 continue;
2409
2410 if (lRet == ERROR_NO_MORE_ITEMS)
2411 lRet = ERROR_SUCCESS;
2412 break;
2413 }
2414
2415 /* The CLSID is stored either in the key itself or in its default value. */
2416 if (FAILED(lRet = SHCLSIDFromStringW(szHandler, &clsid)))
2417 {
2418 dwClsidSize = sizeof(szClsidHandler);
2419 if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS)
2420 {
2421 /* Force a NULL-termination and convert the string */
2422 szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0;
2423 lRet = SHCLSIDFromStringW(szClsidHandler, &clsid);
2424 }
2425 }
2426
2427 if (SUCCEEDED(lRet))
2428 {
2429 /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance.
2430 Only if both interfaces are supported it's a real shell extension.
2431 Then call IShellExtInit's Initialize method. */
2432 if (SUCCEEDED(CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER/* | CLSCTX_NO_CODE_DOWNLOAD */, &IID_IShellPropSheetExt, (LPVOID *)&pspsx)))
2433 {
2434 if (SUCCEEDED(pspsx->lpVtbl->QueryInterface(pspsx, &IID_IShellExtInit, (PVOID *)&psxi)))
2435 {
2436 if (SUCCEEDED(psxi->lpVtbl->Initialize(psxi, NULL, pDataObj, hKey)))
2437 {
2438 /* Add the IShellPropSheetExt instance to the array */
2439 psxa->pspsx[psxa->uiCount++] = pspsx;
2440 }
2441 else
2442 {
2443 psxi->lpVtbl->Release(psxi);
2444 pspsx->lpVtbl->Release(pspsx);
2445 }
2446 }
2447 else
2448 pspsx->lpVtbl->Release(pspsx);
2449 }
2450 }
2451
2452 } while (psxa->uiCount != psxa->uiAllocated);
2453 }
2454 else
2456
2457 RegCloseKey(hkPropSheetHandlers);
2458 }
2459
2460 if (lRet != ERROR_SUCCESS && psxa)
2461 {
2462 SHDestroyPropSheetExtArray((HPSXA)psxa);
2463 psxa = NULL;
2464 }
2465
2466 return (HPSXA)psxa;
2467}
#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 SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:300
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:2503
UINT uiAllocated
Definition: shellord.c:2292

Referenced by SHCreatePropSheetExtArray().

◆ SHCreateShellFolderView()

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

Definition at line 2934 of file shellord.c.

2936{
2937 IShellView * psf;
2938 HRESULT hRes;
2939
2940 *ppsv = NULL;
2941 if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
2942 return E_INVALIDARG;
2943
2944 TRACE("sf=%p outer=%p callback=%p\n",
2945 pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
2946
2947 hRes = IShellView_Constructor(pcsfv->pshf, &psf);
2948 if (FAILED(hRes))
2949 return hRes;
2950
2951 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppsv);
2952 IShellView_Release(psf);
2953
2954 return hRes;
2955}
#define E_INVALIDARG
Definition: ddrawi.h:101
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1405
IShellView * psvOuter
Definition: shlobj.h:1404
UINT cbSize
Definition: shlobj.h:1402
IShellFolder * pshf
Definition: shlobj.h:1403

◆ SHCreateShellFolderViewEx()

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

Definition at line 1627 of file shellord.c.

1630{
1631 IShellView * psf;
1632 HRESULT hRes;
1633
1634 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1635 psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
1636 psvcbi->fvm, psvcbi->psvOuter);
1637
1638 *ppv = NULL;
1639 hRes = IShellView_Constructor(psvcbi->pshf, &psf);
1640
1641 if (FAILED(hRes))
1642 return hRes;
1643
1644 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
1645 IShellView_Release(psf);
1646
1647 return hRes;
1648}
REFIID LPVOID * ppv
Definition: atlbase.h:39
FOLDERVIEWMODE fvm
Definition: shlobj.h:1327
IShellView * psvOuter
Definition: shlobj.h:1323
LPFNVIEWCALLBACK pfnCallback
Definition: shlobj.h:1326
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1324
IShellFolder * pshf
Definition: shlobj.h:1322

◆ SHCreateStdEnumFmtEtc()

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

Definition at line 2552 of file shellord.c.

2556{
2557 IEnumFORMATETC *pef;
2558 HRESULT hRes;
2559 TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
2560
2561 hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
2562 if (FAILED(hRes))
2563 return hRes;
2564
2565 IEnumFORMATETC_AddRef(pef);
2566 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
2567 IEnumFORMATETC_Release(pef);
2568
2569 return hRes;
2570}
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 2503 of file shellord.c.

2504{
2505 UINT i;
2506 PPSXA psxa = (PPSXA)hpsxa;
2507
2508 TRACE("(%p)\n", hpsxa);
2509
2510 if (psxa)
2511 {
2512 for (i = 0; i != psxa->uiCount; i++)
2513 {
2514 psxa->pspsx[i]->lpVtbl->Release(psxa->pspsx[i]);
2515 }
2516
2517 LocalFree(psxa);
2518 }
2519}
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 803 of file shellord.c.

809{
810 FIXME("(%p %p %p 0x%08x %p):stub.\n",
811 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
812 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
813}
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 636 of file shellord.c.

643{
644#ifdef __REACTOS__
645 CHAR *szText = NULL, szTitle[100];
646 LPCSTR pszText, pszTitle = szTitle;
647 LPSTR pszTemp;
649 int ret;
650
651 __ms_va_start(args, uType);
652
653 TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
654
655 if (IS_INTRESOURCE(lpCaption))
657 else
658 pszTitle = lpCaption;
659
660 if (IS_INTRESOURCE(lpText))
661 {
662 /* Retrieve the length of the Unicode string and obtain the maximum
663 * possible length for the corresponding ANSI string (not counting
664 * any possible NULL-terminator). */
665 const WCHAR *ptr;
666 UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
667
669 NULL, 0, NULL, NULL);
670
671 if (len)
672 {
673 szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(CHAR));
674 if (szText) LoadStringA(hInstance, LOWORD(lpText), szText, len + 1);
675 }
676 pszText = szText;
677 if (!pszText) {
678 WARN("Failed to load id %d\n", LOWORD(lpText));
680 return 0;
681 }
682 }
683 else
684 pszText = lpText;
685
687 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
688
690
691 ret = MessageBoxA(hWnd, pszTemp, pszTitle, uType | MB_SETFOREGROUND);
692
693 HeapFree(GetProcessHeap(), 0, szText);
694 LocalFree(pszTemp);
695 return ret;
696
697#else // __REACTOS__
698
699// Wine version, broken.
700 char szText[100],szTitle[100];
701 LPCSTR pszText = szText, pszTitle = szTitle;
702 LPSTR pszTemp;
704 int ret;
705
706 __ms_va_start(args, uType);
707 /* wvsprintfA(buf,fmt, args); */
708
709 TRACE("(%p,%p,%p,%p,%08x)\n",
710 hInstance,hWnd,lpText,lpCaption,uType);
711
712 if (IS_INTRESOURCE(lpCaption))
713 LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
714 else
715 pszTitle = lpCaption;
716
717 if (IS_INTRESOURCE(lpText))
718 LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
719 else
720 pszText = lpText;
721
723 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
724
726
727 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
728 LocalFree(pszTemp);
729 return ret;
730#endif
731}
#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:1307
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define LOWORD(l)
Definition: pedump.c:82
#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)
#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

◆ ShellMessageBoxW()

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

Definition at line 565 of file shellord.c.

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

2576{
2577 FIXME("params ignored: %p %p\n", pidlFolder, pidlSaveFile);
2579 {
2580 return FALSE;
2581 }
2582 /* Open the search results folder */
2583 /* FIXME: CSearchBar should be opened as well */
2584 return ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{E17D4FC0-5564-11D1-83F2-00A0C90DC849}", NULL, SW_SHOWNORMAL) > (HINSTANCE)32;
2585}
#define SW_SHOWNORMAL
Definition: winuser.h:781
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2793
@ REST_NOFIND
Definition: shlobj.h:1696
HANDLE HINSTANCE
Definition: typedefs.h:77

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

◆ SHFlushClipboard()

HRESULT WINAPI SHFlushClipboard ( void  )

Definition at line 2075 of file shellord.c.

2076{
2077 return OleFlushClipboard();
2078}
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2290

◆ SHFlushSFCache()

void WINAPI SHFlushSFCache ( void  )

Definition at line 2872 of file shellord.c.

2873{
2874}

◆ SHFreeUnusedLibraries()

void WINAPI SHFreeUnusedLibraries ( void  )

Definition at line 1751 of file shellord.c.

1752{
1753 FIXME("stub\n");
1755}
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void)
Definition: combase.c:1936

◆ SHGetImageList()

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

Definition at line 2886 of file shellord.c.

2887{
2888 HIMAGELIST hLarge, hSmall;
2889 HIMAGELIST hNew;
2890 HRESULT ret = E_FAIL;
2891
2892 /* Wine currently only maintains large and small image lists */
2893 if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
2894 {
2895 FIXME("Unsupported image list %i requested\n", iImageList);
2896 return E_FAIL;
2897 }
2898
2899 Shell_GetImageLists(&hLarge, &hSmall);
2900#ifndef __REACTOS__
2901 hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall);
2902
2903 /* Get the interface for the new image list */
2904 if (hNew)
2905 {
2907 ImageList_Destroy(hNew);
2908 }
2909#else
2910 /* Duplicating the imagelist causes the start menu items not to draw on
2911 * the first show. Was the Duplicate necessary for some reason? I believe
2912 * Windows returns the raw pointer here. */
2913 hNew = (iImageList == SHIL_LARGE ? hLarge : hSmall);
2914 ret = IImageList2_QueryInterface((IImageList2 *) hNew, riid, ppv);
2915#endif
2916
2917 return ret;
2918}
#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:188
#define SHIL_SMALL
Definition: shellapi.h:186
#define SHIL_LARGE
Definition: shellapi.h:185

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

1728{ TRACE("%p\n", lpUnknown);
1729
1730 *lpUnknown = SHELL32_IExplorerInterface;
1731
1733 return E_FAIL;
1734
1735 IUnknown_AddRef(SHELL32_IExplorerInterface);
1736 return S_OK;
1737}
#define S_OK
Definition: intsafe.h:52
static LPUNKNOWN SHELL32_IExplorerInterface
Definition: shellord.c:1710

Referenced by _SHGetInstanceExplorer(), and SHOpenFolderWindow().

◆ SHGetNameAndFlagsW()

EXTERN_C HRESULT SHGetNameAndFlagsW ( LPCITEMIDLIST  pidl,
DWORD  Shgdn,
LPWSTR  pszText,
UINT  cchBuf,
DWORD *  pSfgao 
)

Referenced by SHGetNewLinkInfoW().

◆ SHGetNewLinkInfoA()

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

Definition at line 2712 of file shellord.c.

2714{
2715 WCHAR wszLinkTo[MAX_PATH];
2716 WCHAR wszDir[MAX_PATH];
2717 WCHAR wszName[MAX_PATH];
2718 BOOL res;
2719
2720 MultiByteToWideChar(CP_ACP, 0, pszLinkTo, -1, wszLinkTo, MAX_PATH);
2721 MultiByteToWideChar(CP_ACP, 0, pszDir, -1, wszDir, MAX_PATH);
2722
2723 res = SHGetNewLinkInfoW(wszLinkTo, wszDir, wszName, pfMustCopy, uFlags);
2724
2725 if (res)
2726 WideCharToMultiByte(CP_ACP, 0, wszName, -1, pszName, MAX_PATH, NULL, NULL);
2727
2728 return res;
2729}
_In_ LPCSTR pszDir
Definition: shellapi.h:612
_In_ LPCSTR _Out_ BOOL * pfMustCopy
Definition: shellapi.h:614
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2731

Referenced by test_sh_new_link_info().

◆ SHGetNewLinkInfoW()

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

Definition at line 2731 of file shellord.c.

2733{
2735 PCWSTR basename, pszDotForExt = L".", pszExt = (uFlags & SHGNLI_USEURLEXT) ? L"url" : L"lnk";
2736 WCHAR *dst_basename, szTarget[MAX_PATH];
2737 int i=2;
2738 LPCITEMIDLIST pidl = (uFlags & SHGNLI_PIDL) ? (LPCITEMIDLIST)pszLinkTo : NULL;
2739 SHFILEINFO fi;
2740 BOOL UseDisplayName = FALSE;
2741 UINT SHGFIPidlFlag = pidl ? SHGFI_PIDL : 0;
2742
2743 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
2744 pszName, pfMustCopy, uFlags);
2745
2746 if (uFlags & ~HANDLEDFLAGS)
2747 FIXME("ignoring flags: 0x%08x\n", uFlags & ~HANDLEDFLAGS);
2748
2749 *pfMustCopy = FALSE;
2750 fi.dwAttributes = SFGAO_FILESYSTEM | SFGAO_LINK;
2751 if (SHGetFileInfoW(pszLinkTo, 0, &fi, sizeof(fi), SHGFI_DISPLAYNAME | SHGFI_ATTRIBUTES | SHGFI_ATTR_SPECIFIED | SHGFIPidlFlag))
2752 UseDisplayName = TRUE;
2753
2754 if (pidl)
2755 {
2756 if (!UseDisplayName)
2757 return FALSE;
2758
2759 pszLinkTo = fi.szDisplayName;
2760 UINT shgdn = (uFlags & SHGNLI_NOLOCNAME) ? SHGDN_FORPARSING : SHGDN_NORMAL;
2761 if ((fi.dwAttributes & SFGAO_LINK) &&
2762 SUCCEEDED(SHGetNameAndFlagsW(pidl, shgdn | SHGDN_INFOLDER, szTarget, _countof(szTarget), NULL)))
2763 {
2764 StringCchCopyW(fi.szDisplayName, _countof(fi.szDisplayName), szTarget); // Including possible .lnk extension
2765 }
2766
2767 if (SUCCEEDED(SHGetNameAndFlagsW(pidl, SHGDN_FORPARSING, szTarget, _countof(szTarget), NULL)))
2768 pszLinkTo = szTarget;
2769 else
2770 fi.dwAttributes &= ~SFGAO_FILESYSTEM; // We can't validate this PIDL as a path
2771 }
2772 else if (uFlags & SHGNLI_NOLOCNAME)
2773 {
2774 UseDisplayName = FALSE;
2775 }
2776
2777 /* FIXME: should test if the file is a shortcut or DOS program */
2778 if ((fi.dwAttributes & SFGAO_FILESYSTEM) && GetFileAttributesW(pszLinkTo) == INVALID_FILE_ATTRIBUTES)
2779 return FALSE;
2780
2781 if (fi.dwAttributes & SFGAO_LINK)
2782 {
2783 *pfMustCopy = TRUE; // The caller is not supposed to create a .lnk pointing to a .lnk
2784
2785 // Remove the "inputname.lnk" extension so that the "(%d)" handling can add it back correctly
2786 uFlags &= ~SHGNLI_NOLNK;
2787 pszExt = PathFindExtensionW(pszLinkTo);
2788 pszDotForExt = L"";
2789 UseDisplayName = TRUE;
2790 if (pszLinkTo != fi.szDisplayName)
2792 if (*pszExt)
2794 }
2795
2796 if (uFlags & SHGNLI_NOLNK)
2797 pszDotForExt = pszExt = L""; // The caller does not want us to append an extension
2798
2799 basename = PathFindFileNameW(UseDisplayName ? fi.szDisplayName : pszLinkTo);
2800 *pszName = UNICODE_NULL;
2801 if (!(uFlags & SHGNLI_NOUNIQUE)) // SHGNLI_NOUNIQUE does not prefix the directory
2802 {
2803 StringCchCopyW(pszName, MAX_PATH, pszDir);
2804 if (!PathAddBackslashW(pszName))
2805 return FALSE;
2806 }
2807 dst_basename = pszName + strlenW(pszName);
2808
2809 StringCchPrintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s%s%s", basename, pszDotForExt, pszExt);
2811 {
2812 StringCchPrintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d)%s%s", basename, i, pszDotForExt, pszExt);
2813 i++;
2814 }
2815 return TRUE;
2816}
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
#define UNICODE_NULL
#define PathAddBackslashW
Definition: pathcch.h:302
#define PathRemoveExtension
Definition: shlwapi.h:503
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:431
#define SHGFI_ATTR_SPECIFIED
Definition: shellapi.h:175
#define SHGNLI_NOUNIQUE
Definition: shellapi.h:602
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:167
#define SHGFI_ATTRIBUTES
Definition: shellapi.h:169
#define SHGNLI_NOLNK
Definition: shellapi.h:603
#define SHGFI_PIDL
Definition: shellapi.h:181
#define SHGNLI_NOLOCNAME
Definition: shellapi.h:604
#define SHGNLI_USEURLEXT
Definition: shellapi.h:605
#define SHGNLI_PIDL
Definition: shellapi.h:600
EXTERN_C HRESULT SHGetNameAndFlagsW(LPCITEMIDLIST pidl, DWORD Shgdn, LPWSTR pszText, UINT cchBuf, DWORD *pSfgao)
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
DWORD dwAttributes
Definition: shellapi.h:380
CHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:381
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define strlenW(s)
Definition: unicode.h:28

Referenced by AddUrlToFavorites(), SHGetNewLinkInfoA(), and SHGetNewLinkInfoWrapW().

◆ SHGetSetSettings()

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

Definition at line 232 of file shellord.c.

233{
234#ifdef __REACTOS__
235 const DWORD inverted = SSF_SHOWEXTENSIONS;
236 LPSHELLSTATE gpss = &g_ShellState.ss;
237 HKEY hKeyAdv;
238
239 if (!SHELL_GlobalCounterIsInitialized(g_hShellState))
240 {
241 SHELL_GlobalCounterCreate(&SHGCGUID_ShellState, g_hShellState);
242 }
243
244 if (!lpss)
245 {
246 SHELL_GlobalCounterIncrement(SHELL_GCOUNTER_SHELLSTATE);
247 return;
248 }
249
250 hKeyAdv = SHGetShellKey(SHKEY_Root_HKCU | SHKEY_Key_Explorer, L"Advanced", bSet);
251 if (!hKeyAdv && bSet)
252 return;
253
254#define SSF_STRUCTONLY (SSF_NOCONFIRMRECYCLE | SSF_DOUBLECLICKINWEBVIEW | SSF_DESKTOPHTML | \
255 SSF_WIN95CLASSIC | SSF_SORTCOLUMNS | SSF_STARTPANELON)
256#define SSF_ALL (0x07FFFFFF & ~0x40)
257#define SSF_IMPLEMENTED ((SSF_ALL) & ~(SSF_SERVERADMINUI)) // SERVERADMINUI is written by Explorer and read by IsOS()
258#define SHGSS_GetSetStruct(getsetmacro) \
259 do { \
260 getsetmacro(fNoConfirmRecycle, SSF_NOCONFIRMRECYCLE); \
261 getsetmacro(fDoubleClickInWebView, SSF_DOUBLECLICKINWEBVIEW); \
262 getsetmacro(fDesktopHTML, SSF_DESKTOPHTML); \
263 getsetmacro(fWin95Classic, SSF_WIN95CLASSIC); \
264 getsetmacro(lParamSort, SSF_SORTCOLUMNS); \
265 getsetmacro(iSortDirection, SSF_SORTCOLUMNS); \
266 getsetmacro(fStartPanelOn, SSF_STARTPANELON); \
267 } while (0)
268#define SHGSS_GetSetAdv(getsetmacro) \
269 do { \
270 getsetmacro(L"HideFileExt", fShowExtensions, SSF_SHOWEXTENSIONS); \
271 getsetmacro(L"ShowCompColor", fShowCompColor, SSF_SHOWCOMPCOLOR); \
272 getsetmacro(L"DontPrettyPath", fDontPrettyPath, SSF_DONTPRETTYPATH); \
273 getsetmacro(L"ShowAttribCol", fShowAttribCol, SSF_SHOWATTRIBCOL); \
274 getsetmacro(L"MapNetDrvBtn", fMapNetDrvBtn, SSF_MAPNETDRVBUTTON); \
275 getsetmacro(L"ShowInfoTip", fShowInfoTip, SSF_SHOWINFOTIP); \
276 getsetmacro(L"HideIcons", fHideIcons, SSF_HIDEICONS); \
277 getsetmacro(L"WebView", fWebView, SSF_WEBVIEW); \
278 getsetmacro(L"Filter", fFilter, SSF_FILTER); \
279 getsetmacro(L"ShowSuperHidden", fShowSuperHidden, SSF_SHOWSUPERHIDDEN); \
280 getsetmacro(L"NoNetCrawling", fNoNetCrawling, SSF_NONETCRAWLING); \
281 getsetmacro(L"SeparateProcess", fSepProcess, SSF_SEPPROCESS); \
282 getsetmacro(L"AutoCheckSelect", fAutoCheckSelect, ssf_autocheckselect); \
283 getsetmacro(L"IconsOnly", fIconsOnly, ssf_iconsonly); \
284 getsetmacro(L"ShowTypeOverlay", fShowTypeOverlay, ssf_showtypeoverlay); \
285 getsetmacro(L"ShowStatusBar", fShowStatusBar, ssf_showstatusbar); \
286 } while (0)
287
288 if (bSet)
289 {
290 DWORD changed = 0, notcached = ~g_CachedSSF & SSF_IMPLEMENTED;
291 if (notcached & ~dwMask)
292 {
293 // All entries in gpss have to be initialized (except the item we are about to set) because we are about to write the whole struct to the registry
294 SHELLSTATE tempstate;
295 SHGetSetSettings(&tempstate, notcached & ~dwMask, FALSE); // Read entries that are not in gpss/g_CachedSSF
296 }
297
298#define SHGSS_WriteAdv(name, value, SSF) \
299 do { \
300 DWORD val = (value), cb = sizeof(DWORD); \
301 if (SHSetValueW(hKeyAdv, NULL, (name), REG_DWORD, &val, cb) == ERROR_SUCCESS) \
302 { \
303 ++changed; \
304 } \
305 } while (0)
306#define SHGSS_SetAdv(name, field, SSF) \
307 do { \
308 if ((dwMask & (SSF)) && gpss->field != lpss->field) \
309 { \
310 const DWORD bitval = (gpss->field = lpss->field); \
311 SHGSS_WriteAdv((name), ((SSF) & inverted) ? !bitval : !!bitval, (SSF)); \
312 } \
313 } while (0)
314#define SHGSS_SetStruct(field, SSF) \
315 do { \
316 if ((dwMask & (SSF)) && gpss->field != lpss->field) \
317 { \
318 gpss->field = lpss->field; \
319 ++changed; \
320 } \
321 } while (0)
322
323 if ((dwMask & SSF_SHOWALLOBJECTS) && gpss->fShowAllObjects != lpss->fShowAllObjects)
324 {
325 gpss->fShowAllObjects = lpss->fShowAllObjects;
326 SHGSS_WriteAdv(L"Hidden", lpss->fShowAllObjects ? 1 : 2, SSF_SHOWALLOBJECTS);
327 }
328 SHGSS_SetStruct(fShowSysFiles, SSF_SHOWSYSFILES);
329 SHGSS_GetSetAdv(SHGSS_SetAdv);
330 SHGSS_GetSetStruct(SHGSS_SetStruct);
331 if (changed)
332 {
333 if ((dwMask & SSF_SHOWSUPERHIDDEN) && (DLL_EXPORT_VERSION) < _WIN32_WINNT_VISTA)
334 {
335 // This is probably a Windows bug but write this alternative name just in case someone reads it
336 DWORD val = gpss->fShowSuperHidden != FALSE;
337 SHSetValueW(hKeyAdv, NULL, L"SuperHidden", REG_DWORD, &val, sizeof(val));
338 }
339 SHELL32_WriteRegShellState(&g_ShellState); // Write the new SHELLSTATE
340 SHGetSetSettings(NULL, 0, TRUE); // Invalidate counter
341 SHSendMessageBroadcastW(WM_SETTINGCHANGE, 0, (LPARAM)L"ShellState"); // Notify everyone
342 }
343 }
344 else
345 {
346 DWORD read = 0, data, cb, dummy = 0;
348 if (SHELL_GlobalCounterChanged(&g_ShellStateCounter, SHELL_GCOUNTER_SHELLSTATE))
349 g_CachedSSF = 0;
350
351#define SHGSS_ReadAdv(name, SSF) ( \
352 (g_CachedSSF & (SSF)) != (SSF) && (cb = sizeof(DWORD)) != 0 && \
353 SHQueryValueEx(hKeyAdv, (name), NULL, NULL, &data, &cb) == ERROR_SUCCESS && \
354 cb == sizeof(DWORD) && (read |= (SSF)) != 0 )
355#define SHGSS_GetFieldHelper(field, SSF, src, dst, cachevar) \
356 do { \
357 if (dwMask & (SSF)) \
358 { \
359 (dst)->field = (src)->field; \
360 cachevar |= (SSF); \
361 } \
362 } while (0)
363#define SHGSS_CacheField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), &rss.ss, gpss, read)
364#define SHGSS_GetField(field, SSF) SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, dummy)
365#define SHGSS_GetAdv(name, field, SSF) \
366 do { \
367 if (SHGSS_ReadAdv((name), (SSF))) \
368 gpss->field = ((SSF) & inverted) ? data == FALSE : data != FALSE; \
369 SHGSS_GetFieldHelper(field, (SSF), gpss, lpss, read); \
370 } while (0)
371
372 if (SHGSS_ReadAdv(L"Hidden", SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES))
373 {
374 gpss->fShowAllObjects = data == 1;
375 gpss->fShowSysFiles = data > 1;
376 }
377 SHGSS_GetField(fShowAllObjects, SSF_SHOWALLOBJECTS);
378 SHGSS_GetField(fShowSysFiles, SSF_SHOWSYSFILES);
379 SHGSS_GetSetAdv(SHGSS_GetAdv);
380 if (dwMask & ~(read | g_CachedSSF))
381 {
382 REGSHELLSTATE rss;
384 {
385 SHGSS_GetSetStruct(SHGSS_CacheField); // Copy the requested items to gpss
386 }
387 else
388 {
390 read = 0; // The advanced items we read are no longer valid in gpss
391 g_CachedSSF = SSF_STRUCTONLY;
392 }
393 }
394 SHGSS_GetSetStruct(SHGSS_GetField); // Copy requested items from gpss to output
395 g_CachedSSF |= read;
396 }
397 if (hKeyAdv)
398 RegCloseKey(hKeyAdv);
399#else
400 if(bSet)
401 {
402 FIXME("%p 0x%08x TRUE\n", lpss, dwMask);
403 }
404 else
405 {
406 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
407 }
408#endif //__REACTOS__
409}
#define read
Definition: acwin.h:97
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
DWORD WINAPI SHSetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2292
DWORD WINAPI SHSendMessageBroadcastW(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ordinal.c:3616
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
Definition: ordinal.c:4049
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 WM_SETTINGCHANGE
Definition: winuser.h:1657
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
Definition: shellord.c:419
#define SSF_SHOWSYSFILES
Definition: shlobj.h:1655
#define SSF_SHOWEXTENSIONS
Definition: shlobj.h:1651
#define SSF_SHOWSUPERHIDDEN
Definition: shlobj.h:1667
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1650
#define SHELL_GlobalCounterIncrement(handle)
Definition: shlwapi_undoc.h:54
#define SHELL_GlobalCounterIsInitialized(handle)
Definition: shlwapi_undoc.h:52
#define SHELL_GlobalCounterCreate(refguid, handle)
Definition: shlwapi_undoc.h:47
BOOL fShowSysFiles
Definition: shlobj.h:1590
BOOL fShowSuperHidden
Definition: shlobj.h:1602
BOOL fShowAllObjects
Definition: shlobj.h:1586

Referenced by DesktopOnInitDialog(), CDefView::FillList(), GeneralDlg_OnInitDialog(), CDefView::GetItemActivateFlags(), CShellDispatch::GetSetting(), IntSetShellStateSettings(), CStartMenuSettingsPage::OnApply(), OnCopyData(), process_test(), 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 419 of file shellord.c.

420{
421#ifdef __REACTOS__
424 *lpsfs = *(LPSHELLFLAGSTATE)&ss;
425 if (dwMask & SSF_HIDEICONS)
426 lpsfs->fHideIcons = ss.fHideIcons;
427 if (dwMask & ssf_autocheckselect)
428 lpsfs->fAutoCheckSelect = ss.fAutoCheckSelect;
429 if (dwMask & ssf_iconsonly)
430 lpsfs->fIconsOnly = ss.fIconsOnly;
431#else
432 HKEY hKey;
434 DWORD dwDataSize = sizeof (DWORD);
435
436 TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
437
438 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
439 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
440 return;
441
442 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
443 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
444
445 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
446 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
447
448 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
449 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
450
451 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
452 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
453
454 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
455 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
456
457 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
458 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
459
460 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
461 { if (dwData == 0)
462 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
463 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
464 }
465 else if (dwData == 1)
466 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
467 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
468 }
469 else if (dwData == 2)
470 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
471 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
472 }
473 }
475#endif //__REACTOS__
476 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
477}
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:1665
#define SSF_DONTPRETTYPATH
Definition: shlobj.h:1660
#define SSF_SORTCOLUMNS
Definition: shlobj.h:1654
struct SHELLFLAGSTATE * LPSHELLFLAGSTATE
#define SSF_SHOWATTRIBCOL
Definition: shlobj.h:1657
#define SSF_MAPNETDRVBUTTON
Definition: shlobj.h:1661
#define SSF_SHOWINFOTIP
Definition: shlobj.h:1662
#define SSF_HIDEICONS
Definition: shlobj.h:1663
BOOL fMapNetDrvBtn
Definition: shlobj.h:1639
BOOL fShowInfoTip
Definition: shlobj.h:1640
BOOL fHideIcons
Definition: shlobj.h:1641
BOOL fIconsOnly
Definition: shlobj.h:1643
BOOL fShowExtensions
Definition: shlobj.h:1630
BOOL fAutoCheckSelect
Definition: shlobj.h:1642
BOOL fShowSysFiles
Definition: shlobj.h:1632
BOOL fDontPrettyPath
Definition: shlobj.h:1637
BOOL fShowAllObjects
Definition: shlobj.h:1629
BOOL fShowAttribCol
Definition: shlobj.h:1638

Referenced by SHGetSetSettings(), and START_TEST().

◆ SHHandleUpdateImage()

INT WINAPI SHHandleUpdateImage ( PCIDLIST_ABSOLUTE  pidlExtra)

Definition at line 2667 of file shellord.c.

2668{
2669#ifdef __REACTOS__
2670 if (!pidlExtra)
2671 return -1;
2672
2674 (UNALIGNED const SHCNF_UPDATEIMAGE_DATA_2*)pidlExtra;
2675 if (pData->dwProcessId == GetCurrentProcessId())
2677
2678 WCHAR szHashItem[MAX_PATH];
2679 StrCpyNW(szHashItem, pData->szHashItem, _countof(szHashItem));
2680
2681 return SHLookupIconIndexW(szHashItem, pData->iIndex, pData->uFlags);
2682#else
2683 FIXME("%p - stub\n", pidlExtra);
2684
2685 return -1;
2686#endif
2687}
WCHAR *WINAPI StrCpyNW(WCHAR *dst, const WCHAR *src, int count)
Definition: string.c:470
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:1207

◆ SHLimitInputEdit()

HRESULT WINAPI SHLimitInputEdit ( HWND  hWnd,
IShellFolder *  psf 
)

Definition at line 3260 of file shellord.c.

3261{
3262 IItemNameLimits *pLimits;
3263 HRESULT hr;
3264 LPWSTR pwszValidChars, pwszInvalidChars;
3265 UxSubclassInfo *pInfo;
3266
3267 pInfo = GetPropW(hWnd, L"UxSubclassInfo");
3268 if (pInfo)
3269 {
3271 pInfo = NULL;
3272 }
3273
3274 hr = psf->lpVtbl->QueryInterface(psf, &IID_IItemNameLimits, (LPVOID *)&pLimits);
3275 if (FAILED(hr))
3276 {
3277 ERR("hr: %x\n", hr);
3278 return hr;
3279 }
3280
3281 pwszValidChars = pwszInvalidChars = NULL;
3282 hr = pLimits->lpVtbl->GetValidCharacters(pLimits, &pwszValidChars, &pwszInvalidChars);
3283 if (FAILED(hr))
3284 {
3285 ERR("hr: %x\n", hr);
3286 pLimits->lpVtbl->Release(pLimits);
3287 return hr;
3288 }
3289
3290 pInfo = UxSubclassInfo_Create(hWnd, pwszValidChars, pwszInvalidChars);
3291 if (!pInfo)
3292 hr = E_FAIL;
3293
3294 pLimits->lpVtbl->Release(pLimits);
3295
3296 return hr;
3297}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static UxSubclassInfo * UxSubclassInfo_Create(HWND hwnd, LPWSTR valid, LPWSTR invalid)
Definition: shellord.c:3226

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

◆ SHLoadOLE()

HRESULT WINAPI SHLoadOLE ( LPARAM  lParam)

Definition at line 2028 of file shellord.c.

2029{ FIXME("0x%08lx stub\n",lParam);
2030 return S_OK;
2031}

◆ SHObjectProperties()

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

Definition at line 2689 of file shellord.c.

2690{
2691 LPITEMIDLIST pidl = NULL;
2692 switch (dwType)
2693 {
2694 case SHOP_FILEPATH:
2695 pidl = ILCreateFromPathW(szObject);
2696 break;
2697 }
2698 if (pidl)
2699 {
2700 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST, hwnd, L"properties",
2701 NULL, szPage, NULL, SW_SHOWNORMAL, NULL, pidl };
2702 BOOL result = ShellExecuteExW(&sei);
2703 ILFree(pidl);
2704 return result;
2705 }
2706
2707 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
2708
2709 return TRUE;
2710}
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:2738
#define SHOP_FILEPATH
Definition: vfdshmenu.cpp:36

◆ SHOutOfMemoryMessageBox()

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

Definition at line 2063 of file shellord.c.

2067{
2068 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
2069 return 0;
2070}

◆ SHRegisterDragDrop()

HRESULT WINAPI SHRegisterDragDrop ( HWND  hWnd,
LPDROPTARGET  pDropTarget 
)

Definition at line 749 of file shellord.c.

752{
753 static BOOL ole_initialized = FALSE;
754 HRESULT hr;
755
756 TRACE("(%p,%p)\n", hWnd, pDropTarget);
757
758 if (!ole_initialized)
759 {
761 if (FAILED(hr))
762 return hr;
763 ole_initialized = TRUE;
764 }
765 return RegisterDragDrop(hWnd, pDropTarget);
766}
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 2472 of file shellord.c.

2473{
2474 PSXA_CALL Call;
2475 UINT i;
2476 PPSXA psxa = (PPSXA)hpsxa;
2477
2478 TRACE("(%p,%u,%p,%08lx)\n", hpsxa, uPageID, lpfnReplaceWith, lParam);
2479
2480 if (psxa)
2481 {
2482 ZeroMemory(&Call, sizeof(Call));
2483 Call.lpfnAddReplaceWith = lpfnReplaceWith;
2484 Call.lParam = lParam;
2485
2486 /* Call the ReplacePage method of all registered IShellPropSheetExt interfaces.
2487 Each shell extension is only allowed to call the callback once during the callback. */
2488 for (i = 0; i != psxa->uiCount; i++)
2489 {
2490 Call.bCalled = FALSE;
2491 psxa->pspsx[i]->lpVtbl->ReplacePage(psxa->pspsx[i], uPageID, PsxaCall, (LPARAM)&Call);
2492 }
2493
2494 return Call.uiCount;
2495 }
2496
2497 return 0;
2498}
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 784 of file shellord.c.

785{
786 TRACE("(%p)\n", hWnd);
787 return RevokeDragDrop(hWnd);
788}
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:629

◆ SHRunControlPanel()

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

Definition at line 1695 of file shellord.c.

1696{
1697#ifdef __REACTOS__
1698 TRACE("(%s, %p)n", debugstr_w(commandLine), parent);
1699 /* MSDN indicates that ROS should have a version check here but Vista+ just forwards to SHUNIMPL
1700 if (LOBYTE(GetVersion()) >= 6)
1701 return FALSE;
1702 */
1703 return SHELL32_RunControlPanel(commandLine, parent);
1704#else
1705 FIXME("(%s, %p): stub\n", debugstr_w(commandLine), parent);
1706 return FALSE;
1707#endif
1708}
EXTERN_C BOOL WINAPI SHELL32_RunControlPanel(_In_ PCWSTR commandLine, _In_opt_ HWND parent)
r parent
Definition: btrfs.c:3010

◆ SHSetInstanceExplorer()

VOID WINAPI SHSetInstanceExplorer ( LPUNKNOWN  lpUnknown)

Definition at line 1717 of file shellord.c.

1718{ TRACE("%p\n", lpUnknown);
1719 SHELL32_IExplorerInterface = lpUnknown;
1720}

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

◆ SHSetLocalizedName()

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

Definition at line 2835 of file shellord.c.

2836{
2837 FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
2838
2839 return S_OK;
2840}

◆ SHShellFolderView_Message()

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

Definition at line 499 of file shellord.c.

503{
504 FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
505 return 0;
506}

◆ SHStartNetConnectionDialog()

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

Definition at line 2818 of file shellord.c.

2819{
2820#ifdef __REACTOS__
2821 if (SHELL_OsIsUnicode())
2822 return SHStartNetConnectionDialogW(hwnd, (LPCWSTR)pszRemoteName, dwType);
2823 return SHStartNetConnectionDialogA(hwnd, pszRemoteName, dwType);
2824#else
2825 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
2826
2827 return S_OK;
2828#endif
2829}
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:1609

◆ SHTestTokenMembership()

EXTERN_C BOOL WINAPI SHTestTokenMembership ( HANDLE  TokenHandle,
ULONG  ulRID 
)

Definition at line 2968 of file shellord.c.

2969{
2971 DWORD nSubAuthority0, nSubAuthority1;
2972 DWORD nSubAuthorityCount;
2973 PSID SidToCheck;
2974 BOOL IsMember = FALSE;
2975
2976 if ((ulRID == SECURITY_SERVICE_RID) || ulRID == SECURITY_LOCAL_SYSTEM_RID)
2977 {
2978 nSubAuthority0 = ulRID;
2979 nSubAuthority1 = 0;
2980 nSubAuthorityCount= 1;
2981 }
2982 else
2983 {
2984 nSubAuthority0 = SECURITY_BUILTIN_DOMAIN_RID;
2985 nSubAuthority1 = ulRID;
2986 nSubAuthorityCount= 2;
2987 }
2988
2989 if (!AllocateAndInitializeSid(&ntAuth,
2990 nSubAuthorityCount,
2991 nSubAuthority0,
2992 nSubAuthority1,
2993 0, 0, 0, 0, 0, 0,
2994 &SidToCheck))
2995 {
2996 return FALSE;
2997 }
2998
2999 if (!CheckTokenMembership(TokenHandle, SidToCheck, &IsMember))
3000 {
3001 IsMember = FALSE;
3002 }
3003
3004 FreeSid(SidToCheck);
3005 return IsMember;
3006}
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:773
#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 2649 of file shellord.c.

2650{
2651#ifdef __REACTOS__
2652 WCHAR szHashItem[MAX_PATH];
2653 SHAnsiToUnicode(pszHashItem, szHashItem, _countof(szHashItem));
2654 SHUpdateImageW(szHashItem, iIndex, uFlags, iImageIndex);
2655#else
2656 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
2657#endif
2658}
void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
Definition: shellord.c:2609

◆ SHUpdateImageW()

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

Definition at line 2609 of file shellord.c.

2610{
2611#ifdef __REACTOS__
2612 // If iImageIndex == -1 (undetermined), it will fall back to the default value of 1.
2613 INT iEffectiveImageIndex = (iImageIndex == -1) ? 1 : iImageIndex;
2614
2616 item1.cbSize = sizeof(item1);
2617 item1.iIndex = iIndex;
2618 item1.iEffective = iEffectiveImageIndex;
2619 item1.uFlags = uFlags;
2620 item1.iEffective2 = iEffectiveImageIndex;
2621 item1.terminator = 0;
2622
2624
2625 LPWSTR pEnd = StrCpyNXW(item2.szHashItem, pszHashItem, _countof(item2.szHashItem));
2626 *pEnd = UNICODE_NULL;
2627
2628 item2.cbOffset = (WORD)((PBYTE)pEnd - (PBYTE)&item2);
2629 item2.iIndex = iIndex;
2630 item2.iEffectiveImageIndex = iEffectiveImageIndex;
2631 item2.uFlags = uFlags;
2632 item2.dwProcessId = GetCurrentProcessId();
2633 item2.terminator = 0;
2634
2636#else
2637 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
2638#endif
2639}
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:1072
static const struct metadata_item item1[]
Definition: metadata.c:3603
static const struct metadata_item item2[]
Definition: metadata.c:3608
BYTE * PBYTE
Definition: pedump.c:66
#define SHCNE_UPDATEIMAGE
Definition: shlobj.h:1951
#define SHCNF_IDLIST
Definition: shlobj.h:1968

Referenced by SHUpdateImageA().

◆ SHValidateUNC()

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

Definition at line 2107 of file shellord.c.

2108{
2109 FIXME("(%p, %s, 0x%08x): stub\n", hwndOwner, debugstr_w(pszFile), fConnect);
2110 return FALSE;
2111}

◆ SHWaitForFileToOpen()

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

Definition at line 2084 of file shellord.c.

2088{
2089 FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
2090 return FALSE;
2091}
_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 1655 of file shellord.c.

1656{
1657 TRACE("(%p, %s, 0x%08x, %p)\n", hwnd, debugstr_w(pszHelp), uCommand, dwData);
1658 if (!WinHelpW(hwnd, pszHelp, uCommand, dwData))
1659 {
1660#if 0
1663#endif
1664 return FALSE;
1665 }
1666 return TRUE;
1667}
#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 835 of file shellord.c.

836{
837 FIXME("(%p):stub.\n", pidl);
838
839 return FALSE;
840}

◆ UxSubclassInfo_Create()

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

Definition at line 3226 of file shellord.c.

3227{
3228 UxSubclassInfo *pInfo;
3230 if (!pInfo)
3231 {
3232 ERR("HeapAlloc failed.\n");
3234 CoTaskMemFree(invalid);
3235 return NULL;
3236 }
3237
3239 if (!pInfo->fnWndProc)
3240 {
3241 ERR("SetWindowLongPtrW failed\n");
3243 CoTaskMemFree(invalid);
3244 HeapFree(GetProcessHeap(), 0, pInfo);
3245 return NULL;
3246 }
3247
3248 pInfo->hwnd = hwnd;
3249 pInfo->pwszValidChars = valid;
3250 pInfo->pwszInvalidChars = invalid;
3251 if (!SetPropW(hwnd, L"UxSubclassInfo", pInfo))
3252 {
3254 pInfo = NULL;
3255 }
3256 return pInfo;
3257}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOLEAN valid
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SetWindowLongPtrW
Definition: winuser.h:5512
static LRESULT CALLBACK LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shellord.c:3133
#define GWLP_WNDPROC
Definition: treelist.c:66

Referenced by SHLimitInputEdit().

◆ UxSubclassInfo_Destroy()

static void UxSubclassInfo_Destroy ( UxSubclassInfo *  pInfo)
static

Definition at line 3040 of file shellord.c.

3041{
3042 if (!pInfo)
3043 return;
3044
3045 RemovePropW(pInfo->hwnd, L"UxSubclassInfo");
3046
3049
3051
3052 HeapFree(GetProcessHeap(), 0, pInfo);
3053}
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 1966 of file shellord.c.

1967{
1968 DWORD r;
1969 HKEY hkey = 0;
1970
1971 TRACE("%p\n",cs);
1972
1973 if( cs == NULL )
1974 return FALSE;
1975
1976 r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0,
1977 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1978 if( r == ERROR_SUCCESS )
1979 {
1980 r = RegSetValueExW( hkey, L"Settings", 0,
1981 REG_BINARY, (LPBYTE) cs, cs->cLength);
1982
1983 RegCloseKey( hkey );
1984 }
1985
1986#ifdef __REACTOS__
1987 /* TODO: if (r==ERROR_SUCCESS) Increment GLOBALCOUNTER_FOLDERSETTINGSCHANGE */
1988#endif
1989 return (r==ERROR_SUCCESS);
1990}
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

◆ DAD_bDragging

BOOL DAD_bDragging = FALSE
static

◆ DAD_himlTrack

HIMAGELIST DAD_himlTrack = NULL
static

Definition at line 79 of file shellord.c.

Referenced by DAD_DragEnterEx(), and DAD_SetDragImage().

◆ DAD_ptHotspot

POINT DAD_ptHotspot
static

Definition at line 80 of file shellord.c.

Referenced by DAD_DragEnterEx(), and DAD_SetDragImage().

◆ SHELL32_IExplorerInterface

LPUNKNOWN SHELL32_IExplorerInterface =0
static

Definition at line 1710 of file shellord.c.

Referenced by SHGetInstanceExplorer(), and SHSetInstanceExplorer().